save plots in sentiment evaluation
This commit is contained in:
parent
771b710007
commit
b3fa62bbfc
@ -43,6 +43,7 @@
|
|||||||
"import re\n",
|
"import re\n",
|
||||||
"import matplotlib.pyplot as plt\n",
|
"import matplotlib.pyplot as plt\n",
|
||||||
"import matplotlib\n",
|
"import matplotlib\n",
|
||||||
|
"import datetime\n",
|
||||||
"matplotlib.rc('font', family='symbola', size=16)"
|
"matplotlib.rc('font', family='symbola', size=16)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -116,7 +117,7 @@
|
|||||||
" pred_X = np.array([sentiment_score(x) for x in predicted_sentiment_vectors_list[i]])\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",
|
" 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.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",
|
" plt.savefig(\"val-error_sentiment-plot\" + str(datetime.datetime.now()) + \".png\", bbox_inches='tight')\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # sentiment score axis\n",
|
" # sentiment score axis\n",
|
||||||
" top_X = np.array([x[0] for x in top_sentiments])\n",
|
" top_X = np.array([x[0] for x in top_sentiments])\n",
|
||||||
@ -138,7 +139,7 @@
|
|||||||
" pred_X = np.array([x[0] for x in predicted_sentiment_vectors_list[i]])\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",
|
" 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.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.savefig(\"val-error_positive-negative-plot\" + str(datetime.datetime.now()) + \".png\", bbox_inches='tight')\n",
|
||||||
" plt.show()"
|
" plt.show()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user