2018-07-23 09:23:17 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 1,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"%matplotlib inline"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 2,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
2018-07-23 20:11:24 +02:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stderr",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"Using TensorFlow backend.\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"[nltk_data] Downloading package punkt to /home/jonas/nltk_data...\n",
|
|
|
|
"[nltk_data] Package punkt is already up-to-date!\n",
|
|
|
|
"[nltk_data] Downloading package averaged_perceptron_tagger to\n",
|
|
|
|
"[nltk_data] /home/jonas/nltk_data...\n",
|
|
|
|
"[nltk_data] Package averaged_perceptron_tagger is already up-to-\n",
|
|
|
|
"[nltk_data] date!\n",
|
|
|
|
"[nltk_data] Downloading package wordnet to /home/jonas/nltk_data...\n",
|
|
|
|
"[nltk_data] Package wordnet is already up-to-date!\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2018-07-23 09:23:17 +02:00
|
|
|
"source": [
|
|
|
|
"import numpy as np \n",
|
|
|
|
"import pandas as pd \n",
|
|
|
|
"import simple_twitter_learning as stl\n",
|
2018-07-23 13:25:37 +02:00
|
|
|
"import re\n",
|
2018-07-23 20:11:24 +02:00
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"import matplotlib\n",
|
|
|
|
"matplotlib.rc('font', family='symbola', size=16)"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"* download data"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 3,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"dataset already downloaded\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"%%bash\n",
|
|
|
|
"\n",
|
|
|
|
"if [ ! -e 'dataset_sentiment.csv' ]\n",
|
|
|
|
"then\n",
|
|
|
|
" echo \"downloading dataset\"\n",
|
|
|
|
" wget https://raw.githubusercontent.com/SmartDataAnalytics/MA-INF-4222-NLP-Lab/master/2018_SoSe/exercises/dataset_sentiment.csv\n",
|
|
|
|
"else\n",
|
|
|
|
" echo \"dataset already downloaded\"\n",
|
|
|
|
"fi"
|
|
|
|
]
|
|
|
|
},
|
2018-07-23 13:25:37 +02:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"* plot function:"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 19,
|
2018-07-23 13:25:37 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"def sentiment_score(s):\n",
|
|
|
|
" #(pos, neg, neu)^T\n",
|
|
|
|
" return s[0] - s[1]\n",
|
|
|
|
"\n",
|
|
|
|
"def plot_sentiment_space(predicted_sentiment_vectors_list, top_sentiments, top_emojis, style=['bo']):\n",
|
|
|
|
" # sentiment score axis\n",
|
|
|
|
" top_X = np.array([sentiment_score(x) for x in top_sentiments])\n",
|
|
|
|
" \n",
|
|
|
|
"\n",
|
|
|
|
" # neutral axis:\n",
|
|
|
|
" top_Y = np.array([x[2] for x in top_sentiments])\n",
|
|
|
|
" \n",
|
|
|
|
"\n",
|
2018-07-23 20:11:24 +02:00
|
|
|
" fig_1, ax_1 = plt.subplots(figsize=(7.5,5))\n",
|
2018-07-23 13:25:37 +02:00
|
|
|
" plt.title(\"sentiment-score-plot\")\n",
|
|
|
|
" plt.xlabel(\"sentiment score\")\n",
|
|
|
|
" plt.ylabel(\"neutrality\")\n",
|
2018-07-23 20:11:24 +02:00
|
|
|
" plt.xlim([np.min(top_X),np.max(top_X)])\n",
|
|
|
|
" plt.ylim([np.min(top_Y),np.max(top_Y)])\n",
|
2018-07-23 13:25:37 +02:00
|
|
|
" for i in range(len(top_X)):\n",
|
|
|
|
" plt.text(top_X[i], top_Y[i], top_emojis[i])\n",
|
|
|
|
" for i in range(len(predicted_sentiment_vectors_list)):\n",
|
|
|
|
" pred_X = np.array([sentiment_score(x) for x in predicted_sentiment_vectors_list[i]])\n",
|
|
|
|
" pred_Y = np.array([x[2] for x in predicted_sentiment_vectors_list[i]])\n",
|
|
|
|
" plt.plot(pred_X, pred_Y, style[i], alpha=0.5)\n",
|
|
|
|
" #plt.savefig(\"val-error_sentiment-plot\" + str(datetime.datetime.now()) + \".png\", bbox_inches='tight')\n",
|
|
|
|
"\n",
|
|
|
|
" # sentiment score axis\n",
|
|
|
|
" top_X = np.array([x[0] for x in top_sentiments])\n",
|
|
|
|
" \n",
|
|
|
|
"\n",
|
|
|
|
" # neutral axis:\n",
|
|
|
|
" top_Y = np.array([x[1] for x in top_sentiments])\n",
|
|
|
|
" \n",
|
|
|
|
"\n",
|
2018-07-23 20:11:24 +02:00
|
|
|
" fig_2, ax_2 = plt.subplots(figsize=(7.5,5))\n",
|
2018-07-23 13:25:37 +02:00
|
|
|
" plt.title(\"positive-negative-plot\")\n",
|
|
|
|
" plt.xlabel(\"positive\")\n",
|
|
|
|
" plt.ylabel(\"negative\")\n",
|
2018-07-23 20:11:24 +02:00
|
|
|
" plt.xlim([np.min(top_X),np.max(top_X)])\n",
|
|
|
|
" plt.ylim([np.min(top_Y),np.max(top_Y)])\n",
|
2018-07-23 13:25:37 +02:00
|
|
|
" for i in range(len(top_X)):\n",
|
|
|
|
" plt.text(top_X[i], top_Y[i], top_emojis[i])\n",
|
|
|
|
" for i in range(len(predicted_sentiment_vectors_list)):\n",
|
|
|
|
" pred_X = np.array([x[0] for x in predicted_sentiment_vectors_list[i]])\n",
|
|
|
|
" pred_Y = np.array([x[1] for x in predicted_sentiment_vectors_list[i]])\n",
|
|
|
|
" plt.plot(pred_X, pred_Y, style[i], alpha=0.5)\n",
|
|
|
|
" #'plt.savefig(\"val-error_positive-negative-plot\" + str(datetime.datetime.now()) + \".png\", bbox_inches='tight')\n",
|
|
|
|
" plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"* read data:"
|
|
|
|
]
|
|
|
|
},
|
2018-07-23 09:23:17 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 5,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"df = pd.read_csv('dataset_sentiment.csv')\n",
|
|
|
|
"df = df[['text','sentiment']]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 6,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<div>\n",
|
|
|
|
"<style scoped>\n",
|
|
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
|
|
" vertical-align: middle;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe tbody tr th {\n",
|
|
|
|
" vertical-align: top;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe thead th {\n",
|
|
|
|
" text-align: right;\n",
|
|
|
|
" }\n",
|
|
|
|
"</style>\n",
|
|
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
|
|
" <thead>\n",
|
|
|
|
" <tr style=\"text-align: right;\">\n",
|
|
|
|
" <th></th>\n",
|
|
|
|
" <th>text</th>\n",
|
|
|
|
" <th>sentiment</th>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </thead>\n",
|
|
|
|
" <tbody>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>0</th>\n",
|
|
|
|
" <td>nancyleegrahn how did everyone feel about th...</td>\n",
|
|
|
|
" <td>Neutral</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>1</th>\n",
|
|
|
|
" <td>scottwalker didnt catch the full gopdebate l...</td>\n",
|
|
|
|
" <td>Positive</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>2</th>\n",
|
|
|
|
" <td>tjmshow no mention of tamir rice and the gop...</td>\n",
|
|
|
|
" <td>Neutral</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>3</th>\n",
|
|
|
|
" <td>robgeorge that carly fiorina is trending ho...</td>\n",
|
|
|
|
" <td>Positive</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>4</th>\n",
|
|
|
|
" <td>danscavino gopdebate w realdonaldtrump deliv...</td>\n",
|
|
|
|
" <td>Positive</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </tbody>\n",
|
|
|
|
"</table>\n",
|
|
|
|
"</div>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
" text sentiment\n",
|
|
|
|
"0 nancyleegrahn how did everyone feel about th... Neutral\n",
|
|
|
|
"1 scottwalker didnt catch the full gopdebate l... Positive\n",
|
|
|
|
"2 tjmshow no mention of tamir rice and the gop... Neutral\n",
|
|
|
|
"3 robgeorge that carly fiorina is trending ho... Positive\n",
|
|
|
|
"4 danscavino gopdebate w realdonaldtrump deliv... Positive"
|
|
|
|
]
|
|
|
|
},
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 6,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"df['text'] = df['text'].apply(lambda x: x.lower())\n",
|
|
|
|
"df['text'] = df['text'].apply(lambda x: x.replace('rt',' '))\n",
|
|
|
|
"df['text'] = df['text'].apply((lambda x: re.sub('[^a-zA-Z0-9\\s]','',x)))\n",
|
|
|
|
"df.head()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 7,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"neg = np.array([df['sentiment'][i] == 'Negative' for i in range(df.shape[0])])\n",
|
|
|
|
"pos = np.array([df['sentiment'][i] == 'Positive' for i in range(df.shape[0])])\n",
|
|
|
|
"neu = np.array([df['sentiment'][i] == 'Neutral' for i in range(df.shape[0])])\n",
|
|
|
|
"\n",
|
|
|
|
"text = np.array(df['text'].tolist())"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"* load pipeline"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 8,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"pipeline_file = \"/home/jonas/Dokumente/NLP_DATA/python_dumps/pipelines/tfidf_final/final_epoch01.pipeline\"\n",
|
|
|
|
"pm = stl.pipeline_manager.load_from_pipeline_file(pipeline_file)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"* plot statements"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 9,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"top_20 = list(\"😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂\")\n",
|
|
|
|
"top_20_sents = stl.emoji2sent(top_20)\n",
|
|
|
|
"\n",
|
|
|
|
"pred_pos = pm.predict(text[pos])\n",
|
|
|
|
"pred_neg = pm.predict(text[neg])\n",
|
|
|
|
"pred_neu = pm.predict(text[neu])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 10,
|
2018-07-23 09:23:17 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2018-07-23 20:11:24 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5AAAAJrCAYAAACWbnxKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3Xuc1VW9//HXgkFRMS4iEohOHkxU0BGHE5DmTtODxxuco2kZSj87lqlIxwsoZptEA/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2Sz0CmFULoQ3Jx/dsNDr1NsjHA06WuSZKknV2McTwwvq3rkCS1jfY8A7lv/vmjBu0fFhyTJEmSJJVIu52BBDo3c2y3xhpDCOcD5wPsscceRw4YMKA16pIkSZKkdu/5559fGmPcu5hjtucAWZt/bnjj6A4FxzYTY7wDuAOgsrIyzps3r/WqkyRJkqR2LISwoNhjtuclrHXXPu7eoH0PtrwuUpIkSZLUytptgIwxvg0sJNlIp9D+wLMlL0iSJEmSdnJtGSDDFg0hXBxCuLug6UbglILjxwAvAU+1fnmSJEmSpEIlvwYyhPB54FjgS8BeIYTJwOsxxhlAf6CioPutwIQQwnjgb8AgYGSMMZa2akmSJElSKHUWCyGUARsKQ2AIYZcY49pifo6b6EiSJEnamYUQno8xVhZzzJLPQMYY1zfSVtTwKEmSJEkqvna7iY4kSZIkqX0xQEqSJEmSUjFASpIkSZJSMUBKkiRJklIxQEqSJEmSUjFASpIkSZJSMUBKkiRJklIxQEqSJEmSUjFASpIkSZJSMUBKkiRJklIxQEqSJEmSUjFASpIkSZJSMUBKkiRJklIxQEqSJEmSUjFASpI
|
2018-07-23 09:23:17 +02:00
|
|
|
"text/plain": [
|
2018-07-23 13:25:37 +02:00
|
|
|
"<Figure size 1080x720 with 1 Axes>"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
2018-07-23 20:11:24 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA4wAAAJrCAYAAACr/B0sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3X2clXWd//HXh1tvUEgEERUnb1ZRzFFwBSU54X2pya6lv2VbcWstd5Fwt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foq7b25IRFRS7Zdx0tkPbA7lj7XV1NK80vX/BvZ362DgV8Cd6SUbiidO5jsFxIvkQ193h2YmVK6v8n7bAvcUPr8r5Btb5K3QqwkaRMZGCVpC1MKjGeklGZUupbNWUScBhxPFpRXlnrCegMHkM1nrE8p5Q1p7bRKgXFGSqmmwqVIklpJu6+SWvpt7CCyYUv7ppSO2sD1/1n68Q2y/8le1mRYiiRJHdH5wNjS/ogN+zS+BjwYEROBX1eyOEmSNka7j/lPKd2ZUvoG2R5T6w2sEfF5YI+U0tdTSjeTberbsDS5JKmFNmKOoFrPPcAZ5fNAoXHO3Vjevw/i5mJ9cyglSZ1QR9+HcTLw7w0HKaXflyb4jwQeqlhVktQJlUZ4nF46PD8i9kkp/Vcla9qcpZQuiIh/AL4WEcvJ5i5uRTZn9HfAret7fWcSEaOAz5Fty/G5iOgHTEgpralsZZKkTVWxOYwRUQMUUkqFZs4PJNsz6sCU0hNl7Y+RTZC/oj3qlCRJkqQtVUdehnrX0nPTVfDeLjsnSZIkSWojHXlI6lbrObd1XmNpSfQzAbbddtuh++67b1vUJUmSJEkd3iOPPLI
|
2018-07-23 09:23:17 +02:00
|
|
|
"text/plain": [
|
2018-07-23 13:25:37 +02:00
|
|
|
"<Figure size 1080x720 with 1 Axes>"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
2018-07-23 13:25:37 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#stl.plot_sentiment_space(predicted_sentiment_vectors=pred_pos, top_sentiments=top_20_sents, top_emojis=top_20, style='go')\n",
|
|
|
|
"#stl.plot_sentiment_space(predicted_sentiment_vectors=pred_neg, top_sentiments=top_20_sents, top_emojis=top_20, style='ro')\n",
|
|
|
|
"#stl.plot_sentiment_space(predicted_sentiment_vectors=pred_neu, top_sentiments=top_20_sents, top_emojis=top_20, style='bo')\n",
|
|
|
|
"plot_sentiment_space(predicted_sentiment_vectors_list=[pred_pos,pred_neg,pred_neu], top_sentiments=top_20_sents, top_emojis=top_20, style=['g+','b+','r+'])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## user labeled sentiment dataset"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 11,
|
2018-07-23 13:25:37 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"df = pd.read_csv('../sentiment_sentences.csv', delimiter=';')"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 12,
|
2018-07-23 13:25:37 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"neg = np.array([df['sent'][i] == 'n' for i in range(df.shape[0])])\n",
|
|
|
|
"pos = np.array([df['sent'][i] == 'p' for i in range(df.shape[0])])\n",
|
|
|
|
"\n",
|
|
|
|
"text = np.array(df['text'].tolist())\n",
|
|
|
|
"\n",
|
|
|
|
"pred_pos = pm.predict(text[pos])\n",
|
|
|
|
"pred_neg = pm.predict(text[neg])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2018-07-23 20:11:24 +02:00
|
|
|
"execution_count": 20,
|
2018-07-23 13:25:37 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
2018-07-23 09:23:17 +02:00
|
|
|
{
|
|
|
|
"data": {
|
2018-07-23 20:11:24 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfYAAAFbCAYAAAAnaayMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhc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ucB/iMig0p4SBLQp4Q6a4jIOa7fOwA7yh2oMUWwMXZjjCknEXkZZzfDd7zKa+FM4PsrzmTGv4nIuzgTCtf5IVRTDVTbxC4iH6qq95aSxhhTZiLSEGd2/p88E7aI/A3nCm7/h7NCYgbO0vaJfgnUnFEqKg9V28QeGhqqrVu39ncYxpgAcfz4cXbs2EH9+vVp3LgxtWrVApwraGZmZvLLL79Qt25dIiMj8drD3lRTX3311a+qGlrymWVTbWfFt27dmg0bNvg7DGNMAMnNzSUxMZHFixeTmpqKiJCXl8fvfvc7xowZQ3R0tL9DNGcQEfmxQuqtri32mJgYtcRujDHGX0TkK1Ut1WWfy8JmxRtjjDEBxBK7McYYE0AssRtjjDEBxBK7McYYE0AssRtjjDEBxBK7McYYE0AssRtjjDEBxBK7McYYE0AssRtjjDEBxBK7McYYE0AssRtjTADZu3dv/u+ZmZm8++677Nq1iw8//LDI80xgscRujDEB4r333qNjx45s27YNgHHjxpGQkEDHjh2ZMGECb731FgCvvfYaHTp0YP/+/f4M11QQS+zGGBMgrr32WhYuXMisWbM4ePAgmzZtonXr1tSpU4du3bqxZMkSvvzyS5YvX877779PkyZN/B2yqQCW2I0xJgCcOHGCHj16sHbtWm666SZ++OEHsrKyuOWWW2jdujXnnnsuO3fu5IILLqB///4kJiZyzz33+DtsUwEssRtjTIAQEYKDg6lVqxb
|
2018-07-23 09:23:17 +02:00
|
|
|
"text/plain": [
|
2018-07-23 20:11:24 +02:00
|
|
|
"<Figure size 540x360 with 1 Axes>"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
2018-07-23 20:11:24 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAe4AAAFbCAYAAAATEG2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0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hIMmbQmSGqbEUpkuotgfNeAl4Gb3X1P6LnnAbcStLS2ufsjZvZLgtbgBQSB+Ql3f7RU3ZsRZGkPcPe95VzfSILf0S9D17eLYG516ZZu6eddS/C7/B+h575I8OV0OsGXhUSCLuc/unt4zniF72VmFxFk2kfKJwiE14d6sWIJkuxOJmj5NiNI9OsE3Au86O7/N6KeJwCPEkzd2kcwb7oHcDNwGbCD4P/g2DKu8RWCOdUflT4WOp5MMNSxKfQ6TYE/eGju/qGY2bcE08w2EfRItA9d13R3Xxo65zcEv1t9CIbhXnL3x0LH+hB8MdxEMCRzHDDL3d8p9T4tgMdC17+VYFpeWRn1IgdpyIH7XIL5uL8PPT6P4I/WfoLxqiYEXVsGDHT3981sKcHY51Pu/nLoeR+5+yGnkkj0hAL3Ve7+TG3XpSEzszEEw0Y3u/sPoZZhPHAqwXh3kbuX1dVeb4UC9zPuPrGWqyJSroacVd6OiO45d3/TzB4ACj20elSotZHv7u+HTiskWMijRcTrNMxvNiKHdgdwWWh+dXiedzbwvpn9F/BBbVZO5GjVkMdVsjh4l6G3CC2uEfIvYJiZrTSz5QQtiTGlpsc05C839U4lxpCl+rwBXFV64ZfQ48soOY+6oahojF2kTmjIXeXxBOv/Dgg9Xk7wReV4gqUYjSB7eBFBK/snHFhacYO7p5nZaQTrHGuMuw4I9ZBcQZD5vxaY6+63126tGjYzG0W
|
2018-07-23 09:23:17 +02:00
|
|
|
"text/plain": [
|
2018-07-23 20:11:24 +02:00
|
|
|
"<Figure size 540x360 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"plot_sentiment_space(predicted_sentiment_vectors_list=[pred_pos,pred_neg], top_sentiments=top_20_sents, top_emojis=top_20, style=['go','ro'])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 22,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<div>\n",
|
|
|
|
"<style scoped>\n",
|
|
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
|
|
" vertical-align: middle;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe tbody tr th {\n",
|
|
|
|
" vertical-align: top;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe thead th {\n",
|
|
|
|
" text-align: right;\n",
|
|
|
|
" }\n",
|
|
|
|
"</style>\n",
|
|
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
|
|
" <thead>\n",
|
|
|
|
" <tr style=\"text-align: right;\">\n",
|
|
|
|
" <th></th>\n",
|
|
|
|
" <th>text</th>\n",
|
|
|
|
" <th>sent</th>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </thead>\n",
|
|
|
|
" <tbody>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>0</th>\n",
|
|
|
|
" <td>I am so happy</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>1</th>\n",
|
|
|
|
" <td>i love my life</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>2</th>\n",
|
|
|
|
" <td>i really like this sunshine</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>3</th>\n",
|
|
|
|
" <td>while doing sport i feel free</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>4</th>\n",
|
|
|
|
" <td>i is terrible to learn when the weather is thi...</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>5</th>\n",
|
|
|
|
" <td>i am almost crying when i run out of ice cream</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>6</th>\n",
|
|
|
|
" <td>fuck off</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>7</th>\n",
|
|
|
|
" <td>you are my best friend ever</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>8</th>\n",
|
|
|
|
" <td>i love my mommy</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>9</th>\n",
|
|
|
|
" <td>i prefer oral exams</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>10</th>\n",
|
|
|
|
" <td>best cocktail is the mojito especial</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>11</th>\n",
|
|
|
|
" <td>you got a beautiful wedding</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>12</th>\n",
|
|
|
|
" <td>you husband is this handsome</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>13</th>\n",
|
|
|
|
" <td>this is such a sneaky bitch</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>14</th>\n",
|
|
|
|
" <td>you're kidding</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>15</th>\n",
|
|
|
|
" <td>you are really too drunk</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>16</th>\n",
|
|
|
|
" <td>you start being annoying</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>17</th>\n",
|
|
|
|
" <td>i love my mac</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>18</th>\n",
|
|
|
|
" <td>but it would be better if they are less expensive</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>19</th>\n",
|
|
|
|
" <td>you are a bad friend</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>20</th>\n",
|
|
|
|
" <td>I am in love with my new laptop</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>21</th>\n",
|
|
|
|
" <td>You piss me off</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>22</th>\n",
|
|
|
|
" <td>I hate school</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>23</th>\n",
|
|
|
|
" <td>I'm so mad at you</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>24</th>\n",
|
|
|
|
" <td>Seeing you cry, makes me sad</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>25</th>\n",
|
|
|
|
" <td>You are so lovely</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>26</th>\n",
|
|
|
|
" <td>Fish is disgusting</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>27</th>\n",
|
|
|
|
" <td>At times I feel so depressed</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>28</th>\n",
|
|
|
|
" <td>Summer makes me happy</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>29</th>\n",
|
|
|
|
" <td>I want to dance and sing aloud</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>30</th>\n",
|
|
|
|
" <td>Everything will be ok</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>31</th>\n",
|
|
|
|
" <td>why are you upset?</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>32</th>\n",
|
|
|
|
" <td>I dont like it when it rains</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>33</th>\n",
|
|
|
|
" <td>I dont care at all</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>34</th>\n",
|
|
|
|
" <td>you are such a bitch</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>35</th>\n",
|
|
|
|
" <td>I dont understand what this is all about</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>36</th>\n",
|
|
|
|
" <td>give me a break, idiot!</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>37</th>\n",
|
|
|
|
" <td>please dont leave me</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>38</th>\n",
|
|
|
|
" <td>I love cuddling with my dog</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>39</th>\n",
|
|
|
|
" <td>I want to die</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>40</th>\n",
|
|
|
|
" <td>that is really sad!</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>41</th>\n",
|
|
|
|
" <td>why are you saying that, you moron!</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>42</th>\n",
|
|
|
|
" <td>OMG! i love that cat soo much!</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>43</th>\n",
|
|
|
|
" <td>can you feel the love tonight</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>44</th>\n",
|
|
|
|
" <td>i get so emotional when i watch lion king</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>45</th>\n",
|
|
|
|
" <td>i really hate you</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>46</th>\n",
|
|
|
|
" <td>that is disgusting</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>47</th>\n",
|
|
|
|
" <td>my heart is broken</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>48</th>\n",
|
|
|
|
" <td>i love these sunny days</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>49</th>\n",
|
|
|
|
" <td>this gave me positive feelings</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>50</th>\n",
|
|
|
|
" <td>i am sick</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>51</th>\n",
|
|
|
|
" <td>i am tired</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>52</th>\n",
|
|
|
|
" <td>are you sick or tired?</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>53</th>\n",
|
|
|
|
" <td>you are so cute and sweet</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>54</th>\n",
|
|
|
|
" <td>i just lost my mind</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>55</th>\n",
|
|
|
|
" <td>i hate all people</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>56</th>\n",
|
|
|
|
" <td>you are just dumb</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>57</th>\n",
|
|
|
|
" <td>i will get lucky</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>58</th>\n",
|
|
|
|
" <td>i like ice cream</td>\n",
|
|
|
|
" <td>p</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>59</th>\n",
|
|
|
|
" <td>go home you idiot</td>\n",
|
|
|
|
" <td>n</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </tbody>\n",
|
|
|
|
"</table>\n",
|
|
|
|
"</div>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
" text sent\n",
|
|
|
|
"0 I am so happy p\n",
|
|
|
|
"1 i love my life p\n",
|
|
|
|
"2 i really like this sunshine p\n",
|
|
|
|
"3 while doing sport i feel free p\n",
|
|
|
|
"4 i is terrible to learn when the weather is thi... n\n",
|
|
|
|
"5 i am almost crying when i run out of ice cream n\n",
|
|
|
|
"6 fuck off n\n",
|
|
|
|
"7 you are my best friend ever p\n",
|
|
|
|
"8 i love my mommy p\n",
|
|
|
|
"9 i prefer oral exams p\n",
|
|
|
|
"10 best cocktail is the mojito especial p\n",
|
|
|
|
"11 you got a beautiful wedding p\n",
|
|
|
|
"12 you husband is this handsome p\n",
|
|
|
|
"13 this is such a sneaky bitch n\n",
|
|
|
|
"14 you're kidding n\n",
|
|
|
|
"15 you are really too drunk n\n",
|
|
|
|
"16 you start being annoying n\n",
|
|
|
|
"17 i love my mac p\n",
|
|
|
|
"18 but it would be better if they are less expensive n\n",
|
|
|
|
"19 you are a bad friend n\n",
|
|
|
|
"20 I am in love with my new laptop p\n",
|
|
|
|
"21 You piss me off n\n",
|
|
|
|
"22 I hate school n\n",
|
|
|
|
"23 I'm so mad at you n\n",
|
|
|
|
"24 Seeing you cry, makes me sad n\n",
|
|
|
|
"25 You are so lovely p\n",
|
|
|
|
"26 Fish is disgusting n\n",
|
|
|
|
"27 At times I feel so depressed n\n",
|
|
|
|
"28 Summer makes me happy p\n",
|
|
|
|
"29 I want to dance and sing aloud p\n",
|
|
|
|
"30 Everything will be ok p\n",
|
|
|
|
"31 why are you upset? n\n",
|
|
|
|
"32 I dont like it when it rains n\n",
|
|
|
|
"33 I dont care at all n\n",
|
|
|
|
"34 you are such a bitch n\n",
|
|
|
|
"35 I dont understand what this is all about n\n",
|
|
|
|
"36 give me a break, idiot! n\n",
|
|
|
|
"37 please dont leave me n\n",
|
|
|
|
"38 I love cuddling with my dog p\n",
|
|
|
|
"39 I want to die n\n",
|
|
|
|
"40 that is really sad! n\n",
|
|
|
|
"41 why are you saying that, you moron! n\n",
|
|
|
|
"42 OMG! i love that cat soo much! p\n",
|
|
|
|
"43 can you feel the love tonight p\n",
|
|
|
|
"44 i get so emotional when i watch lion king p\n",
|
|
|
|
"45 i really hate you n\n",
|
|
|
|
"46 that is disgusting n\n",
|
|
|
|
"47 my heart is broken n\n",
|
|
|
|
"48 i love these sunny days p\n",
|
|
|
|
"49 this gave me positive feelings p\n",
|
|
|
|
"50 i am sick n\n",
|
|
|
|
"51 i am tired n\n",
|
|
|
|
"52 are you sick or tired? n\n",
|
|
|
|
"53 you are so cute and sweet p\n",
|
|
|
|
"54 i just lost my mind n\n",
|
|
|
|
"55 i hate all people n\n",
|
|
|
|
"56 you are just dumb n\n",
|
|
|
|
"57 i will get lucky p\n",
|
|
|
|
"58 i like ice cream p\n",
|
|
|
|
"59 go home you idiot n"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2018-07-23 20:11:24 +02:00
|
|
|
"display(df)"
|
2018-07-23 09:23:17 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"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.5"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|