Cross-language sentiment analysis of European Twitter messages during the COVID-19 pandemic (2020)

Abstract: In this paper, we analyze Twitter messages (tweets) collected during the first months of the COVID-19 pandemic in Europe with regard to their sentiment. This is implemented with a neural network for sentiment analysis using multilingual sentence embeddings. We separate the results by country of origin, and correlate their temporal development with events in those countries. This allows us to study the effect of the situation on people’s moods. We see, for example, that lockdown announcements correlate with a deterioration of mood in almost all surveyed countries, which recovers within a short time span.

## introduction the covid-19 pandemic has led to a worldwide situation with a large number of unknowns. many heretofore unseen events occurred within a short time span, and governments have had to make quick decisions for containing the spread of the disease. due to the extreme novelty of the situation, the outcomes of many of these events have not been studied well so far. this is true with regards to their medical effect, as well as the effect on people's perceptions and moods. first studies about the effect the pandemic has on people's lives are being published at the moment (e.g. @xcite , mainly focusing on surveys and polls. naturally, such studies are limited to relatively small numbers of participants and focus on specific regions (e.g. countries). in contrast, social media provides a large amount of user-created messages reflective of those users' moods and opinions. the issue with this data source is the difficulty of analysis -social media messages are extremely noisy and idiosyncratic, and the amount of incoming data is much too large to analyze manually. we therefore need automatic methods to extract meaningful insights. in this paper, we describe a data set collected from twitter during the months of december 2019 through april 2020, and present an automatic method for determining the sentiments contained in these messages. we then calculate the development of these sentiments over time, segment the results by country, and correlate them with events that took place in each country during those five months. ## related work since the pandemic outbreak and lockdown measures, numerous studies have been published to investigate the impact of the corona pandemic on twitter. feng and zhou (2020) analyzed tweets from the us on a state and county level. first, they could detect differences in temporal tweeting patterns and found that people tweeting more about covid-19 during working hours as the pandemic progressed. furthermore, they conducted a sentiment analysis over time including an event specific subtask reporting negative sentiment when the 1000th death was announced and positive when the lockdown measures were eased in the states. lyu et al. (2020) looked into us-tweets which contained the terms "chinese-virus" or "wuhanvirus" referring to the covid-19 pandemic to perform a user characterization. they compared the results to users that did not make use of such controversial vocabulary. the findings suggest that there are noticeable differences in age group, geolocation, or followed politicians. chen et al. (2020) focused on sentiment analysis and topic modelling on covid-19 tweets containing the term "chinese-virus" (controversial) and contrasted them against tweets without such terms (non-controversial). tweets containing "chinesevirus" discussing more topics which are related to china whereas tweets without such words stressing how to defend the virus. the sentiment analysis revealed for both groups negative sentiment, yet with a slightly more positive and analytical tone for the non-controversial tweets. furthermore, they accent more the future and what the group itself can do to fight the disease. in contrast, the controversial group aiming more on the past and concentrate on what others should do. ## data collection for our study, we used the freely available twitter api to collect the tweets from december 2019 to april 2020. the free api allows streaming of 1% of the total tweet amount. to cover the largest possible area, we used a bounding box which includes the entire world. from this data, we sub-sampled 4,683,226 geo-referenced tweets in 60 languages located in the europe. to create the europe sample, we downloaded a shapefile of the earth foot_0 , then we filtered by country performing a point in polygon test using the python package shapely foot_1 . figure 1 depicts the europe twitter activity in total numbers. most tweets come from the u.k. tweets are not filtered by topic, i.e. many of them are going to be about other topics than covid-19. this is by design. as we will describe later, we also apply a simple keyword filter to detect tweets that are probably covid-19-related for further analysis. ## analysis method we now describe how the automatic sentiment analysis was performed, and the considerations involved in this method. ## results in the following, we present the detected sentiment developments over time over-all and for select countries, and correlate them with events that took place within these months. results for some other countries would have been interesting as well, but were not included because the main spoken language is not covered by muse (e.g. sweden, denmark). others were excluded because there was not enough material available; we only analyze countries with at least 300,000 recorded tweets. as described in section 3, tweets are filtered geographically, not by language (i.e. italian tweets may also be in other languages than italian). ## conclusion in this paper, we presented the results of a sentiment analysis of 4.6 million geotagged twitter messages collected during the months of december 2019 through april 2020. this analysis was performed with a neural network trained on an unrelated twitter sentiment data set. the tweets were then tagged with sentiment on a scale from 0 to 1 using this network. the results were aggregated by country, and averaged over time. additionally, the sentiments of tweets containing covid-19-related keywords were aggregated separately. we find several interesting results in the data. first of all, there is a general downward trend in sentiment in the last few months corresponding to the covid-19 pandemic, with clear dips at times of lockdown announcements and a slow recovery in the following weeks in most countries. covid-19 keywords were used rarely before february, and correlate with a rise in cases in each country. the sentiment of keyworded tweets starts out very negative at the beginning of increased keyword usage, and becomes more positive over time. however, it remains significantly below the average sentiment in all countries except germany. interestingly, there is a slight upward development in sentiment in most countries towards the end of the considered period.