Plot sentiment over time

How do I plot sentiment over time in pandas? the plot should have lines of positive, negative and neutral all in one chart so that people can see the sentiment of tweets over time

You probably mean something like this,


Also seaborn gives a lot of nice visualizing effect for plotting multiple graphs at a time, you can check the below post for more details.

yes. so I have built a model that can predict sentiment using lstm. I want to then plot the sentiment over time from twitter data. My plot should show positive, negative and neutral tweet over time

Do you mean you want to plot a live graph of setiment analysis after getting the data from twitter which will be updated automatically ? or do you have a test dataset and want to manually update the graph.

If you want to update the graph manually and assuming you already have a test dataset available on which you want to get the sentiment analysis, you can use the model to predict the twitter data for a range of time and save your average result(say day wise or hour wise) in a dataframe. you can continue this process for a data of say 30 days or a year and you will get a large dataframe containing the average sentimental analysis per day/per hour. You can then plot it to a graph matplotlib/seaborn as mentioned above.

I have a dataset. I will try it out

1 Like

this link doesn’t show how to plot loss of lstm and logistic regression model for example

Link Here . Check this link here, maybe this might be helpful to you.