Swarna Weerasinghe,Oladapo Oyebode,Rita Orji,Stan Matwin
Dynamics of emotion trends in Canadian Twitter users during COVID-19 confinement in relation to caseloads: Artificial intelligence-based emotion detection approach
COVID-19,artificial intelligence,sentiment analysis,emotional impact assessment,latency period estimation,ARIMA modeling
Multiple waves of COVID-19 have significantly impacted the emotional well-being of all, but many were subject to additional risks associated with forced regulations. The objective of this research was to assess the immediate emotional impact, expressed by Canadian Twitter users, and to estimate the linear relationship, with the vicissitudes of COVID caseloads, using ARIMA time-series regression. We developed two Artificial Intelligence-based algorithms to extract tweets using 18 semantic terms related to social confinement and locked down and then geocoded them to tag Canadian provinces. Tweets (n = 64,732) were classified as positive, negative, and neutral sentiments using a word-based Emotion Lexicon. Our results indicated: that Tweeters were expressing a higher daily percentage of negative sentiments representing, negative anticipation (30.1%), fear (28.1%), and anger (25.3%), than positive sentiments comprising positive anticipation (43.7%), trust (41.4%), and joy (14.9%), and neutral sentiments with mostly no emotions, when hash-tagged social confinement and locked down. In most provinces, negative sentiments took on average two to three days after caseloads increase to emerge, whereas positive sentiments took a slightly longer period of six to seven days to submerge. As daily caseloads increase, negative sentiment percentage increases in Manitoba (by 68% for 100 caseloads increase) and Atlantic Canada (by 89% with 100 caseloads increase) in wave 1(with 30% variations explained), while other provinces showed resilience. The opposite was noted in the positive sentiments. The daily percentage of emotional expression variations explained by daily caseloads in wave one were 30% for negative, 42% for neutral, and 2.1% for positive indicating that the emotional impact is multifactorial. These provincial-level impact differences with varying latency periods should be considered when planning geographically targeted, time-sensitive, confinement-related psychological health promotion efforts. Artificial Intelligence-based Geo-coded sentiment analysis of Twitter data opens possibilities for targeted rapid emotion sentiment detection opportunities.
Dynamics of emotion trends in Canadian Twitter users during COVID-19 confinement in relation to caseloads: Artificial intelligence-based emotion detection approach

Multiple waves of COVID-19 have significantly impacted the emotional well-being of all, but many were subject to additional risks associated with forced regulations. The objective of this research was to assess the immediate emotional impact, expressed by Canadian Twitter users, and to estimate the linear relationship, with the vicissitudes of COVID caseloads, using ARIMA time-series regression. We developed two Artificial Intelligence-based algorithms to extract tweets using 18 semantic terms related to social confinement and locked down and then geocoded them to tag Canadian provinces. Tweets (n = 64,732) were classified as positive, negative, and neutral sentiments using a word-based Emotion Lexicon. Our results indicated: that Tweeters were expressing a higher daily percentage of negative sentiments representing, negative anticipation (30.1%), fear (28.1%), and anger (25.3%), than positive sentiments comprising positive anticipation (43.7%), trust (41.4%), and joy (14.9%), and neutral sentiments with mostly no emotions, when hash-tagged social confinement and locked down. In most provinces, negative sentiments took on average two to three days after caseloads increase to emerge, whereas positive sentiments took a slightly longer period of six to seven days to submerge. As daily caseloads increase, negative sentiment percentage increases in Manitoba (by 68% for 100 caseloads increase) and Atlantic Canada (by 89% with 100 caseloads increase) in wave 1(with 30% variations explained), while other provinces showed resilience. The opposite was noted in the positive sentiments. The daily percentage of emotional expression variations explained by daily caseloads in wave one were 30% for negative, 42% for neutral, and 2.1% for positive indicating that the emotional impact is multifactorial. These provincial-level impact differences with varying latency periods should be considered when planning geographically targeted, time-sensitive, confinement-related psychological health promotion efforts. Artificial Intelligence-based Geo-coded sentiment analysis of Twitter data opens possibilities for targeted rapid emotion sentiment detection opportunities.

