Merge branch 'master' of ssh://gogs@the-cake-is-a-lie.net:20022/jonas/NLP-LAB.git
This commit is contained in:
		
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										61
									
								
								Project/sentiment_sentences.csv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								Project/sentiment_sentences.csv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,61 @@ | ||||
| text;sent | ||||
| I am so happy;p | ||||
| i love my life;p | ||||
| i really like this sunshine;p | ||||
| while doing sport i feel free;p | ||||
| i is terrible to learn when the weather is this good;n | ||||
| i am almost crying when i run out of ice cream;n | ||||
| fuck off;n | ||||
| you are my best friend ever;p | ||||
| i love my mommy;p | ||||
| i prefer oral exams;p | ||||
| best cocktail is the mojito especial;p | ||||
| you got a beautiful wedding;p | ||||
| you husband is this handsome;p | ||||
| this is such a sneaky bitch;n | ||||
| you're kidding;n | ||||
| you are really too drunk;n | ||||
| you start being annoying;n | ||||
| i love my mac;p | ||||
| but it would be better if they are less expensive;n | ||||
| you are a bad friend;n | ||||
| I am in love with my new laptop;p | ||||
| You piss me off;n | ||||
| I hate school;n | ||||
| I'm so mad at you;n | ||||
| Seeing you cry, makes me sad;n | ||||
| You are so lovely;p | ||||
| Fish is disgusting;n | ||||
| At times I feel so depressed;n | ||||
| Summer makes me happy;p | ||||
| I want to dance and sing aloud;p | ||||
| Everything will be ok;p | ||||
| why are you upset?;n | ||||
| I dont like it when it rains;n | ||||
| I dont care at all;n | ||||
| you are such a bitch;n | ||||
| I dont understand what this is all about;n | ||||
| give me a break, idiot!;n | ||||
| please dont leave me;n | ||||
| I love cuddling with my dog;p | ||||
| I want to die;n | ||||
| that is really sad!;n | ||||
| why are you saying that, you moron!;n | ||||
| OMG! i love that cat soo much!;p | ||||
| can you feel the love tonight;p | ||||
| i get so emotional when i watch lion king;p | ||||
| i really hate you;n | ||||
| that is disgusting;n | ||||
| my heart is broken;n | ||||
| i love these sunny days;p | ||||
| this gave me positive feelings;p | ||||
| i am sick;n | ||||
| i am tired;n | ||||
| are you sick or tired?;n | ||||
| you are so cute and sweet;p | ||||
| i just lost my mind;n | ||||
| i hate all people;n | ||||
| you are just dumb;n | ||||
| i will get lucky;p | ||||
| i like ice cream;p | ||||
| go home you idiot;n | ||||
| 
 | 
							
								
								
									
										
											BIN
										
									
								
								Project/sentiment_sentences.ods
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Project/sentiment_sentences.ods
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -157,7 +157,7 @@ | ||||
|     { | ||||
|      "data": { | ||||
|       "application/vnd.jupyter.widget-view+json": { | ||||
|        "model_id": "233f744d595f4b81a362faef6b148fe7", | ||||
|        "model_id": "e508c9a1f8634b7ba790cf2f291e215a", | ||||
|        "version_major": 2, | ||||
|        "version_minor": 0 | ||||
|       }, | ||||
| @ -263,7 +263,8 @@ | ||||
|     "           [\n", | ||||
|     "               [\n", | ||||
|     "                   (widgets.Text(),\"test_input\"),\n", | ||||
|     "                   (widgets.HTML(),\"prediction\")\n", | ||||
|     "                   (widgets.HTML(),\"prediction\"),\n", | ||||
|     "                   (widgets.Text(value=\"😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂\"),\"prediction_ground_set\")\n", | ||||
|     "               ],\n", | ||||
|     "               [\n", | ||||
|     "                   (widgets.Checkbox(),\"show_sorted_list\"),\n", | ||||
| @ -760,9 +761,10 @@ | ||||
|     "            return\n", | ||||
|     "        X = shown_widgets[\"test_input\"].value\n", | ||||
|     "        pred = pm.predict([X])\n", | ||||
|     "        shown_widgets[\"prediction\"].value = \"<h1> \" + str(stl.sent2emoji(pred)[0]) + \"</h1>\"\n", | ||||
|     "        target_list=list(shown_widgets[\"prediction_ground_set\"].value)\n", | ||||
|     "        shown_widgets[\"prediction\"].value = \"<h1> \" + str(stl.sent2emoji(pred,custom_target_emojis=target_list)[0]) + \"</h1>\"\n", | ||||
|     "        if shown_widgets[\"show_sorted_list\"].value:\n", | ||||
|     "            mp(\"## \" + \"\".join(stl.edist.sentiment_vector_to_emoji(pred, only_emoticons=True, n_results=100)))\n", | ||||
|     "            mp(\"## \" + \"\".join(stl.edist.sentiment_vector_to_emoji(pred, only_emoticons=True, n_results=100, custom_target_emojis=target_list)))\n", | ||||
|     "        \n", | ||||
|     "\n", | ||||
|     "\n", | ||||
|  | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -68,7 +68,7 @@ def sentiment_score(s): | ||||
|     #(pos, neg, neu)^T | ||||
|     return s[0] - s[1] | ||||
|  | ||||
| def plot_sentiment_space(predicted_sentiment_vectors, top_sentiments, top_emojis, style='bo'): | ||||
| def plot_sentiment_space(predicted_sentiment_vectors, top_sentiments, top_emojis, style='bo', additional_patches = None): | ||||
|     # sentiment score axis | ||||
|     top_X = np.array([sentiment_score(x) for x in top_sentiments]) | ||||
|     pred_X = np.array([sentiment_score(x) for x in predicted_sentiment_vectors]) | ||||
| @ -86,6 +86,9 @@ def plot_sentiment_space(predicted_sentiment_vectors, top_sentiments, top_emojis | ||||
|     for i in range(len(top_X)): | ||||
|         plt.text(top_X[i], top_Y[i], top_emojis[i]) | ||||
|     plt.plot(pred_X, pred_Y, style) | ||||
|     for p_tuple in additional_patches: | ||||
|         ax_1.add_artist(p_tuple[0]) | ||||
|         p_tuple[0].set_alpha(0.4) | ||||
|     plt.savefig("val-error_sentiment-plot" + str(datetime.datetime.now()) +  ".png", bbox_inches='tight') | ||||
|  | ||||
|     # sentiment score axis | ||||
| @ -105,6 +108,9 @@ def plot_sentiment_space(predicted_sentiment_vectors, top_sentiments, top_emojis | ||||
|     for i in range(len(top_X)): | ||||
|         plt.text(top_X[i], top_Y[i], top_emojis[i]) | ||||
|     plt.plot(pred_X, pred_Y, style) | ||||
|     for p_tuple in additional_patches: | ||||
|         ax_2.add_artist(p_tuple[1]) | ||||
|         p_tuple[1].set_alpha(0.4) | ||||
|     plt.savefig("val-error_positive-negative-plot" + str(datetime.datetime.now()) + ".png", bbox_inches='tight') | ||||
|     plt.show() | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user