Main Article Content
Abstract
The proliferation of social media platforms, particularly X, has revolutionized public communication but poses challenges for sentiment analysis due to informal language characterized by abbreviations, slang, emojis, and creative spellings. This study presents an Attention-Enhanced Convolutional Neural Network–Bidirectional Gated Recurrent Unit (CNN-BiGRU) model, a hybrid architecture designed for both accuracy and computational efficiency. It integrates CNNs for local feature extraction, BiGRUs for capturing sequential dependencies, and an attention mechanism to prioritize sentiment-critical components. Evaluated on Sentiment140 (1.6 million tweets, binary classification) and SemEval-2017 Task 4 (65,000 tweets, three-class classification), the model demonstrates statistically significant accuracy improvements (up to 1.7 percentage points) compared to baseline models, including BERT Base, while requiring substantially fewer parameters and offering potential for faster inference. The model achieves 86.3% accuracy on Sentiment140 and 77.2% on SemEval-2017 Task 4, effectively handling linguistic variability. Its comparatively lightweight design makes it suitable for real-time sentiment analysis scenarios where computational resources may be constrained. This framework offers a robust and scalable solution for analyzing sentiment in evolving online communication, with applications in market research, public opinion monitoring, and crisis management.
Keywords
Article Details
Copyright (c) 2026 Rahman Abid (Author)

