save plots in sentiment evaluation

This commit is contained in:
Jonas Weinz 2018-07-29 20:00:05 +02:00
parent 771b710007
commit b3fa62bbfc

View File

@ -43,6 +43,7 @@
"import re\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib\n",
"import datetime\n",
"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_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",
" 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",
@ -138,7 +139,7 @@
" 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.savefig(\"val-error_positive-negative-plot\" + str(datetime.datetime.now()) + \".png\", bbox_inches='tight')\n",
" plt.show()"
]
},