changed jupyter notebook Prototype.py in order to have faster loading of first Textarea.

This commit is contained in:
alpcentaur 2020-08-27 20:55:36 +02:00
parent f86792b1d6
commit 0b6122c6ff
7 changed files with 180 additions and 238 deletions

View file

@ -30,14 +30,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/html": [
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
@ -74,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@ -95,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@ -112,35 +128,11 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"initializing the libraries\n",
"Creating the bag of words...\n",
"\n",
"dumping the data to hkl format..\n",
"done\n",
"Creating the bag of words...\n",
"\n",
"dumping the data to hkl format..\n",
"done\n",
"loading SolveShorts Databases\n",
"loading SentSeg Databases\n",
"loading SayYes Databases\n",
"loading passiv2active Databases\n",
"loading conjunctivesolve Databases\n",
"done\n",
"dumping the session\n",
"done\n"
]
}
],
"outputs": [],
"source": [
"\n",
"# importing the libraries\n",
@ -187,34 +179,33 @@
"#print('loading conjunctivesolve Databases')\n",
"#cs.load_DB_into_FASTsearch()\n",
"#print('done')\n",
"\n",
"#import dill\n",
"#print('dumping the session')\n",
"#dill.dump_session('voilastate.db')\n",
"#print('done')\n"
"\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"loading SentSeg Databases\n",
"done\n",
"dumping the session\n",
"done\n"
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "44d5cd66922e47eea1e041f5a4d0450c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Textarea(value='', layout=Layout(height='180px', width='99%'), placeholder='Hier den Text eingeben, darunter k…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import dill\n",
"dill.load_session('voilastate.db')\n",
"\n",
"#print('done')\n",
"\n",
"#print('loading passiv2active Databases')\n",
@ -262,6 +253,7 @@
"#oi = oi()\n",
"\n",
"\n",
"\n",
"import ipywidgets as widgets\n",
"\n",
"TextFeld = widgets.Textarea(placeholder='Hier den Text eingeben, darunter können die Module aktiviert(grün) oder deaktiviert(pink) werden', disabled=False)\n",
@ -275,15 +267,19 @@
"TextFelddouble.layout.width = '99%'\n",
"TextFelddouble.disabled=True\n",
"\n",
"#display(TextFeld)"
"display(TextFeld)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"\n",
"import dill\n",
"dill.load_session('voilastate.db')\n",
"\n",
"dawidth = '100%'\n",
"KonjunktiveErsetzen = widgets.ToggleButton(\n",
" value=False,\n",
@ -351,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@ -368,10 +364,43 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<br>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0ffc0a362eda4b26b52365b4bc8e9d98",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"GridBox(children=(ToggleButton(value=True, description='Eine Aussage pro Satz', layout=Layout(width='100%')), …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"display(HTML('<br>'))\n",
"display(Grid)\n",
"\n",
"\n",
"\n",
"\n",
"def function():\n",
" out = 'Wählen Sie ein Kästchen aus!'\n",
@ -526,28 +555,12 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>"
]
"outputs": [],
"source": []
},
{
"cell_type": "code",
@ -557,47 +570,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e8a207b4bbbf4ede88e8de51a7f01e76",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Textarea(value='', layout=Layout(height='180px', width='99%'), placeholder='Hier den Text eingeben, darunter k…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<br>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3b9404b205f8409ebdfb8d2f9fb5e1e6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"GridBox(children=(ToggleButton(value=True, description='Eine Aussage pro Satz', layout=Layout(width='100%')), …"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d09eeedd9a08403daaf2436b6106b675",
"model_id": "a997b9dff3d04ac9ae6a172ca3d2f4dd",
"version_major": 2,
"version_minor": 0
},
@ -617,9 +590,7 @@
"#display(i)\n",
"\n",
"#print(widgets.interact_manual.opts)\n",
"display(TextFeld)\n",
"display(HTML('<br>'))\n",
"display(Grid)\n",
"\n",
"widgets.interact_manual.opts['manual_name']= 'Übersetzen'\n",
"ola = widgets.interact_manual(function)\n",
"ola.widget.children[0].style.button_color = 'lightgreen'\n",
@ -639,7 +610,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2049909ffcfd4cee8b9fe8b7602812c9",
"model_id": "b1b855420c5f4e10b43ffde5863d27f8",
"version_major": 2,
"version_minor": 0
},
@ -761,7 +732,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8818b8d76a4640a399063390f9a32703",
"model_id": "33a76d73064142e69756ead3fc1dbc02",
"version_major": 2,
"version_minor": 0
},
@ -787,7 +758,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "822ff5f7c5864ad8a328e951a306ccad",
"model_id": "d507502e11734ce4be24fd5fa588d676",
"version_major": 2,
"version_minor": 0
},

