nlp-lab/Project/advanced_approach/Evaluation_sentiment_dataset.ipynb

825 lines
184 KiB
Plaintext
Raw Normal View History

2018-07-27 12:11:38 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"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"
]
}
],
"source": [
"import numpy as np \n",
"import pandas as pd \n",
"import twitter_learning as twl\n",
"import re\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib\n",
"matplotlib.rc('font', family='symbola', size=16)"
]
},
{
"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"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* plot function:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"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",
" fig_1, ax_1 = plt.subplots(figsize=(7.5,5))\n",
" plt.title(\"sentiment-score-plot\")\n",
" plt.xlabel(\"sentiment score\")\n",
" plt.ylabel(\"neutrality\")\n",
" plt.xlim([np.min(top_X),np.max(top_X)])\n",
" plt.ylim([np.min(top_Y),np.max(top_Y)])\n",
" 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",
" fig_2, ax_2 = plt.subplots(figsize=(7.5,5))\n",
" plt.title(\"positive-negative-plot\")\n",
" plt.xlabel(\"positive\")\n",
" plt.ylabel(\"negative\")\n",
" plt.xlim([np.min(top_X),np.max(top_X)])\n",
" plt.ylim([np.min(top_Y),np.max(top_Y)])\n",
" 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:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('dataset_sentiment.csv')\n",
"df = df[['text','sentiment']]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"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"
]
},
"execution_count": 6,
"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",
"execution_count": 7,
"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",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"pipeline_file = \"/home/jonas/Dokumente/NLP_DATA/python_dumps/pipelines/tfidf_final/final_epoch01.pipeline\"\n",
"pm = twl.pipeline_manager.load_from_pipeline_file(pipeline_file)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* plot statements"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"top_20 = list(\"😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂\")\n",
"top_20_sents = twl.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",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfYAAAFbCAYAAAAnaayMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIu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GGNm4tyfB3jfGHNpFYekA2dXUWeIMaaH7+eBwPpaB6pUBfQeu1JK1ZIx5iWc1QwXBG1vhTOA7yGcwYyPG2PewxlQ+FUjhKqOAEdsYjfGLBKR4CUllVKqxowxnXBG508ITNjGmMdxnuD2As4MiZk4U9vvbZRAVZNSX3noiE3sUVFR0r9//8YOQynVQuTn57N+/Xrat29P165dadWqFeA8QTM3N5fff/+dtm3b0rNnT4LWsFdHqO+++26viERVXbJmjthR8f3792flypWNHYZSqgUpLCxkzpw5zJs3j6ysLIwxFBcXc+qppzJx4kSGDBnS2CGqJsQY82u91HukttiHDh0qmtiVUko1FmPMdyJSrcc+14SOildKKaVaEE3sSimlVAuiiV0ppZRqQTSxK6WUUi2IJnallFKqBdHErpRSSrUgmtiVUkqpFkQTu1JKKdWCaGJXSimlWhBN7EoppVQLooldKaVakG3btpX8nJuby3vvvcfGjRtZtGhRheVUy6KJXSmlWoiFCxcyaNAg1q5dC8Cdd97J9OnTGTRoEHfffTdvv/02AG+88QYDBw5k+/btjRmuqiea2JVSqoW46KKLSE1N5YknnmDnzp14PB769+9PREQEw4YN49133+Xbb7/lk08+4YMPPqB79+6NHbKqB5rYlVKqBSgqKmLkyJF8+eWXXHnllfzyyy8cOHCAa665hv79+9OrVy82bNjAMcc
"text/plain": [
"<Figure size 540x360 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAe4AAAFbCAYAAAATEG2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3Xl8lOW1wPHfmQQSSCBhDyg4UqhRUcNmA6K+bEpdk16s3FI1Wmu1UsFqBUXroGDBulCLS9HaQIXiUkGu1bgyAkpU1IgUUVkiCIQlIYEEss65f7y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uPxu3q2Nb8DwtgT9rcO7+kYhIJu40s224LRIdg6/rYVVdGdzn17h/W/1wu+FeVNWng9v64X4x3IbbJXMKMEdV3610nSjg6eDr34E7La+qEfXGHKI5J+6Lcefj3hd8/lPcD60y3P6qFrhNWwJcqKpLRWQlbt/ns6r6UvC4j1X1iFNJTP0JJu7rVTW1oWNpzkRkDG630XhVzQ3WDGOAs3D7uwOqWlVTe5MVTNypqupr4FCMqVZzHlXegZDmOVV9U0QeA0o1uHpUsLZRrKpLg7uV4i7kERVynub5zcaYI7sbGBucX10+z3s3sFREJgAfNmRwxpyomnO/SjaH3mXobYKLawQtAy4Xka9FZDVuTWJMpekxzfnLTZNTgz5kU3f+A1xfeeGX4POxHDyPurk4XB+7MY1Cc24qj8Fd/3dw8Plq3C8qXtylGAV39LAft5Z9BgeWVtyiqpNF5BzcdY6tj7sRCLaQXIc78n898Kqq3tWwUTVvIvIz3MVNsnH7tiNxxxR8gju
"text/plain": [
"<Figure size 540x360 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#twl.plot_sentiment_space(predicted_sentiment_vectors=pred_pos, top_sentiments=top_20_sents, top_emojis=top_20, style='go')\n",
"#twl.plot_sentiment_space(predicted_sentiment_vectors=pred_neg, top_sentiments=top_20_sents, top_emojis=top_20, style='ro')\n",
"#twl.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",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('../sentiment_sentences.csv', delimiter=';')"
]
},
{
"cell_type": "code",
"execution_count": 12,
"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",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfYAAAFbCAYAAAAnaayMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3XtYlGX6wPHvLXjANEQUDdPKPGUeULAFszRNMytPndwts8NmmZvlqkmrla1Y6lqrZf06uCq2WdvBrN22zDSzVDIzM9eyUhPUPAGSEijI/fvjncFh5CgDI8P9ua65YJ73nWfuYXTueY6vqCrGGGOMCQw1/B2AMcYYY3zHErsxxhgTQCyxG2OMMQHEErsxxhgTQCyxG2OMMQHEErsxxhgTQCyxG2PMaRCR80RkqYisFpGp/o7HGDdL7MZUABGZVUT5yyKSIiJNKjumsirqNRiHqu4C/gDUBpqfbj0i8icROd9HYRljid2YCnJhEeWRQDgQUomxnK6iXoNxUdXfgO/KWY39nY1PWWI3xsdEJAzoV8ThwUAzVf258iIqOxFpC0T5O45AJyI1gaH+jsMEFkvsxviQiJwLvArULey4quaoanrlRlU2rqT+T0D8HUsgE5FGwEtAC3/HYgJLsL8DMKYyiMhdOF3gqUAQzphoXVUdJyJ1gUeAmsCvwEXAYlX9t4icB8wDOgHvAc8CV+AkvcuAN1T1X67nqAckAGe77i90Pf0RVb1fREYBg1xxDFLVvSJyBzAGaAkMxOmqbwg0dtU/GjiAM5YLcCmwRVWneb2+RsCjQCaQ7XoNz6rqGhGJAZ4G2gNzgFU4rfGartfyd1Vd6arnfOBh17FGHq9hp6o+XsLfuAYwFjgBHH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wWjPwMYmj4f4ulGpm713YdakSoxfBPdz/dzG4jmF/bg2C86WqC1vZPgTyCbsu1BBm1DxBkhu43s58QTIUpd8EIiT4zc4KgE0OQJNWZoNfkXndfEzrHCOYNpxIEhpYESVOT3H1z6JzXCRLUuhIMmbQmSGqbEUpkuotgfNeAl4Gb3X1P6LnnAbcStLS2ufsjZvZLgtbgBQSB+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
"text/plain": [
"<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": 14,
"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"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(df)"
]
},
{
"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
}