Machine learning techniques for sentiment analysis classification: a comparative study

Billal El Khattabi, Hicham Omara, Adnan Souri

Abstract


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).

Keywords


Deep learning; Hybrid approaches; Machine learning; Natural language processing; Sentiment analysis; Text classification

Full Text:

PDF


DOI: http://doi.org/10.11591/ijai.v15.i6.pp5822-5837

Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 Billal El Khattabi, Hicham Omara, Adnan Souri

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

IAES International Journal of Artificial Intelligence (IJ-AI)
ISSN/e-ISSN 2089-4872/2252-8938 
This journal is published by the Institute of Advanced Engineering and Science (IAES).

View IJAI Stats