diff --git a/Project/Tools/User_Interface.ipynb b/Project/Tools/User_Interface.ipynb new file mode 100644 index 0000000..51794cd --- /dev/null +++ b/Project/Tools/User_Interface.ipynb @@ -0,0 +1,406 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# User Interface Configuration and Information\n", + "We want to create a small user interface for our prototype in emoji prediction" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Needed\n", + "We want to define needed components for this UI" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import random\n", + "import ipywidgets as widgets\n", + "from IPython.display import display, clear_output" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Trigger refresh of prediction\n", + "each action of typing and sending should yield a new updated prediction for best fitting emojis" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "predictions = [\"🤐\",\"🤑\",\"🤒\",\"🤓\",\"🤔\",\"🤕\",\"🤗\",\"🤘\"]\n", + "\n", + "def trigger_new_prediction(all_chat, current_message):\n", + " global predictions\n", + " random.shuffle(predictions)\n", + " update_descriptions()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### User Output\n", + "the wiritten text as an overview or list of text" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "all_text = \"no text yet \\n\"\n", + "\n", + "out = widgets.Output(layout = widgets.Layout(max_height = \"500px\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### User Input\n", + "the user has to interact with our UI so hee needs:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Text Input field\n", + "a simple line for text input on the bottom of UI" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "text_input = widgets.Text()\n", + "\n", + "def submit_new_message(p):\n", + " global all_text\n", + " bar = \"----------- \\n\"\n", + " time = \"12:00 \\n\"\n", + " msg = text_input.value +\"\\n\"\n", + " new_message = bar + time + msg\n", + " all_text += new_message \n", + " \n", + " with out:\n", + " clear_output()\n", + " print(all_text)\n", + " \n", + " trigger_new_prediction(all_text, text_input.value)\n", + " update_descriptions()\n", + " text_input.description = \"\"\n", + " \n", + "text_input.on_submit(submit_new_message)\n", + "\n", + "#TODO\n", + "#text_input.observe(trigger_new_prediction, type=\"change\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### A sent button to enter yout typed in message\n", + "alternatively it should be also possible to simply type enter" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "sent_button = widgets.Button(description = \"Sent\")\n", + "\n", + "sent_button.on_click(submit_new_message)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### A list of buttons for selecting predicted emojis\n", + "a set of fixed size of buttons with a dynamic changeable labeling replaced by the unicode emoji" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p0_button = widgets.Button(description = \"p0\")\n", + "\n", + "def on_p0_button_click(p):\n", + " update_descriptions() \n", + " #with out:\n", + " text_input.value += \" \"+predictions[0]\n", + "\n", + "p0_button.on_click(on_p0_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p1_button = widgets.Button(description = \"p1\")\n", + "\n", + "def on_p1_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[1]\n", + "\n", + "p1_button.on_click(on_p1_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p2_button = widgets.Button(description = \"p2\")\n", + "\n", + "def on_p2_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[2]\n", + "\n", + "p2_button.on_click(on_p2_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p3_button = widgets.Button(description = \"p3\")\n", + "\n", + "def on_p3_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[3]\n", + "\n", + "p3_button.on_click(on_p3_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p4_button = widgets.Button(description = \"p4\")\n", + "\n", + "def on_p4_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[4]\n", + "\n", + "p4_button.on_click(on_p4_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p5_button = widgets.Button(description = \"p5\")\n", + "\n", + "def on_p5_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[5]\n", + "\n", + "p5_button.on_click(on_p5_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p6_button = widgets.Button(description = \"p6\")\n", + "\n", + "def on_p6_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[6]\n", + "\n", + "p6_button.on_click(on_p6_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "p7_button = widgets.Button(description = \"p7\")\n", + "\n", + "def on_p7_button_click(p):\n", + " update_descriptions()\n", + " with out:\n", + " text_input.value += \" \"+predictions[7]\n", + "\n", + "p7_button.on_click(on_p7_button_click)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def update_descriptions():\n", + " global predictions\n", + " p0_button.description = predictions[0]\n", + " p1_button.description = predictions[1]\n", + " p2_button.description = predictions[2]\n", + " p3_button.description = predictions[3]\n", + " p4_button.description = predictions[4]\n", + " p5_button.description = predictions[5]\n", + " p6_button.description = predictions[6]\n", + " p7_button.description = predictions[7]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Additional\n", + "Developer Information\n", + "#### Output of in and out commands\n", + "#### Prob distribution or whole list of sorted emojis\n", + "#### configuration information" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prototype UI" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c3dff961d8674fc284e1a83b77923687", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "A Jupyter Widget" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "ename": "TypeError", + "evalue": "trigger_new_prediction() missing 1 required positional argument: 'current_message'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/ipywidgets/widgets/widget.py\u001b[0m in \u001b[0;36m_handle_msg\u001b[0;34m(self, msg)\u001b[0m\n\u001b[1;32m 665\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'buffer_paths'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 666\u001b[0m \u001b[0m_put_buffers\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstate\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'buffer_paths'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmsg\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'buffers'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 667\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_state\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstate\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 668\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 669\u001b[0m \u001b[0;31m# Handle a state request.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/ipywidgets/widgets/widget.py\u001b[0m in \u001b[0;36mset_state\u001b[0;34m(self, sync_data)\u001b[0m\n\u001b[1;32m 532\u001b[0m \u001b[0;31m# be locked when the hold_trait_notification context manager is\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 533\u001b[0m \u001b[0;31m# released and notifications are fired.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 534\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_lock_property\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0msync_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhold_trait_notifications\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 535\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msync_data\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 536\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/contextlib.py\u001b[0m in \u001b[0;36m__enter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__enter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 81\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgen\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 82\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mStopIteration\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mRuntimeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"generator didn't yield\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/ipywidgets/widgets/widget.py\u001b[0m in \u001b[0;36m_lock_property\u001b[0;34m(self, **properties)\u001b[0m\n\u001b[1;32m 615\u001b[0m \u001b[0mflawed\u001b[0m\u001b[0;34m.\u001b[0m \u001b[0mIn\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mfuture\u001b[0m \u001b[0mwe\u001b[0m \u001b[0mmay\u001b[0m \u001b[0mwant\u001b[0m \u001b[0mto\u001b[0m \u001b[0mlook\u001b[0m \u001b[0minto\u001b[0m \u001b[0mbuffering\u001b[0m \u001b[0mstate\u001b[0m \u001b[0mchanges\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 616\u001b[0m back to the front-end.\"\"\"\n\u001b[0;32m--> 617\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_property_lock\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mproperties\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 618\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 619\u001b[0m \u001b[0;32myield\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py\u001b[0m in \u001b[0;36m__set__\u001b[0;34m(self, obj, value)\u001b[0m\n\u001b[1;32m 583\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTraitError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'The \"%s\" trait is read-only.'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 584\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 585\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 586\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_validate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py\u001b[0m in \u001b[0;36mset\u001b[0;34m(self, obj, value)\u001b[0m\n\u001b[1;32m 572\u001b[0m \u001b[0;31m# we explicitly compare silent to True just in case the equality\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 573\u001b[0m \u001b[0;31m# comparison above returns something other than True/False\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 574\u001b[0;31m \u001b[0mobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_notify_trait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mold_value\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_value\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 575\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 576\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__set__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py\u001b[0m in \u001b[0;36m_notify_trait\u001b[0;34m(self, name, old_value, new_value)\u001b[0m\n\u001b[1;32m 1137\u001b[0m \u001b[0mnew\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnew_value\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1138\u001b[0m \u001b[0mowner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1139\u001b[0;31m \u001b[0mtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'change'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1140\u001b[0m ))\n\u001b[1;32m 1141\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/ipywidgets/widgets/widget.py\u001b[0m in \u001b[0;36mnotify_change\u001b[0;34m(self, change)\u001b[0m\n\u001b[1;32m 598\u001b[0m \u001b[0;31m# Send new state to front-end\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 599\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msend_state\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 600\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mWidget\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnotify_change\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchange\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 601\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 602\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__repr__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py\u001b[0m in \u001b[0;36mnotify_change\u001b[0;34m(self, change)\u001b[0m\n\u001b[1;32m 1174\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1175\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1176\u001b[0;31m \u001b[0mc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchange\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1177\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1178\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_add_notifiers\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandler\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: trigger_new_prediction() missing 1 required positional argument: 'current_message'" + ] + } + ], + "source": [ + "text_output = widgets.VBox([out])\n", + "all_prediction_buttons = widgets.HBox([p0_button,p1_button,p2_button,p3_button,p4_button,p5_button,p6_button,p7_button])\n", + "user_input = widgets.HBox([text_input,sent_button])\n", + "total_layout = widgets.VBox([text_output,all_prediction_buttons,user_input],layout = widgets.Layout(max_width = \"450px\"))\n", + "display(total_layout)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Project/naive_approach/Emoji_Distance.ipynb b/Project/naive_approach/Emoji_Distance.ipynb index 5b2fc06..20fcf39 100644 --- a/Project/naive_approach/Emoji_Distance.ipynb +++ b/Project/naive_approach/Emoji_Distance.ipynb @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 34, "metadata": { "collapsed": true }, @@ -26,6 +26,17 @@ "import numpy as np" ] }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "N=3" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -47,21 +58,33 @@ }, "outputs": [], "source": [ - "#calculates vector distance between 2 3-dim sentiment representations of emojis\n", - "def sentiment_vector_dist(v1,v2):\n", - " #pos_v1 = v1[0]\n", - " #neg_v1 = v1[1]\n", - " #neu_v1 = v1[2]\n", - " \n", - " #pos_v2 = v2[0]\n", - " #neg_v2 = v2[1]\n", - " #neu_v2 = v2[2]\n", - " \n", - " #tmp_dist = float(np.abs(pos_v1-pos_v2))+float(np.abs(neg_v1-neg_v2))+float(np.abs(neu_v1-neu_v2))\n", - " \n", - " #calculates vector distance between 2 3-dim sentiment representations of emojis consisting of positive neutral and negative probabilistic occuring\n", - " tmp_dist = np.linalg.norm(np.array(v1)-np.array(v2)) \n", - " return tmp_dist" + "def dataframe_to_dictionary():\n", + " data = {}\n", + " data_only_emoticons = {}\n", + " list_sentiment_vectors = []\n", + " list_emojis = []\n", + " list_sentiment_emoticon_vectors = []\n", + " list_emoticon_emojis = []\n", + " for index, row in df.iterrows():\n", + " emo = row[\"Emoji\"]\n", + " occ = row[\"Occurrences\"]\n", + " pos = row[\"Positive\"]\n", + " neg = row[\"Negative\"]\n", + " neu = row[\"Neutral\"]\n", + " data.update({emo:[pos/occ,neg/occ,neu/occ]})\n", + " \n", + " list_sentiment_vectors.append(np.array([pos/occ,neg/occ,neu/occ]))\n", + " list_emojis.append(emo)\n", + " \n", + " if(row[\"Unicode block\"]==\"Emoticons\"):\n", + " data_only_emoticons.update({emo:[pos/occ,neg/occ,neu/occ]})\n", + " \n", + " list_sentiment_emoticon_vectors.append(np.array([pos/occ,neg/occ,neu/occ]))\n", + " list_emoticon_emojis.append(emo)\n", + "\n", + "\n", + " return data,data_only_emoticons,np.array(list_sentiment_vectors), np.array(list_emojis), np.array(list_sentiment_emoticon_vectors),np.array(list_emoticon_emojis)\n", + "#d , doe = dataframe_to_dictionary()" ] }, { @@ -72,15 +95,7 @@ }, "outputs": [], "source": [ - "#calculates vector representation in a 3dim 0 to 1space of dimension: positive,negative,neutral\n", - "def emoji_to_sentiment_vector(e):\n", - " tmp = df[df[\"Emoji\"]==e] \n", - " #calculate by espacial labeled occurences devided by sum of overall occurences\n", - " pos = tmp[\"Positive\"].values/tmp[\"Occurrences\"].values\n", - " neg = tmp[\"Negative\"].values/tmp[\"Occurrences\"].values\n", - " neu = tmp[\"Neutral\"].values/tmp[\"Occurrences\"].values\n", - " #return as np array\n", - " return np.array([pos,neg,neu])" + "data , data_only_emoticons, list_sentiment_vectors , list_emojis , list_sentiment_emoticon_vectors , list_emoticon_emojis = dataframe_to_dictionary()" ] }, { @@ -90,6 +105,43 @@ "collapsed": true }, "outputs": [], + "source": [ + "#calculates vector distance between 2 3-dim sentiment representations of emojis\n", + "def sentiment_vector_dist(v1,v2):\n", + " #calculates vector distance between 2 3-dim sentiment representations of emojis consisting of positive neutral and negative probabilistic occuring\n", + " tmp_dist = np.linalg.norm(np.array(v1)-np.array(v2)) \n", + " return tmp_dist" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#calculates vector representation in a 3dim 0 to 1space of dimension: positive,negative,neutral\n", + "def emoji_to_sentiment_vector(e, only_emoticons=True):\n", + " \"\"\"tmp = df[df[\"Emoji\"]==e] \n", + " #calculate by espacial labeled occurences devided by sum of overall occurences\n", + " pos = tmp[\"Positive\"].values[0]/tmp[\"Occurrences\"].values[0]\n", + " neg = tmp[\"Negative\"].values[0]/tmp[\"Occurrences\"].values[0]\n", + " neu = tmp[\"Neutral\"].values[0]/tmp[\"Occurrences\"].values[0]\n", + " #return as np array\n", + " return np.array([pos,neg,neu])\"\"\"\n", + " if e in (data_only_emoticons if only_emoticons else data):\n", + " return np.array((data_only_emoticons if only_emoticons else data)[e])\n", + " return np.array([float('NaN')]*N) " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], "source": [ "#function to call for evaluating two emojis in its sentimental distance\n", "def emoji_distance(e1,e2):\n", @@ -102,46 +154,98 @@ }, { "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [], - "source": [ - "def sentiment_vector_to_emoji(v1):\n", - " #if(len(v1) == 3):\n", - " #set initial values to compare with\n", - " best_emoji = \"😐\"\n", - " min_distance = 10000\n", - " \n", - " #compare only with filtred emoticons\n", - " df_filtered = df[df[\"Unicode block\"]==\"Emoticons\"]\n", - " all_smilies = list(df_filtered[\"Emoji\"])\n", - " for e in all_smilies:\n", - " v2 = emoji_to_sentiment_vector(e)\n", - " d = sentiment_vector_dist(v1,v2)\n", - " if(d < min_distance):\n", - " min_distance = d\n", - " best_emoji = e\n", - " print(str(v1),str(v2),str(min_distance),str(type(v1)),str(type(v2)),e)\n", - "\n", - "\n", - " print(\"for sentiment vector: \"+str(v1)+\" the emoji is : \"+str(best_emoji)+\" with distance of \"+str(min_distance)+\"!\")\n", - " return best_emoji\n", - " \n", - " #else:\n", - " #print(\"WRONG SENTIMENT VECTOR\")" - ] - }, - { - "cell_type": "code", - "execution_count": 43, + "execution_count": 27, "metadata": { "collapsed": true }, "outputs": [], "source": [ - "def show_demo():\n", + "def sentiment_vector_to_emoji(v1, only_emoticons=True):\n", + " #more efficient approach for min distance\n", + " distances = (list_sentiment_emoticon_vectors if only_emoticons else list_sentiment_vectors) - v1\n", + " distances = np.linalg.norm(distances, axis=1)\n", + " #find min entry\n", + " min_entry = np.argmin(distances)\n", + " \n", + " return (list_emoticon_emojis if only_emoticons else list_emojis)[min_entry]\n", + "\n", + " #version for dics\n", + "\n", + " \"\"\"#set initial values to compare with\n", + " best_emoji = \"😐\"\n", + " min_distance = 10000\n", + "\n", + " #compare only with filtred emoticons not containing other elements like cars etc.\n", + " #compare for each existing emoticons sentment vector to find the minimal distance equivalent to the best match\n", + " for e,v2 in doe.items():\n", + " #v2 = emoji_to_sentiment_vector(e)\n", + " d = sentiment_vector_dist(v1,v2)\n", + " if(d < min_distance):\n", + " min_distance = d\n", + " best_emoji = e\n", + "\n", + "\n", + " #print(\"for sentiment vector: \"+str(v1)+\" the emoji is : \"+str(best_emoji)+\" with distance of \"+str(min_distance)+\"!\")\n", + " return best_emoji\"\"\"\n", + "\n", + " #old version\n", + "\n", + " \"\"\"#set initial values to compare with\n", + " best_emoji = \"😐\"\n", + " min_distance = 10000\n", + "\n", + " #compare only with filtred emoticons not containing other elements like cars etc.\n", " df_filtered = df[df[\"Unicode block\"]==\"Emoticons\"]\n", " all_smilies = list(df_filtered[\"Emoji\"])\n", + " #compare for each existing emoticons sentment vector to find the minimal distance equivalent to the best match\n", + " for e in all_smilies:\n", + " v2 = emoji_to_sentiment_vector(e)\n", + " d = sentiment_vector_dist(v1,v2)\n", + " if(d < min_distance):\n", + " min_distance = d\n", + " best_emoji = e\n", + "\n", + "\n", + " #print(\"for sentiment vector: \"+str(v1)+\" the emoji is : \"+str(best_emoji)+\" with distance of \"+str(min_distance)+\"!\")\n", + " return best_emoji\"\"\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_demo_min_distances(only_emoticons = True):\n", + " #df_filtered = df[df[\"Unicode block\"]==\"Emoticons\"]\n", + " all_smilies = list_emoticon_emojis if only_emoticons else list_emojis\n", + "\n", + " d_m = np.zeros(shape=(len(all_smilies),len(all_smilies)))\n", + "\n", + " for c1 in range(len(all_smilies)):\n", + " for c2 in range(len(all_smilies)):\n", + " e1 = all_smilies[c1]\n", + " e2 = all_smilies[c2]\n", + "\n", + " d = emoji_distance(e1,e2)\n", + " d_m[c1,c2] = d\n", + " \n", + " for c in range(len(d_m[0])):\n", + " emoji = all_smilies[c]\n", + " row = d_m[c]\n", + " row_sorted = np.argsort(row)\n", + " #closest 5\n", + " r = row_sorted[0:10]\n", + " #print()\n", + " closest = \"\"\n", + " for i in r:\n", + " closest+=all_smilies[i]\n", + " print(emoji+\": \"+closest)\n", + " \n", + " \"\"\"df_filtered = df[df[\"Unicode block\"]==\"Emoticons\"]\n", + " all_smilies = list(df_filtered[\"Emoji\"])\n", "\n", " d_m = np.zeros(shape=(len(all_smilies),len(all_smilies)))\n", "\n", @@ -163,63 +267,1150 @@ " closest = \"\"\n", " for i in r:\n", " closest+=all_smilies[i]\n", - " print(emoji+\": \"+closest)" + " print(emoji+\": \"+closest)\"\"\"" ] }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[[ 0.39118825]\n", - " [ 0.38451268]\n", - " [ 0.22429907]] [[ 0.46813021]\n", - " [ 0.24716181]\n", - " [ 0.28470797]] 0.168625514858 😂\n", - "[[ 0.39118825]\n", - " [ 0.38451268]\n", - " [ 0.22429907]] [[ 0.34310532]\n", - " [ 0.43648208]\n", - " [ 0.2204126 ]] 0.0709076267317 😭\n", - "[[ 0.39118825]\n", - " [ 0.38451268]\n", - " [ 0.22429907]] [[ 0.39118825]\n", - " [ 0.38451268]\n", - " [ 0.22429907]] 0.0 😢\n", - "for sentiment vector: [[ 0.39118825]\n", - " [ 0.38451268]\n", - " [ 0.22429907]] the emoji is : 😢 with distance of 0.0!\n" + "😂: 😂😱😬🙇😈😹😅😥🙉😵\n", + "😍: 😍😊😘😚😻😛😋😇🙌😀\n", + "😭: 😭😪😓😴😔😷😖😫😢😨\n", + "😘: 😘😚😍😙😊😗😛😻😽😋\n", + "😊: 😊😻😛😍😇😋😀🙌😘😚\n", + "😁: 😁😄😝😎🙊😜😆🙆😉🙋\n", + "😩: 😩😒😕🙍😿😾😠😦😐😑\n", + "🙏: 🙏😏😸😉🙀😮😜😝😄🙉\n", + "😏: 😏🙏😮🙀😸😈🙉😉😜😝\n", + "😉: 😉😜😸😝🙆😄😁😎😆🙊\n", + "🙌: 🙌😀😛😻😇🙋😌😊😋😃\n", + "🙈: 🙈😼😌🙊🙋😆😁😄😺😎\n", + "😄: 😄😝😁😆😜🙊😉😎😸🙉\n", + "😒: 😒😩😕😿🙍😾😠😦😐😑\n", + "😃: 😃🙆😎😀😇😋🙋🙌😁🙊\n", + "😔: 😔😷😭😖😪😓😴😫😤😨\n", + "😱: 😱😬😂🙇😹😅😥😵😈😯\n", + "😜: 😜😉😝😁😄🙆😎😸😆🙊\n", + "😳: 😳😲😧😵😯🙇😹😶😢😥\n", + "😡: 😡😣😞🙎😫😖😰😠😔😷\n", + "😎: 😎🙆😁🙊😜😃😄😝🙋😉\n", + "😢: 😢😟😪😓😴😭😵😥😧😰\n", + "😋: 😋😇😻😀😊😃😛🙌😍🙆\n", + "🙊: 🙊🙋😁😆😎🙈😌😄😼😝\n", + "😴: 😴😭😪😓😔😧😨😢😷😲\n", + "😌: 😌🙋🙈🙊🙌😼😀😎😆😁\n", + "😞: 😞😫😖🙎😰😓😔😡😪😭\n", + "😆: 😆😄😁🙊😝😼🙈😜😎🙉\n", + "😝: 😝😄😜😁😆😉😸😎🙊🙆\n", + "😪: 😪😓😭😴😔😢😷😖😫😞\n", + "😫: 😫😖😞😔😷😭😓😪😣😡\n", + "😅: 😅😹😥😬🙇😱😂😟😵😢\n", + "😀: 😀😇🙌😻😛😋😃🙋😊😌\n", + "😚: 😚😘😍😙😗😊😛😻😽😋\n", + "😻: 😻😊😛😇😀😋🙌😍😘😃\n", + "😥: 😥😹😟😅😵🙇😬😱😢😂\n", + "😕: 😕😒😩😿🙍😾😠😦😐😑\n", + "😤: 😤🙅😷😨😔😶😑😖😭😴\n", + "😈: 😈😮🙉🙀😂😱😬😯🙇😄\n", + "😰: 😰🙎😞😫😓😢😪😭😖😟\n", + "😑: 😑😦😐🙅😤😿😶😒😨😕\n", + "😹: 😹🙇😥😬😅😵😱😂😟😢\n", + "😠: 😠🙍😾😩😒😕😿😣😖😫\n", + "😓: 😓😪😭😴😔😢😷😖😫😞\n", + "😣: 😣😡😫😞😠😖🙍😾🙎😷\n", + "😐: 😐😦😑😿😕😒😩🙅😤🙍\n", + "😨: 😨😶🙅😤😧😲😴😔😷😭\n", + "😖: 😖😫😔😷😞😭😓😪😣😴\n", + "😷: 😷😔😖😤😭😫😪😓😨😴\n", + "🙋: 🙋😌🙊🙈😎🙌😀😁😆😼\n", + "😛: 😛😻😊🙌😀😇😍😋😘😽\n", + "😬: 😬😱😂🙇😹😅😥😵😈😟\n", + "😙: 😙😚😘😗😍😊😛😻😽😋\n", + "🙆: 🙆😎😜😃😉😁😝😄🙊😸\n", + "🙅: 🙅😤😶😨😑😷😔😲😧😴\n", + "🙉: 🙉🙀😈😄😝😆😸😮😁😜\n", + "😇: 😇😀😋😻🙌😊😛😃🙋😍\n", + "😿: 😿😒😕😩🙍😦😠😐😾😑\n", + "😲: 😲😧😶😨😴😳😭😪😓🙅\n", + "😶: 😶😨🙅😲😧😤😴😔😷😭\n", + "😵: 😵🙇😹😥😟😱😬😅😢😳\n", + "😸: 😸😉😜😝😄🙀😁🙉🙆😎\n", + "😧: 😧😲😨😴😶😭😪😳😓😢\n", + "😮: 😮😈🙀🙉😏😸😯😂🙏😱\n", + "😽: 😽😛😘😍😚🙌😊😻😗😺\n", + "🙀: 🙀🙉😮😈😸😝😄😜😉😆\n", + "🙇: 🙇😹😱😬😵😥😂😅😟😯\n", + "😟: 😟😥😢😵😹😅🙇😬😱😓\n", + "😯: 😯😳🙇😱😈😵😮😂😬😹\n", + "😦: 😦😐😑😿😕😒😩🙅😤🙍\n", + "🙍: 🙍😾😩😠😒😕😿😣😖😡\n", + "😺: 😺🙈😌😼🙋😽🙊🙌😆😛\n", + "😾: 😾🙍😩😠😒😕😿😣😡😖\n", + "😼: 😼🙈😆🙊😌😁🙋😄😝🙉\n", + "🙎: 🙎😰😞😡😫😖😣😓😪😭\n", + "😗: 😗😙😚😘😽😍😊😛😻🙌\n" ] - }, + } + ], + "source": [ + "show_demo_min_distances()" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#test bipolar matching entiment vector vs. emoji\n", + "#def show_demo_matching_bipolar\n", + "# df_filtered = df[df[\"Unicode block\"]==\"Emoticons\"]\n", + "# all_smilies = list(df_filtered[\"Emoji\"])\n", + "# for e in all_smilies:\n", + "# v2 = emoji_to_sentiment_vector(e)\n", + "# sentiment_vector_to_emoji(v2)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ { "data": { "text/plain": [ - "'😢'" + "[('😂', '😂'),\n", + " ('❤', '😙'),\n", + " ('♥', '😋'),\n", + " ('😍', '😍'),\n", + " ('😭', '😭'),\n", + " ('😘', '😘'),\n", + " ('😊', '😊'),\n", + " ('👌', '🙌'),\n", + " ('💕', '😋'),\n", + " ('👏', '🙋'),\n", + " ('😁', '😁'),\n", + " ('☺', '😍'),\n", + " ('♡', '😍'),\n", + " ('👍', '🙋'),\n", + " ('😩', '😩'),\n", + " ('🙏', '🙏'),\n", + " ('✌', '😜'),\n", + " ('😏', '😏'),\n", + " ('😉', '😉'),\n", + " ('🙌', '🙌'),\n", + " ('🙈', '🙈'),\n", + " ('💪', '😃'),\n", + " ('😄', '😄'),\n", + " ('😒', '😒'),\n", + " ('💃', '😚'),\n", + " ('💖', '😚'),\n", + " ('😃', '😃'),\n", + " ('😔', '😔'),\n", + " ('😱', '😱'),\n", + " ('🎉', '😚'),\n", + " ('😜', '😜'),\n", + " ('☯', '😏'),\n", + " ('🌸', '😋'),\n", + " ('💜', '😊'),\n", + " ('💙', '😚'),\n", + " ('✨', '😏'),\n", + " ('😳', '😳'),\n", + " ('💗', '😊'),\n", + " ('★', '😏'),\n", + " ('█', '😏'),\n", + " ('☀', '🙏'),\n", + " ('😡', '😡'),\n", + " ('😎', '😎'),\n", + " ('😢', '😢'),\n", + " ('💋', '😍'),\n", + " ('😋', '😋'),\n", + " ('🙊', '🙊'),\n", + " ('😴', '😴'),\n", + " ('🎶', '😀'),\n", + " ('💞', '😚'),\n", + " ('😌', '😌'),\n", + " ('🔥', '😏'),\n", + " ('💯', '😯'),\n", + " ('🔫', '😷'),\n", + " ('💛', '😚'),\n", + " ('💁', '🙉'),\n", + " ('💚', '😘'),\n", + " ('♫', '😏'),\n", + " ('😞', '😞'),\n", + " ('😆', '😆'),\n", + " ('😝', '😝'),\n", + " ('😪', '😪'),\n", + " ('�', '😏'),\n", + " ('😫', '😫'),\n", + " ('😅', '😅'),\n", + " ('👊', '😅'),\n", + " ('💀', '🙅'),\n", + " ('😀', '😀'),\n", + " ('😚', '😚'),\n", + " ('😻', '😻'),\n", + " ('©', '😏'),\n", + " ('👀', '😯'),\n", + " ('💘', '😍'),\n", + " ('🐓', '😏'),\n", + " ('☕', '😏'),\n", + " ('👋', '😆'),\n", + " ('✋', '😥'),\n", + " ('🎊', '😗'),\n", + " ('🍕', '🙏'),\n", + " ('❄', '😎'),\n", + " ('😥', '😥'),\n", + " ('😕', '😕'),\n", + " ('💥', '😏'),\n", + " ('💔', '😶'),\n", + " ('😤', '😤'),\n", + " ('😈', '😈'),\n", + " ('►', '😏'),\n", + " ('✈', '😏'),\n", + " ('🔝', '😉'),\n", + " ('😰', '😰'),\n", + " ('⚽', '😋'),\n", + " ('😑', '😑'),\n", + " ('👑', '😍'),\n", + " ('😹', '😹'),\n", + " ('👉', '😏'),\n", + " ('🍃', '🙏'),\n", + " ('🎁', '😙'),\n", + " ('😠', '😠'),\n", + " ('🐧', '🙏'),\n", + " ('☆', '😏'),\n", + " ('🍀', '😏'),\n", + " ('🎈', '😍'),\n", + " ('🎅', '😏'),\n", + " ('😓', '😓'),\n", + " ('😣', '😣'),\n", + " ('😐', '😐'),\n", + " ('✊', '😁'),\n", + " ('😨', '😨'),\n", + " ('😖', '😖'),\n", + " ('💤', '🙀'),\n", + " ('💓', '😍'),\n", + " ('👎', '😖'),\n", + " ('💦', '😌'),\n", + " ('✔', '😏'),\n", + " ('😷', '😷'),\n", + " ('⚡', '😏'),\n", + " ('🙋', '🙋'),\n", + " ('🎄', '🙆'),\n", + " ('💩', '😶'),\n", + " ('🎵', '😎'),\n", + " ('➡', '😏'),\n", + " ('😛', '😛'),\n", + " ('😬', '😬'),\n", + " ('👯', '😜'),\n", + " ('💎', '😃'),\n", + " ('🌿', '😏'),\n", + " ('🎂', '😛'),\n", + " ('🌟', '😏'),\n", + " ('🔮', '😏'),\n", + " ('❗', '😏'),\n", + " ('👫', '😈'),\n", + " ('🏆', '😚'),\n", + " ('✖', '😏'),\n", + " ('☝', '😮'),\n", + " ('😙', '😙'),\n", + " ('⛄', '🙆'),\n", + " ('👅', '😁'),\n", + " ('♪', '😃'),\n", + " ('🍂', '😉'),\n", + " ('💏', '😼'),\n", + " ('🔪', '😯'),\n", + " ('🌴', '🙆'),\n", + " ('👈', '🙏'),\n", + " ('🌹', '😃'),\n", + " ('🙆', '🙆'),\n", + " ('➜', '😏'),\n", + " ('👻', '😏'),\n", + " ('💰', '😏'),\n", + " ('🍻', '🙋'),\n", + " ('🙅', '🙅'),\n", + " ('🌞', '😉'),\n", + " ('🍁', '🙏'),\n", + " ('⭐', '😃'),\n", + " ('▪', '😏'),\n", + " ('🎀', '😋'),\n", + " ('━', '😏'),\n", + " ('☷', '😏'),\n", + " ('🐷', '😏'),\n", + " ('🙉', '🙉'),\n", + " ('🌺', '🙏'),\n", + " ('💅', '😼'),\n", + " ('🐶', '😀'),\n", + " ('🌚', '😌'),\n", + " ('👽', '😏'),\n", + " ('🎤', '🙊'),\n", + " ('👭', '🙋'),\n", + " ('🎧', '😝'),\n", + " ('👆', '😏'),\n", + " ('🍸', '😀'),\n", + " ('🍷', '😏'),\n", + " ('®', '😏'),\n", + " ('🍉', '😻'),\n", + " ('😇', '😇'),\n", + " ('☑', '😏'),\n", + " ('🏃', '🙏'),\n", + " ('😿', '😿'),\n", + " ('│', '😏'),\n", + " ('💣', '😳'),\n", + " ('🍺', '😉'),\n", + " ('▶', '😏'),\n", + " ('😲', '😲'),\n", + " ('🎸', '🙏'),\n", + " ('🍹', '😊'),\n", + " ('💫', '🙏'),\n", + " ('📚', '🙉'),\n", + " ('😶', '😶'),\n", + " ('🌷', '🙏'),\n", + " ('💝', '😍'),\n", + " ('💨', '🙏'),\n", + " ('🏈', '🙆'),\n", + " ('💍', '😌'),\n", + " ('☔', '😈'),\n", + " ('👸', '😋'),\n", + " ('🇪', '😃'),\n", + " ('░', '😯'),\n", + " ('🍩', '😝'),\n", + " ('👾', '😏'),\n", + " ('☁', '😏'),\n", + " ('🌻', '🙆'),\n", + " ('😵', '😵'),\n", + " ('📒', '😏'),\n", + " ('↿', '😋'),\n", + " ('🐯', '🙏'),\n", + " ('👼', '🙉'),\n", + " ('🍔', '😮'),\n", + " ('😸', '😸'),\n", + " ('👶', '🙊'),\n", + " ('↾', '😋'),\n", + " ('💐', '😙'),\n", + " ('🌊', '🙆'),\n", + " ('🍦', '🙋'),\n", + " ('🍓', '😍'),\n", + " ('👇', '😏'),\n", + " ('💆', '😬'),\n", + " ('🍴', '🙆'),\n", + " ('😧', '😧'),\n", + " ('🇸', '😃'),\n", + " ('😮', '😮'),\n", + " ('▓', '😏'),\n", + " ('🚫', '😐'),\n", + " ('😽', '😽'),\n", + " ('🌈', '🙆'),\n", + " ('🙀', '🙀'),\n", + " ('⚠', '😏'),\n", + " ('🎮', '😸'),\n", + " ('╯', '😯'),\n", + " ('🍆', '🙏'),\n", + " ('🍰', '😌'),\n", + " ('✓', '😏'),\n", + " ('👐', '😢'),\n", + " ('🙇', '🙇'),\n", + " ('🍟', '🙀'),\n", + " ('🍌', '😁'),\n", + " ('💑', '😘'),\n", + " ('👬', '😳'),\n", + " ('🐣', '😌'),\n", + " ('🎃', '😻'),\n", + " ('▬', '🙏'),\n", + " ('nan', '😂'),\n", + " ('😟', '😟'),\n", + " ('🐾', '😽'),\n", + " ('🎓', '🙌'),\n", + " ('🏊', '😃'),\n", + " ('🍫', '😹'),\n", + " ('📷', '😸'),\n", + " ('👄', '😉'),\n", + " ('🌼', '😙'),\n", + " ('🚶', '😶'),\n", + " ('🐱', '😽'),\n", + " ('║', '😏'),\n", + " ('🐸', '😳'),\n", + " ('🇺', '🙌'),\n", + " ('👿', '😕'),\n", + " ('🚬', '🙌'),\n", + " ('✿', '😏'),\n", + " ('📖', '😱'),\n", + " ('🐒', '🙏'),\n", + " ('🌍', '😻'),\n", + " ('┊', '😗'),\n", + " ('🐥', '😇'),\n", + " ('🌀', '😏'),\n", + " ('🐼', '😏'),\n", + " ('🎥', '😏'),\n", + " ('💄', '😸'),\n", + " ('💸', '😯'),\n", + " ('⛔', '🙆'),\n", + " ('●', '😏'),\n", + " ('🏀', '😈'),\n", + " ('💉', '😆'),\n", + " ('💟', '😚'),\n", + " ('🚗', '😏'),\n", + " ('😯', '😯'),\n", + " ('📝', '😏'),\n", + " ('═', '😏'),\n", + " ('♦', '😉'),\n", + " ('💭', '😏'),\n", + " ('🌙', '😋'),\n", + " ('🐟', '😚'),\n", + " ('👣', '😏'),\n", + " ('☞', '😏'),\n", + " ('✂', '😐'),\n", + " ('🗿', '😉'),\n", + " ('🍝', '😯'),\n", + " ('👪', '😰'),\n", + " ('🍭', '😮'),\n", + " ('🌃', '😏'),\n", + " ('❌', '😅'),\n", + " ('🐰', '😻'),\n", + " ('💊', '🙊'),\n", + " ('🚨', '😗'),\n", + " ('😦', '😦'),\n", + " ('🍪', '🙉'),\n", + " ('🍣', '🙅'),\n", + " ('╭', '😏'),\n", + " ('✧', '😏'),\n", + " ('🎆', '😙'),\n", + " ('╮', '😏'),\n", + " ('🎎', '😗'),\n", + " ('🇩', '😋'),\n", + " ('✅', '🙏'),\n", + " ('👹', '😯'),\n", + " ('📱', '😏'),\n", + " ('🙍', '🙍'),\n", + " ('🍑', '😂'),\n", + " ('🎼', '😏'),\n", + " ('🔊', '🙏'),\n", + " ('🌌', '🙌'),\n", + " ('🍎', '😏'),\n", + " ('🐻', '🙊'),\n", + " ('─', '😏'),\n", + " ('╰', '😏'),\n", + " ('💇', '🙀'),\n", + " ('♬', '😏'),\n", + " ('♚', '😏'),\n", + " ('🔴', '😏'),\n", + " ('🍱', '😿'),\n", + " ('🍊', '😁'),\n", + " ('🍒', '😏'),\n", + " ('🐭', '😍'),\n", + " ('👟', '😉'),\n", + " ('🌎', '😏'),\n", + " ('🍍', '😺'),\n", + " ('🐮', '😋'),\n", + " ('📲', '😏'),\n", + " ('☼', '😏'),\n", + " ('🌅', '🙀'),\n", + " ('🇷', '😍'),\n", + " ('👠', '🙀'),\n", + " ('🌽', '😎'),\n", + " ('💧', '😖'),\n", + " ('❓', '😏'),\n", + " ('🍬', '😼'),\n", + " ('😺', '😺'),\n", + " ('🐴', '😏'),\n", + " ('🚀', '😉'),\n", + " ('¦', '😗'),\n", + " ('💢', '😏'),\n", + " ('🎬', '😏'),\n", + " ('🍧', '😼'),\n", + " ('🍜', '😺'),\n", + " ('🐏', '😃'),\n", + " ('🐘', '😯'),\n", + " ('👧', '😯'),\n", + " ('⠀', '😏'),\n", + " ('🏄', '😃'),\n", + " ('➤', '😏'),\n", + " ('⬆', '😏'),\n", + " ('🍋', '😏'),\n", + " ('🆗', '😽'),\n", + " ('⚪', '🙏'),\n", + " ('📺', '🙏'),\n", + " ('🍅', '😺'),\n", + " ('⛅', '😎'),\n", + " ('🐢', '😏'),\n", + " ('👙', '😃'),\n", + " ('🏡', '🙋'),\n", + " ('🌾', '😽'),\n", + " ('◉', '😏'),\n", + " ('✏', '😏'),\n", + " ('🐬', '🙏'),\n", + " ('🍤', '😏'),\n", + " ('🇹', '😃'),\n", + " ('♣', '🙏'),\n", + " ('🐝', '😏'),\n", + " ('🌝', '😏'),\n", + " ('🇮', '😃'),\n", + " ('🔋', '😕'),\n", + " ('🐍', '🙏'),\n", + " ('♔', '🙏'),\n", + " ('🍳', '😢'),\n", + " ('🔵', '😏'),\n", + " ('😾', '😾'),\n", + " ('🌕', '😛'),\n", + " ('🐨', '🙊'),\n", + " ('🔐', '😼'),\n", + " ('💿', '😋'),\n", + " ('❁', '😏'),\n", + " ('🌳', '🙆'),\n", + " ('👰', '😃'),\n", + " ('❀', '😏'),\n", + " ('⚓', '😻'),\n", + " ('🚴', '😋'),\n", + " ('▀', '😳'),\n", + " ('👗', '😏'),\n", + " ('➕', '😽'),\n", + " ('💬', '😸'),\n", + " ('▒', '😏'),\n", + " ('🔜', '😮'),\n", + " ('🍨', '😅'),\n", + " ('💲', '😏'),\n", + " ('⛽', '😏'),\n", + " ('🍙', '🙀'),\n", + " ('🍗', '😳'),\n", + " ('🍲', '😯'),\n", + " ('🍥', '😕'),\n", + " ('▸', '😏'),\n", + " ('♛', '😏'),\n", + " ('😼', '😼'),\n", + " ('🐙', '🙏'),\n", + " ('👨', '😃'),\n", + " ('🍚', '😽'),\n", + " ('🍖', '😯'),\n", + " ('♨', '😗'),\n", + " ('🎹', '😏'),\n", + " ('♕', '😏'),\n", + " ('▃', '😗'),\n", + " ('🚘', '😳'),\n", + " ('🍏', '😯'),\n", + " ('👩', '😵'),\n", + " ('👦', '😏'),\n", + " ('🇬', '😏'),\n", + " ('🇧', '😏'),\n", + " ('☠', '😯'),\n", + " ('🐠', '😌'),\n", + " ('🚹', '😙'),\n", + " ('💵', '😸'),\n", + " ('✰', '😙'),\n", + " ('╠', '😏'),\n", + " ('👛', '😆'),\n", + " ('🚙', '😏'),\n", + " ('🌱', '😃'),\n", + " ('💻', '😏'),\n", + " ('🌏', '🙏'),\n", + " ('▄', '😳'),\n", + " ('👓', '😏'),\n", + " ('◄', '😏'),\n", + " ('⚾', '😧'),\n", + " ('🌲', '🙏'),\n", + " ('👴', '😈'),\n", + " ('🏠', '🙆'),\n", + " ('🍇', '😼'),\n", + " ('🍘', '😺'),\n", + " ('🍛', '😵'),\n", + " ('🐇', '😮'),\n", + " ('🔞', '😯'),\n", + " ('👵', '😺'),\n", + " ('◀', '😏'),\n", + " ('🔙', '😏'),\n", + " ('🌵', '😬'),\n", + " ('🐽', '😯'),\n", + " ('🍮', '😔'),\n", + " ('🎇', '😗'),\n", + " ('🐎', '😸'),\n", + " ('➔', '😏'),\n", + " ('💶', '😏'),\n", + " ('🐤', '😃'),\n", + " ('╩', '😏'),\n", + " ('🛀', '🙇'),\n", + " ('🌑', '😎'),\n", + " ('🚲', '🙏'),\n", + " ('🐑', '😳'),\n", + " ('🏁', '🙏'),\n", + " ('🍞', '😯'),\n", + " ('🎾', '😽'),\n", + " ('╚', '😏'),\n", + " ('🈹', '😏'),\n", + " ('🐳', '😯'),\n", + " ('👮', '😐'),\n", + " ('☹', '😕'),\n", + " ('🐵', '🙆'),\n", + " ('✪', '😏'),\n", + " ('◕', '🙏'),\n", + " ('🗼', '😃'),\n", + " ('▐', '😏'),\n", + " ('♠', '😏'),\n", + " ('┳', '😐'),\n", + " ('👺', '🙅'),\n", + " ('🐚', '😏'),\n", + " ('👂', '😶'),\n", + " ('🗽', '😏'),\n", + " ('🍵', '😆'),\n", + " ('🆒', '😏'),\n", + " ('🍯', '😟'),\n", + " ('🐺', '😏'),\n", + " ('⇨', '🙏'),\n", + " ('➨', '😏'),\n", + " ('🌓', '😋'),\n", + " ('🔒', '😬'),\n", + " ('╬', '😳'),\n", + " ('👳', '😗'),\n", + " ('🌂', '😏'),\n", + " ('🚌', '😏'),\n", + " ('♩', '🙆'),\n", + " ('🍡', '😳'),\n", + " ('❥', '😏'),\n", + " ('🎡', '😏'),\n", + " ('💌', '😽'),\n", + " ('🐩', '😏'),\n", + " ('🌜', '🙏'),\n", + " ('⌚', '😏'),\n", + " ('🚿', '😚'),\n", + " ('🐖', '😏'),\n", + " ('🔆', '😃'),\n", + " ('🌛', '😃'),\n", + " ('💂', '😷'),\n", + " ('🐔', '😏'),\n", + " ('🙎', '🙎'),\n", + " ('🏩', '🙋'),\n", + " ('🇫', '🙏'),\n", + " ('🔨', '😶'),\n", + " ('📢', '🙏'),\n", + " ('🐦', '🙏'),\n", + " ('🐲', '😏'),\n", + " ('♻', '🙏'),\n", + " ('🌘', '😋'),\n", + " ('🍐', '😅'),\n", + " ('🌔', '😋'),\n", + " ('╥', '😰'),\n", + " ('❊', '😏'),\n", + " ('👖', '😏'),\n", + " ('🚺', '😏'),\n", + " ('😗', '😗'),\n", + " ('🎭', '😳'),\n", + " ('🐄', '😏'),\n", + " ('◟', '😏'),\n", + " ('🍢', '😳'),\n", + " ('🎨', '😏'),\n", + " ('⬇', '🙊'),\n", + " ('🚼', '😋'),\n", + " ('⛲', '😏'),\n", + " ('▁', '😏'),\n", + " ('🇴', '😏'),\n", + " ('🌗', '😍'),\n", + " ('🌖', '😍'),\n", + " ('🔅', '😗'),\n", + " ('👜', '😏'),\n", + " ('🐌', '😙'),\n", + " ('💼', '😍'),\n", + " ('🚕', '😯'),\n", + " ('🐹', '😼'),\n", + " ('🌠', '😗'),\n", + " ('🐈', '😏'),\n", + " ('⇧', '😏'),\n", + " ('☎', '😏'),\n", + " ('🌁', '😏'),\n", + " ('⚫', '😂'),\n", + " ('♧', '🙏'),\n", + " ('🏰', '😏'),\n", + " ('🚵', '😏'),\n", + " ('🎢', '😃'),\n", + " ('🎷', '😙'),\n", + " ('🎐', '😏'),\n", + " ('┈', '😾'),\n", + " ('╗', '😏'),\n", + " ('╱', '😏'),\n", + " ('🌇', '😃'),\n", + " ('⏰', '😽'),\n", + " ('⇩', '😏'),\n", + " ('🚂', '😏'),\n", + " ('◠', '🙏'),\n", + " ('🎿', '😸'),\n", + " ('✦', '😏'),\n", + " ('🆔', '😗'),\n", + " ('⛪', '😏'),\n", + " ('🌒', '😋'),\n", + " ('🐪', '😋'),\n", + " ('╔', '😏'),\n", + " ('╝', '🙏'),\n", + " ('👔', '🙈'),\n", + " ('🔱', '😯'),\n", + " ('🆓', '😏'),\n", + " ('🐋', '😮'),\n", + " ('▽', '🙆'),\n", + " ('▂', '😏'),\n", + " ('🐛', '🙀'),\n", + " ('👕', '🙆'),\n", + " ('🚋', '😏'),\n", + " ('💳', '🙆'),\n", + " ('🌆', '😏'),\n", + " ('🏧', '😗'),\n", + " ('💡', '😍'),\n", + " ('🔹', '😏'),\n", + " ('⬅', '🙏'),\n", + " ('🍠', '😰'),\n", + " ('🐫', '😏'),\n", + " ('🏪', '😏'),\n", + " ('۩', '😏'),\n", + " ('🇱', '🙏'),\n", + " ('📹', '😀'),\n", + " ('👞', '😀'),\n", + " ('🚑', '😯'),\n", + " ('🆘', '😟'),\n", + " ('👚', '😋'),\n", + " ('🚍', '😟'),\n", + " ('□', '😡'),\n", + " ('🐂', '😏'),\n", + " ('🚣', '😋'),\n", + " ('✳', '😏'),\n", + " ('🏉', '😃'),\n", + " ('🗻', '😋'),\n", + " ('🐀', '😏'),\n", + " ('╦', '😏'),\n", + " ('⛺', '😛'),\n", + " ('🐕', '😏'),\n", + " ('🏂', '😎'),\n", + " ('👡', '😎'),\n", + " ('📻', '🙏'),\n", + " ('✒', '😏'),\n", + " ('🌰', '😋'),\n", + " ('🏢', '😏'),\n", + " ('🎒', '😛'),\n", + " ('⌒', '😋'),\n", + " ('🏫', '😣'),\n", + " ('📴', '😗'),\n", + " ('🚢', '😺'),\n", + " ('🚚', '😏'),\n", + " ('🐉', '😏'),\n", + " ('❒', '😏'),\n", + " ('🐊', '😏'),\n", + " ('🔔', '😗'),\n", + " ('◢', '😙'),\n", + " ('🏥', '😏'),\n", + " ('❔', '😳'),\n", + " ('🚖', '😳'),\n", + " ('🃏', '😟'),\n", + " ('▼', '😯'),\n", + " ('▌', '😑'),\n", + " ('☛', '😏'),\n", + " ('✩', '😏'),\n", + " ('💒', '😋'),\n", + " ('🚤', '😏'),\n", + " ('🐐', '🙏'),\n", + " ('■', '😿'),\n", + " ('🔚', '😉'),\n", + " ('🎻', '😏'),\n", + " ('🔷', '😏'),\n", + " ('🚦', '😯'),\n", + " ('🔓', '😟'),\n", + " ('🎽', '🙏'),\n", + " ('📅', '😈'),\n", + " ('🎺', '😗'),\n", + " ('✯', '😏'),\n", + " ('🍈', '😾'),\n", + " ('✉', '😏'),\n", + " ('╣', '😏'),\n", + " ('◤', '😗'),\n", + " ('○', '😃'),\n", + " ('🍼', '😽'),\n", + " ('📀', '😏'),\n", + " ('🚛', '😳'),\n", + " ('📓', '😏'),\n", + " ('☉', '😏'),\n", + " ('💴', '🙅'),\n", + " ('┼', '😯'),\n", + " ('🐃', '😏'),\n", + " ('➰', '😡'),\n", + " ('🔌', '😶'),\n", + " ('🍄', '😯'),\n", + " ('📕', '😏'),\n", + " ('📣', '🙋'),\n", + " ('🚓', '😏'),\n", + " ('🐗', '😃'),\n", + " ('↪', '😏'),\n", + " ('⛳', '😙'),\n", + " ('┻', '😾'),\n", + " ('┛', '😍'),\n", + " ('┃', '🙏'),\n", + " ('👱', '😏'),\n", + " ('⏳', '😰'),\n", + " ('💺', '😏'),\n", + " ('🏇', '😶'),\n", + " ('☻', '😏'),\n", + " ('📞', '🙏'),\n", + " ('Ⓐ', '😳'),\n", + " ('🌉', '😋'),\n", + " ('🚩', '😑'),\n", + " ('✎', '😋'),\n", + " ('📃', '🙏'),\n", + " ('🏨', '😏'),\n", + " ('📌', '😕'),\n", + " ('♎', '😳'),\n", + " ('💷', '🙏'),\n", + " ('🚄', '😋'),\n", + " ('▲', '😋'),\n", + " ('⛵', '😋'),\n", + " ('🔸', '😏'),\n", + " ('⌛', '🙇'),\n", + " ('🚜', '😗'),\n", + " ('🐆', '😏'),\n", + " ('👒', '😏'),\n", + " ('❕', '😏'),\n", + " ('🔛', '😽'),\n", + " ('♢', '😏'),\n", + " ('🇲', '🙏'),\n", + " ('❅', '😙'),\n", + " ('👝', '😺'),\n", + " ('✞', '🙏'),\n", + " ('◡', '😏'),\n", + " ('🎋', '😗'),\n", + " ('👥', '🙀'),\n", + " ('📵', '😏'),\n", + " ('🐡', '😏'),\n", + " ('◆', '😙'),\n", + " ('🏯', '😏'),\n", + " ('☂', '😏'),\n", + " ('🔭', '🙏'),\n", + " ('🎪', '😏'),\n", + " ('🐜', '😋'),\n", + " ('♌', '😙'),\n", + " ('☐', '😕'),\n", + " ('👷', '🙀'),\n", + " ('↳', '😏'),\n", + " ('🔈', '😏'),\n", + " ('📄', '😗'),\n", + " ('📍', '😏'),\n", + " ('🚐', '😙'),\n", + " ('🚔', '😏'),\n", + " ('🌋', '😋'),\n", + " ('📡', '🙀'),\n", + " ('⏩', '😏'),\n", + " ('🚳', '😗'),\n", + " ('✘', '😙'),\n", + " ('۞', '😏'),\n", + " ('☾', '😏'),\n", + " ('🅰', '🙀'),\n", + " ('📥', '😏'),\n", + " ('🇼', '🙏'),\n", + " ('┓', '😋'),\n", + " ('┣', '😋'),\n", + " ('Ⓛ', '🙏'),\n", + " ('Ⓔ', '🙏'),\n", + " ('🔦', '😏'),\n", + " ('👤', '😙'),\n", + " ('🚁', '😏'),\n", + " ('🎠', '🙆'),\n", + " ('🐁', '😐'),\n", + " ('📗', '😮'),\n", + " ('┐', '😶'),\n", + " ('☮', '😢'),\n", + " ('♂', '😏'),\n", + " ('◞', '😏'),\n", + " ('📯', '😏'),\n", + " ('🔩', '😮'),\n", + " ('👢', '😙'),\n", + " ('◂', '😏'),\n", + " ('📰', '😺'),\n", + " ('📶', '😏'),\n", + " ('🚥', '😏'),\n", + " ('🌄', '😏'),\n", + " ('🗾', '😏'),\n", + " ('🔶', '😏'),\n", + " ('🏤', '😏'),\n", + " ('🎩', '😏'),\n", + " ('Ⓜ', '😺'),\n", + " ('🔧', '😾'),\n", + " ('🐅', '😏'),\n", + " ('♮', '😏'),\n", + " ('🅾', '😶'),\n", + " ('🔄', '😏'),\n", + " ('☄', '😏'),\n", + " ('☨', '😏'),\n", + " ('📦', '😏'),\n", + " ('🚊', '😬'),\n", + " ('🔲', '😍'),\n", + " ('🔁', '😯'),\n", + " ('△', '😏'),\n", + " ('📆', '😗'),\n", + " ('❛', '🙏'),\n", + " ('📉', '🙏'),\n", + " ('▵', '🙏'),\n", + " ('🔎', '😍'),\n", + " ('☜', '😏'),\n", + " ('🇯', '🙏'),\n", + " ('🇵', '🙏'),\n", + " ('📘', '😬'),\n", + " ('✡', '😏'),\n", + " ('ⓔ', '😍'),\n", + " ('🔑', '😬'),\n", + " ('🔃', '😯'),\n", + " ('👃', '🙎'),\n", + " ('⭕', '🙏'),\n", + " ('🔘', '😏'),\n", + " ('ⓒ', '🙎'),\n", + " ('🚭', '😗'),\n", + " ('🚉', '😍'),\n", + " ('🚪', '😍'),\n", + " ('➳', '🙏'),\n", + " ('🚃', '😍'),\n", + " ('┯', '😐'),\n", + " ('🏬', '😏'),\n", + " ('☽', '😏'),\n", + " ('🆙', '🙏'),\n", + " ('🆖', '😬'),\n", + " ('☪', '😏'),\n", + " ('┗', '😗'),\n", + " ('🚮', '🙎'),\n", + " ('┫', '😏'),\n", + " ('Ⓞ', '🙏'),\n", + " ('❇', '😋'),\n", + " ('✴', '😋'),\n", + " ('┌', '😳'),\n", + " ('☊', '😗'),\n", + " ('🔕', '😡'),\n", + " ('⬛', '😡'),\n", + " ('❝', '😏'),\n", + " ('❞', '😏'),\n", + " ('🚞', '😋'),\n", + " ('🍶', '😋'),\n", + " ('🌐', '😋'),\n", + " ('♀', '😏'),\n", + " ('🚅', '😋'),\n", + " ('🚒', '😑'),\n", + " ('➣', '😏'),\n", + " ('♋', '😏'),\n", + " ('♍', '😋'),\n", + " ('🕝', '😑'),\n", + " ('ⓐ', '😗'),\n", + " ('✗', '😳'),\n", + " ('📙', '😺'),\n", + " ('Ⓢ', '😏'),\n", + " ('📋', '😋'),\n", + " ('⇢', '😳'),\n", + " ('🎱', '😺'),\n", + " ('🐞', '😏'),\n", + " ('🔺', '😏'),\n", + " ('ⓡ', '😗'),\n", + " ('🎍', '😏'),\n", + " ('♤', '😋'),\n", + " ('🎲', '😏'),\n", + " ('🎯', '😋'),\n", + " ('〠', '😏'),\n", + " ('🔉', '😋'),\n", + " ('↩', '😗'),\n", + " ('🚾', '😏'),\n", + " ('🎣', '😐'),\n", + " ('🔣', '😏'),\n", + " ('❎', '😕'),\n", + " ('➥', '😏'),\n", + " ('🅱', '😏'),\n", + " ('🎌', '😗'),\n", + " ('◣', '😏'),\n", + " ('⏬', '😗'),\n", + " ('♭', '😏'),\n", + " ('💠', '😏'),\n", + " ('ⓞ', '😗'),\n", + " ('🔳', '🙏'),\n", + " ('🏭', '🙏'),\n", + " ('🔰', '😏'),\n", + " ('🎳', '😐'),\n", + " ('☚', '😗'),\n", + " ('➽', '🙏'),\n", + " ('➫', '🙏'),\n", + " ('➖', '😕'),\n", + " ('🏮', '😏'),\n", + " ('📛', '😏'),\n", + " ('꒰', '🙏'),\n", + " ('꒱', '🙏'),\n", + " ('◝', '😐'),\n", + " ('📑', '😗'),\n", + " ('🎦', '😏'),\n", + " ('ⓧ', '😗'),\n", + " ('🇨', '😏'),\n", + " ('🇳', '😏'),\n", + " ('🔟', '😗'),\n", + " ('〓', '😗'),\n", + " ('ⓜ', '🙏'),\n", + " ('➠', '😗'),\n", + " ('🚆', '🙏'),\n", + " ('🚠', '😏'),\n", + " ('℅', '😕'),\n", + " ('☃', '🙏'),\n", + " ('🚽', '😗'),\n", + " ('📐', '😏'),\n", + " ('ⓝ', '😗'),\n", + " ('✮', '😏'),\n", + " ('⇦', '😗'),\n", + " ('👲', '🙏'),\n", + " ('🚡', '😐'),\n", + " ('🎑', '😏'),\n", + " ('🔬', '😗'),\n", + " ('➗', '😐'),\n", + " ('📈', '🙏'),\n", + " ('⌘', '😏'),\n", + " ('⏪', '🙏'),\n", + " ('╹', '😏'),\n", + " ('◎', '😗'),\n", + " ('🔼', '😏'),\n", + " ('꒦', '😕'),\n", + " ('📎', '😗'),\n", + " ('⑅', '😗'),\n", + " ('⍝', '😏'),\n", + " ('📁', '😏'),\n", + " ('✭', '😗'),\n", + " ('➲', '😏'),\n", + " ('♓', '🙏'),\n", + " ('┏', '😗'),\n", + " ('☇', '😗'),\n", + " ('♺', '😏'),\n", + " ('♞', '😏'),\n", + " ('࿎', '😕'),\n", + " ('📠', '😏'),\n", + " ('👘', '😗'),\n", + " ('↙', '😗'),\n", + " ('Ⓕ', '🙏'),\n", + " ('Ⓦ', '🙏'),\n", + " ('Ⓟ', '🙏'),\n", + " ('🕑', '🙏'),\n", + " ('💽', '😏'),\n", + " ('🕛', '😗'),\n", + " ('🎫', '😏'),\n", + " ('♈', '😕'),\n", + " ('📟', '😏'),\n", + " ('℃', '😏'),\n", + " ('↬', '😗'),\n", + " ('🕒', '😏'),\n", + " ('🇰', '😏'),\n", + " ('↱', '😏'),\n", + " ('✍', '😗'),\n", + " ('⇐', '😏'),\n", + " ('🏦', '😗'),\n", + " ('🔻', '😗'),\n", + " ('ⓟ', '😗'),\n", + " ('ⓕ', '😗'),\n", + " ('ⓘ', '😗'),\n", + " ('♿', '😗'),\n", + " ('⇗', '😗'),\n", + " ('⇘', '😗'),\n", + " ('ⓨ', '😗'),\n", + " ('ⓙ', '😗'),\n", + " ('▫', '😗'),\n", + " ('🔇', '😗'),\n", + " ('⌃', '😕'),\n", + " ('🔖', '😗'),\n", + " ('📜', '😗'),\n", + " ('♏', '😏'),\n", + " ('🚝', '😗'),\n", + " ('☢', '😏'),\n", + " ('🎏', '😏'),\n", + " ('┘', '😕'),\n", + " ('✝', '😕'),\n", + " ('❖', '😏'),\n", + " ('⍣', '😕'),\n", + " ('📮', '😕'),\n", + " ('🕕', '😕'),\n", + " ('🇭', '😏'),\n", + " ('◜', '😏'),\n", + " ('🔯', '😗'),\n", + " ('➸', '😗'),\n", + " ('꒵', '😗'),\n", + " ('🕥', '😕'),\n", + " ('♙', '😏'),\n", + " ('▿', '😏'),\n", + " ('⚃', '😏'),\n", + " ('✽', '😗'),\n", + " ('📼', '😗'),\n", + " ('🕐', '😕'),\n", + " ('🀄', '😗'),\n", + " ('✾', '😏'),\n", + " ('✬', '😗'),\n", + " ('🆑', '😏'),\n", + " ('✫', '😗'),\n", + " ('🕔', '😕'),\n", + " ('❣', '😗'),\n", + " ('➱', '😏'),\n", + " ('🆕', '😏'),\n", + " ('➢', '😏'),\n", + " ('↕', '😏'),\n", + " ('📫', '😗'),\n", + " ('🉐', '😗'),\n", + " ('♊', '😏'),\n", + " ('🈂', '😕'),\n", + " ('🎰', '😕'),\n", + " ('҂', '😕'),\n", + " ('╤', '😕'),\n", + " ('➛', '😏'),\n", + " ('♝', '😏'),\n", + " ('❋', '😏'),\n", + " ('✆', '😏'),\n", + " ('📔', '😗')]" ] }, - "execution_count": 46, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "#show_demo()\n", - "v11 = emoji_to_sentiment_vector(\"😢\")\n", - "sentiment_vector_to_emoji(v11)" + "[(e,sentiment_vector_to_emoji(emoji_to_sentiment_vector(e,only_emoticons=False))) for e in list_emojis]" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 3.33118392e-01 5.70015866e-09 5.45405624e-01 3.61891787e-02\n", + " 3.22864731e-02 1.87023274e-01 7.40931853e-01 3.08743564e-01\n", + " 3.68777881e-01 2.09713028e-01 8.63326899e-02 1.75456769e-01\n", + " 2.09456816e-01 7.45056142e-01 1.30260524e-01 5.82652509e-01\n", + " 3.53554352e-01 2.01443985e-01 4.85493431e-01 6.17183397e-01\n", + " 1.62094866e-01 4.74704900e-01 7.76465219e-02 1.66833329e-01\n", + " 5.36955643e-01 1.38652203e-01 5.67698362e-01 2.03066094e-01\n", + " 2.12404906e-01 5.36588512e-01 5.84954149e-01 3.52979027e-01\n", + " 9.03901452e-02 4.25609843e-02 4.81493548e-02 3.93456821e-01\n", + " 7.62805379e-01 6.29813840e-01 3.18599968e-01 5.01433361e-01\n", + " 7.06272570e-01 3.82249520e-01 6.95514681e-01 5.36365201e-01\n", + " 6.40151317e-01 7.60887637e-01 5.82859091e-01 5.91490468e-01\n", + " 6.00100317e-01 1.38855769e-01 4.98298989e-02 3.46598352e-01\n", + " 9.38806127e-02 1.68762005e-01 6.30326431e-01 2.65642057e-01\n", + " 8.06500677e-02 7.48501150e-01 5.36834774e-01 5.88758832e-01\n", + " 4.22651037e-01 2.42250408e-01 5.31306950e-01 3.36087236e-01\n", + " 9.53768085e-02 2.81491690e-01 3.83891422e-01 4.26413016e-01\n", + " 4.22486149e-01 7.57834870e-01 7.27857015e-01 1.86650364e-01\n", + " 7.41070465e-01 2.05220100e-01 5.35435751e-01 1.11520771e-01]\n" + ] + }, + { + "data": { + "text/plain": [ + "'😍'" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sentiment_vector_to_emoji(np.array([ 0.72967448, 0.05173769, 0.21858783]))" + ] }, { "cell_type": "code",