Undoubtedly the COVID-19 pandemic has impacted the emotional well-being of all, despite their at-risk status for infectivity. Some had to struggle to adapt to social-environmental changes, to the so-called “new norm” and many were subject to forced solitary confinement. These social and physical confinements not only threatened physical health-related activities but encompassed emotional downturns for all. Mandatory public health guidelines-imposed restrictions, such as social isolation and business and entertainment closures further altered peoples’ lifestyles. These compounded factors stemming from social/physical confinement took a toll on everyone's emotional health. Yet there is limited research-based evidence stemming from social /physical confinement-related emotional health dynamics that illustrate latency/resumption and strength of the relational effect of caseloads dynamics. The adverse psychosocial impact of COVID-19 lockdowns is clearly noted in the literature including fear, anxiety, obsessive behavior, increased substance dependence, and depression. There is an abundance of research-based evidence on the psychological impact on frontline healthcare workers and some other selected community groups, but little attention has been paid to uncovering general population-level emotional sentiments resulting from COVID-19-related lockdown and confinement. This is partly due to the inability to conduct population-based research data collection in a timely manner during a pandemic. Social media expressions provide a unique opportunity to uncover subpopulation-level emotional rapid assessment and to examine immediate emotional responses to feelings of isolation during the confinement period. The aim of this article is to apply a machine learning (ML) approach to assess the dynamics (changes across time and geography) of emotional impact expressed in Canadian Twitter data, at the geography level, concentrating on a provincial-level analysis. Social media has been recognized as a viable platform for getting to know people's instant reactions during the COVID-19 outbreak. Global literature supports the feasibility of social media data use, for subpopulation-level emotional response detection. Social media users represent a subset of the general population. A study conducted in Spain using opinions gathered from several social media platforms, including Twitter, provided initial evidence of the capability of capturing emotional sentiments expressed in social media during the pandemic period. Even further, the global social media, Twitter/Weibo data analysis that retained quarantine and locked down hashtags, uncovered emotional dynamics change in relation to economic upturns and downturns. Several other studies that have used Twitter data provided promising results in emotional sentiment detection related to the COVID pandemic. Furthering this knowledge, global Twitter data sentiment classification daily percentages, distributed over three consecutive time intervals, have shown to be related to mortality time series data depicting higher positive emotion rates with low mortality, and surprisingly noted higher sadness daily Tweets when there was a drastic decrease in COVID deaths. Authors recommended comprehensive research to find reasoning to explain those emotional dynamics. There are no studies that explored the long-term temporal association between confinement-related sentiment classification and COVID-19 morbidity data, and we argue morbidity dynamics may be more sensitive than mortality to further explain emotional dynamics. To further understand the confinement-related dynamics of emotional sentiment trends expressed in Twitter data, our study employed a 395-day long time series modeling approach to uncover the relationship between time-varying COVID caseload change on daily emotional sentiment fluctuations. The findings will provide directions for the prevention of government-regulated confinement-related negative emotions before reaching the mortality state. Sentiment analysis has been recognized as a reliable method to track emotional reactions embedded in social media posts. Emotion sentiment detection using Twitter data involves the extraction and classification of emotions expressed in the text data. This type of analysis provides a unique opportunity for rapid emotional burst detection during times of unanticipated, unprecedented events occurrences such as pandemics and natural disasters, especially when traditional data collection takes a lengthy period and greater effort. Specifically, the spatial–temporal emotional sentiment analysis provides population-level emotional outcome data to inform public health officials to take necessary geographically targeted precautionary measures, and to act in a timely manner. Besides, Twitter data capture free-flowing natural expressions and minimize research bias in emotion expression detection from traditional survey data. A study in Southern Italy used 19 oncology professionals’ WhatsApp conversations, during a four-week period of pandemic spread and detected both positive and negative emotional sentiment variations over time in relation to the time-varying volume of COVID-related activities. Though it is encouraging that they detected positive and negative time trends, albeit the period of weekly responses was short, there were no correlations established. Another emotion sentiment research investigation on US healthcare professionals used 53,063 Twitter expressions, over a pre-and post-pandemic two-year period, and noted the post-pandemic increase in sadness, decrease in joy, and noted fear as preceding the waves of the pandemic, which is considered as an anticipated negative outcome in our analysis. We emphasize the importance of uncovering the emotional dynamics of the general population in relation to caseload dynamics across time and geography. These previous studies have demonstrated the capacity of sentiment analysis in detecting dynamics of emotional expression using social media data, during the pandemic among subgroups of healthcare professionals. Nevertheless, no study has captured the spatial–temporal variations in the association between confinement-related dynamics of negative and positive emotional sentiments in relation to dynamics of daily COVID caseloads in Canada. Canada is one of the countries, where strict lockdown measures, such as social confinement and mandatory isolation regulations were imposed and enforced. Nevertheless, to date, there were no time series studies that examined the ecological level impact of public health measures on population-level emotional sentiment dynamics in this country. A study that covered 17 European and North American countries used a containment index that covered eight policies and strictness levels, namely, closing schools, closing workplaces, cancellation of public events, restrictions on gatherings, cancellation of public transportation, stay-at-home requirements, internal movement restrictions, and international travel restrictions. These measures were the same as the ones imposed by the Public Health Agency of Canada that we have captured using hashtags. Based on these measures of COVID-19 government responses, a stringency index was developed, by these researchers, for regions of the world and Canada falls into the second highest in their ranking of the 0-100 scale, falling within the range of 60−80. Researchers showed that there is a linearly increasing relationship between caseloads and stringency index, across different countries, wherein measures were stricken based on caseloads increase. In Canada, strict public health measures were imposed and released at different time points by different provincial jurisdictions depending on the surge and recede of provincial-level caseloads, thus making the case for provincial-level analysis. According to media reports, the outburst of reactions to those restrictions was more prominent in some Canadian geographies than the others, when the social confinement was tightened after every caseload surge was noted, known as waves. The outburst of negative emotional reactions is a result of perceived risk. To our limited knowledge, there are no other studies that investigated the association between emotional sentiment dynamics and caseloads variation over time, neither effect sizes, nor latency of impact onset was available, within the context of stringency such as social/physical confinement and locked down, that varied by geography. By extracting Canadian Twitter data using confinement-related hashtags, our findings will help to contextualize the emotional sentimental dynamics impact of these stringency measures. The findings from Canada will uncover the emotional sentiments dynamics within the context of strict public health measures and facilitate timing and the extent of necessary countermeasures to be taken, to control subsequent negative emotional impacts and to promote timely positive impacts at the population level. While public health measures were essential tools to control the impact of the pandemic, very little is known about the prognostication, magnitude, direction, and latency of emotional impact on COVID caseload increase to those control measures. The practical basis of this study stemmed from multiple research-based evidence sources. Twitter is known as a social media platform for freely communicating with strangers, and sharing emotional feelings, during the time of restricted social interactions, thus confirming the data quality used for this study. Even further, when the Twitter community is observed over a lengthy period of time their emotional responses become stable and the dynamics of changes to events can be captured effectively by using a lengthy period of observations. The theoretical basis for this study is situated within the phenomenon of social amplification of risk framework, wherein the information sharing in social media in response, to a perceived risk of an event, has further been related to the attenuation of the risk associated with public events. Therein the framework provides how the risk events such as the pandemic interact with the communication process of psychological feelings exchange through news media and social networks. The expression of psychological feelings depicts inherent emotions, as Ekman argues, and he classifies them into six basic emotions. In the present study, Lexicon-based sentiment analysis is used to study the dynamics of Tweeters’ emotional expressions related to confinement. In this process, natural flows of expressions, related to confinement, are captured and classified into emotional sentiments using well-recognized emotional Lexicons. It was shown that the words used to indirectly represent COVID-19-related emotional sentiments are captured by Lexicons fairly well and reached greater accuracy of 81% than those with direct representations. The Bidirectional Encoder Representations from Transformers (BERT) model for sentiment classification uses a similar segment classification that results in multiple emotions in the same expression, and we used BERT in conjunction with the emotional dominance theory to uncover the dominant sentiment. The BERT Natural Language Processing model classification of COVID vaccine-related Tweets has received a maximum precision score. Our study is unique in several aspects and contributes to advancing geographically targeted ML-based sentiment analysis to uncover emotional dynamics over time and provides statistical learning tools to examine the association with the temporality of risk event changes. In essence, this study presents an ML-based methodological framework that includes two Python-based algorithms for daily Twitter data extraction using 16 different, COVID-19 confinement-related semantics, geocoding, and emotional sentiment polarization using Natural Language Processing. It uses a large volume of daily Canadian Twitter expression count data (n = 64,372) in English and French, collected over a lengthy period of 396 days, covering the first three waves of the pandemic. Even further, extracting all Twitter geo locations covering an entire country, facilitated provincial-level analysis. Finally, we present statistical learning methods to examine temporal dynamics detection of sentiments in relation to COVID caseload variations. By considering the worldwide evidence of possibilities of linking Tweet-based emotion detection to COVID pandemic-related opinion mining, we expand the existing knowledge base specific to the stringent measure of confinement and fill the gaps in knowledge on exploring emotional sentiment time trends, resulting from COVID caseloads dynamics. Our study expands existing knowledge into AI-based emotion detection algorithms development, the latency of emotional reaction identification, and linear prognostic model-based estimation of the emotional sentiment variation effect in relation to COVID caseloads dynamics. The main contribution of our work is listed below: Mapping polarity, negative or positive, and neutral emotion topics using data extracted from daily tweets during the three waves of the pandemic, reflecting multiple terms of public health-imposed confinement and locked down related hashtags. Development of Artificial Intelligence (AI)-based algorithms to geocode tweets to tag Canadian provinces and to extract sentiments using the National Research Council of Canada (NRC) word-based Emotion Lexicon (NRCCEL). Illustrate the patterns of latency effect of emotional sentiments in relation to COVID case dynamics, within the context of quarantine and locked down and finally, Carry out emotion prognostication using time series modeling, uncovering the dynamic linear relationship between COVID caseloads dynamics, and resulting fluctuations in emotional moods as reflected in the Tweets hash-tagged to quarantine and locked down. The findings of this study will help future geographically targeted, area-based public policy decision-making, and related emotional well-being measures enactment through an understanding of geo-temporal dynamics of emotional variations in relation to the vicissitudes of the pandemic caseloads.

