## 2 Sentiment Analysis Algorithms
### Deep Learning Approach
The Tweets were classified into positive, negative, and neutral classes and were split into 80% for training and 20% for testing. After fine-tuning the learning rate of the mBERT model to \(2\times 10^{-5}\) and the XLM-R model to \(2\times 10^{-6}\), the results showed that mBERT achieved 69% accuracy, whereas XLM-R achieved 71% accuracy. [PERSON] and [PERSON] (2021) [44] conducted a comparative study to evaluate the performance of four machine learning models for sentiment analysis: support vector machine, multinomial naive Bayes, long-short term memory (LSTM), and BERT. The Sentiment140 dataset, which consists of 1.6 million Tweets classified as positive or negative, was used in the study. After preprocessing the data using tokenization, stemming, lemmatization, and stop-word and punctuation removal, the results showed that the BERT model performed the best, achieving 85.4% accuracy and outperforming the other models. The study by [PERSON] et al. (2022) [45] introduced a cutting-edge approach to sentiment analysis by blending the strengths of two popular models: the robustly optimized BERT approach (RoBERTa) and long short-term memory (LSTM). The hybrid model was designed to tackle the challenge of analyzing the sentiment of text sequences by combining the self-attention and dynamic masking capabilities of RoBERTa with the ability of LSTM to capture long-range dependencies in the encoded text. The proposed hybrid model was tested on three widely used sentiment analysis datasets: IMDb, Twitter US Airline, and Sentiment140. The results showed that the hybrid model achieved impressive accuracy scores of 92.96%, 91.37%, and 89.70%, respectively, on these datasets. These results serve as strong evidence of the efficacy of the hybrid model in accurately capturing the sentiment of text sequences. [PERSON] et al. (2022) [46] proposed a BERT-based convolutional bi-directional recurrent neural network (CBRNN) model that combined a pretrained BERT model and a neural network consisting of dilated convolutional and Bi-LSTM layers for sentiment analysis. The model extracted sentence-level semantics and contextual features from the data and generated embeddings, and then used dilated convolution to extract local and global contextual semantic features. Bi-LSTM was used for the entire sequencing of the sentences. The model achieved an accuracy of 97% on US airline reviews, 90% on self-driving car reviews, 96% on US presidential election reviews, and 93% on IMDb. A sentiment transformer graph convolutional network (ST-GCN) was presented by [PERSON] et al. (2022) [47] to model sentiment analysis as a heterogeneous graph and learn document and word embeddings using the sentiment graph transformer neural network. The model learned useful connections between nodes and determined the soft selection of edge types and complex relations to learn node representation for sentiment classification. Laplacian eigenvectors were used to fuse node positional information. The message-passing technique was used to learn the node representation on a heterogeneous graph and a transformer was used to aggregate local substructures with appropriate position encoding. The model achieved state-of-the-art results on real-world datasets achieving 95.43% on SST-B, 94.94% on IMDB, and 72.7% on Yelp 2014. [PERSON] and [PERSON] (2022) [48] proposed the knowledge-enriched attention-based hybrid transformer (KEAHT) model for sentiment analysis. The model used a pretrained BERT model to train on a minimum training corpus. The model incorporated explicit knowledge from Latent Dirichlet Allocation (LDA) topic modeling and lexicalized domain ontology to address the issues of inaccurate polarity scoring and utility-based topic modeling in sentiment analysis. To further improve performance, the external knowledge sources, including sentiment network graphs, text-length distribution, word count, and higher-polarity Tweets, were consolidated.