Sentiment analysis using Twitter data: a comparative application of lexicon- and machine-learning-based approach

  • Original Article
  • Open access
  • Published: 09 February 2023
  • Volume 13 , article number  31 , ( 2023 )

Cite this article

You have full access to this open access article

  • Yuxing Qi 1 &
  • Zahratu Shabrina 2 , 3  

13k Accesses

13 Citations

1 Altmetric

Explore all metrics

Avoid common mistakes on your manuscript.

1 Introduction

Social media platform such as Twitter provides a space where users share their thoughts and opinion as well as connect, communicate, and contribute to certain topics using short, 140 characters posts, known as tweets . This can be done through texts, pictures, and videos, etc., and users can interact using likes, comments, and reposts buttons. According to Twitter ( https://investor.twitterinc.com ), the platform has more than 206 million daily active users in 2022, which is defined as the number of logged accounts that can be identified by the platform and where ads can be shown. As more people contribute to social media, the analysis of information available online can be used to reflect on the changes in people's perceptions, behavior, and psychology (Alamoodi et al. 2021 ). Hence, using Twitter data for sentiment analysis has become a popular trend. The growing interest in social media analysis has brought more attention to Natural Languages Processing (NLP) and Artificial Intelligence (AI) technologies related to text analysis.

Using text analysis, it is possible to determine the sentiments and attitudes of certain target groups. Much of the available literature focuses on texts in English but there is a growing interest in multilanguage analysis (Arun and Srinagesh 2020a ; Dashtipour et al. 2016 ; Lo et al. 2017 ). Text analysis can be done by extracting subjective comments toward a certain topic using different sentiments such as Positive, Negative, and Neutral (Arun and Srinagesh 2020b ). One of the topical interests would be related to the Coronavirus (Covid-19), which is a novel disease that was first discovered in late 2019. The rapid spread of Covid-19 worldwide has affected many countries, leading to changes in people’s lifestyles, such as wearing masks on public transportation and maintaining social distancing. Sentiment analysis can be implemented to social media data to explore changes in people’s behavior, emotions, and opinions such as by dividing the spread trend of Covid-19 into three stages and exploring people’s negative sentiments toward Covid-19 based on topic modeling and feature extraction (Boon-Itt and Skunkan 2020 ). Previous studies have retrieved tweets based on certain hashtags (#) used to categorize content based on certain topics such as “#stayathome” and “#socialdistancing” to measure their frequency (Saleh et al. 2021 ). Another study has used the Word2Vec technique and machine learning models, such as Naive Bayes, SVC, and Decision Tree, to explore the sentimental changes of students during the online learning process as various learning activities were moved online due to the pandemic (Mostafa 2021 ).

In this paper, we implement social media data analysis to explore sentiments toward Covid-19 in England. This paper aims to examine the sentiments of tweets using various methods including lexicon and machine learning approaches during the third lockdown period in England as a case study. Those who just started dealing with NLP should be able to use this paper to help select the appropriate method for their NLP analysis. Empirically, the case study also contributes to our understanding of the sentiments related to the UK national lockdown. In many countries, the implementation of policies and plans related to Covid-19 often sparked widespread discussion on Twitter. Tweet data can reflect the public sentiments on the Covid-19 pandemic, therefore providing an alternative source for guiding the government’s policies. The UK has experienced three national lockdowns since the outbreak of Covid-19, and people have expressed their opinions on Covid-19-related topics, such as social restrictions, vaccination plans, and school reopening, etc., all of which are worthy of exploring and analyzing. In addition, few existing studies focus on the UK or England, especially the change in people’s attitudes toward Covid-19 during the third lockdown.

2 Sentiment analysis approaches

In applying sentiment analysis, the key process is classifying extracted data into sentiment polarities such as positive, neutral, and negative classes. A wide range of emotions can also be considered which is the focus of the emerging fields of affective computing and sentiment analysis (Cambria 2016 ). There are various ways to separate sentiments according to different research topics, for example in political debates, sentiments can be divided further into satisfied and angry (D’Andrea et al. 2015 ). Sentiment analysis with ambivalence handling can be incorporated to account for a finer-grained results and characterize emotions into such detailed categories such as anxiety, sadness, anger, excitement, and happiness (Wang et al. 2015 , 2020 ).

Sentiment analysis is generally done to text data, although it can also be used to analyze data from devices that utilize audio- or audio-visual formats such as webcams to examine expression, body movement, or sounds known as multimodal sentiment analysis (Soleymani et al. 2017 ; Yang et al. 2022 ; Zhang et al. 2020 ). Multimodal sentiment analysis expands text-based analysis into something more complex that opens possibilities in the use of NLP for various purposes. Advancement of NLP is also rapidly growing driven by various research, for example in neural network (Kim 2014 ; Ray and Chakrabarti 2022 ). An example would be the implementation of Neurosymbolic AI that combines deep learning and symbolic reasoning, which is thought to be a promising method in NLP for understanding reasonings (Sarker et al. 2021 ). This indicates the wide possibilities of the direction of NLP research.

There are three main methods to detect and classify emotions expressed in text, which are lexicon-based, machine-learning-based approaches, and hybrid techniques. The lexicon-based approach uses the polarity of words, while the machine learning method sees texts as a classification problem and can be further divided into unsupervised, semi-supervised, and supervised learning (Aqlan et al. 2019 ). Figure  1 shows the classification of methods that can be used for sentiment analysis, and in practical applications, machine learning methods and lexicon-based methods could be used in combination.

figure 1

Sentiment analysis approaches

When dealing with large text data such as those from Twitter, it is important to do the data pre-processing before starting the analysis. This includes replacing upper-case letters, removing useless words or links, expanding contractions, removing non-alphabetical characters or symbols, removing stop words, and removing duplicate datasets. Beyond the basic data cleaning, there is a further cleaning process that should be implemented as well including tokenization, stemming, lemmatization, and Part of Speech (POS) tagging. Tokenization splits texts into smaller units and turns them into a list of tokens. This helps to make it convenient to calculate the frequency of each word in the text and analyze their sentiment polarity. Stemming and lemmatization replace words with their root word. For example, the word “feeling” and “felt” can be mapped to their stem word: “feel” using stemming. Lemmatization, on the other hand, uses the context of the words. This can reduce the dimensionality and complexity of a bag of words, which also improves the efficiency of searching the word in the lexicon when applying the lexicon-based method. POS Tagging can automatically tag the POS of words in the text, such as nouns, verbs, and adjectives, etc., which is useful for feature selection and extraction (Usop et al. 2017 ).

2.1 Lexicon-based approach

The core idea of the lexicon-based method is to (1) split the sentences into a bag of words, then (2) compare them with the words in the sentiment polarity lexicon and their related semantic relations, and (3) calculate the polarity score of the whole text. These methods can effectively determine whether the sentiment of the text is positive, negative, or neutral (Zahoor and Rohilla 2020 ). The lexicon-based approach performs the task of tagging words with semantic orientation either using dictionary-based or corpus-based approaches. The former is simpler, and we can determine the polarity score of words or phrases in the text using a sentiment dictionary with opinion words.

2.1.1 Lexicon-based approaches with built-in library

Examples of the most popular lexicon-based sentiment analysis models in Python are TextBlob and VADER. TextBlob is a Python library based on the Natural Language Toolkit (NLTK) that calculates the sentiment score for texts. An averaging technique is applied to each word to obtain the sentiment polarity scores for the entire text (Oyebode and Orji 2019 ). The words recorded in the TextBlob lexicon have their corresponding polarity score, subjectivity score, and intensity score. Additionally, there may be different records for the same word, so the sentiment score of the word is the average value of the polarity of all records containing them. The sentiment polarity scores produced are between [− 1, 1], in which − 1 refers to negative sentiment and + 1 refers to positive sentiment.

VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based tool for sentiment analysis with a well-established sentiment lexicon (Hutto and Gilbert 2014 ). Compared to the TextBlob library, there are more corpora related to the language of social media, which may work better on a social media-type text that often contains non-formal language. From the results, the positive, negative, neutral, and compound values of tweets are presented, and the sentiment orientation is determined based on the compound score. There are several main steps of compound score calculation. Firstly, each word in the sentiment lexicon is given its corresponding scores of positive, negative, and neutral sentiments, ranging from − 4 to 4 from the most “negative” to the most “positive.” Heuristic rules are then applied when handling punctuation, capitalization, degree modifiers, contrastive conjunctions, and negations, which boosts the compound score of a sentence. The scores of all words in the text are standardized to (− 1, 1) using the formula below:

where x represents the sum of Valence scores of sentiment words, and α is a normalization constant. The compound score is obtained by calculating the scores of all standardized lexicons in the range of − 1 (most negative) to 1 (most positive). The specific classification criteria for both TextBlob and VADER are shown in Table 1 .

2.1.2 Lexicon-based approach with SentiWordNet

SentiWordNet is a lexical opinion resource that operates on the WordNet Database, which contains a set of lemmas with a synonymous interface called “synset” (Baccianella et al. 2010 ). Each synset corresponds to the positive and negative polarity scores. The value range of Pos(s) and Neg(s) is between 0 and 1. The process of SentiWordNet analysis is shown in Fig.  2 .

figure 2

Process of SentiWordNet-based approaches

There are several steps in applying the SentiWordNet-based approach. The first steps are data pre-processing including applying basic data cleaning, tokenization, stemming, and POS tagging. These steps can improve the time spent searching the words in the SentiWordNet database. For a given lemma that contains n meanings in the tweet, only the polarity score with the most common meaning is considered (the first one). The formula is as follows:

We can count the positive and negative terms in each tweet and calculate their sentiment polarity scores (Guerini et al. 2013 ). The sentiment score of each word or specific term in the SentiWordNet lexicon can be calculated by applying Eq. ( 4 ):

The SynsetScore then computes the absolute value of the maximum positive score and the maximum negative score of the word. For a term containing several synsets, the calculation is as follows:

where n is a count number, the total score would be recorded as 0 if this term is not in SentiWordNet. The symbol k indicates how many synsets are contained in this term, and if there are negations in front of this term, then, this sentiment value is reserved. Finally, we can add the sentiment scores of all terms to get the sentiment score of the tweets using the formula below:

where p is a clean tweet with m positive terms and n negative terms. PosScore( p ) is the final score of all the positive terms, while NegScore( p ) represents the negative terms, and SentiScore( s ) is the final sentiment score of tweets (Bonta et al. 2019 ).

2.2 Machine learning approach

The machine learning approaches can construct classifiers to complete sentiment classification by extracting feature vectors, which mainly includes steps including data collecting and cleaning, extracting features, training data with the classifier, and analyzing results (Adwan et al. 2020 ). The dataset needs to be divided into a training and a test dataset using machine learning methods. The training sets aim to enable the classifier to learn the text features, and the test dataset evaluates the performance of the classifier.

The role of classifiers (e.g., Naïve Bayes classifier, Support Vector Machine, Logistic classifier, and Random Forest classifier.) is to classify text into different defined classes. As one of the most common methods for text classification, machine learning is widely used by researchers. In addition, the performance of the same classifier for different types of text may differ greatly, so the feature vectors of each type of text should be trained separately. To increase the robustness of the model, a two-stage support vector machine classifier can be used, which can effectively process the influence of noise data on classification (Barbosa and Feng 2010 ). In the subsequent process, it is necessary to vectorize the tweets data and divide the labeled tweets data into a training set (80%) and a test set (20%), and then, the sentiment labels can be predicted by training different classification models. The overall process is shown in Fig.  3 below:

figure 3

Main process of machine-learning-based approaches

2.2.1 Feature representation

The common methods of text feature representation can be divided into two categories: frequency-based embeddings (e.g., Count vector, Hashing Vectorizer, and TF–IDF) and pre-trained word embedding (e.g., Word2Vec, Glove, and Bert) (Naseem et al. 2021 ). In this paper, the following three feature representation models are mainly used:

Bag of words ( BoW ) converts textual data to numerical data with a fixed-length vector by counting the frequency of each word in tweets. In Python, CountVectorizer() works on calculating terms frequency, in which a sparse matrix of clean tokens is built.

Term frequency–inverse document frequency ( TF–IDF ) measures the relevance between a word and the entire text and evaluates the importance of the word in the tweet dataset. In Python, TfidfVectorizer() can obtain a TF–IDF matrix by calculating the product of the word frequency metric and inverse document frequency metric of each word from clean tweets.

Word2Vec generates a vector space according to all tweet corpus, and each word is represented in the form of a vector in this space. In the vector space, words with similar meanings will be closer together, so this method is more effective for dealing with semantic relations. In Python, the text embedding method can be implemented with the Word2Vec model in the Gensim library, and many different hyperparameters can be adjusted to optimize the word embedding model, such as setting various corpus (sentences), trying different training algorithms (skip-grams/sg), and adjusting the maximum distance between the current word and the predicted word in a sentence (window).

2.2.2 Classification models

Sentiment classification is the process of predicting users’ tweets as positive, negative, and neutral based on the feature representation of tweets. The classifiers in the supervised machine learning methods, such as a random forest, can classify and predict unlabeled text by training a large number of sentiment-labeled tweets. The classification models used in this paper are as follows:

2.2.2.1 Random forest

The results of the random forest algorithm are based on the prediction results of multiple decision trees, and the classification of new data points is determined by a voting mechanism (Breiman 2001 ). Increasing the number of trees can increase the accuracy of the results. There are several steps in applying random forest for text processing (Kamble and Itkikar 2018 ). First, we select n random tweet records from the dataset as the sample dataset and build a decision tree for each sample. We then get the predicted classification results of each decision tree. Then, we take the majority vote for each prediction of the decision trees. The sentiment orientation will be assigned to the category with the most votes. To evaluate the results, we can split the dataset into a training part to build the forest and a test part to calculate the error rate (al Amrani et al. 2018 ).

2.2.2.2 Multinomial Naïve Bayes

This model is based on the Naïve Bayes Theorem, which calculates the probability of multiple categories from many observations, and the category with the maximum probability is assigned to the text. Hence, the model can effectively solve the problem of text classification with multiple classes. The formula using Bayes Theorem to predict the category label based on text features (Kamble and Itkikar 2018 ) is as follows:

where p (label) represents the prior probability of label p , and (feature/label) is the prior probability of the features with a given classifying label. To implement this technique, firstly, we calculate the prior probability for known category labels. Then, we obtain the likelihood probability with each feature for different categories and calculate the posterior probability with the formulas of the Bayes theorem. Lastly, we select the category with the highest probability as the label of the input tweet.

2.2.2.3 Support vector classification (SVC)

The purpose of this model is to determine linear separators in the vector space and facilitate the separation of different categories of input vector data. After the hyperplane is obtained, the extracted text features can be put into the classifier to predict the results. Additionally, the core idea is to find a line closest to the support vectors. The steps in implementing SVC include calculating the distance between the nearest support vectors, which is also called the margin, maximizing the margin to obtain an optimal hyperplane between support vectors from given data, and using this hyperplane as a decision boundary to segregate the support vectors.

2.2.3 Hyperparameters optimization

Hyperparameters can be considered as the settings of machine learning models, and they need to be tuned for ensuring better performance of models. There are many approaches to hyperparameter tuning, including Grid Search, Random Search, and automated hyperparameter optimization. In this study, Grid Search and Random Search are considered. The result may not be the global optimal solution of a classification model, but it is the optimal hyperparameters within the range of these grid values.

In applying Grid Search, we build a hyperparameter values grid, train a model with each combination of hyperparameter values, and evaluate every position of the grid. For Random Search, we build a grid of hyperparameter values and then, train a model with combinations randomly selected, which means not all the values can be tried. For this paper, this latter approach is more feasible because although the results of the Grid Search optimization method might be more accurate, it is inefficient and costs more time when compared with the random search approach.

3 Data and methods

This paper focuses on tweets that were geotagged from the main UK cities during the third national Covid-19 lockdown. The cities are Greater London, Bristol, South Hampton, Birmingham, Manchester, Liverpool, Newcastle, Leeds, Sheffield, and Nottingham. Since the total number of tweets in each city is positively correlated with the urban population size and density, the number of tweets varies widely among these different cities. To collect more tweets to represent the perception of most people in England toward the Covid-19 pandemic, the selection criteria for major cities are based on the total population and density to improve the validity of the data (Jiang et al. 2016 ).

We divide the data collection time frame into three different stages of the third national lockdown in 2021. The timeline of the third national lockdown in England is from 6 January 2021 to 18 July 2021 as can be seen in Fig.  4 . During this period, we selected several critical time points for research and analysis in stages according to the plan of lifting the lockdown in England, and the duration of each stage is about two months. The different stages are Stage 1 on January 6 until March 7, 2021, when England enters the third national lockdown, Stage 2 on March 8 until May 16, 2021, when the government implemented steps 1 and step 2 of lifting the lockdowns and Stage 3 on May 17 until July 18, 2021, when the government implemented step 3 of lifting the lockdown and easing most Covid-19 restrictions in the UK.

figure 4

Detailed timeline of the third national lockdown in 2021

The tweets are extracted using Twint and Twitter Academic API, as these scraping tools can help facilitate the collection of tweets with geo-location, which helps in applying geographical analysis. However, users who are willing to disclose their geographic location when sending tweets only account for 1% of the total users (Sloan and Morgan 2015 ), and the location-sharing option is off by default. Therefore, the data collected by Twint and Twitter academic API are merged to obtain more tweets.

To filter the tweets related to Covid-19, we used keywords including “corona” or “covid” in the searching configuration of Twint or the query field of Twitter academic API, thus extracting the tweets and hashtags containing the search terms. In Twint, 1000 tweets can be fetched in each city per day, which avoids large bias in sentiment analysis due to uneven data distribution, but, in most cases, the number of tweets from a city for one day cannot reach this upper limit. Moreover, cities in the major cities list are used as a condition for filtering tweets from different geographic regions.

A total of 77,332 unique tweets were collected in three stages crawled from January 6 to July 18, 2021 (stage 1: 29,923; stage 2: 24,689; and stage 3: 22,720 tweets). The distribution of the number of tweets in each city is shown in Fig.  5 a. Most of the tweets originate from London, Manchester, Birmingham, and Liverpool, and there are far more tweets in London (37,678) than in other cities. The number of tweets obtained in some cities, such as Newcastle, is much lower than the number of tweets in London, with only 852 tweets collected in six months. Figure  5 shows the distribution of data at each stage with the first stage having the most data while the third stage has the least amount of data. Additionally, at each stage, London has the largest proportion of data, with Newcastle having the least, linear to the total population and density of the area.

figure 5

Distribution of collected tweets based on the selected cities and different stages

Since most raw tweets are unstructured and informal, which may affect the word polarity or text feature extraction, the data were pre-processed before sentiment analysis (Naseem et al. 2021 ). We implemented a basic data-cleaning process as follows:

Replacing upper-case letters to avoid recognizing the same word as different words because of capitalization.

Removing hashtags (#topic), mentioned usernames (@username), and all the links that start with “www,” “http,” and “https.” Removing stop words and short words (less than two characters). The stop words are mostly very common in the text but hardly contain any sentiment polarity. However, in sentiment analysis, “not” and “no” should not be listed as stop words, because removing these negations would change the real meaning of entire sentences.

Reducing repeated characters from some words. Some users will type repeated characters to express their strong emotions, so these words that are not in the lexicons should be converted into their corresponding correct words. For example: “sooooo goooood” becomes “so good.”

Expanding contractions in tweets such as “isn't” or “don't” as these will become meaningless letters or words after punctuations have been removed. Therefore, all contractions in the tweets are expanded into their formal forms, such as “isn’t” become “is not.”

Clearing all non-alphabetical characters or symbols including punctuation, numbers, and other special symbols that may affect the feature extraction of the text.

Removing duplicated or empty tweets and creating a clean dataset.

Converting emojis to their real meaning as many Twitter users use emojis in their tweets to express their sentiments and emotions. Hence, using the demojize() function in the emoji module of Python and transforming emojis into their true meaning may improve the accuracy of the sentiment analysis (Tao and Fang 2020 ).

In addition, for some sentiment analysis approaches, such as SentiWordNet-based analysis, further cleaning is essential, including stemming and POS Tagging.

In this study, strategies for text cleaning, polarity calculation, and sentiment classification model are designed and optimized using two different approaches to sentiment analysis: lexicon and machine-learning-based techniques. We then compared the results of the different methods and compare their output and prediction accuracy. The machine-learning-based approaches require labels with the tweets data, but the constraint is that it often takes too much time to manually annotate a large amount of data. Hence, 3000 tweets are randomly sampled in this paper, with the average number of tweets in each sentiment category of about 1000. To save the time spent on labeling, the classification results of the TextBlob or VADER method are used as the labels of the sample data (Naseem et al. 2021 ). We then manually check whether the classification of the VADER or TextBlob method is correct and modify it when necessary.

4 Results and discussion

4.1 lexicon-based approach.

From Fig.  6 , the results obtained by TextBlob and VADER tools are similar, showing that positive sentiments appear more than negative sentiments. However, the number of neutral sentiments from the VADER method is lower. This might be because the VADER lexicon can efficiently handle the type of language used by social media users such as by considering the use of slang, Internet buzzwords, and abbreviations. On the other hand, TextBlob works better with formal language usage. Moreover, the results from the analysis using the SentiWordNet show a high proportion of negative sentiments. This might be due to some of the social media expressions of positive emotions that are not comprehensively recorded in the dictionary. Additionally, due to its limited coverage of domain-specific words, some words may be assigned wrong scores, which would cause a large deviation in sentiment scores. Only the most common meaning of each word is considered in SentiWordNet-based calculation; therefore, some large bias might occur. Consequently, the results of the VADER method are more convincing in this experiment. According to the comparison of public sentiment toward “Covid-19” and the “Covid-19 vaccine,” the classification results of all three approaches show that more people have positive sentiments than negative, indicating that most people expect the vaccine to have a good impact on Covid-19.

figure 6

a Sentiment classification statistics, b vaccine sentiment statistics

After using the lexicon-based approaches with TextBlob, VADER, and SentiWordNet-based methods, the sentiment scores and their classification results were obtained for each tweet. In this study, the three sentiment categories of positive, negative, and neutral sentiment correspond to 1, − 1, and 0, respectively, and we filter out the tweets in each city with their corresponding sentiment values (positive: 1, negative: − 1; and neutral: 0). The proportion of positive and negative sentiments in each city at each stage was calculated to compare how the sentiments change and to examine the differences in people’s perception of Covid-19 between these different cities.

Figure  7 a indicates the results of using TextBlob in the three stages. In most cities in Fig.  7 a, the proportion of positive sentiments at each stage is between 38 and 50%. Southampton and Manchester show a steady decline, while Sheffield is the only city where the proportion of positive sentiments increased in all three stages. Considering the entire period, Newcastle has the largest proportion of positive emotions, peaking at the second stage (about 50%), and Southampton was the lowest. For negative sentiments, the trend of Sheffield was different from other cities, which rise first and then fall. In addition, for most cities, the proportion of negative sentiments in the second stage is the lowest, and the proportion of negative sentiments in most cities is between 20 and 30%.

figure 7

Results of the various lexicon-based approaches

The results of VADER shown in Fig.  7 b are similar to those of TextBlob. The proportion of positive sentiment in most cities is 40–50%, showing a trend of increasing first and then falling, except for Sheffield. Additionally, most of the negative sentiments account for between 30 and 40%. Moreover, the changes in the proportion of positive emotions in Manchester and Leeds are relatively flat, and the proportion of negative sentiments in Manchester also changes smoothly. However, Nottingham has a large change in positive sentiments at each stage, with a difference of about 6% between the highest and lowest values, and Newcastle has a wide range of negative sentiments proportion.

Based on the results of the SentiWordNet-based approach shown in Fig.  7 c, the proportion of negative sentiments in each city is higher when compared with the previous two methods. Most of the negative sentiments are in the range of 40–50%, while the proportion of positive emotions is mostly between 36 and 46%. In terms of the trend of change, the percentage of Birmingham’s positive sentiment is declining, while the percentage of Liverpool’s positive sentiments trend is the opposite of other cities, which decreased first and then, increased.

Overall, according to the results of the three approaches, for most cities, the proportion of positive sentiments first rises and then, decreases. This is in contrast with the proportion of negative sentiments that decline from the first stage to the second stage and then, start to increase. The number of Covid-19 deaths and confirmed cases could be an indicator that can quantify the severity of the pandemic. Meanwhile, the increase in the number of people vaccinated with the Covid-19 vaccine can reduce the speed of the virus spreading among the population, thereby reducing the impact of the pandemic on people’s lives.

Figure  8 shows the changes in the number of deaths and confirmed cases, and the number of new vaccines given. It shows that after peaking at the beginning of the third national lockdown, the number of deaths began to decline and became stable after April 2021. In addition, the number of newly confirmed cases in 2021 shows a downward trend from January to May but has increased significantly since June. Moreover, from the perspective of vaccination, the peak period of vaccination in 2021 is mainly in April and May, while after June, the vaccination volume drops greatly. Furthermore, combined with the previous results of sentiment analysis, from the first stage to the second stage, the positive sentiment proportion increases in most cities. This might be related to the improved situation of the Covid-19 pandemic as well as the increased number of vaccinations. However, there is a drop in positive sentiments from stage two to stage three, and the negative proportion increases. This might be due to the overall sentiment toward the vaccine’s protection rate and a large amount of new confirmed cases at the time. Overall, it might be that the public feels that the third lockdown policy and vaccination have not achieved the expected effect on the control of Covid-19 in England; hence, the number of negative sentiments has an upward trend after the second stage. More analysis is needed to explain the change in the sentiment trends more accurately.

figure 8

Trend of deaths, confirmed cases, and vaccines

4.2 Machine-learning-based approach

In this paper, supervised learning approaches also need to be considered because unsupervised lexicon-based approaches cannot quantitatively analyze the results of sentiment classification. This part shows the classification performance of the three models (the proportion of the train dataset compared with the test dataset is 8:2) under different feature representation models (BoW, TF–IDF, and Word2Vec) and the optimization training on the models.

4.2.1 The hyperparameters of classification models

Each classification model needs to extract the text features of tweets and vectorize them before training, and the feature vectors of different forms may show different performances in the same classification model. Therefore, before the training of feature vectors, RandomizedSearchCV() is used to optimize the hyperparameters in the classifier. In the optimization process, the hyperparameters that are expected to be optimized can be selected with various options, and the result would be the optimal solution for the hyperparameters grid. Table 2 (a) presents the optimal parameters of the random forest classifier, and Table 2 (b) shows the optimal hyperparameters of the Multinomial Naive Bayes (MNB) classifier and the Support Vector Machine (SVC) classifier.

4.2.2 The evaluation results of classifiers

These models classify all tweets into three categories, which are negative, positive, and neutral. The following Table 3 shows their performance with different feature representations.

In this paper, Accuracy, Precision, and Recall are selected as evaluation indicators, measuring the performance of each classification model. Before calculating them, the values of the confusion matrix need to be known, and they are TP (True Positive), TN (True Negative), FP (False Positive), and FN (False Negative). Accuracy shows the proportion of the number of correct observations to the total observations using the formula below:

Precision is the proportion of positive observations that correctly estimates the total number of positive predictions using the formula:

Recall refers to the proportion of actual positive observations that are identified correctly calculated using:

The F1 Score is a comprehensive evaluation and balance of precision and recall values, which can be calculated as follows:

According to the classification results of the three models, the performance of these classifiers for tweets with negative labels is poor, especially for the Random Forest Classifier, which has a low ability to recognize negative tweets, though the prediction precision is high. The reason for this may be that the labels are annotated manually, and unsupervised learning methods are different from the real sentiment expression of tweets. For the overall prediction, the SVC model has the best prediction ability with an accuracy of 0.71. Additionally, the F1 values of each label show that the SVC model has a good ability to classify the three categories of sentiments.

The accuracy of the three models is relatively high with the TF–IDF method, all above 60%. However, similar to the experimental results using the BoW feature representation, in Random Forest Classifier, the recall value of the negative category is very low, indicating that there are many negative tweets in the test dataset that have not been identified. This may be caused by the imbalanced distribution of data in each category, or the category contains some wrong data that would affect the training results. Moreover, these three models have the best predictive effect on the positive category, with an F1 score above 0.7. In summary, the performance of the SVC model is the best and the accuracy is higher than 70% in our study.

The prediction results of the three classifiers with Word2Vec are not as good as the previous two feature representation models, especially for the identification of negative sentiments. The reasons for the poor performance are that the Word2Vec embedding method needs to group semantically similar words, which requires a large amount of data, and it is difficult to extract sufficient text feature vectors from a small dataset. Moreover, compared with the Multinomial Naïve Bayes classifier, the SVC model and Random Forest classifier have better prediction performance, and their values of accuracy are 0.56 and 0.53, respectively.

5 Conclusion

In conclusion, this paper extracts data regarding Covid-19 from people in the main cities of England on Twitter and separates it into three different stages. First, we perform data cleaning and use unsupervised lexicon-based approaches to classify the sentiment orientations of the tweets at each stage. Then, we apply the supervised machine learning approaches using a sample of annotated data to train the Random Forest classifier, Multinomial Naïve Bayes classifier, and SVC, respectively. From lexicon-based approaches, the three stages of public sentiment changes about the Covid-19 pandemic can be found. For most cities, the proportion of positive sentiments increases first and then drops, while the proportion of negative sentiments changed in a different direction. In addition, by analyzing the number of deaths and confirmed cases as well as vaccination situations, it could be concluded that the increase in confirmed cases and the decrease in vaccination volume might be the reason for the increase in negative sentiments, even though further research is needed to confirm this inference.

For supervised machine learning classifiers, the Random Search method is applied to optimize the hyperparameters of each model. The SVC results using BoW and TF–IDF feature models have the best performance, and their classification accuracy is as high as 71%. Due to the insufficiency of training data, the prediction accuracy of classifiers with the Word2Vec embedding method is low. Consequently, applying machine learning approaches to sentiment analysis can accurately extract text features without being restricted by lexicons.

It is important to note that this paper only collects the opinions of people in England on Twitter about Covid-19; thus, the result should be interpreted by considering this limitation. To obtain a more convincing conclusion, we can increase the data size by incorporating longer timeline, wider geographies, or by collecting data via other social media platforms while also considering the data protection policy. In addition, large-scale manually annotated datasets can be created for training machine learning models to improve their classification ability. Moreover, deep learning approaches can be used for model training, and this can be compared with different machine learning models. Furthermore, the Random Search method can only find the optimal parameters within a certain range, so exploring how to select model hyperparameters efficiently can further improve the stability of machine learning models. However, despite all the limitations, this study has provided contributions in advancing our understanding of the use of various NLP methods.

For lexicon-based approaches, the existing lexicon is modified to better fit the language habits of modern social media, improving the accuracy of this approach. Additionally, an annotated dataset can be created to compare the difference between predicted results and real results. Research on Covid-19 can be based on time series so that the changes in people’s attitudes and perceptions can be analyzed over some time. Moreover, further studies can combine the sentiment classification results with other factors such as deaths and vaccination rates and establish a regression model to analyze which factors contribute to the sentiment changes. Overall, the paper has showcased different methods of conducting sentiment analysis with SVC using BoW or TF–IDF outperformed the model accuracy overall.

6 The codes of the project

The main codes of this project have uploaded to GitHub, and here is the link: https://github.com/Yuxing-Qi/Sentiment-analysis-using-Twitter-data .

Adwan OY, Al-Tawil M, Huneiti AM, Shahin RA, Abu Zayed AA, Al-Dibsi RH (2020) Twitter sentiment analysis approaches: a survey. Int J Emerg Technol Learn. https://doi.org/10.3991/ijet.v15i15.14467

Article   Google Scholar  

al Amrani Y, Lazaar M, el Kadirp KE (2018) Random forest and support vector machine based hybrid approach to sentiment analysis. Proc Comput Sci. https://doi.org/10.1016/j.procs.2018.01.150

Alamoodi AH, Zaidan BB, Zaidan AA, Albahri OS, Mohammed KI, Malik RQ, Almahdi EM, Chyad MA, Tareq Z, Albahri AS, Hameed H, Alaa M (2021) Sentiment analysis and its applications in fighting COVID-19 and infectious diseases: a systematic review. Expert Syst Appl. https://doi.org/10.1016/j.eswa.2020.114155

Aqlan AAQ, Manjula B, Lakshman Naik R (2019) A study of sentiment analysis: Concepts, techniques, and challenges. In Lecture notes on data engineering and communications technologies, vol 28. https://doi.org/10.1007/978-981-13-6459-4_16

Arun K, Srinagesh A (2020a) Multi-lingual Twitter sentiment analysis using machine learning. Int J Electr Comput Eng. https://doi.org/10.11591/ijece.v10i6.pp5992-6000

Arun K, Srinagesh A (2020b) Multi-lingual Twitter sentiment analysis using machine learning. Int J Electr Comput Eng. https://doi.org/10.11591/ijece.v10i6.pp5992-6000

Baccianella S, Esuli A, Sebastiani F (2010) SENTIWORDNET 3.0: an enhanced lexical resource for sentiment analysis and opinion mining. In: Proceedings of the 7th international conference on language resources and evaluation, LREC 2010

Barbosa L, Feng J (2010) Robust sentiment detection on twitter from biased and noisy data. In: Coling 2010—23rd international conference on computational linguistics, proceedings of the conference, 2

Bonta V, Kumaresh N, Janardhan N (2019) A comprehensive study on Lexicon based approaches for sentiment analysis. Asian J Comput Sci Technol 8(S2):1–6. https://doi.org/10.51983/ajcst-2019.8.s2.2037

Boon-Itt S, Skunkan Y (2020) Public perception of the COVID-19 pandemic on Twitter: sentiment analysis and topic modeling study. JMIR Public Health and Surveillance, 6(4), e21978. https://doi.org/10.2196/21978

Breiman L (2001) Random forests. Mach Learn. https://doi.org/10.1023/A:1010933404324

Cambria E (2016) Affective computing and sentiment analysis. IEEE Intell Syst. https://doi.org/10.1109/MIS.2016.31

D’Andrea A, Ferri F, Grifoni P, Guzzo T (2015) Approaches, tools and applications for sentiment analysis implementation. Int J Comput Appl. https://doi.org/10.5120/ijca2015905866

Dashtipour K, Poria S, Hussain A, Cambria E, Hawalah AYA, Gelbukh A, Zhou Q (2016) Multilingual sentiment analysis: state of the art and independent comparison of techniques. Cogn Comput. https://doi.org/10.1007/s12559-016-9415-7

Guerini M, Gatti L, Turchi M (2013) Sentiment analysis: how to derive prior polarities from SentiWordNet. In: EMNLP 2013—2013 conference on empirical methods in natural language processing, proceedings of the conference

Hutto CJ, Gilbert E (2014) VADER: a parsimonious rule-based model for sentiment analysis of social media text. In: Proceedings of the 8th international conference on weblogs and social media, ICWSM 2014. https://doi.org/10.1609/icwsm.v8i1.14550

Jiang B, Ma D, Yin J, Sandberg M (2016) Spatial distribution of city Tweets and their densities. Geogr Anal. https://doi.org/10.1111/gean.12096

Kamble SS, Itkikar PAR (2018) Study of supervised machine learning approaches for sentiment analysis. Int Res J Eng Technol (IRJET) 05(04)

Kim Y (2014) Convolutional neural networks for sentence classification. In: EMNLP 2014—2014 conference on empirical methods in natural language processing, proceedings of the conference. https://doi.org/10.3115/v1/d14-1181

Lo SL, Cambria E, Chiong R, Cornforth D (2017) Multilingual sentiment analysis: from formal to informal and scarce resource languages. Artif Intell Rev. https://doi.org/10.1007/s10462-016-9508-4

Mostafa L (2021) Egyptian student sentiment analysis using Word2vec during the coronavirus (Covid-19) pandemic. In Proceedings of the International Conference on Advanced Intelligent Systems and Informatics 2020 (pp. 195-203). Springer International Publishing. https://doi.org/10.1007/978-3-030-58669-0_18

Naseem U, Razzak I, Khushi M, Eklund PW, Kim J (2021) COVIDSenti: a large-scale benchmark Twitter data Set for COVID-19 sentiment analysis. IEEE Trans Comput Soc Syst. https://doi.org/10.1109/TCSS.2021.3051189

Oyebode O, Orji R (2019) Social media and sentiment analysis: the Nigeria presidential election 2019. In: 2019 IEEE 10th annual information technology, electronics and mobile communication conference, IEMCON 2019. https://doi.org/10.1109/IEMCON.2019.8936139

Ray P, Chakrabarti A (2022) A mixed approach of deep learning method and rule-based method to improve aspect level sentiment analysis. Appl Comput Inform. https://doi.org/10.1016/j.aci.2019.02.002

Saleh SN, Lehmann CU, McDonald SA, Basit MA, Medford RJ (2021) Understanding public perception of coronavirus disease 2019 (COVID-19) social distancing on Twitter. Infect Control Hosp Epidemiol 42(2):131–138. https://doi.org/10.1017/ice.2020.406

Sarker MK, Zhou L, Eberhart A, Hitzler P (2021) Neuro-symbolic artificial intelligence. AI Commun. https://doi.org/10.3233/AIC-210084

Article   MathSciNet   Google Scholar  

Sloan L, Morgan J (2015) Who tweets with their location? Understanding the relationship between demographic characteristics and the use of geoservices and geotagging on twitter. PLoS ONE. https://doi.org/10.1371/journal.pone.0142209

Soleymani M, Garcia D, Jou B, Schuller B, Chang SF, Pantic M (2017) A survey of multimodal sentiment analysis. Image vis Comput. https://doi.org/10.1016/j.imavis.2017.08.003

Tao J, Fang X (2020) Toward multi-label sentiment analysis: a transfer learning based approach. J Big Data. https://doi.org/10.1186/s40537-019-0278-0

Usop ES, Isnanto RR, Kusumaningrum R (2017) Part of speech features for sentiment classification based on Latent Dirichlet allocation. In: Proceedings—2017 4th international conference on information technology, computer, and electrical engineering, ICITACEE 2017, 2018-January. https://doi.org/10.1109/ICITACEE.2017.8257670

Wang Z, Ho SB, Cambria E (2020) Multi-level fine-scaled sentiment sensing with ambivalence handling. Int J Uncertain Fuzziness Knowl-Based Syst. https://doi.org/10.1142/S0218488520500294

Wang Z, Joo V, Tong C, Chan D (2015) Issues of social data analytics with a new method for sentiment analysis of social media data. In: Proceedings of the international conference on cloud computing technology and science, CloudCom, 2015-February(February). https://doi.org/10.1109/CloudCom.2014.40

Yang B, Shao B, Wu L, Lin X (2022) Multimodal sentiment analysis with unidirectional modality translation. Neurocomputing. https://doi.org/10.1016/j.neucom.2021.09.041

Zahoor S, Rohilla R (2020) Twitter sentiment analysis using lexical or rule based approach: a case study. In: ICRITO 2020—IEEE 8th international conference on reliability, Infocom technologies and optimization (trends and future directions). https://doi.org/10.1109/ICRITO48877.2020.9197910

Zhang Y, Rong L, Song D, Zhang P (2020) A survey on multimodal sentiment analysis. In Moshi Shibie yu Rengong Zhineng/pattern recognition and artificial intelligence, vol 33, issue 5. https://doi.org/10.16451/j.cnki.issn1003-6059.202005005

Download references

Author information

Authors and affiliations.

Centre for Urban Science and Progress, King’s College London, London, UK

Department of Geography, King’s College, London, UK

Zahratu Shabrina

Regional Innovation, Graduate School, Universitas Padjadjaran, Bandung, Indonesia

You can also search for this author in PubMed   Google Scholar

Contributions

Z.S. and Y.Q. conceived the presented idea. Y.Q. conducted the data gathering, analysis, and drafted the main manuscript. Z.S. wrote and edited the final version of the manuscript and supervised the project. All authors provided critical feedback and helped shape the research, analysis, and manuscript.

Corresponding author

Correspondence to Zahratu Shabrina .

Ethics declarations

Competing interests.

The authors declare no competing interests.

Additional information

Publisher's note.

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ .

Reprints and permissions

About this article

Qi, Y., Shabrina, Z. Sentiment analysis using Twitter data: a comparative application of lexicon- and machine-learning-based approach. Soc. Netw. Anal. Min. 13 , 31 (2023). https://doi.org/10.1007/s13278-023-01030-x

Download citation

Received : 01 June 2022

Revised : 16 January 2023

Accepted : 20 January 2023

Published : 09 February 2023

DOI : https://doi.org/10.1007/s13278-023-01030-x

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

  • Find a journal
  • Publish with us
  • Track your research

Sentiment Analysis of Twitter Data Using Machine Learning

Ieee account.

  • Change Username/Password
  • Update Address

Purchase Details

  • Payment Options
  • Order History
  • View Purchased Documents

Profile Information

  • Communications Preferences
  • Profession and Education
  • Technical Interests
  • US & Canada: +1 800 678 4333
  • Worldwide: +1 732 981 0060
  • Contact & Support
  • About IEEE Xplore
  • Accessibility
  • Terms of Use
  • Nondiscrimination Policy
  • Privacy & Opting Out of Cookies

A not-for-profit organization, IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity. © Copyright 2024 IEEE - All rights reserved. Use of this web site signifies your agreement to the terms and conditions.

U.S. flag

An official website of the United States government

The .gov means it’s official. Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

The site is secure. The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

  • Publications
  • Account settings

Preview improvements coming to the PMC website in October 2024. Learn More or Try it out now .

  • Advanced Search
  • Journal List
  • Springer Nature - PMC COVID-19 Collection

Logo of phenaturepg

A reliable sentiment analysis for classification of tweets in social networks

Masoud aminimotlagh.

1 School of Electrical Engineering, Iran University of Science and Technology, Tehran, Iran

HadiShahriar Shahhoseini

Nina fatehi.

2 Department of Electrical and Computer Engineering, Wayne State University, Detroit, USA

In modern society, the use of social networks is more than ever and they have become the most popular medium for daily communications. Twitter is a social network where users are able to share their daily emotions and opinions with tweets. Sentiment analysis is a method to identify these emotions and determine whether a text is positive, negative, or neutral. In this article, we apply four widely used data mining classifiers, namely K-nearest neighbor, decision tree, support vector machine, and naive Bayes, to analyze the sentiment of the tweets. The analysis is performed on two datasets: first, a dataset with two classes (positive and negative) and then a three-class dataset (positive, negative and neutral). Furthermore, we utilize two ensemble methods to decrease variance and bias of the learning algorithms and subsequently increase the reliability. Also, we have divided the dataset into two parts: training set and testing set with different percentages of data to show the best train–test split ratio. Our results show that support vector machine demonstrates better outcomes compared to other algorithms, showing an improvement of 3.53% on dataset with two-class data and 7.41% on dataset with three-class data in accuracy rate compared to other algorithms. The experiments show that the accuracy of single classifiers slightly outperforms that of ensemble methods; however, they propose more reliable learning models. Results also demonstrate that using 50% of the dataset as training data has almost the same results as 70%, while using tenfold cross-validation can reach better results.

Introduction

Social networks (SNs) are becoming increasingly popular platforms among people all across the world, and nowadays they are utilized even more than ever. With the growth of SNs like Twitter and increasing their popularity, people share more personal emotions and opinions about various issues in such networks. This rapid growth of SNs, combined with the accessibility of a large amount of data on a multitude of topics, provides a great research potential for a wide range of applications, such as customer analysis, product analysis, sector analysis and digital marketing (Bhatnagar and Choubey 2021 ; Fatehi, et al. 2022 ). In addition, identifying users' polarities and mining their opinions shared in various areas, especially SNs, have become one of the most popular and useful research fields. Social media platforms are able to build rich profiles from the online presence of users by tracking activities such as participation, messaging, and Web site visits (Cui, et al. 2020 ). By an increased growth in the number of users in the SNs and subsequently exponential rise in the interactions between them, large volumes of user-generated content are produced. It is difficult to analyze all these data since most of the social media data are unstructured and dynamic data which frequently alters. Social network analysis provides innovative techniques to analyze interactions among entities by emphasizing on social relationships (Kumar and Sinha 2021 ). Nowadays, analyzing SNs with data mining and machine learning algorithms has become a must-have strategy for obtaining useful data. Data mining is the process of extracting and identifying useful patterns and relationships from piles of data sets that may lead to the extraction of new information by using data analysis tools (Keyvanpour, et al. 2020 ).

Among different SNs, twitter is one of the most studied SNs for social networks' research. Twitter is a SN that enables users to share their daily emotions and opinions. It is considered a convenient platform for users to share personal messages, pictures, and videos. One of the main advantages of platforms like twitter is that users are organized in these platforms, making this possible to investigate groups of people or communities who are united by common interests, rather than individual profiles. Furthermore, this is possible through extensive use of hashtags, mentions, and retweets that form a complex network, which can provide us with a rich source of data to analysis. Twitter is known to be a novel source of data for those studying attitudes, beliefs, and behaviors of consumers and opinion makers (Islam, et al. 2020 ; Kwak and Grable 2021 ).

Among all various forms of communications, text messages are considered one of the most conspicuous forms, since users can express their opinions and emotions on various and diverse topics using text. Text mining is the process of exploring and transforming unstructured text data into structured data to find meaningful insights. It is defined as a multi-purpose research method to study a wide range of issues by systematically and objectively identifying characteristics of large sample data. Text mining is a sub-field of data mining and an extension of classical data mining methods, which can be applied when making sophisticated formulations using text classification and clustering procedures (Yang, et al. 2021 ). Hossny, et al. 2020 listed the key challenges for analyzing the text on Twitter including the tweet’s length, frequent use of abbreviations, misspelled words and acronyms, transliterating non-English words using Roman scripts, ambiguous semantics and synonyms.

Information in several social media platforms, like blogs, reviewing SNs, and Twitter, is being processed for extracting people’s opinions about a particular product, organization, or situation. The attitude and feelings comprise an essential part in evaluating the behavior of an individual that is known as sentiments. These sentiments can further be analyzed using a field of study, known as sentiment analysis (SA) (Singh, et al. 2021 ). SA belongs to the area of natural language processing (NLP) (Chen, et al. 2020 ) and it has been an active research topic in NLP, which is a cognitive computing study of people’s opinions, sentiments, emotions, appraisals, and attitudes toward entities such as products, services, organizations, individuals, issues, events, topics, and their attributes (Dai, et al. 2021 ). Also, it aims to analyze and extract knowledge from the subjective information published on the Internet (Basiri, et al. 2021 ). Sentiment analysis of user-generated data is very useful to know the opinion of the crowd. Two main approaches for sentiment analysis of text documents are described in the literature, specifically approaches based on machine learning and approaches based on symbolic techniques. Symbolic techniques use lexicons and other linguistic resources to determine the sentiment of a given text. Some research has used machine learning for classifying the sentiment of a given text, sometimes following the approach of most symbolic techniques and seeking to identify positive, negative and neutral categories, but sometimes also considering other sentiment categories such as anger, joy and sadness (Moutidis and Williams 2020 ).

The SA plays significant role in many domain by extracting the people’s emotions which then assist business industry to be developed accordingly. In this study, we investigate the performance of different ML models to analyze the sentiment of two real datasets.

So, the contributions in this paper are summarized as follows:

  • We generate and preprocess two real datasets extracted with Twitter Application Programming Interface (API)—binomial and polynomial—to investigate the sentiment analysis. Binomial dataset incorporating two polarities of positive and negative which is the typical dataset used in the literature, polynomial dataset, however, includes three positive, negative, and neutral polarities.
  • We investigate the performance of sentiment classification in terms of accuracy /AUC and accuracy/kappa for four classifiers on both binomial and polynomial datasets, respectively.
  • To increase the reliability of SA and reduce variance and bias of learning models, we apply ensemble methods on both the binomial and polynomial datasets and then report the accuracy values for these methods.
  • To find out the best train–test split ratio in addition to K-fold cross-validation, we divide the dataset into two parts: training set and testing set with different percentages of data.

The rest of this paper is structured as follows: Sect.  2 reviews some of the related works in the literature. A description of the methodology that includes data collection, preprocessing for sentiment analysis, sentiment detection, and classification modelling is presented in Sect.  3 . The results are presented and discussed in Sect.  4 , and eventually, the conclusion is detailed in Sect.  5 .

Related work

Researchers in the field of sentiment analysis have been mostly used supervised machine learning algorithm for primary classification, such as the work done by Chauhan et al. ( 2020 ). Furthermore, many of the recent studies use Twitter as the primary source of data (Al-Laith, et al. ( 2021 ), Yadav, et al. ( 2021 )).

Henríquez and Ruz ( 2018 ) used a non-iterative deep random vectorial functional link called D-RVFL. They analyzed two different datasets. Dataset 1 contains a collection of 10,000 tweets from the Catalan referendum of 2017 and dataset 2 contains a collection of 2187 tweets from the Chilean earthquake of 2010. They consider the datasets as a two-class classification problem with the labels of positive and negative. By the use of D-RVFL, results show the best performance compared to SVM, random forest, and RVFL.

Ankit and Saleena ( 2018 ) proposed an ensemble classification system formed by different learners, such as naive Bayes, random forest, SVMs, and logistic regression classifiers. Their system employs two algorithms: the first algorithm calculates a positive and a negative score for the tweet, and the second algorithm utilizes these scores to predict the sentiment of that tweet. Furthermore, the dataset consists of 43,532 negative and 56,457 positive tweets.

Symeonidis et al. ( 2018 ) evaluated the preprocessing techniques on their resulting classification accuracy and the number of features they produce. However, this paper worked on lemmatization, removing numbers, and replacing contractions techniques, while the detection accuracy is low. For this task, they used four classification algorithms named logistic regression, Bernoulli Naive Bayes, linear SVC, and convolutional neural networks on two datasets with the classes of positive, negative, and neutral.

Sailunaz and Alhajj ( 2019 ), used a dataset to detect sentiment and emotion from tweets and their replies and measured the influence scores of users based on various user-based and tweet-based parameters. The dataset also includes replies to tweets, and the paper introduces agreement score, sentiment score and emotion score of replies in influence score calculation.

Ruz, et al. ( 2020 ), reviewed five classifiers and assessed their performances on two Twitter datasets of two different critical events. Their datasets were Spanish, and they concluded that there is no difference between the behavior of support vector machine (SVM) and random forest in English and Spanish. In order to automatically control the number of edges supported by the training examples in the Bayesian network classifier, they adopt a Bayes factor approach, yielding more realistic networks.

Wang et al. ( 2021 ) proposed a system for general population sentiment monitoring from a social media stream (Twitter), through comprehensive multilevel filters, and improved latent Dirichlet allocation (LDA) method for sentiment classification. They reached an accuracy of 68% for general sentiment analysis using real-world content. Also, they used a dataset with three categories (positive, negative, and neutral) and a dataset with four categories (positive, negative, neutral and junk).

Ali et al. ( 2021 ) utilized the bilingual (English and Urdu) data from Twitter and NEWS websites to do the sentiment and emotional classification using machine learning and deep learning models. Kaur and Sharma ( 2020 ) used API to collect beneficial-related corona virus tweets and then categorized them in three groups (positive, negative, and neutral) to investigate the feeling of people about the COVID-19 pandemic. Nuser et al. ( 2022 ) proposed an unsupervised learning framework based on serial ensemble of some hierarchical clustering methods for sentiment analysis on a binomial dataset collected from Twitter.

Machuca et al. ( 2021 ) used English COVID-19 pandemic tweets to do the sentiment analysis using a logistic regression algorithm on a binomial dataset including positive and negative labels.

In Table ​ Table1, 1 , we present a review of the state-of-the-art and their reported accuracy for the sentiment classification with data structures of binomial (positive and negative) and polynomial (positive, negative, and neutral).

Comparison of sentiment analisys approches

Methodology

This section introduces our research framework in four phases: data collection, preprocessing, sentiment detection, and classification modeling (Fig.  1 ).

An external file that holds a picture, illustration, etc.
Object name is 13278_2022_998_Fig1_HTML.jpg

Overview of proposed sentiment classification workflow

Data collection

Twitter is among the most popular social networking platforms nowadays. It provides its users with a platform to share their daily lives with other users and express their opinions about different national, international issues from various perspectives. Every user can write a short text called tweet with a maximum length of 140 characters. These opinions and comments can be used to raise public awareness to help the government and enterprises understand the views of the public. Twitter also can be used to predict event trends. Therefore, tweets are an important resource to study public awareness.

Researchers and practitioners can access Twitter data using Twitter API. Search and streaming APIs allow them to collect Twitter data using different types of queries, including keywords and user profiles, which has offered them opportunities to access the data needed to analyze challenging problems in diverse domains. Thus, many researchers and practitioners have begun to focus on Twitter data mining to obtain more research value and business value from this research (Li et al. 2019 ).

For our experiments, in order to collect tweets, we selected a few recent events and issues; search keywords about corona virus like #covid-19, #coronavirus. For our experiments, in order to collect tweets, we selected a few recent events and issues; search keywords about corona virus like #covid-19, #coronavirus, #covid19vaccine, etc. A total of 14,000 tweets were extracted using Twitter API. 6980 of which were written in English; therefore, we picked these tweets. These tweets were sentences; consequently, we had to preprocess these sentences and convert them to a set of words. Then, these words were classified to be understood by the classifier. In the following sections, we elaborate the mentioned procedure.

Preprocessing

Tweets are sometimes not in a usable format, for instances they include characters, symbols or emoticons. Therefore, we need to format them in an appropriate usable form to be able to extract meaningful opinions from them. As a first step in preprocessing, most (if not all) studies apply tokenization. Tokenization is a task for separating the full text string into a list of separate words. Tokenization is defined as a kind of lexical analysis that breaks a stream of text up into words, phrases, symbols, or other meaningful elements called tokens. At its core, the process of tokenization is a standard method for further natural language processing (NLP) transformation in preprocessing (Symeonidis, et al. 2018 ). For the preprocessing steps, various methods have been proposed and can be applied for data cleaning. Following are the steps in the data preprocessing that we used in this article:

  • All non-English tweets are eliminated.
  • User names preceded by ‘@’ and external links are omitted.
  • All hashtags (only the # symbol) are removed.
  • Stop-words or useless words are removed from the tweet.
  • All emoticons were removed (i.e.,:-),:-( etc.).

All the tweets were converted to lower case to make the dataset uniform.

Each tweet should be labeled with sentiment with three possible values: negative, neutral, or positive. The first step to label the tweets is to apply unsupervised methods due to the large dataset we have. For this purpose, we used the TextBlob library in the python programming language to label tweets. This library assigns each tweet a number between − 1 and + 1 (-1 is the most negative and + 1 is the most positive value). Then, we double-checked the labels manually. Tweets between [− 1, − 0.1], [− 0.1, + 0.1] and [+ 0.1, + 1] were labeled negative, neutral, and positive, respectively. Figure  2 illustrates the results from the sentiment analysis. Also, the number of tweets in each class is shown in Table ​ Table2. 2 . We have a total of 6980 tweets: 977 of which are negative, 3689 of which are neutral and positive tweets are 2314.

An external file that holds a picture, illustration, etc.
Object name is 13278_2022_998_Fig2_HTML.jpg

Sentiment proportion of dataset

Dataset structure

Classification modelling

For our experiment and in order to make a comparative analysis, we employed four classifiers, which are the most widely used classifiers for sentiment analysis, namely (1) K-nearest neighbor (KNN), (2) decision tree (DT), (3) support vector machine (SVM), (4) Naive Bayes (NB), and also two ensemble methods including voting and bagging.

K-nearest neighbor

The logic behind KNN classification is that we expect a test sample X to have the same label as the training sample located in the local region surrounding X denoting by K. Training a KNN classifier simply consists of determining K. KNN simply memorizes all samples in the training set and then compares the test sample with them.

Decision tree

The decision tree is a particularly efficient method of producing classifiers from data. It is a tree-like collection of nodes intended to create a decision on values affiliation to a class or an estimate of a numerical target value. Each node represents a splitting rule for one specific attribute. For classification, this rule separates values belonging to different classes. The building of new nodes is repeated until the stopping criteria are met. A prediction for the class label attribute is determined depending on the majority of examples which reached this leaf during generation.

Support vector machine

An SVM is a supervised learning algorithm creating learning functions from a set of labeled training data. Support vector machine solves the traditional text categorization problem effectively. The main principle of SVMs is to determine a linear separator that separates different classes in the search space with a maximum distance. SVM’s classification function is based on the concept of decision planes that define decision boundaries between classes of samples. The main idea is that the decision boundary should be as far away as possible from the data points of both classes. There is only one that maximizes the margin.

Naive Bayes

The naive Bayesian method is one of the most widely used methods for text data classification. The naive Bayesian is a simple probabilistic classifier that uses the concept of mixture models to perform classification. The mixture model relies on the assumption that each of the predefined classes is one of the components of the mixture itself. The components of the mixture model denote the probability of belongingness of any term to the particular component. Naive Bayes classifier uses the concept of Bayes theorem and finds the maximum prospect of the probability of any word fitting to a particular given or predefined class. This algorithm assumes that the elements in the dataset are independent from each other and their occurrences in different datasets indicate their relevance to certain data attributes (Desai and Mehta 2016 ). This method is a high-bias, low-variance classifier, and it can build a good model even with a small data set. Typical use cases involve text categorization, including spam detection, sentiment analysis, and recommender systems.

Ensemble methods

Ensemble methods are learning algorithms which by try to improve the predicted performance by employing a set of learning algorithms. They reduce bias and variance of the model and so are more reliable compared to the single classifier (Dietterich 2000 ). The voting method can be used with different combination sets of the classifiers; therefore, we applied the voting method with the combination set of all classifiers to get the maximum value for accuracy. We also used the bagging method with DT (generally this amalgamation has shown a better performance) and bagging with SVM, KNN, and NB.

Evaluation metric

TP, TN, FP, and FN are the number of true positive, true negative, false positive, and false negative.

The area under the curve (AUC) is the measure of the ability of a classifier to distinguish between classes and is used as a summary of the receiver operator characteristic (ROC) curve. The higher the AUC, the better the performance of the model at distinguishing between the positive and negative classes.

Kappa is a metric that provides a comparison between observed accuracy and expected accuracy.

To start the classification, we divided the dataset into a training set and a testing set with different percentages of data. Common ratios used are 70% or 60% of the dataset for training and 30% or 40% for testing. In our experiment, we used different train–test split percentage, which are 10% to 70%. Continuing the classification, we also used K-fold cross-validation (K-FCV) with K  = 10 to generate the training set and the testing set and compare the results with above-mentioned split ratios.

In this paper, first, the above-mentioned classifiers were applied to a dataset with just negative and positive tweets (binomial), and then, the classifiers were applied to a dataset including negative, positive, and neutral tweets (polynomial).

Result analysis

This section gives an overview of the accuracy rates of different trained classifiers. All the calculations are done in the RapidMiner Studio application.

Table ​ Table3 3 shows the predicted accuracy of all classifiers when the tweets are binomial. Our results in Table ​ Table3 3 demonstrate that K-FCV with k  = 10 has the highest accuracy rate, except DT, besides the accuracy when we use the train–test split procedure. SVM with 86.42% in single methods and voting with 86.75% in ensemble methods has the best accuracy rates. In Table ​ Table4, 4 , we can see the differences between the accuracy rates. In most algorithms, there is some decrease in accuracy rate when we used 60% of the dataset for training data. Also, this decrease can be seen when 40% of the dataset is used for training in some methods. Furthermore, in all methods when the ratio is 20%, there is the most increase in accuracy rate in comparison with the ratio of 10%. NB algorithm with + 9.15% and bagging with NB with + 9.62% have the most variation in accuracy rate from 10 to 70% train–test split percentages of the dataset.

Sentiment accuracy comparison on binomial dataset

Sentiment accuracy differences on binomial dataset

Table ​ Table5 5 shows the predicted AUC for binomial dataset. SVM and bagging with SVM have the best values. We can also see that the 10-FCV has better results than the split procedure. From Table ​ Table6, 6 , the results show that there is some reduction when we use 60% of the dataset for training data than 50%. An increase in AUC from 10 to 20% of the dataset is more than other ratios.

Sentiment AUC comparison on binomial dataset

Sentiment AUC differences on binomial dataset

The classification continued with the polynomial dataset. So we applied classifiers to the dataset with three categories including positive, negative, and neutral tweets. Tables ​ Tables7, 7 , ​ ,8, 8 , ​ ,9, 9 , ​ ,10 10 show the comparison between classifiers in terms of accuracy and kappa metrics when the tweets are polynomial. According to Tables ​ Tables7, 7 , ​ ,8, 8 , ​ ,9, 9 , ​ ,10, 10 , there is some reduction in accuracy and kappa rates when we use 60% of the dataset for training data than 50% in most classifiers, and in some cases we have just a little increase in the accuracy and kappa rates. SVM and bagging with SVM have better results compared to other classifiers. SVM with an accuracy of 73.91% is the better choice for polynomial classification. However, the bagging with SVM is a more reliable model compared to SVM, employing the ensemble method. This technique makes the learning model more reliable by reducing variance and bias. Tables ​ Tables7 7 and ​ and10 10 show that the most positive variation has happened from 10 to 20% of the dataset in both accuracy and kappa terms.

Sentiment accuracy comparison on polynomial dataset

Sentiment accuracy differences on polynomial dataset

Sentiment Kappa comparison on polynomial dataset

Sentiment Kappa differences on polynomial dataset

From the results of accuracy and AUC on the binomial dataset (Tables ​ (Tables3, 3 , ​ ,4, 4 , ​ ,5, 5 , ​ ,6) 6 ) and the results of accuracy and kappa on the polynomial dataset (Tables ​ (Tables7, 7 , ​ ,8, 8 , ​ ,9, 9 , ​ ,10), 10 ), we can observe that SVM and bagging with SVM have better results compared to other classifiers. However, the accuracy of polynomial classification is less than binomial. The reason of over-performing of SVM can be the fact the text data have a sparse nature. In such type of data, there are few irrelevant features that tend to have a correlation with each other. This leads those features to turn into some distinct categories, which can be separated by linear separators. Also, we can see most of the classifiers in 50% train–test split percentage have almost the same results as 70% in accuracy (Figs.  3 and  4 ), AUC and kappa rates, while using 10-FCV can reach better results.

An external file that holds a picture, illustration, etc.
Object name is 13278_2022_998_Fig3_HTML.jpg

Classification accuracy on binomial dataset

An external file that holds a picture, illustration, etc.
Object name is 13278_2022_998_Fig4_HTML.jpg

Classification accuracy on polynomial dataset

We also compared the performance of SVM, when 10-FCV is imposed, with state of the art presented in Table ​ Table1. 1 . The results showed that overall accuracy has improved at least 3.52% and 5.91% on binomial and polynomial datasets, respectively. This improvement can be a result of using the training and testing data divided through the K-fold cross-validation method.

In this paper, we aimed to analyze the sentiment of social media data, specifically Twitter, using both single classifiers and ensemble models combined with single classifiers on two datasets including binomial (positive and negative) and polynomial (positive, negative, and neutral) datasets.

From the results, we observed that data mining is a good choice for sentiment prediction since the accuracy rates are relatively high values. We also reviewed four classifiers, including SVM, K-nearest neighbor, decision tree and naive Bayes and two bagging ensemble methods.

From the results, we concluded that among single classifiers and their combination with the ensemble methods, SVM reached 3.53% and 7.41% over performances on binomial and polynomial datasets, respectively. Although ensemble methods do not show over performance compared to single methods, they are able to decrease the bias or variance of the learning models and also decrease the generalization error. Therefore, there is a trade-off between reliability of the algorithm and accuracy.

Our results show that using 50% of the dataset as training data has almost the same results as 70%; however, using 10-FCV has better results. This conclusion can be seen both in the accuracy and AUC rates in the binomial dataset and accuracy and kappa rates in the polynomial dataset.

In future studies, we will apply other ensemble methods, such as boosting and stacking combined with other classifiers, along with single classifiers. Furthermore, we will attempt to improve our dataset by selecting other keywords including both negative and positive sentiments and increasing the size of the dataset by extracting more tweets.

Authors' contributions

All authors have contributed in this research.

The authors received no funding to conduct the research.

Declarations

The authors declare that they have no competing interests.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

  • Ali MZ, Javed K, Tariq A (2021) Sentiment and emotion classification of epidemic related bilingual data from social media. arXiv preprint arXiv:2105.01468
  • Al-Laith A, Shahbaz M, Alaskar HF, Rehmat A. Arasencorpus: a semi-supervised approach for sentiment annotation of a large arabic text corpus. Appl Sci. 2021; 11 (5):2434. doi: 10.3390/app11052434. [ CrossRef ] [ Google Scholar ]
  • Ankit, Saleena N. An ensemble classification system for Twitter sentiment analysis. Procedia Comput Sci. 2018; 132 :937–946. doi: 10.1016/j.procs.2018.05.109. [ CrossRef ] [ Google Scholar ]
  • Basiri ME, Nemati S, Abdar M, Cambria E, Rajendra AU, et al. ABCDM: an attention-based bidirectional CNN-RNN deep model for sentiment analysis. Futur Gener Comput Syst. 2021; 115 :279–294. doi: 10.1016/j.future.2020.08.005. [ CrossRef ] [ Google Scholar ]
  • Bhatnagar S, Choubey N. Making sense of tweets using sentiment analysis on closely related topics. Soc Netw Anal Min. 2021; 11 :44. doi: 10.1007/s13278-021-00752-0. [ PMC free article ] [ PubMed ] [ CrossRef ] [ Google Scholar ]
  • Chauhan UA, Afzal MT, Shahid A, Abdar M, Basiri ME, Zhou X. A comprehensive analysis of adverb types for mining user sentiments on amazon product reviews. World Wide Web. 2020; 23 (3):1811–1829. doi: 10.1007/s11280-020-00785-z. [ CrossRef ] [ Google Scholar ]
  • Chen J, Hossain MS, Zhang H. Analyzing the sentiment correlation between regular tweets and retweets. Soc Netw Anal Min. 2020; 10 :13. doi: 10.1007/s13278-020-0624-4. [ CrossRef ] [ Google Scholar ]
  • Cui R, Agrawal G, Ramnath R. Tweets can tell: activity recognition using hybrid gated recurrent neural networks. Soc Netw Anal Min. 2020; 10 :16. doi: 10.1007/s13278-020-0628-0. [ CrossRef ] [ Google Scholar ]
  • Dai Y, Liu J, Zhang J, Fu H, Xu Z, et al. Unsupervised Sentiment Analysis by Transferring Multi-source Knowledge. Cogn Comput. 2021 doi: 10.1007/s12559-020-09792-8. [ CrossRef ] [ Google Scholar ]
  • Desai M, Mehta MA (2016) Techniques for sentiment analysis of Twitter data: A comprehensive survey. In: 2016 International Conference on Computing, Communication and Automation (ICCCA). 149–154 10.1109/CCAA.2016.7813707
  • Dietterich TG, (2000) Ensemble methods in machine learning. In: Multiple Classifier Systems. MCS 2000. Lecture Notes in Computer Science. 1857, 1–15. 10.1007/3-540-45014-9_1
  • Fatehi N, Shahhoseini HS, Wei J, Chang CT. An automata algorithm for generating trusted graphs in online social networks. Appl Soft Comput. 2022; 118 :108475. doi: 10.1016/j.asoc.2022.108475. [ CrossRef ] [ Google Scholar ]
  • Henríquez PA, Ruz GA (2018) Twitter Sentiment Classification Based on Deep Random Vector Functional Link. In: 2018 International Joint Conference on Neural Networks (IJCNN), 1–6 10.1109/IJCNN.2018.8489703
  • Hossny AH, Mitchell L, Lothian N, Osborne G, et al. Feature selection methods for event detection in Twitter: a text mining approach. Soc Netw Anal Min. 2020; 10 :61. doi: 10.1007/s13278-020-00658-3. [ CrossRef ] [ Google Scholar ]
  • Islam MR, Liu S, Wang X, Xu G, et al. Deep learning for misinformation detection on online social networks: a survey and new perspectives. Soc Netw Anal Min. 2020; 10 :82. doi: 10.1007/s13278-020-00696-x. [ PMC free article ] [ PubMed ] [ CrossRef ] [ Google Scholar ]
  • Kaur C, Sharma A, (2020). Twitter sentiment analysis on coronavirus using textblob (No. 2974). EasyChair.
  • Keyvanpour M, Karimi Zandian Z, Heidarypanah M. OMLML: a helpful opinion mining method based on lexicon and machine learning in social networks. Soc Netw Anal Min. 2020; 10 :10. doi: 10.1007/s13278-019-0622-6. [ CrossRef ] [ Google Scholar ]
  • Kumar P, Sinha A. Information diffusion modeling and analysis for socially interacting networks. Soc Netw Anal Min. 2021; 11 :11. doi: 10.1007/s13278-020-00719-7. [ PMC free article ] [ PubMed ] [ CrossRef ] [ Google Scholar ]
  • Kwak EJ, Grable JE. Conceptualizing the use of the term financial risk by non-academics and academics using twitter messages and science direct paper abstracts. Soc Netw Anal Min. 2021; 11 :6. doi: 10.1007/s13278-020-00709-9. [ PMC free article ] [ PubMed ] [ CrossRef ] [ Google Scholar ]
  • Li X, Xie Q, Jiang J, Zhou Y, Huang L, et al. Identifying and monitoring the development trends of emerging technologies using patent analysis and Twitter data mining: The case of perovskite solar cell technology. Technol Forecast Soc Chang. 2019; 146 :687–705. doi: 10.1016/j.techfore.2018.06.004. [ CrossRef ] [ Google Scholar ]
  • Machuca CR, Gallardo C, Toasa RM. 2021, Twitter sentiment analysis on coronavirus: Machine learning approach. J Phys Conf Series. 1828; 1 :012104. [ Google Scholar ]
  • Moutidis I, Williams HTP. Good and bad events: combining network-based event detection with sentiment analysis. Soc Netw Anal Min. 2020; 10 :64. doi: 10.1007/s13278-020-00681-4. [ CrossRef ] [ Google Scholar ]
  • Ruz GA, Henríquez PA, Mascareño A. Sentiment analysis of Twitter data during critical events through Bayesian networks classifiers. Futur Gener Comput Syst. 2020; 106 :92–104. doi: 10.1016/j.future.2020.01.005. [ CrossRef ] [ Google Scholar ]
  • Sailunaz K, Alhajj R. Emotion and sentiment analysis from Twitter text. J Comput Sci. 2019; 36 :101003. doi: 10.1016/j.jocs.2019.05.009. [ CrossRef ] [ Google Scholar ]
  • Singh M, Jakhar AK, Pandey S. Sentiment analysis on the impact of coronavirus in social life using the BERT model. Soc Netw Anal Min. 2021; 11 :33. doi: 10.1007/s13278-021-00737-z. [ PMC free article ] [ PubMed ] [ CrossRef ] [ Google Scholar ]
  • Symeonidis S, Effrosynidis D, Arampatzis A. A comparative evaluation of pre-processing techniques and their interactions for twitter sentiment analysis. Expert Syst Appl. 2018; 110 :298–310. doi: 10.1016/j.eswa.2018.06.022. [ CrossRef ] [ Google Scholar ]
  • Wang D, Al-Rubaie A, Hirsch B, Pole GC, et al. National happiness index monitoring using Twitter for bilanguages. Soc Netw Anal Min. 2021; 11 :24. doi: 10.1007/s13278-021-00728-0. [ CrossRef ] [ Google Scholar ]
  • Yadav N, Kudale O, Rao A, Gupta S, Shitole A. Twitter sentiment analysis using supervised machine learning. In: Hemanth J, Bestak R, Chen JI-Z, editors. Intelligent Data Communication Technologies and Internet of Things. Singapore: Springer; 2021. pp. 631–642. [ Google Scholar ]
  • Yang Y, Hsu JH, Löfgren K, CHo W, et al. Cross-platform comparison of framed topics in Twitter and Weibo: machine learning approaches to social media text mining. Soc Netw Anal Min. 2021; 11 :75. doi: 10.1007/s13278-021-00772-w. [ CrossRef ] [ Google Scholar ]
  • Nuser M, Alsukhni E, Saifan A, Khasawneh R, Ukkaz D, (2022) Sentiment analysis of COVID-19 vaccine with deep learning. J Theor Appl Inf Technol. 100(12):4513-4521.
  • Open access
  • Published: 17 April 2023

Twitter sentiment analysis using hybrid gated attention recurrent network

  • Nikhat Parveen 1 , 2 ,
  • Prasun Chakrabarti 3 ,
  • Bui Thanh Hung 4 &
  • Amjan Shaik 2 , 5  

Journal of Big Data volume  10 , Article number:  50 ( 2023 ) Cite this article

3701 Accesses

8 Citations

Metrics details

This article has been updated

Sentiment analysis is the most trending and ongoing research in the field of data mining. Nowadays, several social media platforms are developed, among that twitter is a significant tool for sharing and acquiring peoples’ opinions, emotions, views, and attitudes towards particular entities. This made sentiment analysis a fascinating process in the natural language processing (NLP) domain. Different techniques are developed for sentiment analysis, whereas there still exists a space for further enhancement in accuracy and system efficacy. An efficient and effective optimization based feature selection and deep learning based sentiment analysis is developed in the proposed architecture to fulfil it. In this work, the sentiment 140 dataset is used for analysing the performance of proposed gated attention recurrent network (GARN) architecture. Initially, the available dataset is pre-processed to clean and filter out the dataset. Then, a term weight-based feature extraction termed Log Term Frequency-based Modified Inverse Class Frequency (LTF-MICF) model is used to extract the sentiment-based features from the pre-processed data. In the third phase, a hybrid mutation-based white shark optimizer (HMWSO) is introduced for feature selection. Using the selected features, the sentiment classes, such as positive, negative, and neutral, are classified using the GARN architecture, which combines recurrent neural networks (RNN) and attention mechanisms. Finally, the performance analysis between the proposed and existing classifiers is performed. The evaluated performance metrics and the gained value for such metrics using the proposed GARN are accuracy 97.86%, precision 96.65%, recall 96.76% and f-measure 96.70%, respectively.

Introduction

Sentiment Analysis (SA) uses text analysis, NLP (Natural Language Processing), and statistics to evaluate the user’s sentiments. SA is also called emotion AI or opinion mining [ 1 ]. The term ‘sentiment’ refers to feelings, thoughts, or attitudesexpressed about a person, situation, or thing. SA is one of the NLP techniques used to identify whether the obtained data or information is positive, neutral or negative. Business experts frequently use it to monitor or detect sentiments to gauge brand reputation, social data and understand customer needs [ 2 , 3 ]. Over recent years, the amount of information uploaded or generated online has rapidly increased due to the enormous number of Internet users [ 4 , 5 ].

Globally, with the emergence of technology, social media sites [ 6 , 7 ] such as Twitter, Instagram, Facebook, LinkedIn, YouTube etc.,have been used by people to express their views or opinions about products, events or targets. Nowadays, Twitter is the global micro-blogging platform greatly preferred by users to share their opinions in the form of short messages called tweets [ 8 ]. Twitterholds 152 M (million) daily active users and 330 M monthly active users,with 500 M tweets sent daily [ 9 ]. Tweets often effectively createa vast quantity of sentiment data based on analysis. Twitter is an effective OSN (online social network) for disseminating information and user interactions. Twitter sentiments significantly influence diverse aspects of our lives [ 10 ]. SA and text classification aims at textual information extraction and further categorizes the polarity as positive (P), negative (N) or neutral (Ne).

NLP techniques are often used to retrieve information from text or tweet content. NLP-based sentiment classification is the procedure in which the machine (computer) extracts the meaning of each sentence generated by a human. Manual analysis of TSA (Twitter Sentiment Analysis) is time-consuming and requires more experts for tweet labelling. Hence, to overcome these challenges automated model is developed. The innovations of ML (Machine learning) algorithms [ 11 , 12 ],such as SVM (Support Vector Machine), MNB (Multinomial Naïve Bayes), LR (Logistic Regression), NB (Naïve Bayes) etc., have been used in the analysis of online sentiments. However, these methods illustrated good performance, but these approaches are very slow and need more time to perform the training process.

DL model is introduced to classify Twitter sentiments effectively. DL is the subset of ML that utilizes multiple algorithms to solve complicated problems. DL uses a chain of progressive events and permits the machine to deal with vast data and little human interaction. DL-based sentiment analysis offers accurate results and can be applied to various applications such as movie recommendations, product predictions, emotion recognition [ 13 , 14 , 15 ],etc. Such innovations have motivated several researchers to introduce DL in Twitter sentiment analysis.

SA (Sentiment Analysis) is deliberated with recognizing and classifying the polarity or opinions of the text data. Nowadays, people widely share their opinions and sentiments on social sites. Thus, a massive amount of data is generated online, and effectively mining the online data is essential for retrieving quality information. Analyzing online sentiments can createa combined opinion on certain products. Moreover, TSA (Twitter Sentiment Analysis) is challenging for multiple reasons. Short texts (tweets), owing to the maximum character limit, is a major issue. The presence of misspellings, slang and emoticons in the tweets requires an additional pre-processing step for filtering the raw data. Also, selecting a new feature extraction model would be challenging,further impacting sentiment classification. Therefore, this work aims to develop a new feature extraction and selection approach integrated with a hybrid DL classification model for accurate tweet sentiment classification. The existing research works [ 16 , 17 , 18 , 19 , 20 , 21 ] focus on DL-based TSA, which haven’t attained significant results because of smaller dataset usage and slower manual text labelling. However, the datasets with unwanted details and spaces also reduce the classification algorithm’s efficiency. Further, the dimension occupied by extracted features also degrades the efficiency of a DL approach. Hence, to overcome such issues, this work aims to develop a successful DL algorithm for performing Twitter SA. Pre-processing is a major contributor to this architecture as it can enhance DL efficiency by removing unwanted details from the dataset. This pre-processing also reduces the processing time of a feature extraction algorithm. Followed to that, an optimization-based feature selection process was introduced, which reduces the effort of analyzing irrelevant features. However, unlike existing algorithms, the proposed GARN can efficiently analyse the text-based features. Further, combining the attention mechanism with DL has enhanced the overall efficiency of the proposed DL algorithm. As attention mechanism have the greater ability to learn the selected features by reducing the complexity of model. This merit causes the attention mechanism to integrate with RNN and achieved effective performance.

The major objectives of the proposed research are:

To introduce a new deep model Hybrid Mutation-based White Shark Optimizer with a Gated Attention Recurrent Network (HMWSO-GARN) for Twitter sentiment analysis.

The feature set can be extracted with the new Term weighting-based feature extraction (TW-FE) approach named Log Term Frequency-based Modified Inverse Class Frequency (LTF-MICF) is used and compared with traditional feature extraction models.

To identify the polarity of tweets with the bio-inspired feature selection and deep classification model.

To evaluate the performance using different metrics and compare it with traditional DL procedures on TSA.

Related works

Some of the works related to dl-based twitter sentiment analysis are:.

Alharbi et al. [ 16 ] presented the analysis of Twitter sentiments using a DNN (deep neural network) based approach called CNN (Convolutional Neural Network). The classification of tweets was processed based on dual aspects, such as using social activities and personality traits. The sentiment (P, N or Ne) analysis was demonstrated with the CNN model, where the input layer involves the feature lists and the pre-trained word embedding (Word2Vec). The dual datasets used for processing were SemEval-2016_1 and SemEval-2016_2. The accuracy obtained by CNN was 88.46%, whereas the existing methods achieved less accuracy than CNN. The accuracy of existing methods is LSTM (86.48%), SVM (86.75%), KNN (k-nearest neighbour) (82.83%), and J48 (85.44%), respectively.

Tam et al. [ 17 ] developed a Convolutional Bi-LSTM model based on sentiment classification on Twitter data. Here, the integration of CNN-Bi-LSTM was characterized byextracting local high-level features. The input layer gets the text input and slices it into tokens. Each token was transformed into NV (numeric values). Next, the pre-trained WE (word embedding), such as GloVe and W2V (word2vector), were used to create the word vector matrix. The important words were extracted using the CNN model,and the feature set was further minimized using the max-pooling layer. The Bi-LSTM (backwards, forward) layers were utilized to learn the textual context. The dense layer (DeL) was included after the Bi-LSTM layer to interconnect the input data with output using weights. The performance was experimented using datasets TLSA (Twitter Label SA) and SST-2 (Stanford Sentiment Treebank). The accuracy with the TLSA dataset was (94.13%) and (91.13%) with the SST-2 dataset.

Chugh et al. [ 18 ] developed an improved DL model for information retrieval and classification of sentiments. The hybridized optimization algorithm SMCA was the integration of SMO (Spider Monkey Optimization) and CSA (Crow Search Algorithm). The presented DRNN (DeepRNN) was trained using the algorithm named SMCA. Here, the sentiment categorization was processed with DeepRNN-SMCA and the information retrieval was done with FuzzyKNN. The datasets used were the mobile reviews amazon dataset and telecom tweets dataset. Forsentiment classification, the accuracy obtained on the first dataset was (0.967), andthe latter was gained (0.943). The performance with IR (information retrieval) on dataset 1 gained (0.831) accuracy and dataset 2 obtained (0.883) accuracy.

Alamoudi et al. [ 19 ] performed aspect-based SA and sentiment classification aboutWE (word embeddings) and DL. The sentiment categorization involves both ternary and binary classes. Initially, the YELP review dataset was prepared and pre-processed for classification. The feature extraction was modelled with TF-IDF, BoW and Glove WE. Initially, the NB and LR were used for first set feature (TF-IDF, BoW features) modelling; then, the Glove features were modelled using diverse models such as ALBERT, CNN, and BERT for the ternary classification. Next, aspect and sentence-based binary SA was executed. The WE vector for sentence and aspect was done with the Glove approach. The similarity among aspects and sentence vectors was measured using cosine similarity, and binary aspects were classified. The highest accuracy (98.308%) was obtained when executed with the ALBERT model on aYELP 2-class dataset, whereas the BERT model gained (89.626%) accuracy with a YELP 3-class dataset.

Tan et al. [ 20 ] introduced a hybrid robustly optimized BERT approach (RoBERTa) with LSTM for analyzing the sentiment data with transformer and RNN. The textual data was processed with word embedding, and tokenization of the subwordwas characterized with the RoBERTa model. The long-distance Tm (temporal) dependencies were encoded using the LSTM model. The DA (data augmentation) based on pre-trained word embedding was developed to synthesize multiple lexical samples and present the minority class-based oversampling. Processing of DA solves the problem of an imbalanced dataset with greater lexical training samples. The Adam optimization algorithm was used to perform hyperparameter tuning,leading to greater results with SA. The implementation datasets were Sentiment140,Twitter US Airline,and IMDb datasets. The overall accuracy gained with these datasets was 89.70%, 91.37% and 92.96%, respectively.

Hasib et al. [ 21 ] proposed a novel DL-based sentiment analysis of Twitter data for the US airline service. The Twitter tweet is collected from the Kaggle dataset: crowdflowerTwitter US airline sentiment. Two models are used for feature extraction:DNN and convolutional neural network (CNN). Before applying four layers, the tweets are converted to metadata and tf-idf. The four layers of DNN aretheinput, covering, and output layers. CNN for feature extraction is by the following phases; data pre-processing, embedded features, CNN and integration features. The overall precision is 85.66%, recall is 87.33%, and f1-score is 87.66%, respectively. Sentiment analysis was used to identify the attitude expressed using text samples. To identify such attitudes, a novel term weighting scheme was developed by Carvalho and Guedes in [ 24 ], which was an unsupervised weighting scheme (UWS). It can process the input without considering the weighting factor. The SWS (Supervised Weighting Schemes) was also introduced, which utilizes the class information related to the calculated term weights. It had shown a more promising outcome than existing weighting schemes.

Learning from online courses are considered as the mainstream of learning domain. However, it was identified that analysing the users comments are considered as the major key for enhancing the efficiency and quality of online courses. Therefore, identifying sentiments from the user’s comments were considered as the efficient process for enhancing the learning process of online course. By taking this as major goal, an ensemble learning architecture was introduced by Pu et al. in [ 34 ] which utilizes glove, and Word2Vec for obtaining vector representation. Then, the extraction of deep features was achieved using CNN (Convolutional neural network) and bidirectional long and short time network (Bi-LSTM). The integration of suggested models were achieved using ensemble multi-objective gray wolf optimization (MOGWO). It achieves 91% f1-score value.

The sentiment dictionaries use binary sentiment analysis like BERT, word2vec and TF-IDF were used to convert movie and product review into vectors. Three-way decision in binary sentiment analysis separates the data sample into uncertain region (UNC), positive (POS) region and Negative (NEG) region. UNC got benefit from this three-way decision model and enhances the effect of binary sentiment analysis process. For the optimal feature selection, Chen, J et al. [ 35 ] developed a three-way decision model which get the optimal features representation of positive and negative domains for sentiment analysis. Simulation was done in both Amazon and IMDB database to show the effectiveness of the proposed methodology.

The advancements in biga data analytics (BDA) model is obtained by the people who generate large amount of data in their day-to-day live. The linguistic based tweets, feature extraction and sentimental texts placed between the tweets are analysed by the sentimental analysis (SA) process. In this article, Jain, D.K et al. [ 36 ] developed a model which contains pre-processing, feature extraction, feature selection and classification process. Hadoop Map Reduce tool is used to manage the big data, then pre-processing method is initiated to remove the unwanted words from the text. For feature extraction, TF-IDF vector is utilized and Binary Brain Storm Optimization (BBSO) is used to select the relevant features from the group of vectors. Finally, the incidence of both positive and negative sentiments is classified using Fuzzy Cognitive Maps (FCMs). Table 1 shows the comparative analysis of Twitter sentiment analysis using DL techniques.

Problem statement

There are many problems related to twitter sentiment analysis using DL techniques. The author in [ 16 ] has used the DL model and performed the sentiment classification from Twitter data. To classify such data, this method analysed each user’s behavioural information. However, this method has faced struggles in interpreting exact tweet words from the massive tweet corpus; due to this, the efficiency of a classification algorithm has been reduced.ConvBiLSTM was introduced in [ 17 ], which used glove and word2vec-based features for sentiment classification. However, the extracted features are not sufficient to achieve satisfactory accuracy. Then, processing time reduction was considered a major objective in [ 18 ], which utilizes DeepRNN for sentiment classification. But it fails to reduce the dimension occupied by the extracted features. This makes several valuable featuresfall within the local optimum. DL and word embedding processes were combined in [ 19 ], which utilizes Yelp reviews for processing. It has shown efficient performance for two classes but fails to provide better accuracy for three-class classification. Recently, a hybrid LSTM architecture was developed in [ 20 ], which has shown flexible processing over sentiment classification and takes a huge amount of time to process large datasets. DNN-based feature extraction and CNN-based sentiment classification were performed in [ 21 ], which haven’t shown more efficient performance than other algorithms. Further, it also concentrated only on 2 classes.

Few of the existing literatures fails to achieve efficient processing time, complexity and accuracy due to the availability of large dataset. Further, the extraction of low-level and unwanted features reduces the efficiency of classifier. Further, the usage of all extracted features occupies large dimension. These demerits makes the existing algorithms not suitable for efficient processing. This shortcomings open a research space for efficient combined algorithm for twitter data analysis. To overcome such issue, the proposed architecture has combined RNN and attention mechanism. The features required for classification is extracted using LTF-MICF which provides features for twitter processing. Then, the dimension occupied by huge extracted features are reduced using HMWSO algorithm. This algorithm has the ability to process the features in less time complexity and shows better optimal feature selection process. This selected features has enhanced the performance of proposed classifier over the large dataset and also achieved efficient accuracy with less misclassification error rate.

Proposed methodology

For sentiment classification of Twitter tweets, a DL technique of gated attention recurrent network (GARN) is proposed. The Twitter dataset (Sentiment140 dataset) with sentiment tweets that the public can access is initially collected and given as input. After collecting data, the next stage is pre-processing the tweets. In the pre-processing stage, tokenization, stopwords removal, stemming, slang and acronym correction, removal of numbers, punctuations &symbol removal, removal of uppercase and replacing with lowercase, character &URL, hashtag & user mention removal are done. Now the pre-processed dataset act as input for the next process. Based on term frequency, a term weight is allocated for each term in the dataset using the Log Term Frequency-based Modified Inverse Class Frequency (LTF-MICF) extraction technique. Next, Hybrid Mutation based White Shark Optimizer (HMWSO) is used to select optimal term weight. Finally, the output of HMWSO is fed into the gated attention recurrent network (GARN) for sentiment classification with three different classes. Figure  1 shows a diagrammatic representation of the proposed methodology.

figure 1

Architecture diagram

Tweets pre-processing

Pre-processing is converting the long data into short text to perform other processes such as classification, detecting unwanted news, sentiment analysis etc., as Twitter users use different styles to post their tweets. Some may post the tweet in abbreviations, symbols, URLs, hashtags, and punctuations. Also, tweets may consist of emojis, emoticons, or stickers to express the user’s sentiments and feelings. Sometimes the tweets may be in a hybrid form,such as adding abbreviations, symbols and URLs. So these kinds of symbols, abbreviations, and punctuations should be removed from the tweet toclassify the dataset further. The features to be removed from the tweet dataset are tokenization, stopwords removal, stemming, slag and acronym correction, removal of numbers, punctuation and symbol removal, noise removal, URL, hashtags, replacing long characters, upper case to lower case, and lemmatization.

Tokenization

Tokenization [ 28 ] is splitting a text cluster into small words, symbols, phrases and other meaningful forms known as tokens. These tokens are considered as input for further processing. Another important use of tokenization is that it can identify meaningful words.The tokenization challenge depends only on the type of language used. For example, in languages such as English and French, some words may be separated by white spaces. Other languages, such as Chinese and Thai words,are not separated. The tokenization process is carried out in the NLTK Python library. In this phase, the data is processed in three forms: convert the text document into word counts. Secondly,data cleansing and filtering occur, andfinally, the document is split into tokens or words.

The example provided below illustrates the original tweet before and after performing tokenization:

Before tokenization

DLis a technology which trains the machineto behave naturally like a human being.

After tokenization

Deep, learning, is, a, technology, which, train, the, machine, to, behave, naturally, like, a, human, being.

Numerous tools are available to tokenize a text document. Some of them are as follows;

NLTK word tokenize

Nlpdotnet tokenizer

TextBlob word tokenize

Mila tokenizer

Pattern word tokenize

MBSP word tokenize

Stopwords removal

Stopword removal [ 28 ] is a process of removing frequently used words with meaningless in a text document. Stopwords such as are, this, that, and, so are frequently occurring words in a sentence. These words are also termed pronouns, articles and prepositions. Such words are not used forfurther processing, so removing those words is required. If such words are not removed, the sentence seems heavy and becomes less important for the analyst.Also, they are not considered keywords in Twitter analysis applications. Many methods exist to remove stopwords from a document; they are.

Classic method

Mutual information (MI) method

Term based random sampling (TBRS) method

Removing stopwords from a pre-compiled list is performed using a classic-based method. Z-methods are known as Zipf’s law-based methods. In Z-methods, three removal processes occur: removing the most frequently used words, removing the words which occur once in a sentence, and removing words with a document frequency of low inverse. In the mutual MI method, the information with low mutual will be removed. In the TBRS method, the words are randomly chosen from the document and given rank for a particular term using the Kullback–Leibler divergence formula, which is represented as;

where \(Q_{l} (t)\) is the normalized term frequency (NTF) of the term \(t\) within a mass \(l\) , and NTF is denoted as \(Q(t)\) of term \(t\) in the entire document. Finally, using this equation, the least terms are considered a stopword list from which the duplications are removed.

Removing prefixesand suffixes from a word is performed using the stemming method. It can also be defined as detecting the root and stem of a word and removing them. For example, processed word processing can be stemmed from a single word as a process [ 28 ]. The two points to be considered while performing stemming are: the words with different meanings must be kept separate, and the words of morphological forms will contain the same meaning and must be mapped with a similar stem. There are stemming algorithms to classify the words. The algorithms are divided into three methods: truncating, statistical, and mixed methods. Truncating method is the process of removing a suffix from a plural word. Some rules must be carried out to remove suffixes from the plurals to convert the plural word into the singular form.

Different stemmer algorithms are used under the truncating method. Some algorithms are Lovins stemmer, porters stemmer, paice and husk stemmer, and Dawson stemmer. Lovins stemmer algorithm is used to remove the lengthy suffix from a word. The drawback of using this stemmer is that it consumes more time to process. Porter’s stemmer algorithm removes suffixes from a word by applying many rules. If the applied rule is satisfied, the suffix is automatically removed. The algorithm consists of 60 rules and is faster than theLovins algorithm. Paice and husk is an iterative algorithm that consists of 120 rules to remove the last character of the suffixed word. This algorithm performs two operations, namely, deletion and replacement. The Dawson algorithm keeps the suffixed words in reverse order by predicting their length and the last character. In statistical methods, some algorithms are used: N-gram stemmer, HMM stemmer, and YASS stemmer. In a mixed process, the inflectional and derivational methods are used.

Slang and acronym correction

Users typically use acronyms and slang to limit the characters in a tweet posted on social media [ 29 ]. The use of acronyms and slangis an important issue because the users do not have the same mindset to make the acronym in the same full form, and everyone considers the tweet in different styles or slang. Sometimes, the acronym posted may possess other meanings or be associated with other problems. So, interpreting these kinds of acronyms and replacing them with meaningful words should be done so the machine can easily understand the acronym’s meaning.

An example illustrates the original tweet with acronyms and slang before and after removal.

Before removal : ROM permanently stores information in the system, whereas RAM temporarily stores information in the system.

After removal : Read Only Memory permanently store information in the system, whereas Random Access Memory temporarily store information in the system.

Removal of numbers

Removal of numbers in the Twitter dataset is a process of deleting the occurrence of numbers between any words in a sentence [ 29 ].

An example illustrates the original tweet before and after removing numbers.

Before removal : My ink “My Way…No Regrets” Always Make Happiness Your #1 Priority.

After removal : My ink “My Way … No Regrets” Always Make Happiness Your # Priority.

Once removed, the tweet will no longer contain any numbers.

Punctuation and symbol removal

The punctuation and symbols are removed in this stage. Punctuations such as ‘.’, ‘,’, ‘?’, ‘!’, and ‘:’ are removed from the tweet [ 29 , 30 ].

An example illustrates the original tweet before and after removing punctuation marks.

After removal : My ink My Way No Regrets Always Make Happiness Your Priority.

After removal, the tweet will not contain any punctuation. Symbol removal is the process of removing all the symbols from the tweet.

An example illustrates the original tweet before and after removing symbols.

After removal : wednesday addams as a disney princess keeping it.

After removal, there would not be any symbols in the tweet.

Removal of uppercase into lowercase character

In this process of removal or deletion, all the uppercase charactersare replaced with lowercase characters [ 30 ].

An example illustrates the original tweet before and after removing uppercase characters into lowercase characters.

After removal : my ink my way no regrets always make happiness your priority.

After removal, the tweet will no longer contain capital letters.

URL, hashtag & user mention removal

For clear reference,Twitter users post tweets with various URLs and hashtags [ 29 , 30 ]. This information ishelpful for the people but mostly noise, which cannot be used for further processes. The example provided below illustrates the original tweet with URL, hashtag and user mention before removal and after removal:

Before removal : This gift is given by #ahearttouchingpersonfor securing @firstrank. Click on the below linkto know more https://tinyurl.com/giftvoucher .

After removal : This is a gift given by a heart touching person for securing first rank. Click on the below link to know more.

Term weighting-based feature extraction

After the pre-processing, the pre-processed data is extracted in text documents based on the term weighting \(T_{w}\) [ 22 ]. A new term weighting scheme,Log term frequency-based modified inverse class frequency (LTF-MICF), is employed in this research paper for feature extraction based on term weight. The technique integrates two different term weighting schemes: log term frequency (LTF) and modified inverse class frequency (MICF). The frequently occurring terms in the document are known as term frequency \(^{f} T\) . But, \(^{f} T\) alone is insufficient because the frequently occurring terms will possess heavyweight in the document. So, the proposed hybrid feature extraction technique can overcome this issue. Therefore, \(^{f} T\) is integrated with MICF, an effective \(T_{w}\) approach. Inverse class frequency \(^{f} C_{i}\) is the inverse ratio of the total class of terms that occurs on training tweets to the total classes. The algorithm for the TW-FE technique is shown in algorithm 1 [ 22 ].

figure b

Two steps are involved in calculating LTF \(^{l} T_{f}\) . The first step is to calculate the \(^{f} T\) of each term in the pre-processed dataset. The second step is, applying log normalization to the output of the computed \(^{f} T\) data. The modified version of \(^{f} C_{i}\) , the MICF is calculated for each term in the document. MICF is said to be executed then;each term in the document should have different class-particular ranks, which should possess differing contributions to the total term rank. It is necessary to assign dissimilar weights for dissimilar class-specific ranks. Consequently, the sum of the weights of all class-specific ranks is employed as the total term rank. The proposed formula for \(T_{w}\) using LTF-based MICF is represented as follows [ 22 ];

where a specific weighting factor is denoted \(w_{sp}\) for each \(tp\) for class \(C_{r}\) , which can be clearly represented as;

The method used to assign a weight for a given dataset is known as the weighting factor (WF). Where the number of tweets \(s_{i}\) in class \(C_{r}\) which contains pre-processed terms \(tp\) is denoted as \(s_{i} \mathop{t}\limits^{\rightharpoonup}\) . The number of \(s_{i}\) in other classes, which contains \(tp\) is denoted as \(s_{i} \mathop{t}\limits^{\leftarrow}\) . The number of \(s_{i}\) in-class \(C_{r}\) , which do not possess, \(tp\) is denoted as \(s_{i} \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{t}\) . The number of \(s_{i}\) in other classes, which do not possess, \(tp\) is denoted as \(s_{i} \tilde{t}\) . To eliminate negative weights, the constant ‘1’ is used. In extreme cases, to avoid a zero-denominator issue, the minimal denominator is set to ‘1’ if \(s_{i} \mathop{t}\limits^{\leftarrow}\)  = 0 or \(s_{i} \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{t}\)  = 0. The formula for \(^{l} T_{f} (tp)\) and \(^{f} C_{i} (tp)\) can be presented as follows [ 22 ];

where raw count of \(tp\) on \(s_{i}\) is denoted as \(^{f} T(tp,s_{i} )\) , i.e., the total times of \(tp\) occurs on \(s_{i}\) .

where \(r\) refers to the total number of classes in \(s_{i}\) , and \(C(tp)\) is the total number of classes in \(tp\) . The dataset features are represented as \(f_{j} = \left\{ {f_{1} ,f_{2} ,..........f_{3} ,......f_{m} } \right\}\) after \(T_{w}\) , where the number of weighted terms in the pre-processed dataset is denoted as \(f_{1} ,f_{2} ,...f_{3} ,...f_{m}\) respectively. The computed rank values of each term in the text document of tweets are used for performing the further process.

Feature selection

The existence of irrelevant features in the data can reduce the accuracy level of the classification process and make the model to learn those irrelevant features. This issue is termed as the optimization issue. This issue can be ignored only by taking optimal solutions from the processed dataset. Therefore, a feature selection algorithm named White shark optimizer with a hybrid mutation strategy is utilized to achieve a feature selection process.

White Shark Optimizer (WSO)

WSO is proposed based on the behaviour of the white shark while foraging [ 23 ]. Great white shark in the ocean catches prey by moving the waves and other features to catch prey kept deep in the ocean. Since the white shark catch prey based on three behaviours, namely: (1) the velocity of the shark in catching the prey, (2) searching for the best optimal food source, (3) the movement of other sharks toward the shark, which is near to the optimal food source. The initial white shark population is represented as;

where \(W_{q}^{p}\) is the initial parameters of the \(p_{th}\) white shark in the \(q_{th}\) dimension. The upper and lower bounds in the \(q_{th}\) dimension are denoted as \(up_{q}\) and \(lb_{q}\) , respectively. Whereas \(r\) denotes a random number in the range [0, 1].

The white shark’s velocity is to locate the prey based on the motion of the sea wave is represented as [ 23 ];

where \(s = 1,2,....m\) is the index of a white shark with a population size of \(m\) . The new velocity of \(p_{th}\) shark is denoted as \(vl_{s + 1}^{p}\) in \((s + 1)_{th}\) step. The initial speed of the \(p_{th}\) shark in the \(s_{th}\) step is denoted as \(vl_{s}^{p}\) . The global best position achieved by any \(p_{th}\) shark in \(s_{th}\) step is denoted as \(W_{{gbest_{s} }}\) . The initial position of the \(p_{th}\) shark in \(s_{th}\) step is denoted as \(W_{s}^{p}\) . The best position of the \(p_{th}\) shark and the index vector on attainingthe best position are denoted as \(W_{best}^{{vl_{s}^{p} }}\) and \(vc^{i}\) . Where \(C_{1}\) and \(C_{2}\) in the equation is defined as the creation of uniform random numbers of the interval [1, 0]. \(F_{1}\) and \(F_{2}\) are the force of the shark to control the effect of \(W_{{gbest_{s} }}\) and \(W_{best}^{{vl_{s}^{p} }}\) on \(W_{s}^{p}\) . \(\mu\) represents to analyze the convergence factor of the shark. The index vector of the white shark is represented as;

where \(rand(1,t)\) is a random numbers vector obtained with a uniform distribution in the interval [0, 1].The forces of the shark to control the effect are represented as follows;

The initial and maximum sum of the iteration is denoted as \(u\) and \(U\) , whereas the white shark’s current and sub-ordinate velocities are denoted as \(F_{\min }\) and \(F_{\max }\) . The convergence factor is represented as;

where \(\tau\) is defined as the acceleration coefficient. The strategy for updating the position of the white shark is represented as follows;

The new position of the \(p_{th}\) shark in \((s + 1)\) iteration, \(\neg\) represent the negation operator, \(c\) and \(d\) represents the binary vectors. The search space lower and upper bounds are denoted as \(lo\) and \(ub\) . \(W_{0}\) and \(fr\) denotes the logical vector and frequency at which the shark moves. The binary and logic vectors are expressed as follows;

The frequency at which the white shark moves is represented as;

\(fr_{\max }\) and \(fr_{\min }\) represents the maximum and minimum frequency rates. The increase in force at each iteration is represented as;

where \(MV\) represents the weight of the terms in the document.

The best optimal solution is represented as;

where the position updation following the food source of \(p_{th}\) the white shark is denoted as \(W_{s + 1}^{\prime p}\) . The \({\text{sgn}} (r_{2} - 0.5)\) produce 1 or −1 to modify the search direction. The food source and shark distance \(\vec{D}is_{w}\) and the strength of the white shark following other sharks close to the food source \(Str_{sns}\) is formulated as follows;

The initial best optimal solutions are kept constant, and the position of other sharks is updated according to these two constant optimal solutions. The fish school behaviour of the sharks is formulated as follows;

The weight factor \(^{j} we\) is represented as;

where \(^{q} fit\) is defined as the fitness of each term in the text document. The expansion of the equation is represented as;

The concatenation of hybrid mutation \(HM\) is applied to the WSO for a faster convergence process. Thus, the hybrid mutation applied with the optimizer is represented as;

whereas \(G_{a} (\mu ,\sigma )\) and \(C_{a} (\mu ,\sigma )\) represents an arbitrary number of both Gaussian and Cauchy distribution. \((\mu ,\sigma )\) and \((\mu^{\prime},\sigma^{\prime})\) represents the mean and variance function of both Gaussian and Cauchy distributions. \(D_{1}\) and \(D_{2}\) represents the coefficients of Gaussian \(^{t + 1} GM\) along with Cauchy \(^{t + 1} CM\) mutation. On applying these two hybrid mutation operators, a new solution is produced that is represented as;

whereas \(^{p}_{we}\) represents the weight vector and \(PS\) represents the size of the population. The selected features from the extracted features are represented as \(Sel(p = 1,2,...m)\) . The WSO output is denoted as \((sel) = \left\{ {sel^{1} ,sel^{2} ,.....sel^{m} } \right.\left. {} \right\}\) ,which is a new sub-group of terms in the dataset. At the same time, \(m\) denotes a new number of each identical feature. Finally, the feature selection stage provides a dataset document with optimal features.

Gated attention recurrent network (GARN) classifier

GARN is a hybrid network of Bi-GRU with an attention mechanism. Many problems occur due to the utilization of recurrent neural network (RNNs) because it employs old information rather than the current information for classification. To overcome this problem, a bidirectional recurrent neural network (BRNN) model is proposed, which can utilize both old and current information. So, to perform both the forward and reverse functions, two RNNs are employed. The output will be connected to a similar output layer to record the feature sequence. Based on the BRNN model, another bidirectional gated recurrent unit (Bi-GRU) model is introduced, which replaces the hidden layer of the BRNN with a single GRU memory unit. Here, the hybridization of both Bi-GRU with attention is considered agated attention recurrent network (GARN) [ 25 ] and its structure is given in Fig.  2 .

figure 2

Structure of GARN

Consider an m-dimensional input data as \((y_{1} ,y_{2} ,....,y_{m} )\) . The hidden layer in the BGRU produces an output \(H_{{t_{1} }}\) at a time interval \(t_{1}\) is represented as;

where the weight factor for two connecting layers is denoted as \(w_{e}\) , \(c\) is the bias vector, \(\sigma\) represents the activation function, positive and negative outputs of GRU is denoted as \(\vec{H}_{{t_{1} }}\) and \(\overleftarrow {H} _{{t_{1} }}\) , \(\oplus\) is a bitwise operator.

Attention mechanism

In sentiment analysis, the attention module is very important to denote the correlation between the terms in a sentence and the output [ 26 ]. For direct simplification, an attention model is used in this proposal named as feed-forward attention model. This simplification is to produce a single vector \(\nu\) from the total sequence represented as;

Where \(\beta\) is a learning function and is identified using \(H_{{t_{1} }}\) . From the above Eq.  34 , the attention mechanism produces a fixed length for the embedding layer in a BGRU model for every single vector \(\nu\) by measuring the average weight of the data sequence \(H\) . The structure for attention mechanism is shown in Fig.  3 . Therefore, the final sub-set for the classification is obtained from:

figure 3

Structure of attention mechanism

Sentiment classification

Twitter sentiment analysis is formally a classification problem. The proposed approach classifies the sentiment data into three classes: positive, negative and neutral. For classification, the softmax classifier is used to classify the output in the hidden layer \(H^{\# }\) is represented as;

where \(w_{e}\) is the weight factor, \(c\) is a bias vector and \(H^{\# }\) is the output of the last hidden layer. Also, the cross-entropy is evaluated as a loss function represented as;

The total number of samples is denoted as, \(n\) . The real category of the sentence is denoted as \(sen_{j}\) ,the sentence with the predictive category is denoted as \(x_{j}\) , and the \(L2\) regular item is denoted as \(\lambda ||\theta ||^{2}\) .

Results and discussion

This section briefly describes the performance metrics like accuracy, precision, recall and f-measure. The overall analysis of the Twitter sentiment classification with pre-processing, feature extraction, feature selection and classification are also analyzed and discussed clearly. Results on comparing the existing and trending classifiers with term weighting schemes in bar graphs and tables are included. Finally, a small discussion about the overall workflow concluded the research by importing the analyzed performance metrics. The sentiment is an expression from individuals based on an opinion on any subject. Tweet-based analysis of sentiment mainly focuses on detecting positive and negative sentiments. So, it is necessary to enhance the classification classes in which a neutral class is added to the datasets.

The dataset utilized in our proposed work is Sentiment 140, gathered from [ 27 ], which contains 1,600,000tweets extracted from Twitter API. The score values for each tweet as, for positive tweets, the rank value is 4.Similarly, for negative tweets rank value is 0, and for neutral tweets, the rank value is 2.The total number of positive tweets in a dataset is 20832, neutral tweets are 18318, negative tweets are 22542, and irrelevant tweets are 12990. From the entire dataset, 70%is used for training, 15% for testing and 15% for validation. Table 2 shows the system configuration of the designed classifier.

Performance metrics

In this proposed method, 4 different weight schemes are compared with other existing,proposed classifiers in which the performance metrics are precision, f1-score, recall and accuracy. Four notations, namely, true-positive \((t_{p} )\) , true-negative \((t_{n} )\) , false-positive \((f_{p} )\) and false-negative, \((f_{n} )\) are particularly utilized to measure the performance metrics.

Accuracy \((A_{c} )\)

Accuracy is the dataset’s information accurately being classified by the proposed classifier. The accuracy value for the proposed method is obtained using Eq.  39 .

Precision \((P_{r} )\)

Precision is defined as the number of terms accurately identified positive to the total identified positively. The precision value for the proposed method is obtained using Eq.  40 .

Recall \((R_{e} )\)

The recall is defined as the percentage of accurately identified positive observations to the total observations in the dataset. The recall value for the proposed method is obtained using Eq.  41 .

F1-score \((F_{s} )\)

F1-score is defined as the average weight of recall and precision. The f1-score value for the proposed method is obtained using Eq.  42 .

Analysis of Twitter sentiments using GARN

The research paper mainly focuses on classifying Twitter sentiments in the form of three classes, namely, positive, negative and neutral. The data are collected using Twitter api. After collecting data, it is given as input for pre-processing. The unwanted symbols are removed in the pre-processing technique, giving a new pre-processed dataset. Now, the pre-processed dataset is given as an input to extract the required features. These features are extracted from the pre-processed dataset using a novel technique known as the log term frequency-based modified inverse class frequency (LTF-MICF) model, which integrates two-weight schemes, LTF and MICF. Here, the required features are extracted in which the extracted features are given as input to select an optimal feature subset. The optimized feature subset is selected using a hybrid mutation-based white shark optimizer (HMWSO). The mutation is referred to as the Cauchy mutation and the Gaussian mutation. Finally, with the selected feature sub-set as input, the sentiments are classified under three classes using a classifier named gated recurrent attention recurrent network (GARN), which is a hybridization of Bi-GRU with an attention mechanism.

The evaluated value of the proposed GARN is preferred for classifying the sentiments of Twitter tweets. The suggested GARN model is implemented in the Python environment, and the sentiment140 Twitter dataset is utilized for training the proposed model. To evaluate the efficiency of the classifier, the proposed classifier is compared with existing classifiers, namely, CNN (Convolutional neural network), DBN (Deep brief neural network), RNN (Recurrent neural network), and Bi-LSTM (Bi-directional long short term memory). Along with these classifiers, the proposed term weighting scheme (LTF-MICF) with the existing term weighting schemes TF (Term Frequency), TF-IDF (Term-frequency-inverse document frequency), TF-DFS (Term-frequency-distinguishing feature selector), and W2V (Word to vector) are also analyzed. The performance was evaluated for both sentiment classification with an optimizer and without using an optimizer. The metrics evaluated are accuracy, precision, recall and f1-score, respectively.The existing methods implemented and proposed (GARU) are Bi-GRU, RNN, Bi-LSTM, and CNN. The simulation parameters used for processing the proposed and existing methods are discussed in Table 3 . This comparative analysis is performed to show the efficiency of a proposed over the other related existing algorithms.

Figure  4 compares the accuracy of the GARN with the existing classifiers. The accuracy obtained by existing Bi-GRU, Bi-LSTM, RNN, and CNN for the LTF-MICF is 96.93%, 95.79%, 94.59% and 91.79%. In contrast, the proposed GARN classifier achieves an accuracy of 97.86% and is considered the best classifier with the LTF-MICF term weight scheme for classifyingTwitter sentiments. But when the proposed classifier is compared with other term weighting schemes,TF-DFS, TF-IDF, TF and W2V, the accuracy obtained is 97.53%, 97.26%, 96.73% and 96.12%. Therefore, the term weight scheme withthe GARN classifier is the best solution for classification problems. Table 4 contains the accuracy values attained by four existing classifiers and the proposed classifier with four existing term weight schemes and proposed term weight scheme.

figure 4

Accuracy of the classifiers with term weight schemes

Figure  5 shows the precision performance analysis with the proposed and four existing classifiers for different term weight schemes. The precision of all existing classifiers with other term weight schemes is less than the proposed term weighting scheme. In Bi-GRU, the precision obtained by TF-DFS, TF-IDF, TF and W2V is 94.51%, 94.12%, 93.76% and 93.59%. But, when Bi-GRU is compared with the LTF-MICF term weight scheme, the precision level is increased by 95.22%. The precision achieved by the suggested method GARN with TF-DFS, TF-IDF, TF and W2V is 96.03%, 95.67%, 94.90% and 93.90%. Whereas, when the GARN classifier is compared with the suggested term weighting scheme LTF-MICF the precision achieved is 96.65%, which is considered the best classifier with the best term weighting scheme. Figure  5 shows that the GARN classifier with the LTF-MICF term weighting scheme achieved the highest precision level compared with other classifiers and term weighting schemes.Table 5 indicates the precision performance analysis for existing and proposed classifiers with term weight schemes.

figure 5

Precision of the classifiers with term weight schemes

The analysis graph of Fig.  6 shows the f-measure of the four prevalent classifiers and suggested classifiers with different term weight schemes. The f-measure of all the prevalent classifier with other term weight schemes are minimum compared to the suggested term weighting scheme. In Bi-LSTM, the f-measure gained with TF-DFS, TF-IDF, TF and W2V is93.34%, 92.77%, 92.28% and 91.89%. Compared with LTF-MICF, the f-measure level is improved by 95.22%. The f-measure derived by the advance GARN with TF-DFS, TF-IDF, TF and W2V is 96.10%, 95.65%, 94.90% and 94.00%. When GARN is compared with the advanced LTF-MICF scheme, the f-measure grows by 96.70%, which is considered the leading classifier with the supreme term weighting scheme. Therefore, from Fig.  6 , the GARN model with the LTF-MICF scheme achieved the greatest f-measure level compared with other DL models and term weighting schemes.Table 6 indicates the performance analysis of the f-measure for both prevalent and suggested classifiers with term weight schemes.

figure 6

F-measure of the classifiers with term weight schemes

Figure  7 illustrates the recall of the four previously discovered DL models andthe recommended model of dissimilar term weight schemes. The recall of the previously discovered classifier with other term weight schemes is reduced compared to the novel term weighting scheme. In RNN, the recall procured with TF-DFS, TF-IDF, TF and W2V is 91.83%, 90.65%, 90.36% and 89.04%. In comparison with LTF-MICF, the recall value is raised by 92.25%. The recall acquired by the invented GARN with TF-DFS, TF-IDF, TF and W2V is 96.23%, 95.77%, 94.09% and 94.34%. Comparing GARN with the advanced LTF-MICF scheme maximizes recall by 96.76%,which is appraised as the prime classifier with an eminent term weighting scheme. Therefore, from Fig.  7 , the GARN model with the LTF-MICF scheme securedextraordinaryrecallvalue when differentiated from other DL models and term weighting schemes. Table 7 indicates the recall performance analysis for the previously discovered and recommended classifiers with term weight schemes.

figure 7

Recall of the classifiers with term weight schemes

The four stages employed to implement this proposed work are Twitter data collection, tweet pre-processing, term weighting-based feature extraction, feature selection and classification of sentiments present in the tweet. Initially, the considered tweet sentiment dataset is subjected to pre-processing.Here, tokenization, stemming, punctuations, symbols, numbers, hashtags, and acronyms are removed. After removal, a clean pre-processed dataset is obtained. The performance achieved by proposed and existing methods for solving proposed objective is discussed in Table 8 .

Using this pre-processed dataset, a term weighting-based feature extraction is done using an integrated terms weight scheme such as LTF and MICF as a novel term weighting scheme technique named LTF-MICF technique. An optimization algorithm, HMWSO, with two hybrid mutation techniques, namely Cauchy and Gaussian mutation, is chosen for feature selection. Finally, the GARN classifier is used for the classification of Twitter sentiments. The sentiments are classified as positive, negative and neutral. The performance of existing classifiers with term weighting schemes and the proposed classifier with term weighting schemes are analyzed. The performance comparison between the proposed and existing methods is shown in Table 9 . The existing details are collected from previous works developed for sentiment analysis from theTwitter dataset.

Many DL techniques use only a single feature extraction technique, namely term frequency (TF) and distinguishing feature selector (DFS), which will not accurately extract the features. The proposed methods without optimization can diminish the proposed model’s accuracy level. The feature extraction technique used in our proposed work will perform greatly because it can extract features from frequently occurring terms in the document. The proposed work uses an optimization algorithm to increase the accuracy level of the designed model.The achieved results are shown in Fig.  8 .

figure 8

Performance comparison between proposed and existing methods

The accuracy comparison by varying the total selected features is described in Fig.  9 (a). The ROC curve of proposed model is discussed in Fig.  9 (b). The ROC is evaluated using FPR (False positive rate), and TPR (True positive rate). The AUC (Area under curve) obtained for proposed is found to be 0.989. It illustrates that the proposed model has shown efficient accuracy with less error rate.

figure 9

a Accuracy vs no of features b ROC curve

Ablation study

The ablation study for the proposed model is discussed in Table 10 . In this the performance of overall architecture is described, further the comparative analysis between existing techniques also described in Table 10 . Among all the techniques the proposed GARN has attained efficient performance than other algorithms. The hybridized methods are separately analysed and the results achieved by such techniques are also analysed which indicates that the integrating of all methods have improved the overall efficiency than applying the techniques in separate manner. Along with that, the ablation study for feature selection process is also evaluated and the obtained results are provided in Table 10 .The existing classification and feature selection methods taken for comparison are GRN (Gated recurrent network), ARN (Attention based recurrent network), RNN (Recurrent neural network), WSO, and MO (Mutation optimization).

The computational complexity of proposed model is defined below:The complexity of attention model is \(O\left( {n^{2} \cdot d} \right)\) , for recurrent network it is \(O\left( {n \cdot d^{2} } \right)\) , and the complexity of gated recurrent is found to be \(O\left( {k \cdot n \cdot d^{2} } \right)\) . The total complexity of proposed GARN is \(O\left( {k \cdot n^{2} \cdot d} \right)\) . This complexity shows that the proposed model has obtained efficient performance by reducing the system complexity. However, using the model separately won’t provide satisfactory performance. However, integration of such models has attained efficient performance than other existing methods.

GARN is preferred in this research to find the various opinions of Twitter online platform users. The implementation was carried out by utilizing the Sentiment 140 dataset. The performance of the leading GARN classifier is compared with other DL models Bi-GRU, Bi-LSTM, RNN and CNN for four performance metrics: accuracy, precision, f-measure and recall centred with four-term weighting schemes LTF-MICF, TF-DFS, TF-IDF, TF and W2V. The evaluation shows that the leading GARN DL technique reached the target level for Twitter sentiment classification. Additionally, while applying the suggested term weighting scheme-based feature extraction technique LTF-MICF with the leading GARN classifier gained an efficient result for tweet feature extraction. With the Twitter dataset, the GARN accuracy on applying LTF-MICF is 97.86%. The accuracy value attained by the proposed classifier is the highest of all the existing classifiers. Finally, the suggested GARN classifier is regarded as an effective DL classifier for Twitter sentiment analysis and other sentiment analysis applications. The proposed model has attained satisfactory result but it haven’t attained required level. This is because the proposed architecture fails to provide equal importance to the selected features. Due to this, few of the important features get lost, this has reduced the efficient performance of proposed model.Therefore as a future scope, an effective DL technique with the best feature selection method for classifying visual sentiment classification by utilizing all the selected features will be introduced. Further, this method is analysed using the small dataset, therefore in future large data with challenging images will be used to analyse the performance of present architecture.

Availability of data and materials

In this work, the dataset utilized in our proposed work contains 1,600,000 with score values for each tweets as, for positive tweets the rank value is 4 similarly for negative tweets rank value is 0 and for neutral tweets the rank value is 2 are collected using twitter api.

Change history

12 july 2023.

The typo in affiliation has been corrected.

Abbreviations

Deep Learning

  • Gated recurrent attention network

Log Term Frequency-based Modified Inverse Class Frequency

Hybrid mutation based white shark optimizer

  • Recurrent neural network

Natural Language Processing

Support Vector Machine

Naïve Bayes

Twitter Sentiment Analysis

Convolutional Neural Network

Term based random sampling

Saberi B, Saad S. Sentiment analysis or opinion mining: a review. Int J Adv Sci Eng Inf Technol. 2017;7(5):1660–6.

Article   Google Scholar  

Medhat W, Hassan A, Korashy H. Sentiment analysis algorithms and applications: a survey. Ain Shams Eng J. 2014;5(4):1093–113.

Drus Z, Khalid H. Sentiment analysis in social media and its application: systematic literature review. Procedia Comput Sci. 2019;161:707–14.

Zeglen E, Rosendale J. Increasing online information retention: analyzing the effects. J Open Flex Distance Learn. 2018;22(1):22–33.

Google Scholar  

Qian Yu, Deng X, Ye Q, Ma B, Yuan H. On detecting business event from the headlines and leads of massive online news articles. Inf Process Manage. 2019;56(6): 102086.

Osatuyi B. Information sharing on social media sites. Comput Hum Behav. 2013;29(6):2622–31.

Neubaum, German. Monitoring and expressing opinions on social networking sites–Empirical investigations based on the spiral of silence theory. PhD diss., Dissertation, Duisburg, Essen, Universität Duisburg-Essen, 2016, 2016.

Karami A, Lundy M, Webb F, Dwivedi YK. Twitter and research: a systematic literature review through text mining. IEEE Access. 2020;8:67698–717.

Antonakaki D, Fragopoulou P, Ioannidis S. A survey of Twitter research: data model, graph structure, sentiment analysis and attacks. Expert Syst Appl. 2021;164: 114006.

Birjali M, Kasri M, Beni-Hssane A. A comprehensive survey on sentiment analysis: approaches, challenges and trends. Knowl-Based Syst. 2021;226: 107134.

Yadav N, Kudale O, Rao A, Gupta S, Shitole A. Twitter sentiment analysis using supervised machine learning. Intelligent data communication technologies and internet of things. Singapore: Springer; 2021. p. 631–42.

Book   Google Scholar  

Jain PK, Pamula R, Srivastava G. A systematic literature review on machine learning applications for consumer sentiment analysis using online reviews. Comput Sci Rev. 2021;41:100413.

Pandian AP. Performance Evaluation and Comparison using Deep Learning Techniques in Sentiment Analysis. Journal of Soft Computing Paradigm (JSCP). 2021;3(02):123–34.

Gandhi UD, Kumar PM, Babu GC, Karthick G. Sentiment analysis on Twitter data by using convolutional neural network (CNN) and long short term memory (LSTM). Wirel Pers Commun. 2021;17:1–10.

Kaur H, Ahsaan SU, Alankar B, Chang V. A proposed sentiment analysis deep learning algorithm for analyzing COVID-19 tweets. Inf Syst Front. 2021;23(6):1417–29.

Alharbi AS, de Doncker E. Twitter sentiment analysis with a deep neural network: an enhanced approach using user behavioral information. Cogn Syst Res. 2019;54:50–61.

Tam S, Said RB, Özgür Tanriöver Ö. A ConvBiLSTM deep learning model-based approach for Twitter sentiment classification. IEEE Access. 2021;9:41283–93.

Chugh A, Sharma VK, Kumar S, Nayyar A, Qureshi B, Bhatia MK, Jain C. Spider monkey crow optimization algorithm with deep learning for sentiment classification and information retrieval. IEEE Access. 2021;9:24249–62.

Alamoudi ES, Alghamdi NS. Sentiment classification and aspect-based sentiment analysis on yelp reviews using deep learning and word embeddings. J Decis Syst. 2021;30(2–3):259–81.

Tan KL, Lee CP, Anbananthen KSM, Lim KM. RoBERTa-LSTM: a hybrid model for sentiment analysis with transformer and recurrent neural network. IEEE Access. 2022;10:21517–25.

Hasib, Khan Md, Md Ahsan Habib, Nurul Akter Towhid, Md Imran Hossain Showrov. A Novel Deep Learning based Sentiment Analysis of Twitter Data for US Airline Service. In 2021 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD), pp. 450–455. IEEE. 2021.

Zhao H, Liu Z, Yao X, Yang Q. A machine learning-based sentiment analysis of online product reviews with a novel term weighting and feature selection approach. Inf Process Manage. 2021;58(5): 102656.

Braik M, Hammouri A, Atwan J, Al-Betar MA, Awadallah MA. White Shark Optimizer: a novel bio-inspired meta-heuristic algorithm for global optimization problems. Knowl-Based Syst. 2022;243: 108457.

Carvalho F. Guedes, GP. 2020. TF-IDFC-RF: a novel supervised term weighting scheme. arXiv preprint arXiv:2003.07193 .

Zeng L, Ren W, Shan L. Attention-based bidirectional gated recurrent unit neural networks for well logs prediction and lithology identification. Neurocomputing. 2020;414:153–71.

Niu Z, Yu Z, Tang W, Wu Q, Reformat M. Wind power forecasting using attention-based gated recurrent unit network. Energy. 2020;196: 117081.

https://www.kaggle.com/datasets/kazanova/sentiment140

Ahuja R, Chug A, Kohli S, Gupta S, Ahuja P. The impact of features extraction on the sentiment analysis. Procedia Comput Sci. 2019;152:341–8.

Gupta B, Negi M, Vishwakarma K, Rawat G, Badhani P, Tech B. Study of Twitter sentiment analysis using machine learning algorithms on Python. Int J Comput Appl. 2017;165(9):29–34.

Ikram A, Kumar M, Munjal G. Twitter Sentiment Analysis using Machine Learning. In 2022 12th International Conference on Cloud Computing, Data Science & Engineering (Confluence) pp. 629–634. IEEE. 2022.

Gaye B, Zhang D, Wulamu A. A Tweet sentiment classification approach using a hybrid stacked ensemble technique. Information. 2021;12(9):374.

Ahmed K, Nadeem MI, Li D, Zheng Z, Ghadi YY, Assam M, Mohamed HG. Exploiting stacked autoencoders for improved sentiment analysis. Appl Sci. 2022;12(23):12380.

Subba B, Kumari S. A heterogeneous stacking ensemble based sentiment analysis framework using multiple word embeddings. Comput Intell. 2022;38(2):530–59.

Pu X, Yan G, Yu C, Mi X, Yu C. Sentiment analysis of online course evaluation based on a new ensemble deep learning mode: evidence from Chinese. Appl Sci. 2021;11(23):11313.

Chen J, Chen Y, He Y, Xu Y, Zhao S, Zhang Y. A classified feature representation three-way decision model for sentiment analysis. Appl Intell. 2022;1:1–13.

Jain DK, Boyapati P, Venkatesh J, Prakash M. An intelligent cognitive-inspired computing with big data analytics framework for sentiment analysis and classification. Inf Process Manage. 2022;59(1): 102758.

Download references

Acknowledgements

Not applicable.

Authors did not receive any funding for this study.

Author information

Authors and affiliations.

Department of Computer Science & Engineering, Koneru Lakshmaiah Education Foundation, Guntur-Dt, Vaddeswaram, Andhra Pradesh, India

Nikhat Parveen

Ton Duc Thang University, Ho Chi Minh, Vietnam

Nikhat Parveen & Amjan Shaik

ITM SLS Baroda University, Vadodara, Gujarat, India

Prasun Chakrabarti

Data Science Laboratory, Faculty of Information Technology, Industrial University of Ho Chi Minh, Ho Chi Minh, Vietnam

Bui Thanh Hung

Department of Computer Science & Engineering, St.Peter’s Engineering College, Hyderabad, India

Amjan Shaik

You can also search for this author in PubMed   Google Scholar

Contributions

NP and PC has found the proposed algorithms and obtained the datasets for the research and explored different methods discussed and contributed to the modification of study objectives and framework. Their rich experience was instrumental in improving our work. BTH and AS has done the literature survey of the paper and contributed writing the paper. All authors contributed to the editing and proofreading. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Nikhat Parveen .

Ethics declarations

Ethics approval and consent to participate, consent for publication, competing interests.

The authors declare that they have no Competing interests.

Additional information

Publisher's note.

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ .

Reprints and permissions

About this article

Cite this article.

Parveen, N., Chakrabarti, P., Hung, B.T. et al. Twitter sentiment analysis using hybrid gated attention recurrent network. J Big Data 10 , 50 (2023). https://doi.org/10.1186/s40537-023-00726-3

Download citation

Received : 30 June 2022

Accepted : 03 April 2023

Published : 17 April 2023

DOI : https://doi.org/10.1186/s40537-023-00726-3

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

  • Deep learning
  • Term weight-feature extraction
  • White shark optimizer
  • Twitter sentiment
  • Natural language processing

twitter sentiment analysis research papers 2020

This paper is in the following e-collection/theme issue:

Published on 17.4.2024 in Vol 26 (2024)

This is a member publication of University College London (Jisc)

Twitter Analysis of Health Care Workers’ Sentiment and Discourse Regarding Post–COVID-19 Condition in Children and Young People: Mixed Methods Study

Authors of this article:

Author Orcid Image

Original Paper

  • Macarena Chepo 1 * , RN, BSN, MPH, PhD   ; 
  • Sam Martin 2, 3 * , MSc, PhD   ; 
  • Noémie Déom 2 , MSc   ; 
  • Ahmad Firas Khalid 4 , MD, PhD   ; 
  • Cecilia Vindrola-Padros 2 , BA, MA, PhD  

1 School of Nursing, Universidad Andrés Bello, Santiago, Chile

2 Department of Targeted Intervention, University College London, London, United Kingdom

3 Oxford Vaccine Group, Churchill Hospital, University of Oxford, Oxford, United Kingdom

4 Canadian Institutes of Health Research Health System Impact Fellowship, Centre for Implementation Research, Ottawa Hospital Research Institute, Otawa, ON, Canada

*these authors contributed equally

Corresponding Author:

Sam Martin, MSc, PhD

Department of Targeted Intervention

University College London

Charles Bell House 43-45

Foley Street

London, W1W 7TY

United Kingdom

Phone: 44 (0)20 3108 3232

Email: [email protected]

Background: The COVID-19 pandemic has had a significant global impact, with millions of cases and deaths. Research highlights the persistence of symptoms over time (post–COVID-19 condition), a situation of particular concern in children and young people with symptoms. Social media such as Twitter (subsequently rebranded as X) could provide valuable information on the impact of the post–COVID-19 condition on this demographic.

Objective: With a social media analysis of the discourse surrounding the prevalence of post–COVID-19 condition in children and young people, we aimed to explore the perceptions of health care workers (HCWs) concerning post–COVID-19 condition in children and young people in the United Kingdom between January 2021 and January 2022. This will allow us to contribute to the emerging knowledge on post–COVID-19 condition and identify critical areas and future directions for researchers and policy makers.

Methods: From a pragmatic paradigm, we used a mixed methods approach. Through discourse, keyword, sentiment, and image analyses, using Pulsar and InfraNodus, we analyzed the discourse about the experience of post–COVID-19 condition in children and young people in the United Kingdom shared on Twitter between January 1, 2021, and January 31, 2022, from a sample of HCWs with Twitter accounts whose biography identifies them as HCWs.

Results: We obtained 300,000 tweets, out of which (after filtering for relevant tweets) we performed an in-depth qualitative sample analysis of 2588 tweets. The HCWs were responsive to announcements issued by the authorities regarding the management of the COVID-19 pandemic in the United Kingdom. The most frequent sentiment expressed was negative. The main themes were uncertainty about the future, policies and regulations, managing and addressing the COVID-19 pandemic and post–COVID-19 condition in children and young people, vaccination, using Twitter to share scientific literature and management strategies, and clinical and personal experiences.

Conclusions: The perceptions described on Twitter by HCWs concerning the presence of the post–COVID-19 condition in children and young people appear to be a relevant and timely issue and responsive to the declarations and guidelines issued by health authorities over time. We recommend further support and training strategies for health workers and school staff regarding the manifestations and treatment of children and young people with post–COVID-19 condition.

Introduction

More than 3 years after the outbreak of the COVID-19 pandemic [ 1 ], the social, political, and economic impact of this phenomenon has been more than significant, considering >700 million worldwide cases and nearly 7 million people’s deaths [ 2 ]. Given the scale of the phenomenon, it is imperative for all countries to thoroughly examine the lessons gleaned from the pandemic, particularly regarding a matter that has raised significant concern among the populace: the long-term effects experienced by individuals who have had COVID-19, spanning weeks, months, or even years after their initial infection [ 3 ]. This phenomenon, referred to as post–COVID-19 condition (or more commonly “long COVID”), warrants careful consideration and analysis [ 4 ].

There is increasing information regarding the clinical manifestation of this condition, particularly in the adult population. The worldwide prevalence has been estimated at approximately 50% to 70% in individuals hospitalized during acute COVID-19 infection and 10% to 12% in vaccinated cases [ 5 ]. While children and young people have a low likelihood of severe COVID-19 infection [ 6 ], the information available to date indicates that the presence of post–COVID-19 condition in this group may be as disabling as in adults, reaching a prevalence rate of 23.4% (range 3.7%-66.5%) [ 7 ].

An agreed definition by the World Health Organization indicates that post–COVID-19 condition in children and young people is a condition that occurs “in individuals with a history of confirmed or probable SARS-CoV-2 infection when experiencing symptoms lasting at least two months which initially occurred within three months of acute COVID-19” [ 8 ]. Post–COVID-19 condition strongly impacts daily functioning and can develop or continue after COVID-19 infection and may fluctuate or relapse over time [ 4 , 8 , 9 ].

Among the symptoms most frequently attributable to post–COVID-19 condition in children and young people are fatigue, altered smell or anosmia, and anxiety [ 8 ]. However, other symptoms have also been reported, such as sleep disturbances, difficulty in concentrating, abdominal pain, myalgia or arthralgia, earache or ringing in ears, mood swings, persistent chest pain, stomach pain, light sensitivity, diarrhea, heart palpitations, and skin lesions [ 8 , 10 ]. One of England’s most significant studies is the Children and Young People With Long COVID study by Stephenson et al [ 11 ]. This national research matched longitudinal and cohort studies in adolescent individuals aged 11 to 17 years and found the presence of symptoms in 35.4% of the adolescent individuals who tested positive at baseline and 8.3% who of the adolescent individuals who tested negative at baseline. A total of 3 months after testing, 66.5% of those who tested positive and 53.3% of those who tested negative had any symptoms [ 11 ]. However, Stephenson et al [ 12 ] recently indicated that in a 6-month follow-up, the prevalence of specific symptoms reported at the time of the polymerase chain reaction testing decreased over time, where, for example, the prevalence of chills, fever, myalgia, cough, and sore throat among those who tested positive decreased from 10% to 25% to <3%.

As research on the symptoms, prevalence, and treatment of post–COVID-19 condition in children and young people continues, it is essential to add to the literature by developing studies that determine the condition’s impact on this group, considering that they are experiencing a range of unwanted symptoms that disrupt their quality of life and that of their families.

Considering that listening to the voices of families and health workers could be helpful to broaden the knowledge achieved in post–COVID-19 condition in children and young people, a powerful tool could be social media, such as Twitter (subsequently rebranded as X). With >3729 million daily active users, Twitter has become one of the most important social platforms in the world [ 13 ]. People used Twitter during the COVID-19 pandemic for different purposes, such as world leaders communicating with citizens [ 14 , 15 ], organizations monitoring movement [ 16 ], scientists studying public discourse around the pandemic [ 17 , 18 ], and researchers performing sentiment analysis [ 19 - 21 ]. In the case of physicians and health care workers (HCWs), Twitter has been used to share and evaluate scientific evidence, guidelines, and technical advice [ 22 - 24 ] and track the course and burden of disease [ 25 ].

Using the social media monitoring platform Pulsar [ 26 ], we aimed to explore HCWs’ perceptions concerning post–COVID condition in children and young people in the United Kingdom between January 2021 and January 2022. We aimed to contribute to the emerging knowledge on post–COVID-19 condition in children and young people and identify critical areas and future directions for researchers and policy makers.

We considered a mixed methods approach to be a pragmatic research paradigm. We analyzed data by conducting a Collaborative and Digital Analysis of Big Qualitative Data in Time Sensitive Contexts (LISTEN) [ 27 ]. This mixed methods analysis consisted of iterative cycles intercalating team discussion and using digital text and discourse analytics tools to analyze related social media data [ 27 ]. We used the LISTEN method to perform quantitative and qualitative analyses of Twitter posts, extracted through the Pulsar platform [ 26 ], related to the experience of post–COVID-19 condition in children and young people in the United Kingdom (eg, phrases, words, hashtags, videos, and images), published between January 1, 2021, and January 31, 2022. We created an advanced Boolean search for keywords mentioning “long COVID” and corelated words, hashtags, and symptoms; furthermore, we filtered for user accounts who identified as HCWs in their Twitter biography description ( Multimedia Appendix 1 ).

Quantitative analysis of all tweets included the following: (1) engagement analysis, where we specifically measured reactions to posts, for example, a retweet, a share, or a comment or quote made toward a tweet; (2) sentiment and emotion analysis, where we measured the positive or negative sentiment in the words and tone of each post within the context of post–COVID-19 condition and HCW’s roles ( Multimedia Appendix 2 ); (3) emotion analysis, where we measured the emotions expressed in the tweets, classified as sadness, anger, disgust, fear, and joy; (4) frequency analysis, where we observed the frequency of keywords and themes in the data set; (5) segmentation analysis, where we measured the key connections or relationships between keywords and their frequent use in the same context; (6) demographic analysis, where we measured the occupation, gender (man or woman or nonbinary or unknown), and city of origin related to the users posting tweets; and (7) analyses, where we evaluated the most influential accounts and the most mentioned websites.

Big qualitative analysis was carried out through thematic discourse analysis of the data sample, using InfraNodus [ 28 ], specifically analyzing the key themes and topics of concern expressed throughout the data set. A codebook was constructed based on the mapping of themes agreed upon by 3 researchers (ND, SM, and MC; Multimedia Appendix 3 ).

The principal investigators (ND, AFK, SM, and MC) interpreted and analyzed the data collected, following the recommendations for rigorous research provided by Creswell and Poth [ 29 ]. Using the LISTEN method [ 27 ], we aimed to show that the integration of qualitative insights through thematic analysis with the quantitative backing of topic modeling can offer a comprehensive view of the discourse. This mixed methods approach allows us to capture the richness of qualitative data while leveraging the objectivity of quantitative measures. Our initial data harvest of the larger corpus data from the Pulsar platform captured 300,000 tweets; this data harvest helped to underpin the software’s sentiment analysis modeling of this specific data set, providing a robust quantitative foundation. The addition of further qualitative data analyses from a smaller qualitative sample allowed for an in-depth understanding of nuanced conversations, particularly when exploring new or complex phenomena such as post–COVID-19 condition in children and young people, with the provision of insights into the context, subtext, and sentiment behind the tweets offering valuable snapshots of public perception and discourse. We used an iterative mixed methods approach, iterating between team discussions and using digital analytics tools to discern relevant themes from the Twitter data corpus. Specifically, we used InfraNodus for thematic analysis, which incorporates a topic modeling script for analyzing and identifying key topics of concern with a data set and provides a structured and objective interpretation of the data. The coding process involved 3 independent researchers (MC, SM, and ND), each with expertise in health care, social network analysis, and digital global health. When initial coding disagreements arose, we meticulously tagged any queries and discussed the posts in question. These instances led to 3 structured meetings wherein the research team deliberated collaboratively to resolve conflicting interpretations. This approach resulted in an 81.99% (2122/2588) initial intercoder agreement rate for the tweets analyzed. For the remaining instances where consensus was not initially reached, the majority rule was applied to finalize theme codings. To quantify the reliability of our coding procedure, with 81.99% (2122/2588) of the tweets coded identically, we used the Cohen κ score, which provides a measure of interrater agreement adjusted for chance. Including the calculation of all variations, this score was calculated to be approximately κ=0.70, indicating good agreement among the coders.

Ethical Considerations

The study only collected data from publicly accessible social networks that have been anonymized by various means, particularly by replacing all usernames and links with anonymous text and summaries of tweets that have been edited, retaining the original message, avoiding direct quotations being identifiable, and ensuring that no information is provided on the identity of the individuals who posted the content studied on the platform.

Internet research requires researchers to carefully consider guidelines to determine whether ethics approval and informed consent are needed [ 30 ]. On the basis of the terms set out by the Research Ethics Committee at the University College London [ 31 ], the study was considered exempt from formal ethics approval for the following reasons: (1) study involving information freely available in the public domain, such as published biographies, newspaper accounts of an individual’s activities, and published minutes of a meeting, that although is considered personal under the Data Protection Act, would not require ethics review; and (2) study involving anonymized records and data sets in the public domain, such as data sets available through the Office for National Statistics or the UK Data Archive where appropriate permissions have already been obtained and it is not possible to identify individuals from the information provided.

Therefore, we anonymized all records and data sets collected during the study to make identification impossible. We removed social media usernames from the data samples. No direct or easily traceable quotes have been included. These measures align with best practices [ 32 - 35 ]. While this study was beyond the scope of the human ethics committee, we adhered to the principles of ethics: beneficence, nonmaleficence, autonomy, and justice [ 36 ]. We collected and analyzed data through secure encrypted servers via the Meltwater and InfraNodus platforms.

Audience Analysis

During the period from January 2021 to January 2022, we obtained 300,000 tweets from 936 accounts. After filtering for relevant posts (refer to inclusion and exclusion criteria in Multimedia Appendix 1 ), we analyzed a sample of 2588 tweets using mixed methods analysis. In terms of gender (man, woman, nonbinary, or unknown), 32.88% (851/2588) were female individuals, 23.49% (608/2588) were male individuals, and 43.59% (1128/2588) were unknown. According to the description given in the user’s biography, the most frequently self-reported terms were “NHS” (582/2588, 22.49%), “health” (230/2588, 8.89%), “medical” (168/2588, 6.49%), “nurse” (166/2588, 6.41%), “clinical” (160/2588, 6.18%), “mum” (158/2588, 6.11%), “doctor” (145/2588, 5.6%), and “GP” (145/2588, 5.6%). In terms of city, tweets came mainly from London (958/2588, 37.02%), Newcastle upon Tyne (326/2588, 12.6%), Redcar (160/2588, 6.18%), Manchester (140/2588, 5.41%), and Bradford (111/2588, 4.29%).

Regarding profession described in the user’s biography, the most frequently mentioned roles were nurses (176/2588, 6.8%); medical roles, for example, paramedic and nursing assistant (173/2588, 6.68%); clinical roles, for example, surgeon, physiotherapist, and anesthesiologist (160/2588, 6.18%); general practitioners (GPs), for example, hospital GP or local surgery GP (142/2588, 5.49%); and physician (140/2588, 5.41%). The most frequent organization affiliated with was the National Health Service (587/2588, 22.68%).

Most Influential Accounts

One of the accounts that generated the highest number of mentions and, therefore, some of the most influence, as they were the ones that talked the most about post–COVID-19 condition in children and young people, was the account for @longcovidkids (593/2588, 22.91% tweets), related to the most shared website longcovidkids.org [ 37 ] , an international UK-based charity for families and children living with post–COVID-19 condition. Although the account was created in October 2020, it was first mentioned in our data collection timeline on January 1, 2021. It offers web support services, funding, and research participation and represents children and young people living with post–COVID-19 condition in expert forums, research panels, health organizations, and parliamentary groups. The other most shared web pages were theguardian.com (the United Kingdom) [ 38 ], bbc.co.uk (the United Kingdom) [ 39 ], peoplewith.com (the United States) [ 40 ], and ncbi.nlm.nih.gov (the United States) [ 41 ]. This shows that in the United Kingdom, there was a mixed influence of UK and US link resources linked to HCW Twitter users in the United Kingdom.

Keyword Analysis

The volume of social media engagement in the discussion about the post–COVID-19 condition experience in children and young people in the United Kingdom reached 1400 posts, 1550 engagements, and 1.9 million impressions. Overall, comments were very responsive to government decisions regarding the vaccination program and school closures ( Multimedia Appendix 4 ). During the first peak of comments in January 2021, the amount of discourse expanded leading up to March 2021, when there were different announcements of school closures, and the guidelines were delivered regarding the priority groups of the vaccination program (frontline HCW and people aged >80 years first). The highest engagement was between June and July 2021, which coincides with the government announcement regarding the availability of vaccines for people aged >18 years. The third peak of comments occurred in September 2021, the same month the authorities announced the extension of the vaccination program to children aged 12 to 15 years.

Top Keywords Analysis

The top words in posts associated with children and young people’s experience of post–COVID-19 condition in the United Kingdom were “Children” (352/2588, 13.6%), “kids” (160/2588, 6.18%), “people” (158/2588, 6.11%), “Young” (148/2588, 5.72%), and “schools” (83/2588, 3.21%). The top hashtags were #longcovid (1387/2588, 53.59%), #longcovidkids (448/2588, 17.31%), #covid19 (370/2588, 14.3%), and #covid (176/2588, 6.8%).

Sentiment and Emotions Analysis

According to sentiment analysis, 99.38% (2572/2588) of the posts reflected negative sentiments and 0.62% (16/2588) reflected positive sentiments. Negative sentiments were mainly associated with comments on hospitalization figures related to the COVID-19 pandemic, criticism of pandemic mitigation policies, and vaccination of children and young people. Furthermore, positive sentiments mainly concerned acknowledgments around decreasing numbers of community support groups.

The primary emotions identified were as follows:

  • Sadness (1752/2588, 67.7%), such as in the following tweet:
@[Username] Really upset, after my tough on-call last night. Hospitalisations are still going up, and Gov announcement minismises the effect of long-COVID in adults and children. It’s so hard to keep spirits up today. But we’ll try and continue doing our best in the NHS.
  • Joy (367/2588, 14.18%), such as in the following tweet:
@[Username] It’s been an amazing day! [...] I’ve been able to share the experience I’ve gained treating children and adolescents with Long COVID over the last year.
  • Fear (233/2588, 9%), as seen in the following tweet:
@[Username] It’s really urgent that young people get the message that they need to get vaccinated. Long COVID is ruining many people’s lives! It’s not a lie or hypochondria, there are real, physiological changes, please understand!

Segmentation Analysis

This analysis revealed the critical clusters of conversation around the main topics of concern within the discourse network around post–COVID-19 condition. Comments were distributed in 4 key conversation segments as follows:

  • People, schools, and prevention (1734/2588, 67%): Most of the comments related to measures taken in terms of COVID-19 prevention in schools, concern about the risk of exposure, and sharing experiences of infection in schools.
  • Health, adults, and impact (401/2588, 15.49%): Comments mainly reflected concerns and uncertainty about the long-term effect of post–COVID-19 condition on both children and young people and adults.
  • Cases, virus, and risk (326/2588, 12.6%): Comments reflected worries about the associated risks and long-term consequences attributable to post–COVID-19 condition (in both adults and children and young people) and the constant mutation of the virus, which will create a permanent risk in the population.
  • Months, distress, and symptoms (106/2588, 4.1%): Some HCWs used Twitter to share how children and young people experience post–COVID-19 condition and the extent of these symptoms. Some HCWs exemplified certain typical manifestations, such as fatigue.

Discourse Analysis by Theme

To better understand the topics discussed from the segmentation analysis, we performed a discourse analysis of the key co-occurring themes and topics of concern shared within discussions regarding post–COVID-19 condition in children and young people. The following themes emerged ( Textbox 1 ): concern or uncertainty for the future, school attendance, mask protection from COVID-19, vaccine uptake, infection rates, policy (support or skepticism), understanding and visualizing symptoms, child mental health, access to care, community support, and research ( Figures 1 and 2 ).

  • Concern for the future or uncertainty (615/2588, 23.76% tweets): Most comments showed a concern for the future, focusing on shared statistics regarding the rate and spread of infection in children and young people and how this would affect future health outcomes. Furthermore, this group expressed concern regarding political decisions; the presence of illness in loved ones; the eventual overload and response capacity of the health system in the face of an increase in post–COVID-19 condition cases; and the need for training of health care workers (HCWs) to deal with comorbid, potentially long-term symptoms ( Figure 1 A).
  • Schools (460/2588, 17.77% tweets): Comments aimed to promote vaccination policies for schoolchildren and flexible measures regarding teachers’ work and attendance, considering cases of people with prolonged symptoms. In addition, several tweets expressed dissatisfaction with school risk mitigation measures, such as the use of face masks and air filters ( Figure 1 B).
  • Vaccine (386/2588, 14.9% tweets): Most tweets from this group showed their disapproval of the constant changes in the government’s decisions regarding schools and priority groups for vaccination. Between March and June 2021, the first set of tweets criticized the lack of priority in the vaccination program for schoolchildren and other at-risk groups (such as teachers). Once the authorities announced a vaccination program for schoolchildren aged 12 to 15 years ( Multimedia Appendix 4 ), most comments promoted vaccination for this group. A few comments (78/2588, 3.01%) shared concerns about the vaccine’s efficacy for children, based on the experiences of COVID-19 reinfection in adults despite having received the recommended initial doses. However, to a lesser extent (26/2588, 1%), there was a refusal to vaccinate children, citing fear of possible adverse effects. Nonetheless, it is worth noting that the community frequently refuted such comments ( Figure 1 C).
  • Share statistics (334/2588, 12.91% tweets): Frequently, HCWs shared statistical data, such as the number of affected children and young people, the number of post–COVID-19 condition cases, and hospital admissions and deaths. Some of these data were used to validate the existence of the post–COVID-19 phenomenon or to express concern about it ( Figure 1 D).
  • Policy (316/2588, 12.21% tweets): The comments were responsive to the policies emanating from the authorities over time ( Multimedia Appendix 4 ). There were 5 main criticisms, including changes in school closure or opening policies; HCWs question why the authorities ignore the evidence of post–COVID-19 cases in children and young people, leading them to question whether decision makers have sufficient training to control the pandemic adequately; the failure to include teachers and school workers in the COVID-19 vaccination program as well as the younger population; the lack of mitigation measures in schools, such as improvements in ventilation systems and mandatory use of masks; and the herd immunity as a plan in the government’s hidden agenda , that is, to promote work and activate the economy ( Figure 1 E).
  • “Proof” (280/2588, 10.82% tweets): Most tweets in this group argued regarding the existence of children and young people with post–COVID-19 condition through pictures; statistics; scientific papers; and personal, family, and professional experiences ( Figure 1 F).
  • Signs and symptoms (189/2588, 7.3% tweets): Among the symptoms described, chronic fatigue and exhaustion were the most frequent symptoms, which prevent normal activities. Other symptoms were respiratory: dyspnea, chronic cough, and shortness of breath; gastrointestinal: acute or intense abdominal pain, nausea, bloating, gastroparesis, and change in smell or taste; muscular: severe joint pain, “painful foot” and difficulty with physical activity; mental health: anxiety and low mood; topical: rash, skin rashes, and redness and pain in the eyes; and nonspecific symptoms, such as chest pain, heart palpitations, constant high body temperature, precocious puberty, hormonal changes, and erectile dysfunction ( Figure 2 A).
  • Face masks (119/2588, 4.6% tweets): Face masks were widely promoted, especially in schools, because HCWs considered them as a practical and straightforward strategy to control the pandemic ( Figure 2 B).
  • Skepticism (101/2588, 3.9% tweets): Comments showed reticence toward post–COVID-19 condition in children and young people. Some of the arguments focused on a perceived lack of clarity in the clinical manifestations and stressed the need to better differentiate the post–COVID-19 condition from other related symptomatologies, such as mood disorders (eg, depression and anxiety due to confinement). In contrast, several arguments agreed on the need for more scientific evidence, arguing that post–COVID-19 condition in children and young people are isolated. Other users claimed not to know of such cases instead of calling post–COVID-19 condition in children and young people SMS text message an exaggeration. In addition, several arguments favored releasing restrictions for children and young people, particularly arguments related to the use of masks, because of possible associated risks, for example, hypoxia ( Figure 2 C).
  • Mental health (54/2588, 2.09% tweets): Symptoms attributable to mental health problems in children and young people were also a concern. For instance, HCWs mentioned sadness, fear of infecting their family, anxiety regarding sick parents, stress, night terrors, self-harm, and suicidal ideation. Furthermore, users discussed a perceived lack of specific support for children and young people and their families in situations such as hospitalization; prolonged COVID-19 condition; admission to intensive care; and death of a family member, schoolmate, or teacher, all situations that triggered permanent stress in these groups ( Figure 2 D).
  • Community support or asking for advice (93/2588, 3.59% tweets): Some HCWs used Twitter to ask for guidance on a specific issue or share experiences of having post–COVID-19 condition or caring for children and young people or family members. Furthermore, they shared informative infographics provided by experts regarding post–COVID-19 condition in children and young people ( Figure 2 E).
  • Access to health care or treatment (72/2588, 2.78% tweets): Some HCWs mentioned the lack of specialist (cardiology) support, concerns regarding prolonged National Health Service burnout, and criticisms regarding how follow-up was carried out concerning the relative symptomatology of children and young people with post–COVID-19 condition. At the same time, opening new centers for children and young people with post–COVID-19 condition generated different reactions. On the one hand, some HCWs recognized it as a substantial development, but on the other hand, some HCWs recognized it as proof of the existence of post–COVID-19 condition in children and young people, which raised concerns for the future ( Figure 2 F).
  • Research (52/2588, 2% tweets): Under this theme, tweets largely promoted study on post–COVID-19 condition in children and young people or highlighted the need for further study on the subject ( Figure 2 G).
  • Images (57/2588, 2.2% tweets): Images shared were primarily from scientific studies, including infographics (from organizations such as National Health Service or @LongCovidKids) and visualization of children and young people’s symptoms, such as rashes, COVID-19 toe, and joint pain. Most infographics shared by organizations (and not individuals), such as the organization LongCovidKids, were related to statistics, such as the number of children and young people with post–COVID-19 condition or the quantification of the type of symptoms experienced. Shared photographs tended to show the more “visually recognizable” symptoms of post–COVID-19 condition, such as skin lesions, rashes, or inflammation. The less visible symptoms, such as chronic fatigue and neurological issues, were represented with photographs of children and young people lying, sleeping under blankets, or duvets or on hospital beds ( Figure 2 H).

twitter sentiment analysis research papers 2020

Principal Findings

Our primary objective was to explore HCWs’ perceptions concerning post–COVID-19 condition in children and young people in the United Kingdom between January 2021 and January 2022. Our findings indicated that comments made by HCWs on Twitter were responsive to announcements issued by authorities regarding the management of the COVID-19 pandemic in the United Kingdom and associated regulations on the operation of schools. The most frequent feelings and emotions were negative, mainly sadness. In turn, we identified relevant themes for HCWs, such as uncertainty or concern about the future; policies; and regulations for the prevention, management, and addressing both COVID-19 and post–COVID-19 condition in children and young people; vaccination; and the use of Twitter as a strategy to share scientific literature, management strategies, and clinical and personal experiences.

Concern from HCWs regarding the policies for addressing the COVID-19 pandemic in the children and young people in the United Kingdom (including vaccination and schools) was a recurring theme in our findings. Furthermore, concern regarding the side effects of the COVID-19 vaccine and how the vaccine might interact with preexisting physiological symptoms of post–COVID-19 condition in children and young people was a topic of discussion. Similarly, the constant change in policy making in the United Kingdom, as public health bodies and governments have tried to understand and adapt to the emergence of post–COVID-19 condition, have added to the strength of this ongoing debate [ 42 ]. The lack of up-to-date evidence on post–COVID-19 condition in children and young people prompted HCWs to rely on Twitter during the pandemic to communicate relevant information. Twitter has a broad audience reach; is used as a communication tool by politicians, health bodies, and other key influences; and facilitates real-time updates [ 43 ]. During the pandemic, HCWs, primarily those in frontline roles and local response coordination, have often been challenged to become credible spokespersons for pandemic information [ 44 ]. Such credibility directly influences public confidence and decision-making, ultimately determining the success or failure of a public health intervention [ 43 ].

Furthermore, failures in risk communication could explain the presence of uncertainty and negative feelings associated with school regulations. When people are upset, distressed, or fearful, they often do not trust the authority, decrease the perceived validity of the communication received, and find information processing difficult [ 45 ]. In this regard, Fotheringham et al [ 46 ] indicated that during 2020, school leaders in the United Kingdom faced pressures and challenges related to translating and enacting school policies, particularly with the perceived lack of agency shared by the government concerning being able to translate centrally issued guidelines. In turn, Tomson et al [ 47 ] reported that the pandemic has negatively impacted the well-being of leaders in all types of schools and across all demographic groups, affecting their ability to think clearly and solve work-related problems. Given that the protection and care of children and young people health during the COVID-19 pandemic ultimately rests with school leaders, the search for support strategies that focus on the needs of these groups becomes an urgent necessity.

Findings in Relation to Other Studies

Using Twitter’s information, this is one of the first studies to capture health professionals’ perceptions of prolonged COVID-19 in the children and young people in the United Kingdom. However, other studies have addressed post–COVID-19 condition on this social network. Callard and Peregov [ 48 ] reviewed how, through social platforms such as Twitter, patients made the persistence and heterogeneity of COVID-19 symptoms visible, thus catapulting the inclusion of post–COVID-19 condition as a relevant phenomenon in clinical and policy debates. In contrast, other authors in the last 2 years have explored on various platforms (including Twitter) the persistence of symptoms and emotional impact after months of suspected and confirmed diagnosis of COVID-19 [ 49 - 55 ], including the period of vaccination. Furthermore, others have explored web discussions regarding this phenomenon [ 56 ]. Several of these authors agree on a perceived lack of support and specific resources from governmental bodies, a lack of information or clarity in the instructions given, and the absence of formal mechanisms to allow the voices of patients and the community to be heard. The above point is critical as it highlights the gap between the needs of the population and the response provided by policy makers, which not only translates into a gap in access to health services but also limits citizen participation in decision-making on the issues that affect their own health and increases distrust toward regulations and instructions issued by the government.

Implications for Policy and Practice

Several policy recommendations and implications are targeted at various stakeholders to consider while implementing future policy guidelines to address post–COVID-19 health care delivery. First, policy makers should consider investing appropriate resources to collect data regarding post–COVID-19 condition in children and young people, specifically on the impact of COVID-19 on the mental health of children and young people. This implies working closely with researchers to streamline data collection and reporting on post–COVID-19 condition. Second, policy makers should consider providing a basic level of psychosocial support with access to quality mental health and psychosocial support services for HCWs, school staff, parents, and children and young people experiencing post–COVID-19 condition. This implies strengthening health systems, community-based programming, and mobilization. Policies must include documenting the impact of mental health and psychosocial support interventions and innovative approaches to be more widely disseminated and scaled up across different contexts and target population groups. Third, to address the criticism around frequent changes in school closure and opening policies, decision makers should develop clear, easy-to-understand school mitigation plans informed by the best available evidence. The plans should incorporate teachers, school workers, and parents to ensure all voices are included in the policy plan. Fourth, policy makers should adopt a shared decision-making approach incorporating HCWs in the decision-making process for managing the COVID-19 pandemic. Finally, government decision makers should set post–COVID-19 pandemic recovery policies informed from a health equity perspective and how this affects children and young people living with post–COVID-19 condition, factoring in childhood, family income, housing, domestic violence, access to health care, and racism.

In terms of the needed clearer road map for recommendations to support training strategies for HCWs and school staff regarding post–COVID-19 condition in children and young people, we have outlined the following 10 steps.

Step 1: Data Collection and Analysis

Our study underlines the critical need for comprehensive data on post–COVID-19 condition’s impact on the mental health of children and young people. As a first step, it is recommended that policy makers should allocate resources for the systematic collection and analysis of data on post–COVID-19 condition in children and young people, particularly focusing on mental health outcomes. These data should be used to identify the most prevalent symptoms and the most effective treatment strategies. In this context, it is recommended that experts emphasize the importance of early detection and medical consultation for mental health issues in children and young people diagnosed with post–COVID-19 condition, including mood changes, irritability, social withdrawal, memory problems, difficulty in concentrating, anxiety, depression, posttraumatic stress, school absenteeism, and suicidal ideation [ 57 , 58 ]. This entails working closely with researchers to streamline data collection and reporting on post–COVID-19 condition.

Step 2: Psychosocial Support Framework

It has been noted that globally, programs for managing post–COVID-19 condition in children and young people are heterogeneous, ranging from the use of physiotherapy, pediatric occupational therapy, and psychological support to interventions aimed at lifestyle modifications [ 59 ]. This diversity could impact differential outcomes in the treatment, recovery, and timely and effective rehabilitation of children and young people with post–COVID-19 condition. Upon analyzing the wider literature and the social media data in this study, it is recommended that a basic level of psychosocial support should be established. This would involve ensuring access to quality mental health services for HCWs, school staff, parents, and children and young people with post–COVID-19 condition. This framework should be integrated into the health system and community-based programming, emphasizing the mobilization of resources and strengthening of support networks. It is suggested that the psychosocial support framework should facilitate access to quality mental health services and support networks that are robust and responsive. Community engagement gleaned from further Twitter discourse analysis should be a helpful guide in the development of these services to ensure they meet the real and expressed needs of children and young people with post–COVID-19 condition. Practical examples of basic psychosocial support include using web support services; individual or group therapy sessions; school-based emotional support programs; and counseling sessions aimed at parents, family members, or school staff.

Step 3: Educational Mitigation Plans

The frequent policy changes around school closures highlight the necessity for stable and clear educational mitigation plans. It is recommended that these plans should be directly informed by the evidence collected and further analysis of sentiments and emotions surrounding post–COVID-19 condition in schools. Incorporating the viewpoints of teachers, parents, and school staff, as identified in our thematic analysis, will ensure that the mitigation strategies are comprehensive, feasible, and sensitive to the psychosocial impact on children and young people. School staff and policy makers should collaborate to develop clear, evidence-informed educational mitigation plans. These plans should be straightforward and involve teachers, school workers, and parents in their creation, ensuring a unified approach that considers the voices of all stakeholders.

Step 4: Shared Decision-Making in Health Care

In health care settings, the adoption of a shared decision-making model is crucial, enabling HCWs to actively contribute to the formulation of COVID-19 and post–COVID-19 policies. This inclusive approach ensures that frontline workers can provide valuable insights toward policy development. To facilitate this, the establishment of advisory committees composed of representatives from HCWs is recommended. This committee can convene regularly to deliberate on key decisions pertaining to the COVID-19 pandemic management, including prevention measures, resource distribution, and vaccination strategies. Such collaborative groups have demonstrated effectiveness in identifying priority needs within the context of a pandemic [ 60 ].

Step 5: Health Equity in Policy Setting

Post–COVID-19 recovery policies should be set with a health equity lens. This means considering factors such as family income, housing, domestic violence, access to health care, and racism and how these factors affect children and young people living with post–COVID-19 condition. Our findings emphasize the importance of framing post–COVID-19 recovery policies through a lens of health equity. The concerns raised by HCWs regarding the socioeconomic impacts, such as family income and access to health care, underline the need for policies that address not just the medical aspects of post–COVID-19 condition but also the social determinants of health. An equitable approach will ensure that children and young people from diverse backgrounds receive appropriate support.

Step 6: Documenting and Disseminating Interventions

It is vital to document the impact of mental health and psychosocial support interventions. In this context, it is crucial to implement innovative strategies to disseminate unbiased information about post–COVID-19 condition among health care professionals and educators working with children and young people, ensuring it reaches different contexts and populations. These strategies may include creating interactive multimedia resources, such as videos and mobile apps; organizing webinars; actively using social media; and forming web support groups. These groups will provide a space where patients, health care professionals, and educators can share their experiences and knowledge regarding post–COVID-19 condition. These actions will not only help reduce isolation and social stigma but also strengthen support for these groups considered vulnerable [ 61 ].

Step 7: Developing a Clear Communication Strategy

Policy makers must develop a clear communication strategy to address frequent policy changes and mitigate confusion. This strategy should be informed by the data collected and analysis conducted in Step 1. The data reveal a palpable sense of uncertainty and frustration due to frequent policy shifts, underscoring the need for a clear and consistent communication strategy. This strategy should be grounded in the evidence gathered from the health care community’s discourse and aim to minimize confusion by providing timely, transparent, and reliable information regarding post–COVID-19 policies and support services.

Step 8: Training and Support Strategies

On the basis of the findings of the comprehensive data analysis, specific training and support strategies should be developed for HCWs and school staff. These strategies should be focused on the practical aspects of identifying and managing post–COVID-19 condition in children and young people. For instance, training sessions could include practical workshops on recognizing post–COVID-19 symptoms in children and adolescents, conducting diagnostic assessments, and implementing appropriate treatment and support interventions.

Step 9: Continuous Feedback and Policy Adaptation

The continuous evolution of the post–COVID-19 phenomenon demands an iterative approach to policy making. On the basis of our study, we recommend establishing feedback mechanisms with HCWs and school staff to monitor the reception and effectiveness of implemented policies. This feedback, coupled with ongoing research, should inform policy adaptations to ensure they remain aligned with the evolving landscape of post–COVID-19 condition and its impact on children and young people.

Step 10: Evaluation and Research

Finally, there should be a commitment to ongoing evaluation and research. This will involve not only monitoring the implementation of the abovementioned steps but also supporting new research to fill any remaining gaps in understanding the long-term effects of COVID-19 on children and young people.

This sequence of steps is designed to be iterative and responsive, ensuring that the recommendations from the study are translated into concrete actions that adapt to emerging data and research findings.

Strengths and Limitations

A key strength of this study is that our social media analysis of post–COVID-19 condition contributes toward an emerging understanding of reported experiential, emotional, and practical dimensions of post–COVID-19 condition in children and young people specifically and questions of vaccine hesitancy in children and young people with post–COVID-19 condition. This is one of the few studies to collect HCWs’ perceptions regarding post–COVID-19 condition in children and young people in the United Kingdom using information from Twitter. We identify key areas that need considering attention and focus, such as the provision of psychosocial support with access to quality mental health resources to alleviate the impact of post–COVID-19 condition in children and young people and the development of clear post–COVID-19 pandemic recovery guidelines that are informed by health equity perspective, and how this affects children and young people living with post–COVID-19 condition.

One of the limitations this study acknowledges is the definition of post–COVID-19 condition in children and young people. When data were collected, the lack of consensus on the definition of post–COVID-19 condition in children and young people forced us to formulate a definition of post–COVID-19 condition in children and young people based on the available literature. Furthermore, this study is limited to the perceptions of people who used descriptors in their web biography attributable to HCWs; therefore, our results only represent some HCWs in the United Kingdom and those in other countries. In turn, this research collected data from Twitter only; therefore, further inquiry into HCWs’ perceptions of post–COVID-19 condition in children and young people required expanding to other data sources or social networks and including languages other than English. We acknowledge that demographic factors, geographic location, and individual daily activities of social media users can significantly influence language use and word choice, introducing potential biases in tweet-based data. Such biases are inherent in any analysis of social media content and can affect the generalizability of findings. For instance, our study relies on Twitter data, which do not encompass the full spectrum of global or the UK public opinion on post–COVID-19 condition in children and young people. While Twitter serves as a valuable platform for capturing real-time sentiments and experiences, it is not fully representative of all demographics and geographic regions. Our results may reflect the perspectives of more vocal or active social media users, which may not correspond to the silent majority or those without access to social media. In addition, the absence of geotagged information for many users limits our ability to conduct a more nuanced spatial analysis of the sentiments expressed.

Furthermore, our study is built upon the recognition that social media data may overrepresent certain demographic groups while underrepresenting others, such as the older population or those without reliable internet access. This skew can influence the apparent prevalence of certain views or experiences of post–COVID-19 condition. Moreover, individuals’ patterns of daily life, reflected in their social media use and content, contribute additional layers of complexity and potential bias to the discourse analyzed.

Consistent with scholarly precedents on the subject [ 62 , 63 ], our study acknowledges these biases as intrinsic limitations of social media–based research. Although our analysis did not control for these factors, we recognize their potential impact on our results. Future studies would benefit from incorporating a broader array of data sources, including interviews or focus groups, to provide a more representative and comprehensive understanding of post–COVID-19 condition in children and young people. This approach would complement our Twitter-based findings and help mitigate the biases inherent in social media data.

Conclusions

More than a year after the start of the COVID-19 pandemic, the perceptions described on Twitter by HCWs concerning the presence of post–COVID-19 condition in children and young people appear to be a relevant and timely issue as well as very responsive to the declarations and guidelines issued by the health authorities over time. The most prominent group within the discourse studied was the activist or lobbying organization @LongCovidKids, which shared the most tweets and images over the period studied. We recommend that future research focus on how web health activism is organized and carried out for children and young people with post–COVID-19 condition. Such a strategy would allow for a better understanding of the scope and impact of this phenomenon and how it can influence decision-making. Furthermore, we suggest different mitigation strategies, support, and training of HCWs and school staff regarding manifestations and treatment of post–COVID-19 condition in children and young people across all demographic areas.

Acknowledgments

The authors would like to thank the Rapid Research Evaluation and Assessment Lab, Department of Targeted Intervention, University College London, London, United Kingdom, whose support has been essential for developing this project.

Conflicts of Interest

None declared.

Filters used for the search strategy on Twitter.

Sentiment analysis framework: attitudes toward post–COVID-19 condition in children and young people.

Theme codebook: examples of tweets that fit into main themes tagged for mention of children and young people with post–COVID-19 condition.

Timeline of national governmental policies and guidelines regarding children and young people.

  • World Health Organization. COVID-19 Public Health Emergency of International Concern (PHEIC) Global research and innovation forum. Global Research Collaboration for Infectious Disease Preparedness. Feb 12, 2020. URL: https:/​/www.​who.int/​publications/​m/​item/​covid-19-public-health-emergency-of-international-concern-(pheic)-global-research-and-inno vation-forum [accessed 2022-06-06]
  • Johns Hopkins University of Medicine. COVID-19 Dashboard by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University (JHU). Coronavirus Resource Center. Jan 22, 2020. URL: https://coronavirus.jhu.edu/map.html [accessed 2023-06-09]
  • Nature Editorial. Long COVID and kids: more research is urgently needed. Nature. Feb 08, 2022;602(7896):183. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Long COVID or post-COVID conditions. Centers for Disease Control and Prevention. URL: https://www.cdc.gov/coronavirus/2019-ncov/long-term-effects/index.html [accessed 2023-06-09]
  • Davis HE, McCorkell L, Vogel JM, Topol E. Long COVID: major findings, mechanisms and recommendations. Nat Rev Microbiol. Mar 13, 2023;21(3):133-146. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Zimmermann P, Curtis N. Why is COVID-19 less severe in children? A review of the proposed mechanisms underlying the age-related difference in severity of SARS-CoV-2 infections. Arch Dis Child. Dec 01, 2020;106(5):429-439. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Zheng YB, Zeng N, Yuan K, Tian SS, Yang YB, Gao N, et al. Prevalence and risk factor for long COVID in children and adolescents: a meta-analysis and systematic review. J Infect Public Health. Mar 07, 2023;16(5):660-672. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • World Health Organization. A clinical case definition for post COVID-19 condition in children and adolescents by expert consensus. World Health Organization. Feb 16, 2023. URL: https:/​/www.​who.int/​publications/​i/​item/​WHO-2019-nCoV-Post -COVID-19-condition-CA-Clinical-case-definition-2023-1 [accessed 2024-03-26]
  • Stephenson T, Allin B, Nugawela MD, Rojas N, Dalrymple E, Pinto Pereira S, CLoCk Consortium, et al. Long COVID (post-COVID-19 condition) in children: a modified Delphi process. Arch Dis Child. Jun 17, 2022;107(7):674-680. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Esposito S, Principi N, Azzari C, Cardinale F, Di Mauro G, Galli L, et al. Italian intersociety consensus on management of long Covid in children. Ital J Pediatr. Mar 09, 2022;48(1):1-9. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Stephenson T, Pinto Pereira SM, Shafran R, de Stavola BL, Rojas N, McOwat K, CLoCk Consortium, et al. Physical and mental health 3 months after SARS-CoV-2 infection (long COVID) among adolescents in England (CLoCk): a national matched cohort study. Lancet Child Adolesc Health. Feb 08, 2022;6(4):230-239. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Stephenson T, Pinto Pereira SM, Nugawela MD, McOwat K, Simmons R, Chalder T, et al. CLoCk Consortium. Long COVID-six months of prospective follow-up of changes in symptom profiles of non-hospitalised children and young people after SARS-CoV-2 testing: a national matched cohort study (The CLoCk) study. PLoS One. Mar 6, 2023;18(3):e0277704. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Twitter users, stats, data and trends. Data Reportal. May 11, 2023. URL: https://datareportal.com/essential-twitter-stats#:~ :text=Based [accessed 2023-06-09]
  • Rufai SR, Bunce C. World leaders' usage of Twitter in response to the COVID-19 pandemic: a content analysis. J Public Health (Oxf). Aug 18, 2020;42(3):510-516. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Haman M. The use of Twitter by state leaders and its impact on the public during the COVID-19 pandemic. Heliyon. Nov 2020;6(11):e05540. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Huang X, Li Z, Jiang Y, Li X, Porter D. Twitter reveals human mobility dynamics during the COVID-19 pandemic. PLoS One. Nov 10, 2020;15(11):e0241957. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Wicke P, Bolognesi MM. Framing COVID-19: how we conceptualize and discuss the pandemic on Twitter. PLoS One. Sep 30, 2020;15(9):e0240010. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Chang CH, Monselise M, Yang CC. What are people concerned about during the pandemic? detecting evolving topics about COVID-19 from Twitter. J Healthc Inform Res. Jan 17, 2021;5(1):70-97. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Xue J, Chen J, Hu R, Chen C, Zheng C, Su Y, et al. Twitter discussions and emotions about the COVID-19 pandemic: machine learning approach. J Med Internet Res. Nov 25, 2020;22(11):e20550. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Boon-Itt S, Skunkan Y. Public perception of the COVID-19 pandemic on Twitter: sentiment analysis and topic modeling study. JMIR Public Health Surveill. Nov 11, 2020;6(4):e21978. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Valdez D, Ten Thij M, Bathina K, Rutter LA, Bollen J. Social media insights into US mental health during the COVID-19 pandemic: longitudinal analysis of Twitter data. J Med Internet Res. Dec 14, 2020;22(12):e21418. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Rashid MA, Yip SW, Gill D, Arfeen Z. Sharing is caring: an analysis of #FOAMed Twitter posts during the COVID-19 pandemic. Postgrad Med J. Mar 14, 2022;98(1157):199-204. [ CrossRef ] [ Medline ]
  • Ghosh P, Schwartz G, Narouze S. Twitter as a powerful tool for communication between pain physicians during COVID-19 pandemic. Reg Anesth Pain Med. Feb 21, 2021;46(2):187-188. [ CrossRef ] [ Medline ]
  • Burgos LM, Gil Ramirez A, Utengen A, Thamman R. Use of Twitter during COVID-19 pandemic: an opportunity for continuing medical education in cardiology. Medicina (B Aires). 2020;80 Suppl 6:122-123. [ FREE Full text ] [ Medline ]
  • Margus C, Brown N, Hertelendy AJ, Safferman MR, Hart A, Ciottone GR. Emergency physician Twitter use in the COVID-19 pandemic as a potential predictor of impending surge: retrospective observational study. J Med Internet Res. Jul 14, 2021;23(7):e28615. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Pulsar TRAC- Audience intelligence platform and social listening tool. Pulsar. URL: https://www.pulsarplatform.com/solutions/pulsar-trac/ [accessed 2022-03-01]
  • Vera San Juan N, Aceituno D, Djellouli N, Sumray K, Regenold N, Syversen A, et al. Mental health and well-being of healthcare workers during the COVID-19 pandemic in the UK: contrasting guidelines with experiences in practice. BJPsych Open. Dec 10, 2020;7(1):e15. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Paranyushkin D. InfraNodus: generating insight using text network analysis. In: Proceedings of the World Wide Web Conference. 2019. Presented at: WWW '19; May 13-17, 2019; San Francisco, CA. [ CrossRef ]
  • Creswell JW, Poth CN. Qualitative Inquiry and Research Design: Choosing Among Five Approaches 4th Edition. Thousand Oaks, CA. SAGE Publications, Inc; 2017.
  • Eysenbach G, Till JE. Ethical issues in qualitative research on internet communities. BMJ. Nov 10, 2001;323(7321):1103-1105. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • UCL research ethics. University College London. URL: https://www.ucl.ac.uk/research-ethics/do-i-need-ethical-approval# When [accessed 2023-06-12]
  • Martin S, Kilich E, Dada S, Kummervold PE, Denny C, Paterson P, et al. "Vaccines for pregnant women…?! Absurd" - Mapping maternal vaccination discourse and stance on social media over six months. Vaccine. Sep 29, 2020;38(42):6627-6637. [ CrossRef ] [ Medline ]
  • Kummervold PE, Martin S, Dada S, Kilich E, Denny C, Paterson P, et al. Categorizing vaccine confidence with a transformer-based machine learning model: analysis of nuances of vaccine sentiment in Twitter discourse. JMIR Med Inform. Oct 08, 2021;9(10):e29584. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Ahmed W, Bath PA, Demartini G. Using Twitter as a data source: an overview of ethical, legal, and methodological challenges. In: Woodfield K, editor. The Ethics of Online Research. Bingley, UK. Emerald Publishing Limited; Dec 12, 2017.
  • Ayers JW, Caputi TL, Nebeker C, Dredze M. Don't quote me: reverse identification of research participants in social media studies. NPJ Digit Med. Aug 2, 2018;1(1):30. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Varkey B. Principles of clinical ethics and their application to practice. Med Princ Pract. Jun 4, 2021;30(1):17-28. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Long Covid Kids homepage. Long Covid Kids. URL: https://es.longcovidkids.org/ [accessed 2023-06-12]
  • The Guardian homepage. The Guardian. URL: https://www.theguardian.com/uk [accessed 2023-06-12]
  • Welcome to the BBC. BBC. URL: https://www.bbc.com/ [accessed 2023-06-12]
  • People with health. PeopleWith. URL: https://peoplewith.com/ [accessed 2023-06-12]
  • Welcome to NCBI. National Institutes of Health National Library of Medicine. URL: https://www.ncbi.nlm.nih.gov/ [accessed 2023-06-12]
  • Edobor M. Trust and public discourse during the Covid‐19 pandemic. IPPR Progress Rev. Feb 15, 2021;27(4):354-360. [ CrossRef ]
  • Nielsen RK, Fletcher R, Kalogeropoulos A, Simon F. Communications in the coronavirus crisis: lessons for the second wave. Reuters Institute for the Study of Journalism. Oct 27, 2020. URL: https://reutersinstitute.politics.ox.ac.uk/communications-coronavirus-crisis-lessons-second-wave [accessed 2024-03-26]
  • Zohar T, Negev M, Sirkin M, Levine H. Trust in COVID-19 policy among public health professionals in Israel during the first wave of the pandemic: a cross-sectional study. Isr J Health Policy Res. Apr 11, 2022;11(1):20. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Enria L, Waterlow N, Rogers NT, Brindle H, Lal S, Eggo RM, et al. Trust and transparency in times of crisis: results from an online survey during the first wave (April 2020) of the COVID-19 epidemic in the UK. PLoS One. Feb 16, 2021;16(2):e0239247. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Fotheringham P, Harriott T, Healy G, Arenge G, Wilson E. Pressures and influences on school leaders navigating policy development during the COVID‐19 pandemic. Brit Educ Res J. Jul 30, 2021;48(2):201-227. [ CrossRef ]
  • Thomson P, Greany T, Martindale N. The trust deficit in England: emerging research evidence about school leaders and the pandemic. J Educ Admin History. Sep 13, 2021;53(3-4):296-300. [ CrossRef ]
  • Callard F, Perego E. How and why patients made long COVID. Soc Sci Med. Jan 2021;268:113426. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Davis HE, Assaf GS, McCorkell L, Wei H, Low RJ, Re'em Y, et al. Characterizing long COVID in an international cohort: 7 months of symptoms and their impact. EClinicalMedicine. Aug 2021;38:101019. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Miyake E, Martin S. Long Covid: online patient narratives, public health communication and vaccine hesitancy. Digit Health. Nov 29, 2021;7:20552076211059649. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Matharaarachchi S, Domaratzki M, Katz A, Muthukumarana S. Discovering long COVID symptom patterns: association rule mining and sentiment analysis in social media tweets. JMIR Form Res. Sep 07, 2022;6(9):e37984. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Bhattacharyya A, Seth A, Rai S. The effects of long COVID-19, its severity, and the need for immediate attention: analysis of clinical trials and Twitter data. Front Big Data. Dec 15, 2022;5:1051386. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Samannodi M, Alwafi H, Naser AY, Al Qurashi AA, Qedair JT, Salawati E, et al. Determinants of post-COVID-19 conditions among SARS-CoV-2-infected patients in Saudi Arabia: a web-based cross-sectional study. Diseases. Aug 23, 2022;10(3):55. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Santarossa S, Rapp A, Sardinas S, Hussein J, Ramirez A, Cassidy-Bushrow AE, et al. Understanding the #longCOVID and #longhaulers conversation on Twitter: multimethod study. JMIR Infodemiology. 2022;2(1):e31259. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Déguilhem A, Malaab J, Talmatkadi M, Renner S, Foulquié P, Fagherazzi G, et al. Identifying profiles and symptoms of patients with long COVID in France: data mining infodemiology study based on social media. JMIR Infodemiology. Nov 22, 2022;2(2):e39849. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Awoyemi T, Ebili U, Olusanya A, Ogunniyi KE, Adejumo AV. Twitter sentiment analysis of long COVID syndrome. Cureus. Jun 2022;14(6):e25901. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Malone LA, Morrow A, Chen Y, Curtis D, de Ferranti SD, Desai M, et al. Multi-disciplinary collaborative consensus guidance statement on the assessment and treatment of postacute sequelae of SARS-CoV-2 infection (PASC) in children and adolescents. PM R. Oct 2022;14(10):1241-1269. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Shachar-Lavie I, Shorer M, Segal H, Fennig S, Ashkenazi-Hoffnung L. Mental health among children with long COVID during the COVID-19 pandemic. Eur J Pediatr. Apr 14, 2023;182(4):1793-1801. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Brackel CL, Noij LC, Vijverberg SJ, Legghe CL, Maitland-van der Zee AH, van Goudoever JB, et al. International care programs for pediatric post-COVID condition (long COVID) and the way forward. Pediatr Res. Jan 29, 2024. (forthcoming). [ CrossRef ] [ Medline ]
  • Ripp J, Peccoralo L, Charney D. Attending to the emotional well-being of the health care workforce in a New York City health system during the COVID-19 pandemic. Acad Med. Aug 2020;95(8):1136-1139. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Buonsenso D, Camporesi A, Morello R, De Rose C, Fracasso M, Chieffo DP, et al. Social stigma in children with long COVID. Children (Basel). Sep 07, 2023;10(9):1518. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Mitchell L, Frank MR, Harris KD, Dodds PS, Danforth CM. The geography of happiness: connecting twitter sentiment and expression, demographics, and objective characteristics of place. PLoS One. May 29, 2013;8(5):e64417. [ FREE Full text ] [ CrossRef ] [ Medline ]
  • Padilla JJ, Kavak H, Lynch CJ, Gore RJ, Diallo SY. Temporal and spatiotemporal investigation of tourist attraction visit sentiment on Twitter. PLoS One. Jun 14, 2018;13(6):e0198857. [ FREE Full text ] [ CrossRef ] [ Medline ]

Abbreviations

Edited by A Mavragani; submitted 20.06.23; peer-reviewed by R Gore, A Wahbeh; comments to author 02.11.23; revised version received 14.02.24; accepted 08.03.24; published 17.04.24.

©Macarena Chepo, Sam Martin, Noémie Déom, Ahmad Firas Khalid, Cecilia Vindrola-Padros. Originally published in the Journal of Medical Internet Research (https://www.jmir.org), 17.04.2024.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in the Journal of Medical Internet Research, is properly cited. The complete bibliographic information, a link to the original publication on https://www.jmir.org/, as well as this copyright and license information must be included.

  • Main navigation
  • Main content

Cleveland Fed research: How well does the Beige Book predict recessions?

Anecdotal economic data compiled for the Federal Reserve’s Beige Book may be useful in predicting recessions, especially when regional-level economic sentiment is taken into account, according to a new report  published by the Cleveland Fed.

Using natural language processing, researchers from the Cleveland Fed and Washington University in St. Louis constructed indices quantifying the sentiment expressed in the text of all 468 editions of the Beige Book going back to its creation in 1970.

The sentiment of the Beige Book’s national economic summary as well as regional summaries compiled by the 12 Federal Reserve Banks was typically negative during recessions. This suggests that these summaries, which are more timely than data such as GDP, may be useful for determining when the nation is in a recession. For instance, the analysis suggests that the probability of a recession has bounced around considerably since the pandemic-induced recession of early 2020, but the probability remains low as of March 2024, based on data from that month’s Beige Book.

The analysis also suggests that relying on the Beige Book’s national economic summary alone does not provide as much predictive power as evaluating regional-level economic sentiment.

“We view these findings as supporting the attention that the regional Reserve Banks give to firsthand reports of economic activity in their respective Districts,” the authors write.

Read the Economic Commentary: Regional Economic Sentiment: Constructing Quantitative Estimates from the Beige Book and Testing Their Ability to Forecast Recessions

About the Beige Book: To learn more or see the latest edition, visit the Beige Book page at federalreserve.gov .

Federal Reserve Bank of Cleveland

The Federal Reserve Bank of Cleveland is one of 12 regional Reserve Banks that along with the Board of Governors in Washington DC comprise the Federal Reserve System. Part of the US central bank, the Cleveland Fed participates in the formulation of our nation’s monetary policy, supervises banking organizations, provides payment and other services to financial institutions and to the US Treasury, and performs many activities that support Federal Reserve operations System-wide. In addition, the Bank supports the well-being of communities across the Fourth Federal Reserve District through a wide array of research, outreach, and educational activities.

The Cleveland Fed, with branches in Cincinnati and Pittsburgh, serves an area that comprises Ohio, western Pennsylvania, eastern Kentucky, and the northern panhandle of West Virginia.

Media contact

Chuck Soder, [email protected] , 216.672.2798

IMAGES

  1. Sustainability

    twitter sentiment analysis research papers 2020

  2. sentiment-analysis-twitter

    twitter sentiment analysis research papers 2020

  3. (PDF) Sentiment analysis on tweets for social events

    twitter sentiment analysis research papers 2020

  4. (PDF) Political Sentiment Analysis Using Twitter Data

    twitter sentiment analysis research papers 2020

  5. Social Media Sentiment Analysis Using Twitter Datasets

    twitter sentiment analysis research papers 2020

  6. (PDF) Twitter sentiment analysis

    twitter sentiment analysis research papers 2020

VIDEO

  1. Twitter Sentiment Analysis

  2. Sentimental analysis on twitter data using Hybrid Machine Learning Models

  3. Twitter Sentiment Analysis

  4. Twitter Sentiment Analysis of COVID-19 Vaccine

  5. TWITTER SENTIMENT ANALYSIS BASED ON ORDINAL REGRESSION Btech ProjectsLive CSE Major BTech Students

  6. Twitter Sentiment Analysis

COMMENTS

  1. Sentiment analysis using Twitter data: a comparative application of

    Sentiment analysis with ambivalence handling can be incorporated to account for a finer-grained results and characterize emotions into such detailed categories such as anxiety, sadness, anger, excitement, and happiness (Wang et al. 2015, 2020). Sentiment analysis is generally done to text data, although it can also be used to analyze data from ...

  2. A systematic review of social media-based sentiment analysis: Emerging

    2.1. The identification of research questions. Sentiment analysis techniques have been shown to enable individuals, organizations and governments to benefit from the wealth of meaningful information contained in the unstructured data of social media, and there has been a great deal of research devoted to the design of high-performance sentiment classifiers and their applications [1], [4], [5 ...

  3. (PDF) Twitter Sentiment Analysis Approaches: A Survey

    Sentiment analysis, among other approaches, represents a decent percentage of Arabic applications which have led to impressive discoveries. In [10] the authors mentioned different approaches to ...

  4. (PDF) Sentiment Analysis of Twitter Data

    among researchers in sentiment analysis. Research into T witter Sentiment Analysis (TSA) is an active. subfield of text mining. TSA refers to the use of computers to process the subjective nature ...

  5. Twitter Sentiment Analysis

    In this era of growing social media users, Twitter has significantly large number of daily users who post their opinions in the form of tweets. This paper presents an idea of extracting sentiments out of the tweet and an approach towards classifying a tweet into positive, negative or neutral. This approach can be in many ways useful to any organization, who gets mentioned or tagged in a tweet ...

  6. (PDF) Real Time Twitter Sentiment Analysis using Natural Language

    Real Time Twitter Sentiment Analysis using. Natural Language Processing. 1 Anupama B S, 2 Rakshith D B, 3 Rahul Kumar M, 4 Navaneeth M. #Department of Computer Science & Engineering, Siddaganga ...

  7. A large-scale sentiment analysis of tweets pertaining to the 2020 US

    We capture the public sentiment towards candidates in the 2020 US Presidential Elections, by analyzing 7.6 million tweets sent out between October 31st and November 9th, 2020. We apply a novel approach to first identify tweets and user accounts in our database that were later deleted or suspended from Twitter. This approach allows us to observe the sentiment held for each presidential ...

  8. A Comprehensive Survey on Sentiment Analysis in Twitter Data

    It reviews several research papers and states the significant analysis. ... it extends the various research issues which can be useful for the researchers to accomplish further research on sentiment analysis in twitter data. ... P. A., & Mascareñ, A. (2020). Sentiment analysis of Twitter data during critical events through Bayesian networks ...

  9. Sentiment Analysis of Twitter Data: A Survey of Techniq

    In this paper, we provide a survey and a ... Machine, we provide research on twitter data streams.We have also discussed general challenges and applications of Sentiment Analysis on Twitter. opinions in text into categories like "positive" or "ne Keywords Twitter, Sentiment analysis (SA), Opinion mining, Machine learning, Naive Bayes (NB ...

  10. Sentiment Analysis of Twitter Data Using Machine Learning

    Consequently, this research emphasizes the significance and potential of Twitter Sentiment Analysis, as an approach to examining prevailing sentiment. By utilizing Natural Language Processing (NLP) and other strategies the proposed system enhances sentiment analysis methods and their practical use in fields, through machine learning.

  11. Free Full-Text

    Twitter has become a major social media platform and has attracted considerable interest among researchers in sentiment analysis. Research into Twitter Sentiment Analysis (TSA) is an active subfield of text mining. TSA refers to the use of computers to process the subjective nature of Twitter data, including its opinions and sentiments. In this research, a thorough review of the most recent ...

  12. PDF Sentiment Analysis on Twitter by Using TextBlob for Natural Language

    Stop words like am, is, was etc. do not show any emotions. So these are removed for decompressing the data set. Compress extra letter words like 'Funnyyy' to 'Funny'. Slag words like c8, g9 are decompressed which are adjectives or nouns signifying the highest sentiment level. Removal of these words is essential.

  13. Sentimental Analysis of Twitter Data with respect to General Elections

    In this paper, Tweets were collected from the period of Jan 2019 to March 2019. Using that tweets, sentiment analysis was performed to gain the opinion polarity of the folks concerning general elections held in India. Two candidates were considered for this study: Candidate-1 and Candidate-2.

  14. Leveraging Transformer Neural Networks for Enhanced Sentiment Analysis

    This paper presents an intricate exploration of applying deep learning technologies, specifically the Transformer neural network model, in classifying sentiments expressed in a copious corpus of 1.6 million tweets from the Sentiment140 dataset. ... Gupta, Bhumika, "Study of Twitter sentiment analysis using machine learning algorithms on Python ...

  15. (PDF) Twitter Sentiment Analysis-A Review Study

    The basic information and knowledge to sentiment analysis of twitter are briefly discussed in this review paper. Sentiment Analysis can be viewed as a field of text mining, NLP (Natural Language ...

  16. A reliable sentiment analysis for classification of tweets in social

    Related work. Researchers in the field of sentiment analysis have been mostly used supervised machine learning algorithm for primary classification, such as the work done by Chauhan et al. ().Furthermore, many of the recent studies use Twitter as the primary source of data (Al-Laith, et al. (), Yadav, et al. ()).Henríquez and Ruz used a non-iterative deep random vectorial functional link ...

  17. Twitter sentiment analysis using hybrid gated attention recurrent

    Sentiment analysis is the most trending and ongoing research in the field of data mining. Nowadays, several social media platforms are developed, among that twitter is a significant tool for sharing and acquiring peoples' opinions, emotions, views, and attitudes towards particular entities. This made sentiment analysis a fascinating process in the natural language processing (NLP) domain.

  18. Twitter Sentiment Analysis During Covid-19 Outbreak in Nepal

    The graphical representation has been provided on the data after sentiment analysis based on two specified hashtags keywords : #COVID-19 and #coronavirus. The data are collected from the users who shared their location as 'Nepal' between 21st May 2020 and 31st May 2020.

  19. (PDF) Twitter sentiment analysis

    Sentiment analysis is a natural language processing. techniques to quantify an expressed opinion or sentimen t. within a selection of tweets [8]. 2014 International Conference on Information ...

  20. Twitter Sentiment Analysis by Rajani Shree Manjappa, Aditya Kumar

    If you need immediate assistance, call 877-SSRNHelp (877 777 6435) in the United States, or +1 212 448 2500 outside of the United States, 8:30AM to 6:00PM U.S. Eastern, Monday - Friday. The goal of tweet sentiment analysis is to find the positive, negative, or neutral sentiment part in the tweeter data. Sentiment analysis can help any organizat.

  21. Journal of Medical Internet Research

    Through discourse, keyword, sentiment, and image analyses, using Pulsar and InfraNodus, we analyzed the discourse about the experience of post-COVID-19 condition in children and young people in the United Kingdom shared on Twitter between January 1, 2021, and January 31, 2022, from a sample of HCWs with Twitter accounts whose biography ...

  22. Cleveland Fed research: How well does the Beige Book predict recessions?

    Anecdotal economic data compiled for the Federal Reserve's Beige Book may be useful in predicting recessions, especially when regional-level economic sentiment is taken into account, according to a new report published by the Cleveland Fed.. Using natural language processing, researchers from the Cleveland Fed and Washington University in St. Louis constructed indices quantifying the ...

  23. Sentiment Analysis of Tweets in the 2020 U.S. Presidential Election

    Current research has used Twitter API and sentiment analysis to explore public feelings regarding candidates during different elections on Twitter. As the 2020 U.S. presidential election was an ...