Emotion detection from large textual corpora using AI approaches has been applied to online communication data analysis to tackle diverse health issues including fitness, cancer, diabetes, and mental health. Recently, much attention has been paid to COVID-related emotional sentiment classification using social media expressions. Short-term sentiment analysis of lockdown-related Twitter data had shown positive tweets outnumbering negative tweets. Detecting sentiment dynamics in Tweets during COVID has received ML researchers’ attention in the past and the patterns exhibited were different. A study that scrutinized Tweeters’ sentiment dynamics in seven consecutive pandemic time intervals, found sentiment clusters of topics exhibiting variations of occurrence over time, and the lockdown was one prominent topic shown in the first interval, and no details of time-varying polarized sentiments were examined. Another study on the prominent topics and related sentiment variations found the spread and growth of COVID cases as the second prominent topic (15.5% tweets) and the average sentiment score for this topic was negative and then switched to positive when prevention, treatment, and recovery were discussed. A time series tweet data analyses study, similar to ours, was conducted in Ontario, Canada using a short record of daily tweets from March to October 2020. Using a daily positive-to-negative sentiment ratio as the outcome measure, they were unable to find a significant association with COVID case counts. They used the Valence Aware Dictionary for Sentiment Reasoning (VADER) sentiment classifier for daily polarized sentiment calculation. Our study was motivated by their funding but expanded on using a longer record of Twitter data, confined to lockdown and emotional sentiment classification using NRCCEL which uses a large volume of English words, to classify each type of PLUTCHIK emotion. Our study used two of the most popular emotional classification Lexicons in tandem, NRCCEL, and VADER. There is evidence coming, since the early twenties, on the development and application of emotional classifiers. Taking the advantage of Natural Language Processing, a large volume of social media opinions is mined to uncover people's emotions. A system that was developed to extract and analyze emoticons, from pictorial presentations of Chinese text related to health and fitness, classified emotions into seven pre-identified categories: happiness, sadness, fear, anger, disgust, surprise, and love. Their system is based on a kinesics model, which divides emoticons into semantic areas and differs from the lexicon-based system that we propose. Lexicon-based graph models have been developed to extract sentiments from the most important words in a co-occurrence graph model (pictorial presentation) of the sentences extracted from the text. The model was later expanded to use a support vector machine classifier to determine sentiment polarization for a given text corpus. Sentiment analysis moves beyond emotion detection in text corpora and includes polarization of extracted emotions into positive, negative, and neutral sentiments. The most popular and validated lexicon used for COVID-related sentiment analysis is the NRCCEL, which we propose to leverage. This lexicon was selected due to the reasons of giving scores to a broader scheme of eight different emotions joy, sadness, anger, fear, disgust, surprise, trust, and anticipation, depicted in the text corpora and most importantly fits into our aim of uncovering dynamics of variation of emotions. The NRCCEL Lexicon consists of 14,182 English words, the largest text corpora, and their association score of 0 or 1 indicates whether a word is associated with a specific emotion. The NRCCEL has been validated using manual coding and has shown to have 90% accuracy. This approach is based on the components of two well-established and widely used theoretical frameworks: Ekman's theory of basic emotions and Plutchik's emotion theory. This Lexicon was chosen to categorize Twitter statements that do not explicitly express emotions and they are built into dictionaries to carry out ML-based sentiment analysis. Ekman, a 19th-century psychologist, pioneered the basic emotion theory and characterized human emotions into six families, and within each family, there are commonly shared characteristics. The Ekman framework comprises six basic emotions—joy, sadness, anger, fear, disgust, and surprise—while Plutchik emotion theory extends to include—trust and anticipation. Both frameworks have been applied extensively over the years in many health research domains—including a mental illness group, an Australian COVID social media group, Twitter expression classifications around the world, and COVID-related vaccination topic modeling. VADER is another widely used but simple rule-based model for sentiment classification and has been validated again in most of the other sentiment analysis models for social media text analysis but NRCCEL was not one of them. VADER has the advantage of scoring each segment of the expression, as negative, positive, and zero (for neutral) to obtain a cumulative score to assign polarity as negative, positive, or neutral for the entire expression. Our approach to using NRCCEL linguistic valence classification is different in that each Twitter expression is assigned to one of the eight emotions of PLUTCHIK classification prior to polarity classification. Afterward, emotions are classified into negative, positive, and neutral. Researchers used other recursive classification-based approaches for COVID-related sentiment Tweet data analysis to show a pattern of negative sentiments proceeding with positive sentiments. We used a bidirectional encoder representation that results in multiple emotions in the same expression and then in conjunction with the emotional dominance theory the prominent sentiment classification was assigned. We propose an AI-based emotion detection approach. Recent studies have applied similar ML approaches such as Naïve based and logistic regression classifiers to process coronavirus-related Tweets like fear and other negative sentiments. The results showed 91% classification accuracy for Naïve Bayes and 74% accuracy for Logistic regression. Both classification methods were shown to perform well for short-length Tweets but weaker performance for long Tweets used for COVID fear sentiment classifications. Nevertheless, their findings showed that public sentiments were more negative in areas with higher COVID-19 cases. Our study of COVID confinement and locked down hash-tagged data comprised a mixture of short and long Tweets in lengths, thus requiring a better classification algorithm such as NRCCEL to be used. A research study that analyzed two Twitter data sets, one on worldwide data and the other India-specific, examined the impact of COVID on human life, during a short three-month period from 19 January to 12 April 2020. They used the mean of the polarity score from different Tweets as the daily measure to find the time trends. Their sentiment classification based on ML and classification modeling using the BERT model was validated against the emotional classification in the GitHub repository and found to have 94% accuracy. We propose to use the percentage of the polarity score for each of the negative, positive, and neutral types as the daily measure and to use extended versions of the BERT model. For a country-wide emotional sentiment classification, using NRCCEL, Dubey (2020) analyzed Tweets from 12 different countries in April 2020: Australia, Belgium, China, France, Germany, India, Italy, Netherlands, Spain, Switzerland, the UK, and the USA. Their analysis uncovered a worldwide trend of people expressing a mixture of sentiments, some showing hope and positivity about COVID-19 along with fear, sadness, and disgust. North American countries showed distrust and anger on a bigger scale. The current research bare future promises. Indian researchers who identified moods expressed by the Indian nations, during the pandemic, used real-time Twitter posts. They further extended their findings by developing a web-based platform for viewing changes in emotional trends across India. Their system allows viewing of the moods of Indians on specific events happening in the country during COVID-19. A study that examined cross-cultural polarity using sentiment analyses of COVID-19-related Tweets found differences in emotional reactions in neighboring countries, thus stressing the need to consider geo location in the sentiment analysis of social media text data. A global Tweet study on the COVID lockdown that analyzed sentiments for a short duration of 23 days using VADER found a significant association between negative/positive Tweets and infections and deaths. Another study explored COVID-19 lockdown and coping behavior using a mixed method, automated Lexicon-based and qualitative analysis, and found the majority were sharing positive opinions, some expressing negative sentiments, and others on the fence, changing their opinion based on the government decisions. Both studies add credibility to Lexicon-based sentiment analysis of Tweets. Our study takes one step forward in temporal and spatial pattern recognition of dynamics of emotional sentiments in relation to COVID caseloads dynamics, in that we quantify the impact and estimate the latency.

