Context is All You Need: Why Transformers Outperform Traditional ML in Tweet Sentiment
Abstract
This research paper presents a comprehensive comparative analysis of sentiment analysis techniques applied to Twitter data using Natural Language Processing (NLP) methodologies. The study evaluates the performance of conventional machine learning algorithms alongside state-of-the-art transformer-based models on the Sentiment140 dataset containing 1.6 million tweets. We implement and compare four distinct approaches: Naive Bayes and Support Vector Machine (SVM) as traditional machine learning baselines, RoBERTa as an encoder-only transformer, and GPT-2 as a decoder-only transformer architecture. Our methodology encompasses extensive preprocessing pipelines, feature extraction techniques, and rigorous evaluation metrics including accuracy, precision, recall, and F1-score. Experimental results demonstrate that transformer-based models significantly outperform conventional approaches, with RoBERTa achieving 93.87% accuracy and GPT-2 attaining 89.01% accuracy, compared to SVM's 86.22% and Naive Bayes' 75.45%. The findings highlight the superior capability of transformer architectures in capturing contextual semantics and handling the complexities inherent in social media text, establishing new benchmarks for Twitter sentiment analysis applications.
References
[^1] Agarwal, A., Xie, B., Vovsha, I., Rambow, O., & Passonneau, R. (2011). Sentiment analysis of Twitter data. Proceedings of the Workshop on Languages in Social Media, 30-38.
[^2] Cambria, E., & White, B. (2014). Jumping NLP curves: A review of natural language processing research. IEEE Computational Intelligence Magazine, 9(2), 48-57.
[^3] Pak, A., & Paroubek, P. (2010). Twitter as a corpus for sentiment analysis and opinion mining. Proceedings of the Seventh International Conference on Language Resources and Evaluation (LREC'10).
[^4] Pang, B., & Lee, L. (2008). Opinion mining and sentiment analysis. Foundations and Trends in Information Retrieval, 2(1-2), 1- 135.
[^5] Qi, Y., et al. (2023). Sentiment analysis using Twitter data. Social Network Analysis and Mining, 13(1), 1-15.
[^6] Zhang, L., Wang, S., & Liu, B. (2018). Deep learning for sentiment analysis: A survey. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 8(4), e1253.
[^7] Barbieri, F., et al. (2020). TweetEval: Unified benchmark and comparative evaluation for tweet classification. Findings of the Association for Computational Linguistics: EMNLP 2020.
[^8] Vaswani, A., et al. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30. [^9] Manning, C. D., & Schütze, H. (1999). Foundations of statistical natural language processing. MIT Press.
[^10] Rogers, A., Kovaleva, O., & Rumshisky, A. (2020). A primer on neural network models for natural language processing. Journal of Artificial Intelligence Research, 57, 615-686.
Refbacks
- There are currently no refbacks.