Machine learning techniques for sentiment analysis classification: a comparative study
With the exponential growth of online communication, there is an urgent need for robust tools to decode human sentiment in digital text. This research utilized the Sentiment140 dataset, capturing a wide range of real-world Twitter (now X) messages, both positive and negative. This study conducted a rigorous comparative evaluation of various algorithms, including traditional classifiers like naive Bayes (NB), support vector machine (SVM), and logistic regression (LR), alongside deep learning architectures such as convolutional neural networks (CNN), recurrent neural networks (RNN), long-short term memory (LSTM), and bidirectional long-short term memory (BiLSTM). To enhance representational quality, feature engineering was approached through unigram, bigram, term frequency-inverse document frequency (TF-IDF), and advanced embeddings like word to vector (Word2Vec) and global vectors for word representation (GloVe). The analysis revealed a clear leader: transformer-based models, with bidirectional encoder representations from transformers (BERT) achieving an impressive accuracy of 92.76%, surpassing both classical and deep architectures. Notably, hybrid approaches like NB-SVM-maximum entropy (ME) and robustly optimized BERT pretraining approach (RoBERTa)-LSTM also demonstrated competitive performance, underscoring the ongoing relevance of feature-driven and ensemble methods. This finding prompts essential reflection: while transformers excel in contextual understanding, the choice of feature representation and hybridization strategies remains critical for optimizing performance. Ultimately, this study highlights the transformative role of modern architectures in sentiment analysis while reinforcing the importance of methodological diversity in advancing natural language processing (NLP).
Authors
- Adnan Souri (ORCID: https://orcid.org/0000-0002-6888-7563)
- Hicham Omara (ORCID: https://orcid.org/0000-0002-3126-5859)
- Billal El Khattabi (ORCID: https://orcid.org/0009-0000-1841-6838)
Institutions
- Abdelmalek Essaâdi University (MA)
- Sidi Mohamed Ben Abdellah University (MA)
Publication Details
- Journal
- IAES International Journal of Artificial Intelligence
- Published
- 2026-12-01
- DOI
- https://doi.org/10.11591/ijai.v15.i6.pp5822-5837
- Primary Topic
- Sentiment Analysis and Opinion Mining
- Type
- article
- Field-Weighted Citation Impact
- 0.00