To achieve the first two objectives (listed under contributions a and b) of the goal of empirically investigating provincial-level differences, we employed a hybrid approach consisting of an AI-based text mining of Twitter data depicted in Figure 1 and then a statistical learning method of ARIMA time series modeling approach to uncover patterns of temporal variations and associations with covid caseloads dynamics. The first phase involved collecting COVID confinement-related Tweets and associated metadata and then tagging the Tweets with geolocations. In the second phase, we preprocessed the geotagged Tweets using natural language processing (NLP) techniques and then performed an analysis to identify different emotions expressed in the Tweets and then identified corresponding sentiment polarity. In the third phase, we calculated the daily percentage of counts of negative, positive, and neutral sentiments and carried out a time series analysis by province.

Permission was obtained from Twitter Inc. through their Academic Research Track to perform a full-archive Tweet search over a long period. Next, we developed a C# utility that mines historical tweets related to confinement caused by federal and provincial COVID-19 isolation public health policies from the Twitter database. We extracted tweets and associated metadata using the following confinement-related hashtags, keywords, and key phrases: #StayAtHome OR #quarantine OR #quarantined OR #lockdown OR #stayhome OR #quarantinelife OR #QuarantineAndChill OR #selfquarantine OR (((prolonged stay at home) OR isolation OR (locked in) OR (long stay) OR (social isolation) OR (prolonged stay) OR (social withdrawal) OR seclusion OR segregation OR (stuck inside) OR confinement) AND (coronavirus OR covid-19 OR covid19 OR SARS-CoV-2)). These comprehensive lists containing confinement-related semantics vocabulary terms were obtained using three dictionaries: Urban Dictionary, SNOMED-CT (Systematized Nomenclature of Medicine clinical terms), and Unified Medical Language System Mata thesaurus. We collected a total of 8,832,129 tweets, covering 396 days, between 1 March 2020 and 31 March 2021. The metadata associated with the Tweets includes users/authors’ profile and places (such as cities and countries). We obtained daily COVID-19 caseloads by province and territories from the Canadian COVID Data archive. The two databases were merged using the date as the identifier to proceed with Time series modeling. R software was used for data management and time series ARIMA analysis.

We developed a GEOTAGGING algorithm (Figure 2) to tag each tweet with its corresponding geolocation such as city, province, region, and country. The algorithm, implemented in Python, receives the following parameters as input: Collection of tweets Ʈ = {T1, T2,…,Tn} where 1 ≤ n ≤ 8,832,129. Each tweet Ti∈Ʈ is a tuple (I, F, Â, Ƿ), where I is the tweet's unique identifier, F is the full text of the tweet, Â is the identifier of the tweet's author, and Ƿ is the identifier of the place where the tweet originates. A set of geo-places Ƥ = {P1, P2,…, Pm}. Each Pi∈Ƥ = (Ƿ, Ct, Co), where Ƿ is the place's unique identifier, Ct is the city, and Co is the country. A set of authors A = {A1, A2,…, Ak}. Each Ai∈A = (Â, L), where Â is the author's unique identifier and L is a description of the author's location. A dictionary D = (C, V, R) containing Canadian cities (C) mapped to their provinces (V) and regions (R). We formulated the dictionary D using the geodata obtained from the Canadian government's open data portal. The algorithm first tags all tweets in T with the country using the LOCATIONTAGGER function which leverages the locationtagger Python package for extracting the geolocation from unstructured texts (such as the location description provided by tweet authors). Afterward, the algorithm tags Canadian tweets with city, province, and region using the dictionary. The output of the algorithm is a collection of geotagged tweets T-tagged. After executing the algorithm, 4,898,155 tweets were geo-tagged and distributed across 248 countries including Canada. There were 262,204 Canadian tweets, out of which 60,264 could not be mapped to any geolocation (i.e. city, province, or region) in Canada due to a combination of the following reasons: (i) location description provided by tweet authors contains incorrect or wrongly spelled city/province names, (ii) location description was not specified by authors, and (iii) tweets’ place of origin was not available. The algorithm is robust enough to detect abbreviated province names, having supplemented dictionary D with various abbreviations for Canadian provinces (such as “Alb,” “Alta,” and “AB” representing the Alberta province). Figure 3 shows the breakdown of Canadian tweets by province. The importance of ethical considerations related to geo-referenced tweets for mental health research have been emphasized by Fadda et al., and we conducted detailed statistical analysis only on provinces with a large number of tweets and for that reason, all four Atlantic provinces were combined. Next, we preprocessed the Canadian tweets (n = 201,940) by applying the following NLP techniques using Python and the Natural Language Toolkit (NLTK) library: Removal of Tweets that are neither English nor French Removal of hashtags, mentions, and URLs Removal of punctuation and other special characters Removal of numbers Removal of stop words Stemming words to convert them to their root form Removal of duplicates Afterward, we performed sentiment analysis on the remaining 64,372 Canadian tweets to detect dominant emotions and the corresponding sentiment polarity (positive, negative, or neutral). French tweets were translated, using Google translator, into English before processing.

