A Hybrid Framework for Large-scale Tweet Sentiment Analysis Using Classical Machine Learning, Transformer Models and Uncertainty Estimation

Abstract
The article suggests a hybrid framework to analyse Twitter sentiment at scale by combining traditional machine learning methods with deep learning using transformers in a multi-layer stacking configuration. The system is evaluated using a dataset of 74,921 tweets, each labelled with one of three sentiment labels: negative, neutral, or positive. The architecture is 3-tier. Tier A is based on classical classifiers: Logistic Regression, Calibrated Linear SVM and Multinomial Naive Bayes, using TF-IDF features (unigrams to trigrams), with character-level n-grams added. Tier B is a response to a narrow-focused DistilBERT encoder to learn rich contextual embeddings. Tier C fuses out-of-fold predictions from tiers A and B with a stacked meta-learner that combines lexical accuracy and context depth. Removal of noise, normalisation to kenisation and stopword filtering enable complete text preprocessing, ensuring data quality and consistency throughout the pipeline. The experimental results show that the stacked Meta Logistic Regression achieves an accuracy and macro-F1 of 0.9705, which are much better than those of all the standalone classical and transformer baselines. The model has a near-perfect discriminative performance (macro-AUC = 0.994) and a very good calibration (ECE = 0.0043). Aspect and time analyses are also useful to comprehend the dynamics of sentiment and evolving attitudes towards airline services. These findings validate the hypothesis that hybrid stacking is an effective method for leveraging the complementary nature of lexical and contextual representations, thereby improving generalisation and achieving superior performance. The work provides a reproducible, explainable, operationally applicable model of sentiment analysis in operationally sensitive, high-stakes domains.
Keywords: Machine Learning, Natural Language Processing, Sentiment Analysis, TF-IDF, Twitter, Uncertainty Quantification.

Author(s): Demmelash Abate*, Nilay Mistry
Volume: 7 Issue: 3 Pages: 1873-1887
DOI: https://doi.org/10.47857/irjms.2026.v07i03.011806