Real-time tweets about the covid-19 vaccine have been analyzed in this article. My analyzes give answers to whether people think positive or negative about the covid-19 vaccine, or are neutral. You will see which words are tweeted the most with the covid-19 vaccine. Also, tweets about the types of vaccines were compared.
I got the tweets with my Twitter developer account and used Python.
I started with store authentication credentials in relevant variables. I limited the last 1000 tweets.
I filtered tweets to track only these keywords; ‘covid19 vaccine’, ‘covid-19 vaccine’, ‘coronavirus vaccine’, ‘covid19 vaccines’, ‘covid-19 vaccines’, ‘coronavirus vaccines’, ‘vaccine’, ‘vaccines’.
After printing, the keys of the first tweet dict has been seen. It includes created time, id, location, user, status, in reply to status id, in reply to the user id, retweeted status, coordinates, retweeted count, reply count, favorite count, etc. In this case, the text and language were added as a feature.
Let’s quick glance at the data.
Figure 2 shows an example of a tweet about the vaccine. The first row shows the tweet, it’s been retweeted from the user of dsa_bill. The user id is shown in the second row and, respectively, his / her user name, the number of followers of this user, the location, and the description of the account were shown.
Sentiment Analysis falls into the broad category of text classification, the classifier is supposed to tell if the sentiment behind that is positive, negative, or neutral.
The feature of Sentiment Score, Subjectivity, Polarity, and Analysis added to the data frame. Here are the number of Positive, Neutral, and Negatives tweets.
It’s more clear to see the difference with a graph.
The tweets about the most popular vaccines, Pfizer and Moderna compared. Here is the proportion:
Word Cloud
The most-tweeted words in texts containing the covid-19 vaccine are possible to see with word cloud. To make the word cloud clear, I stopped these words; “covid”, “covid19”, “vaccines”, “vaccine”, “https”, “will”, “coronavirus”, “rt”. Words limited to 20.
Conclusion
As a result, the analysis was made over the last 1000 tweets about the covid-19 vaccine. There are 518 neutral, 348 positive, and 134 negative tweets. The proportion of tweets mentioning Pfizer is 0.05% and the proportion is 0.015% for Moderna.
Thank you for reading.
Please don’t hesitate to give me feedback.