To classify the tweets into their respective dominant emotion (because multiple emotions were depicted in the same tweet) and to identify sentiment polarity, we developed a scoring algorithm named SENTIDETECT (Figure 4) that accepts three parameters: A set of Canadian tweets Lc = {T1, T2,…,Tn}, where 1 ≤ n ≤ 64,372. The NRC word-based emotion lexicon L = {Wi, W2,…, Wm}, where 1 ≤ m ≤ 14,182. Each Wi∈ L is a tuple (W, E, S), where W is the word, E is the emotion, and S is the associated score. A set of emotions ɛ = {E1, E2,…, Ek}, where 1 ≤ k ≤ 8. Each Ei∈ ɛ is a tuple (E, P, R), where E is the emotion, P is the corresponding sentiment polarity, and R is the rank (see Table 1). The algorithm (Figure 4) first tokenizes each tweet Ti into words using the WORD_TOKENIZE utility in NLTK, and then proceeds to check if a word Wi is associated with an emotion E in L. If a match is found, E is retrieved and the associated score S, as well as the polarity P, is mapped to E. In addition, S is incremented by 1 for E. The dominant emotion (i.e. the emotion with the highest score) is automatically assigned to each tweet Ti. However, if multiple emotions are dominant, the function HIGHEST_RANK in line 16 of the algorithm returns the emotion with the top rank (Table 1). For instance, if anger and disgust are both dominant, the function returns anger since anger ranks higher than disgust. We generated the rankings shown in Table 1 based on the literature on emotional dominance, which was established following the hypothesis that people engage “more quickly and with greater force with negative emotions (such as anger and fear) than positive emotions (such as joy) because the former carry greater survival potential.” Thus, for text responses with multiple emotions, we created the algorithm to rank anger and fear higher in the negative category and joy in the positive category, and also ranked negative sentiments above positive sentiments in the same text, based on the theory of psychoanalysis of emotions. Neutral sentiment is the least ranked since no emotion is elicited. We implemented the SENTIDETECT algorithm (Figure 4) that we developed in Python.

Seven-day k-mean smoother was used to estimate active cases from the daily reported case counts and this seven-day period is on par with the Statistics Canada used bandwidth. For the tth day, k-mean smoothing with k = 7 days was used where Ci denotes the reported caseload for the ith day. A seven-day period was chosen to smooth out random variation and to capture the reporting delays. We used the seven-day mean smoother of positive, negative, and neutral sentiment, calculated from the daily total percentage of sentiments expressed by different Tweeters, for the time series analysis. On an ith day, = total number of positive sentiments, = total number of negative sentiments, and = total number of neutral sentiments. Thenfor ith day percentage of positive sentiments, for example,We tested which provinces have overall sentiments percentage of positive tweets surpassing negative sentiments or vice versa using chi-square tests. To examine the emotional sentiment or mood changes over the pandemic waves we classified waves based on the dates of (a) emergency measures imposed in each province and (b) the beginning of the wave surge, both happening within a few days, if not coincidental, consistently across Canada. Final ARIMA negative binomial time regression model includes daily negative (or positive) sentiment daily percentage as the target (dependent variable St) and daily caseloads (smoothed over seven days), as the regressor (predictor) (Ct).In this model, St denotes the number of negative (or positive) sentiments extracted from tweets expressed on the tth day. Three separate models were fitted, one to each wave. Wave 1: first 100 days, wave 2: next 130 days, and wave 3: last 163 days. The negative binomial AR model provided a better fit due to skewness in daily Twitter emotion sentiment count percentages. For the purpose of properly informing psychological surveillance measures, we estimated the latency period, the time period from the beginning to the end of emotion effect lasting after caseloads variations occurred, by carrying out cross-correlation analysis to daily sentiment counts. The latency was determined by estimating the lag associated with the first instance of the statistically significant cross-correlation. The cross-correlation at lag i, (ri) is estimated using the function , where the symbol cov stands for the covariance and sd stands for the standard deviation. Given that the cross-correlation expands over a latency period, covering several lag days. We used a visibility graph algorithm that was proven to be more efficient. The method cross-correlates residuals and , from fitting AR time series model to and . Statistical significance was determined using the level of significance at alpha < 0.05. The time lag (or lead) for emotional sentiment exacerbation from the date of the case load surge was estimated using the residuals, filtered using the visibility graph algorithm cross-correlation method that was proven to be more effective than using the cross-correlation without filtering. Power calculation for time series analysis was carried out using a method described in the literature. Based on our power calculations to reach 80% power with alpha = 0.05 level of significance the length of the time series needed to detect a significant beta coefficient of case load influence of 2.5% (sentiment increase per 100 case load increase) with a standard deviation of 1.1% for 35% negative/positive/neutral sentiments is 2073 days. Given that there is a small number of tweets in four Atlantic Provinces and concurrence of the timing of public health restrictions, the four Atlantic Provinces were lumped together in the analysis. We used the formula given in Yukon, Nunavut, PEI, and Atlantic Provinces do not meet these requirements given that there are lots of missing days with no cases and sentiments detected. Therefore, we decided to combine Atlantic Provinces together and only descriptive analysis results are provided for Yukon and Nunavut. We used the following formula for power calculation for time series regression based on the published literature. We used and are 1.96 and 1.28 for 0.05 level of significance and 80% power. We used as 2.5 and the standard deviation as 1.1 based on post-hoc estimation of minimum values. Based on the percentage of negative/positive sentiments of p = 33.3% (Table 1 Canadian average). The required length of n = 243 days. The use of 396 day-long time series for time series regression was justified.NRCCEL sentiment classification: NRCCEL emotional sentiment classifier has been shown to perform the best in an emotional classification's lexicon validation study. However, upon examination of NRCCEL sentiment analysis results, it was revealed that over 50% of sentiments were neutral. Emotion polarization detection literature suggests categorization of “anticipation” as a positive or negative sentiment depending on the context and in relation to COVID researchers have used anticipation as a positive sentiment with vaccine-related text classification. In order to overcome this bias, we used the VADER, which has been evaluated for word-by-word classification of social media-related text emotional sentiment classification using human raters classification of Tweeter data, and this dictionary was found with 96% accuracy.

For this validation segment of the study, we first considered comparison with the Ekman Lexicon, which was originally designed based on facial expressions, and later expanded for textual data analysis. It performed poorly in the extraction of the prominent sentiments of COVID-19 twitter expression classification, especially when there were multiple emotions. Even more importantly it excluded two important categories of pandemic induced quarantined and locked-down related expressions of “anticipation” and “trust.” We manually examined randomly selected tweets and found Ekman lexicon puts weights on single words such as sorry in the part of the expression of “sorry to anyone in social isolation” and classified as “fear,” for example. Whereas the overall meaning of the Twitter expression “sorry to anyone in social isolation, allow actually get tested, hope everyone stay safe” was classified by NRCCEL as a positive sentiment of “joy” and neutral sentiment of “anticipation.” Given that anticipation and trust are important sentiments for quarantine-related sentiments, further analysis was conducted using NRCCEL sentiment analysis. Even further, COVID lockdown tweets emotion sentiments of anger, fear, joy, and no-emotion were significantly (p < 0.0001) over-estimated, and disgust and sadness were underestimated (p < 0.0001) in the Ekman Lexicon classification. Additionally, NRCCEL classification identifies the expression using a string of words (phrase), each phrase is given a score and then add the scores to obtain overall sentiment polarization classification. After NRCCEL classification of the sentiments, we further validated one neutral emotional classification “anticipation” using two lexicons, VADER and Wordnet lexicons. We obtained an F score of 1.29 for VADER and 0.007 for the WordNet classifier. Herein, anticipation was further classified as either positive or negative, or neutral based on the VADER lexicon scoring. Table 2 shows the sentiment polarity for each emotion topic classified by NRCCEL with further classification of “anticipation” by VADER.

