Introduction

Social networking sites were developed in the early-2000s and more than 3 billion people use these websites now. The users of the social networking sites are from different age groups, countries, and professions. They use social media for different purposes including keeping in touch with family and friends, entertainment, and professional reasons. Although social media can be beneficial in many ways, an excessive use of the same may be detrimental to mental health of users. When people spend significant amounts of time using social media developing dependency on the social networking sites for social interaction, communication, entertainment, and emotion expression, it leads to negative outcomes including problematic and addictive behaviors (Arora et al. 2020). According to researchers (Ge et al. 2015), through spending a lot of time in social media for communication, entertainment, and information, people relieve their ill emotions and develop a compulsive addiction to internet. Researchers have studied the causes of social media addiction and the types of users who are more susceptible to addictive behavior. It has been observed that neuroticism (Leong et al. 2019; Marengo et al. 2020), depression, and loneliness (Dalvi-Esfahani et al. 2019) are associated with social media addiction. Users who have more friends and followers (Longobardi et al. 2020) and receive mostly positive feedback (Marengo et al. 2020) on social networking sites are at a higher risk of getting addicted to social media. It has also been observed that happiness in real life is negatively associated with social media addiction, while stress in real life is positively associated with social media addiction (Longstreet and Brooks 2017). Furthermore, people who use social media actively (Longobardi et al. 2020) and people with higher daily screen time (Chung et al. 2019) are more susceptible to social media addiction.

Conventional approaches for assessment of addiction to social media are based on self-reporting instruments such as the Bergen Facebook Addiction Scale (Andreassen et al. 2012), Bergen Social Media Addiction Scale (Andreassen et al. 2017), Chinese Social Media Addiction Scale (Liu and Ma 2018), Twitter Addiction Scale (Kircaburun 2016), and Instagram Addiction Scale (Sholeh and Rusdi 2019). However, self-report data tends to be biased at times and may lead to unreliable results (Althubaiti 2016). The potential of social media data analysis for reliable assessment of behavioral health disorders such as social media addiction, and symptoms of depression, anxiety, and stress has been studied recently. These approaches are based on statistical analysis (De Choudhury et al. 2013a, 2013b, 2014; Schwartz et al. 2014) and more recently on machine learning techniques (Almeida et al. 2017; Mowery et al. 2017; Reece and Danforth 2017; Reece et al. 2017; Yazdavar et al. 2017; Kumar et al. 2019). Machine learning–based approaches are now being used widely in the domain of behavioral health analysis using social media data as they provide accurate results. Researches have been reported diagnosing social media addiction and its associated psychological disorders using social media usage data and machine learning techniques. For example, Shuai et al. (2016) predicted social network mental disorder (SNMD) using features extracted from social network data using machine learning techniques. They detected three types of SNMDs, viz. cyber relationship addiction, net compulsion, and information overload using semi-supervised learning techniques. In a follow-up study, Shuai et al. (2017) introduced a SNMD-based tensor model to improve the accuracy of diagnosis.

The outbreak of COVID-19 was first identified in Wuhan, China, in December 2019. The disease then spread throughout the world and took the shape of a pandemic. Governments around the world responded by enforcing lockdowns in their countries to contain the disease. The pandemic and the lockdowns have deeply affected the mental health of a large number of people around the world. Several researchers found that the pandemic and the lockdowns are resulting in anxiety and depression in a large proportion of the population (Ahmed et al. 2020; Kaparounaki et al. 2020; Odriozola-González et al. 2020; Rajkumar 2020). People are also suffering from loneliness (Killgore et al. 2020), stress (Odriozola-González et al. 2020; Rajkumar 2020), fear (Doshi et al. 2020; Zolotov et al. 2020), insomnia (Voitsidis et al. 2020), and altered drinking behavior (Lechner et al. 2020; Rodriguez et al. 2020). Some people are getting more sleep, but of poorer quality, during the lockdowns (Kaparounaki et al. 2020). The overall mental wellbeing of people has reduced since the beginning of the pandemic (Ahmed et al. 2020). Since people often share their emotion on social networking sites, social media posts are an important indicator of the mental health of people during the lockdowns.

A strict country-wide lockdown began in India on 25 March 2020 and it has been extended several times. The first two phases of the lockdown were colloquially called Lockdown 1.0 (25 March 2020 to 14 April 2020) and Lockdown 2.0 (15 April 2020 to 3 May 2020). Barkur et al. (2020) analyzed the emotion of Twitter posted by users in India during the first few days of Lockdown 1.0. They found that most of the people had a positive sentiment while a non-trivial minority was sad, angry, or afraid. Vibha et al. (2020) conducted a follow-up study in the second week of Lockdown 1.0 and found that a majority of people continued to have a positive sentiment. Doshi et al. (2020) studied the level of fear of COVID-19 among the Indian population in the middle of Lockdown 2.0. They found that the level of fear is low for a majority of the respondents.

