diff --git a/Project/simple_approach/simple_twitter_learning.ipynb b/Project/simple_approach/simple_twitter_learning.ipynb index eccd552..78f5fa0 100644 --- a/Project/simple_approach/simple_twitter_learning.ipynb +++ b/Project/simple_approach/simple_twitter_learning.ipynb @@ -26,12 +26,17 @@ "metadata": {}, "outputs": [], "source": [ - "# TODO importing function for sentiment to emoji mapping\n", - "def sent2emoji(sentiment_vector: np.array):\n", - " return '๐Ÿคฆ'\n", + "import sys\n", + "sys.path.append(\"..\")\n", "\n", - "def emoji2sent(emoji: str):\n", - " return np.zeros(3)" + "from Tools.Emoji_Distance import sentiment_vector_to_emoji\n", + "from Tools.Emoji_Distance import emoji_to_sentiment_vector\n", + "\n", + "def emoji2sent(emoji_arr):\n", + " return np.array([emoji_to_sentiment_vector(e) for e in emoji_arr])\n", + "\n", + "def sent2emoji(sent_arr):\n", + " return [sentiment_vector_to_emoji(s) for s in sent_arr]" ] }, { @@ -1210,7 +1215,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -1229,7 +1234,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -1247,7 +1252,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ @@ -1259,12 +1264,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "* trying a multi label vectorizer" + "* defining different criterias for choosing a single emoji (currently `latest` is used)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 40, "metadata": {}, "outputs": [], "source": [ @@ -1275,13 +1280,84 @@ " return max(set(lst), key=lst.count) if len(lst) > 0 else \"X\" # setting label to 'X' if there is an empty emoji list" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* convert all emojis to a sentiment vector" + ] + }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ - "labels = [emoji2sent(latest(x)) for x in emojis]" + "labels = emoji2sent([latest(e) for e in emojis])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "68733" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(labels)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [], + "source": [ + "wrong_labels = np.isnan(np.linalg.norm(labels, axis=1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* remove all data we have no label for" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "labels = labels[np.invert(wrong_labels)]\n", + "plain_text = plain_text[np.invert(wrong_labels)]\n", + "emojis = emojis[np.invert(wrong_labels)]" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "58308 58308 58308\n" + ] + } + ], + "source": [ + "print(len(labels), len(emojis), len(plain_text))" ] }, { @@ -1293,7 +1369,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -1334,7 +1410,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -1343,16 +1419,16 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ - "y1_weights = np.array([(sum([emoji_weights[e] for e in e_list]) / len(e_list)) if len(e_list) > 0 else 0 for e_list in sent2emoji(y1)])" + "#y1_weights = np.array([(sum([emoji_weights[e] for e in e_list]) / len(e_list)) if len(e_list) > 0 else 0 for e_list in sent2emoji(y1)])" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -1370,7 +1446,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -1394,7 +1470,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -1420,14 +1496,14 @@ " \n", " clf = OVRC(model) if ovrc else model\n", "\n", - " clf.fit(vec_train[:max_size].A, y1[:max_size], validation_split=0.2, sample_weight=y1_weights[:max_size])\n", + " clf.fit(vec_train[:max_size].A, y1[:max_size], validation_split=0.2)#, sample_weight=y1_weights[:max_size])\n", " \n", " return clf" ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -1436,7 +1512,7 @@ "text": [ "Train on 8000 samples, validate on 2000 samples\n", "Epoch 1/1\n", - "8000/8000 [==============================] - 109s 14ms/step - loss: 0.0042 - acc: 0.0012 - val_loss: 0.0042 - val_acc: 0.0020\n" + "8000/8000 [==============================] - 80s 10ms/step - loss: 1.0421 - acc: 0.7270 - val_loss: 1.0213 - val_acc: 0.7330\n" ] } ], @@ -1446,77 +1522,77 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "62691 I just finished mine I was extremely ne...\n", - "9959 Kinda Gross but yup it's ...\n", - "39726 Treating myself to a manicure because even une...\n", - "20883 Sarfraz Done it.Congrats.Pakistan Rules the Wo...\n", - "2705 I turn 20 in Just over a month and Iโ€™ve never ...\n", - "20766 The coolest & beautiful duo ever โคโค\n", - "13242 Studying abroad in Italy for 3 weeks i...\n", - "32951 You're nice to meeeeee thanks I appreciate that \n", - "7297 hahahha it kinda does look like me \n", - "10913 Ya Rasulullah.,You are the Messenger...\n", - "58664 crying\n", - "28113 Man my Dad crazy but I miss his Bok Choi soup ...\n", - "20698 Well done!!\n", - "45787 Mi mess\n", - "36076 schooling all the \n", - "66970 Awww but Iโ€™m sure your man can \n", - "34787 TWEET using the hashtag... is the rel...\n", - "9746 Nation is lost y NS boosting tat he will appea...\n", - "64458 Video dinner medic \n", - "63868 He wouldn't expect anything less \n", - "7878 Looking for an ASAP?๐Ÿ•ฐ๏ธCheck out our ...\n", - "42253 Cuddled up in a hoodie and fuzzy socks. \n", - "32650 Too true the Buble album is out and...\n", - "58945 Woke up late again \n", - "60382 Damn g well mfs glad you out take adva...\n", - "37224 + SATURDAY OFFICIAL CAU VS MOREHOUSE ...\n", - "19488 My back is sore\n", - "36042 Actually, it should be October 31st๐Ÿ•ธ vs. Novem...\n", + "10237 How much do you know about the y...\n", + "45851 She said she don't start until Friday \n", + "28327 Ryane just told me to not stress because it's ...\n", + "22017 Meet Asian & Russian Beauty From Here Fi...\n", + "23341 What do u mean \n", + "42942 โ”Š โ”Š โœฒ๏ฝžโ”Š โœฒ...\n", + "28320 Woot woot leafs win \n", + "26801 weโ€™re here for you and you know that, y...\n", + "66054 gm Mailand have an awesome day \n", + "64440 Happy halloween \n", + "1695 BARCELONA SPOING CLUB \n", + "57848 I will purchase a few things because I love th...\n", + "6174 Ah I'll let you off then ! \n", + "9295 just the idea of empowering women is so...\n", + "48858 Damn!! People late on the thing. This t...\n", + "17032 I miss u \n", + "30856 I just want to be with you always \n", + "56964 when you canโ€™t fall asleep because you just ca...\n", + "64594 less than 24hrs until the big 21\n", + "14707 were furry trash \n", + "54005 At this point, I will break the bank \n", + "60411 Thank not me! \n", + "59436 when u finally get a new nigga and all yo old ...\n", + "1264 I was a Nintendo boy my friend down the...\n", + "42327 Rabbit rabbit white rabbit. May everything goe...\n", + "39441 rainy morning ๐ŸŒง\n", + "17380 I'm glad it arrived safely!! Thank you ...\n", + "51558 Been in this drive through for 15 minutes Sti...\n", + "24223 I'm looking into it!!! \n", + "31673 Seokjin's just standing there & steal my ...\n", " ... \n", - "4414 Absolutely mate \n", - "21768 Running late to pick up the kids, and this tra...\n", - "5359 Lmao well if you say so \n", - "22550 Hardcore \n", - "55252 Click here to watch it: Kane hot office sex i...\n", - "42040 And brother โ€๏ธ thanks\n", - "19063 yes Haley \n", - "477 Our differences are the real treasur...\n", - "41045 I just took a two hour nap instead of d...\n", - "52270 Some guy full on grabbed my ass last night whe...\n", - "52102 Can't ever do anything for myself. \n", - "29210 OMFG SHES SO BEAUTIFUL \n", - "2131 Check out what I'm selling on my shop \n", - "2912 My shordy b boostin \n", - "64797 I pray my nieces NEVER feel this type of hurt ...\n", - "63632 I should definitely go to sleep and rea...\n", - "30426 Texas asf \n", - "68567 annyeong! if you have time kindly check...\n", - "61825 He melts me! I want him to stay this small for...\n", - "8057 Sorry Not Sorry By is Track 13 on I liked it too \n", - "18808 A mansion gap, maybe \n", - "64643 Happy halloween \n", - "34804 Where is a Civil Rights Lawyer ready to help t...\n", - "62123 I keep having dreams that my family come and v...\n", - "18325 # May this day bring countless happines...\n", - "66916 Happy Halloween \n", - "63618 This is what happens when I finish a painting \n", - "Name: text, Length: 61859, dtype: object" + "29591 Lmfao heโ€™s gonna wake up to 17 messages about ...\n", + "52608 The seaweed is always greener in somebody else...\n", + "22482 I can!\n", + "552 This is actually true. I like my rooibos black...\n", + "48523 Also the Punjabi in ke is dying ...\n", + "61773 Always make me cry always hurting me always ma...\n", + "61578 Thank you so much!!! \n", + "34541 I am here for this \n", + "2485 Yes bambz \n", + "35802 Donโ€™t give up just yet.\n", + "8504 HAPPY BIHDAY \n", + "3403 any dates of south america??? \n", + "53606 So nice honey\n", + "6234 my boyfriend and my sister are gonna be here f...\n", + "5030 Thanks! And definitely\n", + "46147 Y'all will roast my ass. Akhant \n", + "6445 Click here to watch it: MILF Phoenix Marie ta...\n", + "65485 Would have broke it\n", + "36002 Okinnam\n", + "53927 Thats my crew, I'd fit right in with th...\n", + "53701 Lol they saving it for match day \n", + "3549 Nooo after tonight we can be friends ag...\n", + "9393 Amazing the media trying to politics a terror ...\n", + "67371 Got so many compliments on our costumes tonigh...\n", + "22173 The Shoes...\n", + "26422 Happy Birthday today to Rep. Bruce Antone and ...\n", + "41219 Good morning sex \n", + "37447 My baby so cute โค๏ธ \n", + "21608 My week on Twitter : 1 Tweet. See yours with \n", + "1594 Itโ€™s fair to say I ruined my life a few times ...\n", + "Name: text, Length: 52477, dtype: object" ] }, - "execution_count": 26, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -1534,7 +1610,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -1543,28 +1619,22 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "array([[0.00124256, 0.00124216, 0.00123592, ..., 0.00123677, 0.00123611,\n", - " 0.00123534],\n", - " [0.00124442, 0.00123547, 0.00123502, ..., 0.00123892, 0.00123958,\n", - " 0.00123556],\n", - " [0.00124413, 0.00123538, 0.00124574, ..., 0.00123829, 0.00123556,\n", - " 0.00123374],\n", + "array([[0.49225155, 0.22154534, 0.28620324],\n", + " [0.4917669 , 0.22080076, 0.28743234],\n", + " [0.49208197, 0.22085808, 0.28705996],\n", " ...,\n", - " [0.00123915, 0.00123915, 0.00123916, ..., 0.00123915, 0.00123916,\n", - " 0.00123915],\n", - " [0.00124084, 0.00124438, 0.00123832, ..., 0.00123602, 0.00125055,\n", - " 0.00123963],\n", - " [0.00124321, 0.0012361 , 0.00123488, ..., 0.00123589, 0.00124259,\n", - " 0.00123691]], dtype=float32)" + " [0.48990184, 0.22155353, 0.28854463],\n", + " [0.49245682, 0.22013731, 0.28740585],\n", + " [0.4891684 , 0.2214878 , 0.2893438 ]], dtype=float32)" ] }, - "execution_count": 28, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -1575,51 +1645,19 @@ }, { "cell_type": "code", - "execution_count": 29, - "metadata": {}, - "outputs": [], - "source": [ - "binary_pred = np.zeros_like(pred)\n", - "binary_pred[np.arange(len(pred)), pred.argmax(1)] = 1 " - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0., 0., 0., ..., 0., 0., 0.],\n", - " [0., 0., 0., ..., 0., 0., 0.],\n", - " [0., 0., 0., ..., 0., 0., 0.]], dtype=float32)" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "binary_pred[[0,1,2]]" - ] - }, - { - "cell_type": "code", - "execution_count": 31, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "# build a dataframe to visualize test results:\n", "testlist = pd.DataFrame({'text': Xt1, \n", - " 'teacher': mlb_single.inverse_transform(yt1) if SINGLE_LABEL else sent2emoji(yt1), \n", - " 'predict': mlb_single.inverse_transform(binary_pred) if SINGLE_LABEL else sent2emoji(binary_pred)})" + " 'teacher': sent2emoji(yt1),\n", + " 'predict': sent2emoji(pred)})" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 60, "metadata": {}, "outputs": [ { @@ -1650,184 +1688,184 @@ " \n", " \n", " \n", - " 15278\n", - " (๐ŸŒ ,)\n", - " (๐Ÿ˜…,)\n", - " <USER> <USER> 2 years? โœŒ\n", + " 62474\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™‹\n", + " Lovely\n", " \n", " \n", - " 36882\n", - " (๐Ÿ•”,)\n", - " (๐Ÿ˜‚,)\n", - " tell me why this is me everyday\n", + " 11750\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " โ˜ child they told that to slaves and look what...\n", " \n", " \n", - " 65543\n", - " (๐ŸŒ,)\n", - " (๐Ÿ“Œ,)\n", - " please follow us ::Twitter โ–ถ๏ธ โ–ถ๏ธ โ–ถ๏ธMARSHMALL...\n", + " 316\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " Only in Wisconsin\n", " \n", " \n", - " 65893\n", - " (๐Ÿ˜‚,)\n", - " (๐Ÿ”,)\n", - " This\n", + " 33553\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™\n", + " : Barboursville For Taxi 703-445-4450\n", " \n", " \n", - " 55496\n", - " (๐ŸŽณ,)\n", - " (๐Ÿ˜,)\n", - " <USER> Im in love\n", + " 1566\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " who cares anyway\n", " \n", " \n", - " 61997\n", - " (๐ŸŒ,)\n", - " (๐ŸŒธ,)\n", - " <USER> Miss you gemmthankyou sooo muchโคโค\n", + " 54842\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " <USER> first it was spratt then faze spratt th...\n", " \n", " \n", - " 15819\n", - " (๐Ÿ”น,)\n", - " (๐Ÿ˜‚,)\n", - " Me as a parent\n", + " 16711\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " I will forever love the Dodgers! BLEED BLUE t...\n", " \n", " \n", - " 21340\n", - " (๐ŸŒ‘,)\n", - " (๐Ÿ˜‚,)\n", - " Really betting my manager rn for tonightโ€™s game\n", + " 52129\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Š\n", + " ok she nailed this โ€๏ธ\n", " \n", " \n", - " 26691\n", - " (๐ŸŽณ,)\n", - " (๐Ÿ˜ฉ,)\n", - " Y ES IM A BAD BOY SO I LIKE BAD GIRL\n", + " 66914\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™†\n", + " time to create the Christmas playlist\n", " \n", " \n", - " 57025\n", - " (๐ŸŒท,)\n", - " (๐Ÿ˜ƒ,)\n", - " <USER> Just downloaded to my fire stick over ...\n", + " 42046\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " Penultimate <HASHTAG> of the 2017 race season!...\n", " \n", " \n", - " 17967\n", - " (๐Ÿ”,)\n", - " (๐Ÿ˜,)\n", - " <USER> Love this ! Hollywood is the man\n", + " 13783\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Š\n", + " hey friends i need space 2nite. happy 11-1! lo...\n", " \n", " \n", - " 68555\n", - " (๐ŸŒ‘,)\n", - " (๐Ÿ˜‰,)\n", - " <USER> Absolutely but if it had been a banana ...\n", + " 4034\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜’\n", + " Sombitch! 3.5 secs left an the goddamn 2K serv...\n", " \n", " \n", - " 20784\n", - " (๐Ÿ’,)\n", - " (๐Ÿป,)\n", - " La Grasaaaaaaaaa Reverse Shatter Back Board S...\n", + " 9773\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " sounds great..\n", " \n", " \n", - " 68300\n", - " (๐Ÿฅฃ,)\n", - " (๐Ÿ˜,)\n", - " I go to New York next month ahhhhhh\n", + " 27593\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ด\n", + " what happens after I give babe a massage\n", " \n", " \n", - " 4659\n", - " (๐Ÿ’,)\n", - " (๐Ÿ˜ญ,)\n", - " <USER> Iโ€™m trying to enjoy it as much as the f...\n", + " 22601\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™\n", + " <USER> Thank you\n", " \n", " \n", - " 66706\n", - " (๐ŸŒ•,)\n", - " (๐Ÿ“ž,)\n", - " : Salamander Resort <HASHTAG> ๐Ÿฝ๏ธ For Taxi 70...\n", + " 64332\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " <USER> I love you I'm so proud of you\n", " \n", " \n", - " 47510\n", - " (๐ŸŽ„,)\n", - " (๐Ÿ‘‰,)\n", - " For your actions there WILL be consequences. Y...\n", + " 23677\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™‹\n", + " <USER> <USER> Love how your coffee bags pop up...\n", " \n", " \n", - " 55294\n", - " (๐Ÿ˜พ,)\n", - " (๐Ÿ˜‚,)\n", - " <USER> Omg my cousin charging 40\n", + " 1530\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " <USER> I know\n", " \n", " \n", - " 621\n", - " (๐ŸŒ,)\n", - " (๐Ÿคฆ,)\n", - " Zoey daycare lets her do whatever she want, I ...\n", + " 38375\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " <USER> Xmas songs all the way! I got a new chr...\n", " \n", " \n", - " 31011\n", - " (๐Ÿ˜Œ,)\n", - " (๐Ÿ˜€,)\n", - " yeah! โœŒ๏ธ\n", + " 37403\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™†\n", + " 54 days until Christmas!!\n", " \n", " \n", - " 30659\n", - " (๐ŸŽ,)\n", - " (๐Ÿ’ช,)\n", - " This was so much I mean SO MUCH over due for t...\n", + " 52706\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™\n", + " \"November comesAnd November goes,ย With the las...\n", " \n", " \n", - " 66284\n", - " (๐Ÿค”,)\n", - " (๐Ÿ™‚,)\n", - " Parent contact booking is now open! Please fol...\n", + " 9628\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " <USER> You want me dead\n", " \n", " \n", - " 66758\n", - " (๐ŸŽ„,)\n", - " (๐Ÿ˜ฅ,)\n", - " <USER> OCONUS we donโ€™t have the Turkey Day buf...\n", + " 41270\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " Finally arrived Thank you so much <USER> So ...\n", " \n", " \n", - " 13456\n", - " (๐ŸŒ ,)\n", - " (๐Ÿ’•,)\n", - " Dems realtor business partners have lots of ni...\n", + " 56276\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " Omfg this is amazing\n", " \n", " \n", - " 15057\n", - " (๐Ÿฅฃ,)\n", - " (๐Ÿ˜‚,)\n", - " Ready for the dodgers fans excuses\n", + " 14805\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Š\n", + " Finding my <HASHTAG> need it now\n", " \n", " \n", - " 188\n", - " (๐ŸŽ„,)\n", - " (๐ŸŽ‰,)\n", - " <USER> Happy Birthday Angge\n", + " 1275\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Š\n", + " <USER> happy birthday\n", " \n", " \n", - " 5054\n", - " (๐ŸŽ„,)\n", - " (๐Ÿ˜‚,)\n", - " <USER> <USER> Lawsuit\n", + " 30821\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Œ\n", + " <USER> better stock up, quenouille season is c...\n", " \n", " \n", - " 18099\n", - " (๐Ÿ‘ƒ,)\n", - " (๐Ÿ˜ค,)\n", - " Finna roll this up no excuses\n", + " 36974\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " i always think miguel is saying \"black power\" ...\n", " \n", " \n", - " 17120\n", - " (๐ŸŒ,)\n", - " (โšก,)\n", - " But itโ€™s forever fuck em and keep it gutta ๏ธ\n", + " 31270\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " <USER> so proud\n", " \n", " \n", - " 14552\n", - " (๐Ÿ“–,)\n", - " (๐Ÿ˜,)\n", - " I just need to hubby a hockey player up\n", + " 21672\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " <USER> snapchat chick ?\n", " \n", " \n", " ...\n", @@ -1836,255 +1874,255 @@ " ...\n", " \n", " \n", - " 21819\n", - " (๐ŸŽ„,)\n", - " (๐Ÿ˜‚,)\n", - " Niggas funny af\n", + " 6464\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " <USER> <USER> Actually I donโ€™t think that woul...\n", " \n", " \n", - " 18460\n", - " (โ™ฟ,)\n", - " (๐Ÿ’,)\n", - " 1. Donโ€™t EVER disrespect Thanksgiving cuz yo f...\n", + " 14439\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜›\n", + " happy birthday to a really great friend, hope ...\n", " \n", " \n", - " 60291\n", - " (๐Ÿšฎ,)\n", - " (๐Ÿ’˜,)\n", - " happy bday lexi <USER>\n", + " 30789\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " Might fuck around and not turn in my library b...\n", " \n", " \n", - " 22623\n", - " (๐Ÿ”–,)\n", - " (๐Ÿ˜ฉ,)\n", - " Mr.Lazaro said โ€œthereโ€™s my girlsโ€ when he seen...\n", + " 37129\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜€\n", + " My lil baby sick and itโ€™s making me sad, I den...\n", " \n", " \n", - " 87\n", - " (๐ŸŒ,)\n", - " (๐ŸŽˆ,)\n", - " Happy Birthday Blake!!!! I hope you have an am...\n", + " 61305\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ƒ\n", + " Love our customers...always on the go! โค๏ธ TRO...\n", " \n", " \n", - " 2884\n", - " (๐Ÿ„,)\n", - " (๐Ÿ˜‰,)\n", - " <USER> This would be a good time to do a Week ...\n", + " 4821\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™Œ\n", + " God bless whoever you marry!\n", " \n", " \n", - " 30212\n", - " (๐Ÿง˜,)\n", - " (๐Ÿ“Œ,)\n", - " <USER> Done, pls โค๏ธ y FAV\n", + " 6509\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ธ\n", + " j-u-v-e: On 1 November, Juventus turns 120! H...\n", " \n", " \n", - " 55813\n", - " (๐Ÿ˜พ,)\n", - " (๐Ÿ˜,)\n", - " There is just something about <USER> <HASHTAG>\n", + " 41347\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜Š\n", + " <USER> Yeah, sunshine, I promise I love you a...\n", " \n", " \n", - " 11657\n", - " (๐Ÿ’š,)\n", - " (๐Ÿ˜ด,)\n", - " <USER> you're brudda!\n", + " 15368\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™Œ\n", + " You ain't ever made love, You just wanted some...\n", " \n", " \n", - " 18215\n", - " (๐Ÿน,)\n", - " (๐Ÿคท,)\n", - " Not being depressed โ€๏ธ\n", + " 22594\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " This whole lingerie thing is funny sha\n", " \n", " \n", - " 48609\n", - " (๐Ÿง˜,)\n", - " (๐Ÿค‘,)\n", - " <USER> I โค you. My woman crush everyday as alw...\n", + " 61471\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " <USER> Wooo congrats buddy!\n", " \n", " \n", - " 16079\n", - " (๐Ÿฅฃ,)\n", - " (โš“,)\n", - " I added a video to a <USER> playlist ๐Ÿ›ณ ๏ธ The ...\n", + " 63724\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‰\n", + " Early mornings\n", " \n", " \n", - " 28380\n", - " (๐Ÿฅฃ,)\n", - " (๐Ÿ˜‚,)\n", - " Dodgers\n", + " 7399\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " <USER> <USER> So Sad\n", " \n", " \n", - " 41212\n", - " (๐ŸŒ,)\n", - " (๐Ÿ”ด,)\n", - " [LIVE] on <USER>\n", + " 8262\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜€\n", + " But opening up means trusting others.And that'...\n", " \n", " \n", - " 67555\n", - " (๐Ÿ”—,)\n", - " (๐Ÿ’ž,)\n", - " โ€ข <USER> my precious Niya always checking up o...\n", + " 61430\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " bambam pink hairโค๏ธ\n", " \n", " \n", - " 45490\n", - " (๐Ÿ•”,)\n", - " (๐Ÿคท,)\n", - " If you wanna make things right it go both ways โ€๏ธ\n", + " 59747\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " Nah last nights game was well worth my months ...\n", " \n", " \n", - " 54052\n", - " (๐ŸŒ,)\n", - " (๐Ÿ˜ข,)\n", - " Poor baby!!!\n", + " 47655\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜š\n", + " <USER> wish your many more happy returns of th...\n", " \n", " \n", - " 54517\n", - " (๐Ÿน,)\n", - " (๐Ÿ˜š,)\n", - " <USER> happy birthday, hope you have a good day\n", + " 30992\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ถ\n", + " my heart breaks into a million pieces every mo...\n", " \n", " \n", - " 24047\n", - " (๐ŸŒท,)\n", - " (๐Ÿ˜Œ,)\n", - " Donโ€™t get mad when them haters stare let em lo...\n", + " 2204\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™\n", + " Call Congress (202) 224-3121 <HASHTAG> <HASHTA...\n", " \n", " \n", - " 253\n", - " (๐Ÿฅ„,)\n", - " (๐Ÿ˜Ž,)\n", - " Sag season right around the corner. 25 on the ...\n", + " 41224\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " I love Lucasโ€™s sister! โค๏ธ Erica is so funny!\n", " \n", " \n", - " 64707\n", - " (๐ŸŽธ,)\n", - " (๐Ÿ˜‡,)\n", - " <USER> Letโ€™s see his costume\n", + " 65180\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " <USER> PULL THRU JELLYBEAN\n", " \n", " \n", - " 34279\n", - " (๐ŸŒฏ,)\n", - " (๐Ÿ˜ฅ,)\n", - " <USER> I AM NERVOUS!!\n", + " 48319\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ญ\n", + " i miss the snickerdoodle swirl from <USER> so ...\n", " \n", " \n", - " 58342\n", - " (๐Ÿค,)\n", - " (๐Ÿ™Œ,)\n", - " <USER> This looks amazing\n", + " 19825\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‹\n", + " I love you- and I really do.\n", " \n", " \n", - " 16361\n", - " (๐ŸŽ„,)\n", - " (๐Ÿ™Œ,)\n", - " <USER> <USER> <USER> <USER> <USER> <USER> Shit...\n", + " 63387\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜น\n", + " Love huvin Mason, can steal aw his Halloween s...\n", " \n", " \n", - " 39069\n", - " (๐Ÿ˜‚,)\n", - " (๐Ÿ‘‡,)\n", - " THIS\n", + " 33798\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " 80/0 at the end of 10 overs - Shikhar Dhawan ...\n", " \n", " \n", - " 59739\n", - " (๐ŸŒท,)\n", - " (๐Ÿ†,)\n", - " I've never consumed a reindeer.\n", + " 63144\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ™‹\n", + " Stoping for a few in between 12 hr shifts is p...\n", " \n", " \n", - " 49140\n", - " (๐ŸŒ•,)\n", - " (๐Ÿค,)\n", - " Sales is the heart of business.\n", + " 5185\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜\n", + " When a band member of Volumes actually adds yo...\n", " \n", " \n", - " 47901\n", - " (๐Ÿ˜‚,)\n", - " (๐Ÿ˜ญ,)\n", - " bruuuuhhh\n", + " 65919\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜ถ\n", + " <USER> <USER> Evil sick humans what a world we...\n", " \n", " \n", - " 4241\n", - " (๐Ÿ’ฒ,)\n", - " (๐ŸŽ“,)\n", - " <USER> Congratulations ! youโ€™ve graduated with...\n", + " 27834\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " <USER> I always thought it was <USER>\n", " \n", " \n", - " 24123\n", - " (โž—,)\n", - " (๐Ÿ‘,)\n", - " <USER> Your A Rock Star! How You Put Up With ...\n", + " 57241\n", + " ๐Ÿ˜‚\n", + " ๐Ÿ˜‚\n", + " <USER> <USER> I thought u meant the show neve...\n", " \n", " \n", "\n", - "

