Emotions soaring during Covid-19 - Emotion detection over 100 million tweets since January

September 8, 2020

I ran 100 million covid-related tweets through my own emotion-detecting neural network. I won’t try to explain the reasons behind the results, since this is an area rife with correlation, Twitter’s US-bias and a of course a very complex system. However, some very interesting patterns emerge! Furthermore, it is clear that this algorithm could be applied to solve other problems: a generalised approach to automate detecting emotional shifts towards a particular topic on Twitter which can have powerful business applications.

Before you see the visualisation, some quick notes:


The first thing that one can see is the clear phases of emotions that Twitter goes through. A brief bout of confusion and amusement is soon replaced with caring, fear and gratitude as the USA issues stay-at-home orders. As things start descending into chaos, we begin to see some heavy negative emotions: anger, annoyance, embarrassment, disappointment and even worse: rising disgust. Many of these emotions are probably a result of those shaming people for refusing to take the crisis seriously.

Secondly, polarised emotions are a thing! Perhaps especially in a two-party democracy such as the USA, or a platform used to express opinions on matters, such as Twitter. This is evident in two conflicting emotions: “approval” vs “disapproval” are often correlating, except in early May. What happened then? Similarly, fear and gratitude seem to correlate.

The strongest of all emotions in relative terms are the spikes in confusion and gratitude. The early spike in confusion makes absolute sense, but one can only make theories about gratitude. For instance, maybe summer holidays have arrived and people really don’t take this summer for granted after staying at home in spring!

So what can one take away from this?

From a global wellbeing perspective, emotions have obviously gotten more negative over the last few months as the reality has hit: The world was not ready (in almost any way) to face a global pandemic like this. Besides some approval, there is no overwhelmingly positive pattern of any emotion on Twitter. It’s a place to vent. So, when you enter the echo chamber of Twitter, do so wisely! It is an angry place. Look after yourself when online and keep in mind that the world’s emotions are not well. Beyond that, I would not recommend making any strong conclusions from correlations that are shown in the data.

From a technical perspective, have a look at the source code, provided below. This type of twitter emotion detection can be applied, and automated, to other things. Want to see people’s attitudes change to a particular hashtag? Want to pick up when emotions shift towards your company or sports team? Automate it with a CNN and Twitter’s API. Apply some simple anomaly detection on top of it to alert you of PR disasters, or even opportunities to invest in particular areas as global emotions shift.

Technical stuff

Code and tools



Note: This code is not intended to run out-of-the-box: You need to fetch the tweets yourself using something like Hydrator. If your python version differs to mine, the neural network pickle may not load.


Covid death rates

Covid tweets

Tools: Python, GIMP

© 2024 Ryan Anderson