View file

@ -30,14 +30,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/html": [
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
@ -74,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@ -95,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@ -112,35 +128,11 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"initializing the libraries\n",
"Creating the bag of words...\n",
"\n",
"dumping the data to hkl format..\n",
"done\n",
"Creating the bag of words...\n",
"\n",
"dumping the data to hkl format..\n",
"done\n",
"loading SolveShorts Databases\n",
"loading SentSeg Databases\n",
"loading SayYes Databases\n",
"loading passiv2active Databases\n",
"loading conjunctivesolve Databases\n",
"done\n",
"dumping the session\n",
"done\n"
]
}
],
"outputs": [],
"source": [
"\n",
"# importing the libraries\n",
@ -187,34 +179,33 @@
"#print('loading conjunctivesolve Databases')\n",
"#cs.load_DB_into_FASTsearch()\n",
"#print('done')\n",
"\n",
"#import dill\n",
"#print('dumping the session')\n",
"#dill.dump_session('voilastate.db')\n",
"#print('done')\n"
"\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"loading SentSeg Databases\n",
"done\n",
"dumping the session\n",
"done\n"
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "44d5cd66922e47eea1e041f5a4d0450c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Textarea(value='', layout=Layout(height='180px', width='99%'), placeholder='Hier den Text eingeben, darunter k…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import dill\n",
"dill.load_session('voilastate.db')\n",
"\n",
"#print('done')\n",
"\n",
"#print('loading passiv2active Databases')\n",
@ -262,6 +253,7 @@
"#oi = oi()\n",
"\n",
"\n",
"\n",
"import ipywidgets as widgets\n",
"\n",
"TextFeld = widgets.Textarea(placeholder='Hier den Text eingeben, darunter können die Module aktiviert(grün) oder deaktiviert(pink) werden', disabled=False)\n",
@ -275,15 +267,19 @@
"TextFelddouble.layout.width = '99%'\n",
"TextFelddouble.disabled=True\n",
"\n",
"#display(TextFeld)"
"display(TextFeld)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"\n",
"import dill\n",
"dill.load_session('voilastate.db')\n",
"\n",
"dawidth = '100%'\n",
"KonjunktiveErsetzen = widgets.ToggleButton(\n",
" value=False,\n",
@ -351,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@ -368,10 +364,43 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<br>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0ffc0a362eda4b26b52365b4bc8e9d98",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"GridBox(children=(ToggleButton(value=True, description='Eine Aussage pro Satz', layout=Layout(width='100%')), …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"display(HTML('<br>'))\n",
"display(Grid)\n",
"\n",
"\n",
"\n",
"\n",
"def function():\n",
" out = 'Wählen Sie ein Kästchen aus!'\n",
@ -526,28 +555,12 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<img src=\"brainBasaBuuka5.png\" width=\"300\" height=\"200\" align=\"center\"/>"
]
"outputs": [],
"source": []
},
{
"cell_type": "code",
@ -557,47 +570,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e8a207b4bbbf4ede88e8de51a7f01e76",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Textarea(value='', layout=Layout(height='180px', width='99%'), placeholder='Hier den Text eingeben, darunter k…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<br>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3b9404b205f8409ebdfb8d2f9fb5e1e6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"GridBox(children=(ToggleButton(value=True, description='Eine Aussage pro Satz', layout=Layout(width='100%')), …"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d09eeedd9a08403daaf2436b6106b675",
"model_id": "a997b9dff3d04ac9ae6a172ca3d2f4dd",
"version_major": 2,
"version_minor": 0
},
@ -617,9 +590,7 @@
"#display(i)\n",
"\n",
"#print(widgets.interact_manual.opts)\n",
"display(TextFeld)\n",
"display(HTML('<br>'))\n",
"display(Grid)\n",
"\n",
"widgets.interact_manual.opts['manual_name']= 'Übersetzen'\n",
"ola = widgets.interact_manual(function)\n",
"ola.widget.children[0].style.button_color = 'lightgreen'\n",
@ -639,7 +610,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2049909ffcfd4cee8b9fe8b7602812c9",
"model_id": "b1b855420c5f4e10b43ffde5863d27f8",
"version_major": 2,
"version_minor": 0
},
@ -761,7 +732,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8818b8d76a4640a399063390f9a32703",
"model_id": "33a76d73064142e69756ead3fc1dbc02",
"version_major": 2,
"version_minor": 0
},
@ -787,7 +758,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "822ff5f7c5864ad8a328e951a306ccad",
"model_id": "d507502e11734ce4be24fd5fa588d676",
"version_major": 2,
"version_minor": 0
},

Binary file not shown.