Of the 262,204 tweets, 64,372 met the inclusion criteria for further analysis. Yukon (n = 76), Nunavut (n = 293), and Prince Edward Island (n = 119) had the least number of Tweets and did not meet the statistical power for time series analysis (Table 2). While most (36.4%) Tweets were classified as neutral, statistically significant higher percentages of negative tweets were noted in all provinces but Saskatchewan, PEI, and Yukon, for the chi-square test. The daily time series of negative and positive Tweet sentiment counts showed a peak shortly after the middle of the first wave and then exponentially decayed overtime during the second and third waves. Most of the tweets (64.5%) were in the first wave of the pandemic, from 2 March 2020 to 10 June 2020. Overall, in Canada, the three waves of Tweets comprised the negative sentiments of Anticipation (30.1%), Fear (28.1%), Anger (25.3%), Sadness (8.6%), and Disgust (7.0%). Positive sentiments were mostly reflected by Anticipation (43.7%), Trust (41.4%), and Joy (14.9%). The tweets classified as neutral had mostly no emotions (86%), anticipation (9.6%), and surprise (4.4%).

The study period covered three waves of COVID caseloads, of which the first wave, the period covering March to June in most provinces is shown, before the first vertical line in Figure 5. In many provinces, the lowest peak of caseloads was in the first wave, while the third wave (19 October 2020 to 31 March 2021) showed the highest peak (Figure 5). Figure 5 shows seven-day daily caseloads (the bottom line in black), averaged using a seven-day k-mean smoother. In almost all provinces the second wave from June to October 2020, had the least number of cases. Nevertheless, negative sentiment expressions in the second wave were greater than in the other two waves. When considering the cross-correlation analysis of the Canadian daily caseloads and sentiment variations, there was a minimum of a five-day lag period shown for negative sentiments to arise in waves two and three, but there was no lag effect detected for wave one, during which negative sentiments were sprouted immediately, on the same day of caseloads increase. However, Tweeters’ positive sentiments took a slightly longer period to emerge, in response to rising cases. It took a minimum of six to seven days to subside positivity in all three waves. In addition to the lag effect, we were able to uncover the magnitude of the effect, when all Canadian data are combined, which calls for provincial-level analysis. In all three waves, when the percent of daily caseloads increased by 100 cases, the daily percent of negative sentiments decreased with varying magnitudes across waves, wave 1(β = −0.47, SE = 0.07), wave 2 (β = −0.20, SE = 0.04), and in wave 3 (β = −0.08, SE = 0.01). This time-varying decline of the magnitude of the gradient, from wave one through to three may indicate getting used to the new norm. Predictive power measured by R2 varies from 30% in wave 1, 12% in wave 2, and 17% in wave 3, which may be a result of having fewer tweets in waves 2 and 3. The daily percentage of positive sentiment expressed by Canadian Tweeters did not show any association with case dynamics in waves 1 and 2 but in wave 3, perhaps because vaccines were approved in wave 3. Overall, when all three waves’ Tweets combined as the caseloads increased by 100, Canadian daily positive sentiments decreased by 5.5% (SE = 0.07). Those Canadian Tweeters who were neutral increased their neutral sentiment expressions in the first two waves with increasing caseloads. For 100 caseloads increase, neutral sentiments increased in wave 1 (β = 4.8% SE = 0.6) and in wave 2 (β = 2.3% SE = 0.42), but not in the third wave. In what follows, the geographical level analysis by province is presented.

Most of the Tweets were in the first wave and we have presented the daily percentages of counts of negative, positive, and neutral for six provinces, covering the first three waves, and therein the four Atlantic provinces were combined (Figure 6). Emotional sentiments started even before the first case of COVID appeared in Canada (Figure 6). Nevertheless, as the daily COVID case numbers increased the three polarized sentiments of daily negative, positive, and neutral classifications showed varying levels and directions by geography and time (Figure 6).

Provincial-level latency period estimation detected the first lead time (in days), in that statistically significant negative/positive sentiment correlations with changing caseloads, were noted. These correlation results provided an estimate of latency, which can be interpreted as an estimate of the time in days taken to react to the caseload changes and we have noted the shortest latency period with the magnitude of the correlation, in Table 3. The latency period of emotional sentiment expressions appearing on Twitter, for caseloads changes, varies by province and by COVID waves. In most provinces, except Ontario (with the longest lag time of 14 days), NB, Quebec, and Alberta (no significant latency), negative emotional sentiment responses increased within two to three days of caseload increase in wave 1. Manitoba (latency = 4) and NS (latency = 9) showed a negative correlation of negative response decrease to caseloads rise in wave 2 and no significant latency in wave 3. Positive sentiments took a slightly longer period and in some provinces four to eight days to decline in response to increasing caseloads, except in Alberta (waves 2 and 3). In Quebec, the latency period for positive sentiment decline was the longest 18 days.

The percentage of variation in negative sentiments explained by the caseloads, overall, measured by R2, varied from 30% in wave 1 to 12% and 17% in waves 2 and 3. Positive sentiment prognostication was very poor (around 2.1%), but neutral sentiment predictive power was 42% in wave 1 and 19% and 1.6% in waves 2 and 3. Negative sentiment prognostication: Canadian Tweeters’ emotional responses to increasing COVID caseloads showed geographic variations, in magnitude and direction, across all three waves (Table 4). As caseloads increased by 100, in Alberta, BC, and Quebec, Tweeters in these provinces showed resilience with decreasing daily percent of negative sentiments, whereas smaller provinces such as Manitoba and Atlantic Canada showed increased negative emotional sentiments with increasing caseloads in wave 1 (Table 4). We also found Alberta and BC Tweeters’ negative emotional sentiments in wave 2 showed a reversing trend in wave 1, with increasing negative sentiments with increasing caseloads. Quebec Tweeters consistently showed resilience towards increasing caseloads (1% decline per 100 case caseload increases). Saskatchewan's negative sentiments were not significantly related to caseloads in all three waves. Overall, Canadian Tweeters showed resilience with increasing caseloads, but the magnitude declined from waves 1 through 3. Positive sentiments prognostication: Alberta Tweeters showed an increasing trend of positive emotional sentiments during waves 1 and 3 with increasing caseloads and changed the direction in wave 2. But Ontario Tweeters remained increasingly positive with increasing caseloads in all three waves (Table 5). Manitoba, Atlantic, and Quebec Tweeters’ positive emotional responses declined with increasing caseloads in wave 1 and this pattern continued only in wave 3 in Quebec. Saskatchewan Tweeters’ positive sentiments went down with increasing caseloads in waves 2 and 3, not in wave 1. Neutral Sentiment prognostication: In wave 1, Neutral sentiments increased with rising caseloads except in Alberta, which happened in wave 2 (Table 6). Of all provinces, Manitoba and Saskatchewan showed the highest magnitude of the trend in wave 1. Alberta and BC trends reversed in wave 3 showing a decline in neutral sentiments with increasing caseloads. Atlantic Canada neutral sentiments associations were not significant. Principal findings: Our hybrid modeling approach that combined AI-based emotion detection tools, as well as supervised learning methods of ARIMA time series modeling and cross-correlation analysis, demonstrated the feasibility of detecting the association between caseload dynamics and polarized emotion sentiments. The major thrust of this study was emotional sentiment extraction algorithm development and application covering an entire country, including many Canadian tweets, 64,372 gathered for a lengthy period of 396 days, covering the first three waves of the pandemic. We used established AI-based techniques and explored the dynamic relationship between daily neutral, negative, and positive sentiments with daily COVID caseloads, stratified by geographic regions. Using Canadian Tweets hash-tagged quarantine and locked down related multiple terms, study findings depict sentiments arising from these regulations. Thus, findings from Twitter data provided a basis to interpret emotional reactions in relation to this social/physical confinement. Overall, our findings suggest daily negative, positive, and neutral sentiment variations are weakly linearly related to caseload changes. It is likely that there are other factors contributing to emotional sentiment dynamics. Nevertheless, daily emotional sentiment variations are significantly influenced by daily caseload changes among those Tweeters who were concerned about being locked down and confined. We found latency of the emotional sentiments to come into effect when the caseloads changed, which was five days for negative emotional sentiments, but a little longer six to seven days for positive sentiments to be expressed.

