How did Twitter respond to the Coronavirus pandemic?

A COVID-19 pandemic exploratory and emotional study in R

Social networks are the primary tools for collecting knowledge regarding the thoughts and perceptions of citizens with regard to different subjects and problems. People devote hours on social media every day to speak to others regarding their thoughts, views and responses. Recently, Coronavirus / COVID19 outbreak has been deemed a pandemic by WHO. While working from home thereby practicing social distancing, I decided to use my free time to look into what people think about corona virus pandemic on twitter.

Data

I fetched tweets related to coronavirus using twitter API and Rtweet package and analyzed these tweets using machine learning techniques and tools as positive and negative. In total 33,350 tweets were analyzed.

Tweet frequency

Word frequency analysis

With frequency review, one of the best ways to test the details is. Though not complex, this basic approach can be unexpectedly insightful in sentiment analysis.

Word cloud

Sentiment Analysis

Sentiment analysis allows one to understand people’s feelings regarding a given topic.This is done by describing, categorizing feelings and transforming expressions into actionable viewpoints.

Next, we can also categorize words using polarity scores, putting the words into the ‘positive’ or ‘negative’ basket. First, we assign each word in the extracted tweets a polarity score. Then we search the dataset to only get terms with a polarity value of 80 or higher.

Most positive and negative words used in the extracted tweets

To have a more detailed interpretation of the usage of positive and negative words. I assigned the words with a sentiment using the ‘bing’ lexicon and conduct a quick count to produce the top 10 most common positive and negative terms used in the extracted tweets.

Sentiment word cloud

Classifying the words into different types of emotions also helps us understand how people feel about a subject, which is the Coronavirus pandemic in this case.

Sentiment based on score

Conclusion:

Some interesting insights from the analysis

1 From the twitter unique location, in aggregate USA is the first country followed by India in terms of tweets.

2 The most frequent words from the word cloud are related to vaccine, trials, suggesting that people are much more concerned about finding the cure of the pandemic. Also, words like mask, news and stay home are frequently used thus proposing people are creating awareness by spreading the news in order to slow the rate of transmission.

3 If you look closely at the most common positive word are trump, positive, support and safe respectively. Most tweets are showing support to health care workers and the most common negative words include virus, death, crisis and outbreak.

4 When looking at sentiment-based score the word “trust” stood out among the other words, followed by “fear” still people fear about the corona virus pandemic.” anticipation” Is the third in terms of score means people are much anticipated towards the end of this corona virus pandemic or finding the vaccine.

5 Overall, the tweets convey an optimistic sentiment (with the high frequency of words such as “trust” and “joy”) of defeating Coronavirus.

Note:This article is focused primarily on data science and machine learning studies. I am not an epidemiologist and I do not believe that the opinions of this Article are medical advice. You can click here to read more about the corona virus pandemic .