6874 rows ร— 3 columns

\n", + "

5831 rows ร— 3 columns

\n", "" ], "text/plain": [ " predict teacher text\n", - "15278 (๐ŸŒ ,) (๐Ÿ˜…,) 2 years? โœŒ\n", - "36882 (๐Ÿ•”,) (๐Ÿ˜‚,) tell me why this is me everyday \n", - "65543 (๐ŸŒ,) (๐Ÿ“Œ,) please follow us ::Twitter โ–ถ๏ธ โ–ถ๏ธ โ–ถ๏ธMARSHMALL...\n", - "65893 (๐Ÿ˜‚,) (๐Ÿ”,) This \n", - "55496 (๐ŸŽณ,) (๐Ÿ˜,) Im in love \n", - "61997 (๐ŸŒ,) (๐ŸŒธ,) Miss you gemmthankyou sooo muchโคโค\n", - "15819 (๐Ÿ”น,) (๐Ÿ˜‚,) Me as a parent \n", - "21340 (๐ŸŒ‘,) (๐Ÿ˜‚,) Really betting my manager rn for tonightโ€™s game \n", - "26691 (๐ŸŽณ,) (๐Ÿ˜ฉ,) Y ES IM A BAD BOY SO I LIKE BAD GIRL \n", - "57025 (๐ŸŒท,) (๐Ÿ˜ƒ,) Just downloaded to my fire stick over ...\n", - "17967 (๐Ÿ”,) (๐Ÿ˜,) Love this ! Hollywood is the man \n", - "68555 (๐ŸŒ‘,) (๐Ÿ˜‰,) Absolutely but if it had been a banana ...\n", - "20784 (๐Ÿ’,) (๐Ÿป,) La Grasaaaaaaaaa Reverse Shatter Back Board S...\n", - "68300 (๐Ÿฅฃ,) (๐Ÿ˜,) I go to New York next month ahhhhhh \n", - "4659 (๐Ÿ’,) (๐Ÿ˜ญ,) Iโ€™m trying to enjoy it as much as the f...\n", - "66706 (๐ŸŒ•,) (๐Ÿ“ž,) : Salamander Resort ๐Ÿฝ๏ธ For Taxi 70...\n", - "47510 (๐ŸŽ„,) (๐Ÿ‘‰,) For your actions there WILL be consequences. Y...\n", - "55294 (๐Ÿ˜พ,) (๐Ÿ˜‚,) Omg my cousin charging 40 \n", - "621 (๐ŸŒ,) (๐Ÿคฆ,) Zoey daycare lets her do whatever she want, I ...\n", - "31011 (๐Ÿ˜Œ,) (๐Ÿ˜€,) yeah! โœŒ๏ธ \n", - "30659 (๐ŸŽ,) (๐Ÿ’ช,) This was so much I mean SO MUCH over due for t...\n", - "66284 (๐Ÿค”,) (๐Ÿ™‚,) Parent contact booking is now open! Please fol...\n", - "66758 (๐ŸŽ„,) (๐Ÿ˜ฅ,) OCONUS we donโ€™t have the Turkey Day buf...\n", - "13456 (๐ŸŒ ,) (๐Ÿ’•,) Dems realtor business partners have lots of ni...\n", - "15057 (๐Ÿฅฃ,) (๐Ÿ˜‚,) Ready for the dodgers fans excuses \n", - "188 (๐ŸŽ„,) (๐ŸŽ‰,) Happy Birthday Angge \n", - "5054 (๐ŸŽ„,) (๐Ÿ˜‚,) Lawsuit \n", - "18099 (๐Ÿ‘ƒ,) (๐Ÿ˜ค,) Finna roll this up no excuses \n", - "17120 (๐ŸŒ,) (โšก,) But itโ€™s forever fuck em and keep it gutta ๏ธ\n", - "14552 (๐Ÿ“–,) (๐Ÿ˜,) I just need to hubby a hockey player up \n", + "62474 ๐Ÿ˜‚ ๐Ÿ™‹ Lovely \n", + "11750 ๐Ÿ˜‚ ๐Ÿ˜‚ โ˜ child they told that to slaves and look what...\n", + "316 ๐Ÿ˜‚ ๐Ÿ˜‚ Only in Wisconsin \n", + "33553 ๐Ÿ˜‚ ๐Ÿ™ : Barboursville For Taxi 703-445-4450 \n", + "1566 ๐Ÿ˜‚ ๐Ÿ˜ who cares anyway \n", + "54842 ๐Ÿ˜‚ ๐Ÿ˜ญ first it was spratt then faze spratt th...\n", + "16711 ๐Ÿ˜‚ ๐Ÿ˜š I will forever love the Dodgers! BLEED BLUE t...\n", + "52129 ๐Ÿ˜‚ ๐Ÿ˜Š ok she nailed this โ€๏ธ \n", + "66914 ๐Ÿ˜‚ ๐Ÿ™† time to create the Christmas playlist \n", + "42046 ๐Ÿ˜‚ ๐Ÿ˜ Penultimate of the 2017 race season!...\n", + "13783 ๐Ÿ˜‚ ๐Ÿ˜Š hey friends i need space 2nite. happy 11-1! lo...\n", + "4034 ๐Ÿ˜‚ ๐Ÿ˜’ Sombitch! 3.5 secs left an the goddamn 2K serv...\n", + "9773 ๐Ÿ˜‚ ๐Ÿ˜ sounds great.. \n", + "27593 ๐Ÿ˜‚ ๐Ÿ˜ด what happens after I give babe a massage \n", + "22601 ๐Ÿ˜‚ ๐Ÿ™ Thank you \n", + "64332 ๐Ÿ˜‚ ๐Ÿ˜š I love you I'm so proud of you \n", + "23677 ๐Ÿ˜‚ ๐Ÿ™‹ Love how your coffee bags pop up...\n", + "1530 ๐Ÿ˜‚ ๐Ÿ˜ญ I know \n", + "38375 ๐Ÿ˜‚ ๐Ÿ˜ Xmas songs all the way! I got a new chr...\n", + "37403 ๐Ÿ˜‚ ๐Ÿ™† 54 days until Christmas!! \n", + "52706 ๐Ÿ˜‚ ๐Ÿ™ \"November comesAnd November goes,ย With the las...\n", + "9628 ๐Ÿ˜‚ ๐Ÿ˜ญ You want me dead \n", + "41270 ๐Ÿ˜‚ ๐Ÿ˜ Finally arrived Thank you so much So ...\n", + "56276 ๐Ÿ˜‚ ๐Ÿ˜‚ Omfg this is amazing \n", + "14805 ๐Ÿ˜‚ ๐Ÿ˜Š Finding my need it now \n", + "1275 ๐Ÿ˜‚ ๐Ÿ˜Š happy birthday\n", + "30821 ๐Ÿ˜‚ ๐Ÿ˜Œ better stock up, quenouille season is c...\n", + "36974 ๐Ÿ˜‚ ๐Ÿ˜‚ i always think miguel is saying \"black power\" ...\n", + "31270 ๐Ÿ˜‚ ๐Ÿ˜š so proud \n", + "21672 ๐Ÿ˜‚ ๐Ÿ˜ญ snapchat chick ? \n", "... ... ... ...\n", - "21819 (๐ŸŽ„,) (๐Ÿ˜‚,) Niggas funny af \n", - "18460 (โ™ฟ,) (๐Ÿ’,) 1. Donโ€™t EVER disrespect Thanksgiving cuz yo f...\n", - "60291 (๐Ÿšฎ,) (๐Ÿ’˜,) happy bday lexi \n", - "22623 (๐Ÿ”–,) (๐Ÿ˜ฉ,) Mr.Lazaro said โ€œthereโ€™s my girlsโ€ when he seen...\n", - "87 (๐ŸŒ,) (๐ŸŽˆ,) Happy Birthday Blake!!!! I hope you have an am...\n", - "2884 (๐Ÿ„,) (๐Ÿ˜‰,) This would be a good time to do a Week ...\n", - "30212 (๐Ÿง˜,) (๐Ÿ“Œ,) Done, pls โค๏ธ y FAV\n", - "55813 (๐Ÿ˜พ,) (๐Ÿ˜,) There is just something about \n", - "11657 (๐Ÿ’š,) (๐Ÿ˜ด,) you're brudda!\n", - "18215 (๐Ÿน,) (๐Ÿคท,) Not being depressed โ€๏ธ \n", - "48609 (๐Ÿง˜,) (๐Ÿค‘,) I โค you. My woman crush everyday as alw...\n", - "16079 (๐Ÿฅฃ,) (โš“,) I added a video to a playlist ๐Ÿ›ณ ๏ธ The ...\n", - "28380 (๐Ÿฅฃ,) (๐Ÿ˜‚,) Dodgers \n", - "41212 (๐ŸŒ,) (๐Ÿ”ด,) [LIVE] on \n", - "67555 (๐Ÿ”—,) (๐Ÿ’ž,) โ€ข my precious Niya always checking up o...\n", - "45490 (๐Ÿ•”,) (๐Ÿคท,) If you wanna make things right it go both ways โ€๏ธ\n", - "54052 (๐ŸŒ,) (๐Ÿ˜ข,) Poor baby!!! \n", - "54517 (๐Ÿน,) (๐Ÿ˜š,) happy birthday, hope you have a good day\n", - "24047 (๐ŸŒท,) (๐Ÿ˜Œ,) Donโ€™t get mad when them haters stare let em lo...\n", - "253 (๐Ÿฅ„,) (๐Ÿ˜Ž,) Sag season right around the corner. 25 on the ...\n", - "64707 (๐ŸŽธ,) (๐Ÿ˜‡,) Letโ€™s see his costume \n", - "34279 (๐ŸŒฏ,) (๐Ÿ˜ฅ,) I AM NERVOUS!!\n", - "58342 (๐Ÿค,) (๐Ÿ™Œ,) This looks amazing \n", - "16361 (๐ŸŽ„,) (๐Ÿ™Œ,) Shit...\n", - "39069 (๐Ÿ˜‚,) (๐Ÿ‘‡,) THIS \n", - "59739 (๐ŸŒท,) (๐Ÿ†,) I've never consumed a reindeer. \n", - "49140 (๐ŸŒ•,) (๐Ÿค,) Sales is the heart of business. \n", - "47901 (๐Ÿ˜‚,) (๐Ÿ˜ญ,) bruuuuhhh \n", - "4241 (๐Ÿ’ฒ,) (๐ŸŽ“,) Congratulations ! youโ€™ve graduated with...\n", - "24123 (โž—,) (๐Ÿ‘,) Your A Rock Star! How You Put Up With ...\n", + "6464 ๐Ÿ˜‚ ๐Ÿ˜‚ Actually I donโ€™t think that woul...\n", + "14439 ๐Ÿ˜‚ ๐Ÿ˜› happy birthday to a really great friend, hope ...\n", + "30789 ๐Ÿ˜‚ ๐Ÿ˜ Might fuck around and not turn in my library b...\n", + "37129 ๐Ÿ˜‚ ๐Ÿ˜€ My lil baby sick and itโ€™s making me sad, I den...\n", + "61305 ๐Ÿ˜‚ ๐Ÿ˜ƒ Love our customers...always on the go! โค๏ธ TRO...\n", + "4821 ๐Ÿ˜‚ ๐Ÿ™Œ God bless whoever you marry! \n", + "6509 ๐Ÿ˜‚ ๐Ÿ˜ธ j-u-v-e: On 1 November, Juventus turns 120! H...\n", + "41347 ๐Ÿ˜‚ ๐Ÿ˜Š Yeah, sunshine, I promise I love you a...\n", + "15368 ๐Ÿ˜‚ ๐Ÿ™Œ You ain't ever made love, You just wanted some...\n", + "22594 ๐Ÿ˜‚ ๐Ÿ˜‚ This whole lingerie thing is funny sha \n", + "61471 ๐Ÿ˜‚ ๐Ÿ˜š Wooo congrats buddy!\n", + "63724 ๐Ÿ˜‚ ๐Ÿ˜‰ Early mornings \n", + "7399 ๐Ÿ˜‚ ๐Ÿ˜ญ So Sad \n", + "8262 ๐Ÿ˜‚ ๐Ÿ˜€ But opening up means trusting others.And that'...\n", + "61430 ๐Ÿ˜‚ ๐Ÿ˜š bambam pink hairโค๏ธ\n", + "59747 ๐Ÿ˜‚ ๐Ÿ˜‚ Nah last nights game was well worth my months ...\n", + "47655 ๐Ÿ˜‚ ๐Ÿ˜š wish your many more happy returns of th...\n", + "30992 ๐Ÿ˜‚ ๐Ÿ˜ถ my heart breaks into a million pieces every mo...\n", + "2204 ๐Ÿ˜‚ ๐Ÿ™ Call Congress (202) 224-3121 PULL THRU JELLYBEAN \n", + "48319 ๐Ÿ˜‚ ๐Ÿ˜ญ i miss the snickerdoodle swirl from so ...\n", + "19825 ๐Ÿ˜‚ ๐Ÿ˜‹ I love you- and I really do. \n", + "63387 ๐Ÿ˜‚ ๐Ÿ˜น Love huvin Mason, can steal aw his Halloween s...\n", + "33798 ๐Ÿ˜‚ ๐Ÿ˜ 80/0 at the end of 10 overs - Shikhar Dhawan ...\n", + "63144 ๐Ÿ˜‚ ๐Ÿ™‹ Stoping for a few in between 12 hr shifts is p...\n", + "5185 ๐Ÿ˜‚ ๐Ÿ˜ When a band member of Volumes actually adds yo...\n", + "65919 ๐Ÿ˜‚ ๐Ÿ˜ถ Evil sick humans what a world we...\n", + "27834 ๐Ÿ˜‚ ๐Ÿ˜‚ I always thought it was \n", + "57241 ๐Ÿ˜‚ ๐Ÿ˜‚ I thought u meant the show neve...\n", "\n", - "[6874 rows x 3 columns]" + "[5831 rows x 3 columns]" ] }, "metadata": {}, @@ -2097,7 +2135,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 61, "metadata": {}, "outputs": [], "source": [ @@ -2113,13 +2151,13 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ba20ba113dff4af0b14ea6a6e666e521", + "model_id": "865c37ebeb2443a589ccbaf220456457", "version_major": 2, "version_minor": 0 }, @@ -2148,7 +2186,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "f3af634eb2e64822921b57848e032dcf", + "model_id": "d34382a5e13c4be396303afc6b138c2a", "version_major": 2, "version_minor": 0 }, @@ -2195,21 +2233,7 @@ " with out:\n", " pred = clf.predict(vectorizer.transform([t.value]))\n", " \n", - " #binary_pred = np.zeros_like(pred)\n", - " #binary_pred[np.arange(len(pred)), pred.argmax(1)] = 1\n", - " \n", - " binary_pred = []\n", - " \n", - " s = np.argsort(pred[0])[-5:]\n", - " \n", - " for i in s:\n", - " b = np.zeros_like(pred[0])\n", - " b[i] = 1\n", - " binary_pred.append(b)\n", - " \n", - " binary_pred = np.array(binary_pred)\n", - " \n", - " display(Markdown(\"# \" + str(mlb_single.inverse_transform(binary_pred) if SINGLE_LABEL else sent2emoji(binary_pred))))\n", + " display(Markdown(\"# \" + str(sent2emoji(pred))))\n", "\n", "b.on_click(handle_submit)\n", " \n", @@ -2219,18 +2243,9 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.9991493705341953\n", - "15\n" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", "\n",