We conducted this study to determine the effects of the pandemic and the lockdown on the mental health of people on the basis of their tweets during Lockdown 1.0 and Lockdown 2.0 in India. In particular, we tried to identify signs of addictive use of Twitter and understand the influence of the emotion of the users on their usage pattern.

Materials and Methods

The study had four steps, viz. collecting tweets from the specified period, identifying frequently tweeting users, clustering the users on the basis of their usage pattern, and emotion analysis of the users in each cluster. The steps are described next.

Step 1: Collection of Tweets

We collected tweets posted by users from India during Lockdown 1.0 and Lockdown 2.0. We collected two types of tweets, viz. emotion-based tweets and situation-based tweets. A tweet is called emotion-based if it reflects the emotion of the user. We considered the four basic emotions as identified by Jack et al. (2014), viz. happiness, sadness, anger or disgust, and fear or surprise. On the basis of existing literature (Shaver et al. 1987; Wang et al. 2012), we compiled a list of emotion-related words (Table 1). We scraped, i.e., downloaded, emotion-based tweets using hashtags, i.e., theme, of these emotion-related words. We also used lexical variants and synonyms of the emotion-related words in our list. For example, for the word “enjoy,” we used lexical variants like “enjoying,” “enjoyable,” and “enjoyment” and synonyms like “appreciate” and “relish.” A tweet is called situation-based if it presents the view of a user on a situation. We scraped situation-based tweets using hashtags related to COVID-19 and the lockdown (Table 1). We excluded tweets with multiple and conflicting emotions from our study. We identified tweets posted by news portal and e-commerce profiles on the basis of an automated subjectivity analysis and excluded those tweets because they were meant to provide information to users and not to express emotion. Finally, we excluded duplicate tweets.

Table 1 Emotion- and situation-related words used for collecting tweets

Step 2: Identification of Frequently Tweeting Users

We identified the users who had posted 4 or more of the tweets collected by us in step 1. We already had the emotion-based and situation-based tweets posted by these users during Lockdown 1.0 and Lockdown 2.0. We now scraped the remaining tweets posted by these users during this period. Although these additional tweets did not reflect any emotion or view on the pandemic, scraping these tweets was necessary to understand the usage pattern of the frequent users. We determined the number of tweets posted by each of those users on each day during Lockdown 1.0 and Lockdown 2.0.

Step 3: Clustering the Users

Clustering is an artificial intelligence technique that groups data points based on the similarity of their features. Several clustering algorithms are known and the k-means algorithm is one of them. The k-means clustering algorithm groups the data points into k mutually exclusive clusters, where k is a natural number, in a way such that the mean distance between the data points and the centroid of the clusters in which they have been included is minimal. We used the k-means clustering algorithm to group the users identified in step 2 based on the similarity between their daily usage pattern. We provided the k-means clustering algorithm fifteen attributes for the users, viz. number of tweets posted in each of the least active 7 days, number of tweets posted in each of the most active 7 days, and total number of tweets posted during the 40-day study period.

Step 4: Emotion Analysis

We identified the overall emotion of each user during Lockdown 1.0 and Lockdown 2.0 on the basis of the most frequently used emotion-related words, including the hashtags, in her/his tweets. We then statistically analyzed the distribution of people with different overall emotions in the different clusters obtained in step 3 and the effects of overall emotion on the frequency of posting messages.

Software Used

The four steps of this study were implemented using the Python programming language. Six external Python libraries were used to scrape and preprocess the tweets, identify new portal and e-commerce profiles, cluster the users, and plot the clusters (Table 2).

Table 2 External Python libraries used in this study

Data Analysis

We used the non-parametric chi-squared goodness of fit with uniform distribution to compare the number of users with different overall emotions in different clusters in step 4. We compared the number of users with the four basic emotions during Lockdown 1.0 and Lockdown 2.0. We also performed one-factor ANOVA to compare the number of tweets posted by users with different overall emotions during Lockdown 1.0 and Lockdown 2.0. The statistical tests were performed using SPSS 26.0 at 95% confidence level.

Results

Following our protocol, 7688 emotion-based tweets and 1690 situation-based tweets were collected. After removing tweets with conflicting emotions, tweets from news portals and e-commerce profiles, and duplicate tweets, 7664 tweets were retained for analysis. On the basis of these tweets, we were able to identify 222 frequent users. These users have posted a total of 45,710 tweets during Lockdown 1.0 and Lockdown 2.0.

Usage Pattern

The k-means clustering algorithm grouped the users into four clusters (Fig. 1). Cluster 1 included 137 (61.7%) users. Those users posted 1.10 and 1.18 tweets daily on an average during Lockdown 1.0 and Lockdown 2.0, respectively (Table 3). Cluster 2 included 44 (21.6%) users who tweeted more frequently. The users in cluster 2 posted 4.85 and 5.62 tweets in a day on average during Lockdown 1.0 and Lockdown 2.0, respectively. Cluster 3 included 30 (13.5%) users who displayed high use. They posted 14.62 and 12.61 tweets daily on average during the two lockdown periods, respectively. Cluster 4 included 7 (3.2%) users and they displayed excessive use. They posted 39.20 and 42.39 tweets in a day on average during Lockdown 1.0 and Lockdown 2.0, respectively.

