I am writing a code for Aspect Based Sentiment analysis in python and also developing a web application using flask. I created a bar graph for sentiment analysis and save this graph on specific folder and now i want to display this graph on flask application. when i am displaying this graph into html web page, it shows only the icon of image not actual image. Here is my python code to create bar graph using my data frame:
d = {'Aspect': Aspect, 'Positive': Positive, 'Neutral': Neutral, 'Negative': Negative}
df = pd.DataFrame(d)
print(df)
df.plot.bar(x="Aspect", y=["Negative", "Neutral", "Positive"], title = "Sentiment Analysis");
plt.savefig(os.path.join('E:/Projects/review/static', 'bar.png'))
full_filename = os.path.join('E:/Projects/review/static/', 'bar.png')
return render_template('view.html',user_image =full_filename)
Here is my python code of view.html file:
<h2>Sentiment</h2>
<h1><img src="{{ user_image }}" alt="User Image"></img></h1>