Merge branch 'master' of ssh://gogs@the-cake-is-a-lie.net:20022/jonas/NLP-LAB.git
This commit is contained in:
commit
051c34ad5d
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": {
|
"data": {
|
||||||
"application/vnd.jupyter.widget-view+json": {
|
"application/vnd.jupyter.widget-view+json": {
|
||||||
"model_id": "233f744d595f4b81a362faef6b148fe7",
|
"model_id": "e508c9a1f8634b7ba790cf2f291e215a",
|
||||||
"version_major": 2,
|
"version_major": 2,
|
||||||
"version_minor": 0
|
"version_minor": 0
|
||||||
},
|
},
|
||||||
@ -263,7 +263,8 @@
|
|||||||
" [\n",
|
" [\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" (widgets.Text(),\"test_input\"),\n",
|
" (widgets.Text(),\"test_input\"),\n",
|
||||||
" (widgets.HTML(),\"prediction\")\n",
|
" (widgets.HTML(),\"prediction\"),\n",
|
||||||
|
" (widgets.Text(value=\"😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂\"),\"prediction_ground_set\")\n",
|
||||||
" ],\n",
|
" ],\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" (widgets.Checkbox(),\"show_sorted_list\"),\n",
|
" (widgets.Checkbox(),\"show_sorted_list\"),\n",
|
||||||
@ -760,9 +761,10 @@
|
|||||||
" return\n",
|
" return\n",
|
||||||
" X = shown_widgets[\"test_input\"].value\n",
|
" X = shown_widgets[\"test_input\"].value\n",
|
||||||
" pred = pm.predict([X])\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",
|
" 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",
|
"\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
|
#(pos, neg, neu)^T
|
||||||
return s[0] - s[1]
|
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
|
# sentiment score axis
|
||||||
top_X = np.array([sentiment_score(x) for x in top_sentiments])
|
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])
|
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)):
|
for i in range(len(top_X)):
|
||||||
plt.text(top_X[i], top_Y[i], top_emojis[i])
|
plt.text(top_X[i], top_Y[i], top_emojis[i])
|
||||||
plt.plot(pred_X, pred_Y, style)
|
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')
|
plt.savefig("val-error_sentiment-plot" + str(datetime.datetime.now()) + ".png", bbox_inches='tight')
|
||||||
|
|
||||||
# sentiment score axis
|
# 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)):
|
for i in range(len(top_X)):
|
||||||
plt.text(top_X[i], top_Y[i], top_emojis[i])
|
plt.text(top_X[i], top_Y[i], top_emojis[i])
|
||||||
plt.plot(pred_X, pred_Y, style)
|
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.savefig("val-error_positive-negative-plot" + str(datetime.datetime.now()) + ".png", bbox_inches='tight')
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
15
error_log.csv
Normal file
15
error_log.csv
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Train-loss;Train-loss-vector;Valid-loss;Valid-loss-vector;;mean
|
||||||
|
0.0148;;0.014416503049941666;[0.01842055, 0.02187643, 0.00295252];5;
|
||||||
|
0.0142;;0.013990323407227162;[0.01740025, 0.02176314, 0.00280759];15;
|
||||||
|
0.0139;;0.013894867185370585;[0.01726196, 0.02160899, 0.00281365];25;
|
||||||
|
0.0134;;0.01334701536721269;[0.01694769 0.02043927 0.00265409];52;[0.5124894, 0.238578, 0.26411116]
|
||||||
|
;;;;;
|
||||||
|
0.0123;;0.01220267935790051;[0.01521431, 0.01880048, 0.00259325];e2;
|
||||||
|
;;;;;
|
||||||
|
d2v:;;;;;
|
||||||
|
0.0158;;0.015347190550520631;[0.0196343, 0.02333904, 0.00306823];5;
|
||||||
|
0.0152;;0.015070546146473468;[0.01918779, 0.02310013, 0.00292371];15;
|
||||||
|
0.0150;;0.014911320278768741;[0.01871091, 0.02312384, 0.00289921];25;
|
||||||
|
0.0145;;0.014387327237701005;[0.01834857, 0.02200531, 0.0028081 ];52;
|
||||||
|
;;;;;
|
||||||
|
0.0144;;0.014354445251258958;[0.0182326, 0.0220324, 0.00279834];e2;
|
|
BIN
error_log.ods
Normal file
BIN
error_log.ods
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user