Fig. 1
figure 1

k-means clustering. The elbow method was used and it was found that the optimum number of clusters that could be formed for our data is four. Clusters 1, 2, 3, and 4 comprise of users with normal, frequent, high, and excessive usage patterns. The silhouette score is 0.75

Table 3 Details of clusters obtained using the k-means clustering algorithm

Overall Emotion of Users

We found that the number of users with different overall emotions varied significantly (P < 0.05) for all four clusters in both Lockdown 1.0 and Lockdown 2.0, with only a single exception (Table 4). The number of users with different overall emotions varied insignificantly (P > 0.05) for cluster 4 during Lockdown 1.0. In cluster 1, 61% and 58% users had an overall happy emotion during Lockdown 1.0 and Lockdown 2.0, respectively (Fig. 2a). However, there was an 11% increase in the number of users with an overall sad emotion from Lockdown 1.0 to Lockdown 2.0. In cluster 2, 58% users had an overall happy emotion while and 15% users had an overall sad emotion during Lockdown 1.0 (Fig. 2b). However, there was an 8% decrease in happy users and a 17% increase in sad users in Lockdown 2.0 in this cluster. Among the high users in cluster 3, 40%, 33%, and 30% had overall happy, sad, and angry emotions in Lockdown 1.0, respectively (Fig. 2c). There was a 10% decrease in happy users and a 13% increase in angry users in Lockdown 2.0 in this cluster. Among the excessive users in cluster 4, 47% and 57% felt angry or disgusted during Lockdown 1.0 and Lockdown 2.0, respectively (Fig. 2d).

Table 4 Emotion analysis of users
Fig. 2
figure 2

Overall emotion of users in (a) cluster 1, (b) cluster 2, (c) cluster 3, and (d) cluster 4 during Lockdown 1.0 and Lockdown 2.0

Effects of Emotion on Usage Pattern

We found that the overall emotion was happiness for 55.9% users in Lockdown 1.0 and for 51.4% users in Lockdown 2.0 (Table 5). The number of tweets posted by users with different overall emotions varied significantly in Lockdown 1.0 (F = 11.93159, P < 0.05). The trend continued in Lockdown 2.0 (F = 10.12033, P < 0.05). Users whose overall emotion was anger or disgust posted more tweets than other users throughout the study period. Users whose overall emotion was sadness also posted tweets more frequently than average users. Users whose overall emotion was happiness, fear, or surprise posted fewer than average number of tweets. People whose tweets did not reflect any overall emotion were among the least active users. The expression of negative emotions and excessive usage patterns of users in cluster 3 and cluster 4 may probably be seen as signs of addiction to Twitter.

Table 5 Number of tweets posted by users with different overall emotions

Discussion

We studied the emotions reflected by the tweets posted by Indian users during the first 40 days of the COVID-19 imposed lockdown there. We also studied the effects of the overall emotion of a person during the period on her/his social media usage. We found that the normal users and the frequent users were typically happy during the study period. On the other hand, the users engaging in excessive use of social media often displayed an overall emotion of anger, disgust, or sadness in their tweets. The expression of negative emotions and excessive usage patterns may probably be seen as signs of addiction to Twitter, and hence it can be observed that people with a negative sentiment are more susceptible to addictive use of social media.

We found that a large proportion of the users displayed an overall happy emotion during the study period. This finding concurs with Barkur et al. (2020) and Vibha et al. (2020) who reported that most users had a positive sentiment during the first 2 weeks of the lockdown in India. Furthermore, we found that only a small proportion of the users had an overall emotion of fear or surprise during Lockdown 1.0 and their number further decreased in Lockdown 2.0. This finding concurs with Doshi et al. (2020) who found that people in India had a low level of fear about the pandemic after 1 month of lockdown.

We observed that a plurality of the study population was not much affected emotionally by the pandemic. However, a non-trivial minority of users displayed negative sentiments and excessive use of social media. We inferred that negative sentiment is a contributing factor for social media addiction. Social media addiction is a behavioral problem and people with social media addiction are typically benefitted by mindfulness-based counseling. We further believe that the lack of fear and surprise among the study population may be attributed to the availability of information through mass media and social media.

Our study is preliminary and non-clinical in nature. Nevertheless, we found an association between emotion of users and their social media usage pattern during the COVID-19 pandemic. We think that the effects of using social media during the pandemic should be studied in detail. The results from different countries which were affected at different times should be compared. Furthermore, attempts to analyze tweets with conflicting emotion-related words should be made.

Conclusion

We concluded that the emotion of people is affecting their social media usage pattern during the COVID-19 pandemic. We found that 16.7% of our study population used social media excessively during the study period. Social media addiction may have long-term implications for the affected users. People with negative sentiments are particularly susceptible to addictive behavior. We recommend people to use social media temperately and refrain from excessive use of the same during the lockdowns.