This work is licensed under a Creative Commons Attribution 4.0 International License.
How to Cite
References
- B. Liu, Sentiment Analysis: Mining Opinions, Sentiments, and Emotions, 2nd ed. Cambridge, UK: Cambridge University Press, 2020.
- A. S. A. Al Sailawi and M. R. Kangavari, "Analyzing social media data to understand long-term crisis management challenges of COVID-19," Fusion: Practice and Applications, vol. 14, no. 2, pp. 227–243, 2024. DOI: 10.54216/FPA.140219
- M. Mustak et al., "Using machine learning to develop customer insights from user-generated content," Journal of Retailing and Consumer Services, vol. 81, p. 104034, Nov. 2024. DOI: 10.1016/j.jretconser.2024.104034
- A. S. A. Al Sailawi and M. R. Kangavari, "Utilizing AI for extracting insights on post WHO's COVID-19 vaccination declaration from X (Twitter) social network," AIMS Public Health, vol. 11, no. 2, pp. 349–378, 2024. DOI: 10.3934/publichealth.2024018
- T. Kolajo, O. Daramola, A. Adebiyi, and A. Seth, "A framework for pre-processing of social media feeds based on integrated local knowledge base," Information Processing & Management, vol. 57, no. 6, p. 102348, Nov. 2020. DOI: 10.1016/j.ipm.2020.102348
- E. Kouloumpis, T. Wilson, and J. Moore, "Twitter sentiment analysis: The good, the bad and the OMG!" in Proc. Int. AAAI Conf. Web and Social Media (ICWSM), vol. 5, no. 1, pp. 538–541, 2011. DOI: 10.1609/icwsm.v5i1.14185
- N. A. Sharma, A. B. M. S. Ali, and M. A. Kabir, "A review of sentiment analysis: Tasks, applications, and deep learning techniques," International Journal of Data Science and Analytics, vol. 19, no. 3, pp. 351–388, Apr. 2025. DOI: 10.1007/s41060-024-00594-x
- Y. Kim, "Convolutional neural networks for sentence classification," in Proc. 2014 Conf. Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, pp. 1746–1751, 2014. DOI: 10.3115/v1/D14-1181
- Y. Yang et al., "Hierarchical deep document model," IEEE Transactions on Knowledge and Data Engineering, 2024. DOI : 10.1109/TKDE.2024
- I. Alagha, "Leveraging knowledge-based features with multilevel attention mechanisms for short Arabic text classification," IEEE Access, vol. 10, pp. 51908–51921, 2022. DOI: 10.1109/ACCESS.2022.3174591
- S. Minaee, E. Azimi, and A. Abdolrashidi, "Deep-sentiment: Sentiment analysis using ensemble of CNN and Bi-LSTM models," arXiv:1904.04206, 2019. DOI: 10.48550/arXiv.1904.04206
- M. M. Rahman et al., "RoBERTa-BiLSTM: A context-aware hybrid model for sentiment analysis," arXiv:2406.00367, 2024. DOI: 10.48550/arXiv.2406.00367
- X. Yuan et al., "Emoji-based co-attention network for microblog sentiment analysis," in Proc. ICONIP, Springer, 2021. DOI: 10.1007/978-3-030-92307-5
- P. Mishra, S. Kaushik, and K. Dey, "Bi-ISCA: Bidirectional inter-sentence contextual attention mechanism for detecting sarcasm in noisy short text," arXiv:2011.11465, 2020. DOI: 10.48550/arXiv.2011.11465
- K. Vo et al., "Combination of domain knowledge and deep learning for sentiment analysis of short and informal messages on social media," International Journal of Computational Vision and Robotics, vol. 9, no. 5, pp. 458–485, 2019. DOI: 10.1504/IJCVR.2019.101779
- J. Devlin, M. W. Chang, K. Lee, and K. Toutanova, "BERT: Pre-training of deep bidirectional transformers for language understanding," in Proc. NAACL-HLT, pp. 4171–4186, 2019. DOI: 10.18653/v1/N19-1423
- Y. Liu et al., "RoBERTa: A robustly optimized BERT pretraining approach," arXiv:1907.11692, 2019. DOI: 10.48550/arXiv.1907.11692
- V. Sanh, L. Debut, J. Chaumond, and T. Wolf, "DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter," arXiv:1910.01108, 2019. DOI: 10.48550/arXiv.1910.01108
- M. Taboada, J. Brooke, M. Tofiloski, K. Voll, and M. Stede, "Lexicon-based methods for sentiment analysis," Computational Linguistics, vol. 37, no. 2, pp. 267–307, 2011. DOI: 10.1162/COLI_a_00049
- T. Hai et al., "Evaluation of text classification using support vector machine compared with Naive Bayes, Random Forest, Decision Tree and K-NN," in Proc. Int. Conf. Advances in Communication Technology and Computer Engineering, Springer, 2023. DOI: 10.1007/978-981-99-0838-7
- S. J. Johnson, M. R. Murty, and I. Navakanth, "A detailed review on word embedding techniques with emphasis on Word2Vec," Multimedia Tools and Applications, vol. 83, no. 13, pp. 37979–38007, 2024. DOI: 10.1007/s11042-023-17007-z
- J. Pennington, R. Socher, and C. D. Manning, "GloVe: Global vectors for word representation," in Proc. 2014 Conf. Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543, 2014. DOI: 10.3115/v1/D14-1162
- C. Sahoo, M. Wankhade, and B. K. Singh, "Sentiment analysis using deep learning techniques: A comprehensive review," International Journal of Multimedia Information Retrieval, vol. 12, no. 2, p. 41, 2023. DOI: 10.1007/s13735-023-00296-3
- M. Schuster and K. K. Paliwal, "Bidirectional recurrent neural networks," IEEE Transactions on Signal Processing, vol. 45, no. 11, pp. 2673–2681, 1997. DOI: 10.1109/78.650093
- K. Cho et al., "Learning phrase representations using RNN encoder-decoder for statistical machine translation," in Proc. EMNLP, pp. 1724–1734, 2014. DOI: 10.3115/v1/D14-1179
- D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine translation by jointly learning to align and translate," arXiv:1409.0473, 2014. DOI: 10.48550/arXiv.1409.0473
- R. P. Kusumawardani and M. W. Maulidani, "Aspect-level sentiment analysis for social media data in the political domain using hierarchical attention and position embeddings," in Proc. ICoDSA, IEEE, 2020. DOI: 10.1109/ICoDSA50139.2020.9213005
- F. Long, K. Zhou, and W. Ou, "Sentiment analysis of text based on bidirectional LSTM with multi-head attention," IEEE Access, vol. 7, pp. 141960–141969, 2019. DOI: 10.1109/ACCESS.2019.2942614
- P. Pujari et al., "Hybrid CNN and RNN for Twitter sentiment analysis," in Proc. Int. Conf. Smart Computing and Communication, Springer, 2024. DOI: 10.1007/978-981-97-3991-2
- Y. Cheng et al., "Text sentiment orientation analysis based on multi-channel CNN and bidirectional GRU with attention mechanism," IEEE Access, vol. 8, pp. 134964–134975, 2020. DOI: 10.1109/ACCESS.2020.3011658
- A. Go, R. Bhayani, and L. Huang, "Twitter sentiment classification using distant supervision," CS224N Project Report, Stanford University, 2009.
- S. Rosenthal, N. Farra, and P. Nakov, "SemEval-2017 Task 4: Sentiment analysis in Twitter," arXiv:1912.00741, 2019. DOI: 10.48550/arXiv.1912.00741
- Z. Lan et al., "ALBERT: A lite BERT for self-supervised learning of language representations," in Proc. ICLR, 2020. DOI: 10.48550/arXiv.1909.11942
- W. Wang et al., "MiniLM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers," in Proc. NeurIPS, 2020. DOI: 10.48550/arXiv.2002.10957
- N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, "SMOTE: Synthetic minority over-sampling technique," Journal of Artificial Intelligence Research, vol. 16, pp. 321–357, 2002. DOI: 10.1613/jair.953
References
B. Liu, Sentiment Analysis: Mining Opinions, Sentiments, and Emotions, 2nd ed. Cambridge, UK: Cambridge University Press, 2020.
A. S. A. Al Sailawi and M. R. Kangavari, "Analyzing social media data to understand long-term crisis management challenges of COVID-19," Fusion: Practice and Applications, vol. 14, no. 2, pp. 227–243, 2024. DOI: 10.54216/FPA.140219
M. Mustak et al., "Using machine learning to develop customer insights from user-generated content," Journal of Retailing and Consumer Services, vol. 81, p. 104034, Nov. 2024. DOI: 10.1016/j.jretconser.2024.104034
A. S. A. Al Sailawi and M. R. Kangavari, "Utilizing AI for extracting insights on post WHO's COVID-19 vaccination declaration from X (Twitter) social network," AIMS Public Health, vol. 11, no. 2, pp. 349–378, 2024. DOI: 10.3934/publichealth.2024018
T. Kolajo, O. Daramola, A. Adebiyi, and A. Seth, "A framework for pre-processing of social media feeds based on integrated local knowledge base," Information Processing & Management, vol. 57, no. 6, p. 102348, Nov. 2020. DOI: 10.1016/j.ipm.2020.102348
E. Kouloumpis, T. Wilson, and J. Moore, "Twitter sentiment analysis: The good, the bad and the OMG!" in Proc. Int. AAAI Conf. Web and Social Media (ICWSM), vol. 5, no. 1, pp. 538–541, 2011. DOI: 10.1609/icwsm.v5i1.14185
N. A. Sharma, A. B. M. S. Ali, and M. A. Kabir, "A review of sentiment analysis: Tasks, applications, and deep learning techniques," International Journal of Data Science and Analytics, vol. 19, no. 3, pp. 351–388, Apr. 2025. DOI: 10.1007/s41060-024-00594-x
Y. Kim, "Convolutional neural networks for sentence classification," in Proc. 2014 Conf. Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, pp. 1746–1751, 2014. DOI: 10.3115/v1/D14-1181
Y. Yang et al., "Hierarchical deep document model," IEEE Transactions on Knowledge and Data Engineering, 2024. DOI : 10.1109/TKDE.2024
I. Alagha, "Leveraging knowledge-based features with multilevel attention mechanisms for short Arabic text classification," IEEE Access, vol. 10, pp. 51908–51921, 2022. DOI: 10.1109/ACCESS.2022.3174591
S. Minaee, E. Azimi, and A. Abdolrashidi, "Deep-sentiment: Sentiment analysis using ensemble of CNN and Bi-LSTM models," arXiv:1904.04206, 2019. DOI: 10.48550/arXiv.1904.04206
M. M. Rahman et al., "RoBERTa-BiLSTM: A context-aware hybrid model for sentiment analysis," arXiv:2406.00367, 2024. DOI: 10.48550/arXiv.2406.00367
X. Yuan et al., "Emoji-based co-attention network for microblog sentiment analysis," in Proc. ICONIP, Springer, 2021. DOI: 10.1007/978-3-030-92307-5
P. Mishra, S. Kaushik, and K. Dey, "Bi-ISCA: Bidirectional inter-sentence contextual attention mechanism for detecting sarcasm in noisy short text," arXiv:2011.11465, 2020. DOI: 10.48550/arXiv.2011.11465
K. Vo et al., "Combination of domain knowledge and deep learning for sentiment analysis of short and informal messages on social media," International Journal of Computational Vision and Robotics, vol. 9, no. 5, pp. 458–485, 2019. DOI: 10.1504/IJCVR.2019.101779
J. Devlin, M. W. Chang, K. Lee, and K. Toutanova, "BERT: Pre-training of deep bidirectional transformers for language understanding," in Proc. NAACL-HLT, pp. 4171–4186, 2019. DOI: 10.18653/v1/N19-1423
Y. Liu et al., "RoBERTa: A robustly optimized BERT pretraining approach," arXiv:1907.11692, 2019. DOI: 10.48550/arXiv.1907.11692
V. Sanh, L. Debut, J. Chaumond, and T. Wolf, "DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter," arXiv:1910.01108, 2019. DOI: 10.48550/arXiv.1910.01108
M. Taboada, J. Brooke, M. Tofiloski, K. Voll, and M. Stede, "Lexicon-based methods for sentiment analysis," Computational Linguistics, vol. 37, no. 2, pp. 267–307, 2011. DOI: 10.1162/COLI_a_00049
T. Hai et al., "Evaluation of text classification using support vector machine compared with Naive Bayes, Random Forest, Decision Tree and K-NN," in Proc. Int. Conf. Advances in Communication Technology and Computer Engineering, Springer, 2023. DOI: 10.1007/978-981-99-0838-7
S. J. Johnson, M. R. Murty, and I. Navakanth, "A detailed review on word embedding techniques with emphasis on Word2Vec," Multimedia Tools and Applications, vol. 83, no. 13, pp. 37979–38007, 2024. DOI: 10.1007/s11042-023-17007-z
J. Pennington, R. Socher, and C. D. Manning, "GloVe: Global vectors for word representation," in Proc. 2014 Conf. Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543, 2014. DOI: 10.3115/v1/D14-1162
C. Sahoo, M. Wankhade, and B. K. Singh, "Sentiment analysis using deep learning techniques: A comprehensive review," International Journal of Multimedia Information Retrieval, vol. 12, no. 2, p. 41, 2023. DOI: 10.1007/s13735-023-00296-3
M. Schuster and K. K. Paliwal, "Bidirectional recurrent neural networks," IEEE Transactions on Signal Processing, vol. 45, no. 11, pp. 2673–2681, 1997. DOI: 10.1109/78.650093
K. Cho et al., "Learning phrase representations using RNN encoder-decoder for statistical machine translation," in Proc. EMNLP, pp. 1724–1734, 2014. DOI: 10.3115/v1/D14-1179
D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine translation by jointly learning to align and translate," arXiv:1409.0473, 2014. DOI: 10.48550/arXiv.1409.0473
R. P. Kusumawardani and M. W. Maulidani, "Aspect-level sentiment analysis for social media data in the political domain using hierarchical attention and position embeddings," in Proc. ICoDSA, IEEE, 2020. DOI: 10.1109/ICoDSA50139.2020.9213005
F. Long, K. Zhou, and W. Ou, "Sentiment analysis of text based on bidirectional LSTM with multi-head attention," IEEE Access, vol. 7, pp. 141960–141969, 2019. DOI: 10.1109/ACCESS.2019.2942614
P. Pujari et al., "Hybrid CNN and RNN for Twitter sentiment analysis," in Proc. Int. Conf. Smart Computing and Communication, Springer, 2024. DOI: 10.1007/978-981-97-3991-2
Y. Cheng et al., "Text sentiment orientation analysis based on multi-channel CNN and bidirectional GRU with attention mechanism," IEEE Access, vol. 8, pp. 134964–134975, 2020. DOI: 10.1109/ACCESS.2020.3011658
A. Go, R. Bhayani, and L. Huang, "Twitter sentiment classification using distant supervision," CS224N Project Report, Stanford University, 2009.
S. Rosenthal, N. Farra, and P. Nakov, "SemEval-2017 Task 4: Sentiment analysis in Twitter," arXiv:1912.00741, 2019. DOI: 10.48550/arXiv.1912.00741
Z. Lan et al., "ALBERT: A lite BERT for self-supervised learning of language representations," in Proc. ICLR, 2020. DOI: 10.48550/arXiv.1909.11942
W. Wang et al., "MiniLM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers," in Proc. NeurIPS, 2020. DOI: 10.48550/arXiv.2002.10957
N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, "SMOTE: Synthetic minority over-sampling technique," Journal of Artificial Intelligence Research, vol. 16, pp. 321–357, 2002. DOI: 10.1613/jair.953