Using several thesauri, we found 19 semantic vocabulary terms representing social and physical confinement measures imposed by provincial public health regulatory systems. Combined with four COVID terms of expressions to these terms, we hash tagged and extracted 8,832,129 tweets, more terms than used in other COVID Tweet data analyses in single country studies. The two algorithms that we developed successfully extracted tweets, covering 396 days, and after geo-tagging and discarding those with no emotions and geo locations, we included 64,732 tweets representing Canadian twitter users’ verbal emotional reactions to these restrictions imposed by the government to control the outbreak. A global study that used two hashtags, COVID-19 and social isolation resulted in over 10 million tweets, and another global study of a short duration of 48 days, that used four COVID and three confinement-related hashtags, revealed 20,051 emotional sentiments labeled tweets. Whereas a study that used three keywords of COVID-19 resulted in 20,325,929 tweets from more than 170 countries. In comparison to these global and multi-country study numbers of tweets, the size of our single-country study sample is large enough to represent a general population of Tweet users in the country. Our sample of Tweets, when stratified by province/region, contains 1600 to 26,992 tweets per province, which may provide a large enough sample to represent the community of Twitter users in each geography. Research conducted in China analyzing 62,119 twitter discussions on news forums stated their sample sufficiently represented a community sample, because of wider coverage. Most of the Canadian tweets (64.5%) were in the first wave, which occurred from March to June 2020, and the number of daily Tweets exponentially decayed over time starting from the mode of the first caseload wave. A Spanish COVID sentiment analysis time series study that covered a shorter time span (60 days) showed a similar linearly increasing pattern at the beginning of the pandemic and then leveled off after reaching the peak of the caseload wave. Another short-term (4 weeks) study conducted in Italy among oncology physicians’ sentiments expressed in WhatsApp messages showed a declining pattern in positive emotions overtime during the pandemic. These geographic variations emphasize the importance of tracking geo-locations of sentiment exacerbation data collected from social media platforms and the necessity of following up for a longer duration, to capture the time-varying patterns across geographies. Following the literature that examined people expressing positive and negative anticipation when coping with COVID, we further classified NRCCEL neutral sentiment classified anticipation using VADER to extract positive anticipations and negative anticipations. Our study revealed negative anticipation as one of the dominant negative expressions followed by fear and anger, in most Canadian provinces, while positive anticipation and trust were major topics of positive sentiments shown in all Canadian provinces. Given that the positive anticipation sentiment was the highest-ranked topic among positive sentiments, Canadian Twitters’ may be optimistic about an upcoming promising end result and this finding is similar to the results shown in a US study. Two other studies that analyzed healthcare professionals’ tweets, one using the Ekman lexicon noted fear and the other Italian study using the NRCCEL lexicon also noted fear, anger, and sadness as the dominating negative sentiments and both studies noted joy as the dominating positive sentiment for their COVID-19 information concepts. Our confinement/social isolation tweet study results that used the NRCCEL lexicon provided a somewhat similar pattern to the aforementioned studies and the subtle differences noted in positive sentiments may be due to the differences in populations, general versus health professionals. In addition, our Tweet data representation of confinement and social isolation may account for the noted differences. Despite hashtag, geographical, and use of lexicon classifications differences, our finding of fear and anger dominating COVID-related social media expressions is congruent with other studies. None of the above studies, polychotomized anticipation into positive, negative, and neutral and we emphasize future research to consider this extended classification. Daily negative tweets outnumbered positive tweets indicating most Canadians relate their social confinement with anticipated negativity, combined with fear and anger as dominant negative emotions expressed. Similarly, a global study on Twitter trends during the early stage of the pandemic from January to April 2020, identified negative emotions (predominantly fear) as exceeding positive emotions. This pattern that we observed was only consistent with the early days of the eight-day worldwide COVID-19-related tweet sentimental analysis results. There were no consistent temporal patterns of negative sentiments dominating positive sentiments or vice versa that we observed across Canadian provincial jurisdictions shown in their short-period world tweet analysis. One Chinese study showed the opposite of the pattern we observed. Wherein Chinese tweets text analysis showed the number of positive emotions (happiness) exceeding negative emotions and they indicated the influence of religion on staying positive. In addition, variations across geo-locations within a country were not tracked in those studies. The aforementioned research findings that supported the consistency of the sentiment polarity dynamic may justify the capability of our hybrid modeling approach to capture essential temporal dynamics from a lengthy recording period. Decides the influence of religion, other social media researchers had explained this pattern of negative emotions exceeding positive emotions using Grey's neuropsychological theory which states that the behavioral inhibition system (BIS) tends to negatively respond to social uncertainty increase. It is possible the pandemic-related confinement and locked down related Tweets that we analyzed reflect more of the BIS-related negative psychological impact than what is shown among the general public. We were unable to find many studies that estimated the time taken for negative and positive sentiments to exacerbate or recede (latency) after COVID caseloads surge or vice versa. The provincial level cross-correlation between the daily percentage of negative (and positive) sentiments and daily caseloads exhibited two to three days on average latency, and in some provinces like Quebec exhibited 14 days of onset of delay in the first wave. Overall, in Canada, negative sentiments were exacerbated after five days of caseload surge, in waves 2 and 3, and it took six to seven days after caseloads increase for the positive sentiments to recede. These latency periods differ not only by province and also across waves but happened within the entire “confinement” or “stay at home” 14-day period. This may reflect this study tweets extracted were related to confinement, which lasted 14 days. One may argue this ecological relationship discovery is spurious. A study conducted in China applied a system dynamic model to establish a causal relationship between public sentiments and government responses to COVID-19. Their validity and rationality of the model performances revealed two findings: (1) increased government positive responses facilitated an increasing trend of positive responses and (2) changes in the epidemic a “worse disaster context” promoted negative emotions. This research evidence may rationalize the dynamic pattern that we observed in some provinces, showing an increasing trend of both negative and positive emotions in relation to increasing caseloads. This may also indicate that Canadian provincial jurisdictions promptly responded to create a positive impact so that positive sentiments increased with daily caseloads increase and this needs to be confirmed in future research. A Chinese study identified significant correlations between COVID case numbers and public attention up to a six-day lag period, with the highest correlation in lag of two to three days. Our findings underscore the need to examine the latency period of emotion exacerbation after caseloads surge to properly inform the timing of the onset of psychological sentiment exacerbation, during the lockdown. Our study added another layer to the existing knowledge base by classifying the responses into negative, positive, and neutral sentiments and significantly predicting these polarized responses in relation to increasing caseloads. This ARIMA time series regression prognostic modeling of confinement and lockdown Twitter response emotions was unique to this study. Overall sentiment daily variations over time and caseload dynamics showed a weak relationship and explained 12% on average for Canada. But when considering the percentage of daily polarized tweets, by province, the daily caseload dynamics significantly predicted the negative and positive emotional sentiment exacerbation/recedes. We were able to identify a significant prognostication effect of the negative emotional effect in four to five provinces in the first three waves. In wave 1, the percentage of variation in negative sentiments (30%) and neutral sentiments (42%) explained by caseloads was higher than for positive sentiment prognostication (2.1%). While most of the Tweets (64.5%) are in the first wave and most Tweets were significantly negative sentiment expressions and this may explain the poor predictive power of positive sentiments. A study that analyzed country-level google trends depicting awareness of coronavirus found a positive serial correlation over time with an increasing volume of responses at the beginning of the pandemic, and this may explain the weak relationship that we observed in some provinces with fewer tweets. It is noteworthy, that the most populated Canadian provinces, Alberta, BC, and Quebec showed a significant resilience effect with linearly declining negative emotional sentiments and inclining positive sentiments in relation to the caseloads increase. This pattern of being vulnerable to increasing caseloads changes, showing increasing negative daily percentages of emotions and decreasing positive emotions were shown in less populated provinces of Manitoba and the region of the Atlantic. Moreover, we uncovered an association between the dynamics of neutral sentiments and caseloads, one that showed increasing neutrality in emotional sentiments with increasing caseloads in the first wave. Confirming the vulnerability, a study conducted in Ontario used a multifactor ARIMA model that included the daily positive-to-negative sentiment ratio for 200 days (that covered the first two Canadian COVID waves) and found a negative association with increasing cases (−0.98 per 100 caseloads increase, p = 0.02). The results are incompatible in magnitude since we used the daily percentage of sentiments, not the ratio, and only confinement-related Tweets but confirmed a similar direction of the association between dynamics of caseloads and sentiments using ARIMA models. Chandrasekaran et al. stated that there is a dearth of knowledge on the temporal pattern of emotional sentiments in relation to COVID outbreaks and our study findings filled this gap in knowledge. They used topics of emotional expressions in global tweets that included 20 topics including the spread of the virus and lockdown regulations for a five-month period, from January to May 2020 and their analysis revealed a higher proportion of negative sentiment scores during the 12 weeks of spread and growth of cases. This pattern further confirms our study finding of significant associations of negative emotional effects with increasing caseloads noted in time series regression models. They illustrated positive sentiments were related to government announcements of incentives for people affected by regulating lockdowns and the positive sentiment trends we noted may also be a result of the Canadian government provision of incentives such as supplementary income packages during the lockdown. Literature suggests other factors contributing to emotional dynamics. A study conducted among nurses’ Facebook expressions found a peak in negative sentiments during the period of isolation. They stated this effect was a result of being away from friends and family, loneliness, and fear of being infected, and they found a peak in the positive sentiments during the period of granting incentives. These global study findings justify the dynamic relationships that we uncovered and there are other factors contributing to sentiment temporal variations in addition to caseloads variations. Though we did not follow a cohort of tweeters using an ID, our findings, when contextualized within confinement and lockdown regulations, may suggest (a) there are three cohorts of tweeters, depending on being pessimistic, optimistic, and naturalistic expressing negative, positive, and neutral sentiments or (b) there is one cohort of tweeters changing their views, from negative to positive or being neutral, depending on external circumstance including caseload dynamics.

