simple improvements

This commit is contained in:
Jonas Weinz 2018-07-22 21:43:12 +02:00
parent 4cd15127ba
commit d39613be17

View File

@ -157,7 +157,7 @@
{ {
"data": { "data": {
"application/vnd.jupyter.widget-view+json": { "application/vnd.jupyter.widget-view+json": {
"model_id": "233f744d595f4b81a362faef6b148fe7", "model_id": "e508c9a1f8634b7ba790cf2f291e215a",
"version_major": 2, "version_major": 2,
"version_minor": 0 "version_minor": 0
}, },
@ -263,7 +263,8 @@
" [\n", " [\n",
" [\n", " [\n",
" (widgets.Text(),\"test_input\"),\n", " (widgets.Text(),\"test_input\"),\n",
" (widgets.HTML(),\"prediction\")\n", " (widgets.HTML(),\"prediction\"),\n",
" (widgets.Text(value=\"😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂\"),\"prediction_ground_set\")\n",
" ],\n", " ],\n",
" [\n", " [\n",
" (widgets.Checkbox(),\"show_sorted_list\"),\n", " (widgets.Checkbox(),\"show_sorted_list\"),\n",
@ -760,9 +761,10 @@
" return\n", " return\n",
" X = shown_widgets[\"test_input\"].value\n", " X = shown_widgets[\"test_input\"].value\n",
" pred = pm.predict([X])\n", " pred = pm.predict([X])\n",
" shown_widgets[\"prediction\"].value = \"<h1> \" + str(stl.sent2emoji(pred)[0]) + \"</h1>\"\n", " target_list=list(shown_widgets[\"prediction_ground_set\"].value)\n",
" shown_widgets[\"prediction\"].value = \"<h1> \" + str(stl.sent2emoji(pred,custom_target_emojis=target_list)[0]) + \"</h1>\"\n",
" if shown_widgets[\"show_sorted_list\"].value:\n", " if shown_widgets[\"show_sorted_list\"].value:\n",
" mp(\"## \" + \"\".join(stl.edist.sentiment_vector_to_emoji(pred, only_emoticons=True, n_results=100)))\n", " mp(\"## \" + \"\".join(stl.edist.sentiment_vector_to_emoji(pred, only_emoticons=True, n_results=100, custom_target_emojis=target_list)))\n",
" \n", " \n",
"\n", "\n",
"\n", "\n",