Our hybrid modeling approach that combined AI-based sentiment analysis and ARIMA time series regression modeling provided important tools for emotion sentiment detection. Within the context of lockdown and confinement, our findings provided directions for public health regulatory authorities to curb the public emotional crisis in relation to surging caseloads. Emotional exacerbations were greater at the beginning of the pandemic during the first wave and within this period caseloads alone explained up to 30% of negative emotions variations. Even though, the caseloads peaked higher during the third wave of the pandemic, Twitter's emotional sentimental expressions were lesser in magnitude than in the first wave, possibly due to getting used to the new norms of confinement and lockdown. It is important to take necessary measures to address rising negative emotions at the early stage of the pandemic within two to three days of the caseloads surge. Our findings suggest geographic heterogeneities of public reactions, depicted by emotional dynamics in tweeter expressions in relation to COVID caseload changes within the same country. The magnitude, direction, and latency periods of the emotional sentiments varied provincially. These noted dynamics of provincial-level differences, in public emotional sentiment expressions, should be considered when planning provincial-level confinement-related psychological health promotion efforts. Future research should validate social media text corpora-based emotional sentiment polarities using geo-linked data obtained from a community sample. Implications: In addition to public health implications, this study contributed an AI-based theoretical framework for extracting and geo-coding Tweets and classification of expressions with a mixture of emotions into a dominant emotion using Lexicon-based emotional sentiment classifications. The hybrid modeling approach with statistical methods expanded to uncover the ecological relationship between temporal variations of emotions and caseload dynamics. The results of the application provide directions for geographically targeted psychological health monitoring. Another dimension uncovered in this study is the benefit of the use of social media as a venue for the free expression of negative outcomes of anticipation, anger, and fear as well as positive outcomes of joy and trust during a confinement and lockdown period. Free expression can be interpreted as a form of social therapy.

Click here for additional data file. Supplemental material, sj-docx-1-dhj-10.1177_20552076231171496 for Dynamics of emotion trends in Canadian Twitter users during COVID-19 confinement in relation to caseloads: Artificial intelligence-based emotion detection approach by Swarna Weerasinghe, Oladapo Oyebode, Rita Orji and Stan Matwin in DIGITAL HEALTH