AN EFFICIENT BERT-BASED FRAMEWORK FOR LARGE-SCALE TWITTER (X) SENTIMENT ANALYSIS USING ATTENTION AND ADAPTIVE THRESHOLDING

Authors

  • K. Vadivelan, Dr. M. Sundara Rajan, Author

Abstract

The massive growth of micro blogs such as Twitter has made their use of large-scale user generated data a crucial tool for real-time public opinion mining. However, traditional sentiment analysis pipelines treat data cleaning, feature representation and decision making as distinct tasks, resulting in sub-optimal overall pipeline performance, especially on data with highly noisy and linguistically variable characteristics like Twitter text. Existing approaches have three main drawbacks: (1) the use of pre-processing pipelines that perform the same cleaning operation regardless of the degree of noise in the individual samples, resulting in the under-cleaning of highly corrupted samples and in over-cleaning of informative informal language; (2) the use of feature extraction strategies that statically pool the contextual embedding representations of each token, discarding the differential contribution of each token to the category information; and (3) the use of classification stages with fixed decision thresholds that are not sensitive to the per-class probability distribution, a situation that leads to systematic misclassification of borderline and ambiguous instances. This paper proposes a novel three-phase approach that tackle each of these deficiencies by using a unique novel algorithm, namely the Noise-Adaptive Lexical Filter (NALF) for preprocessing in Phase 1, the Attention-Weighted Sentiment Pooling (AWSP) mechanism for feature extraction in Phase 2, and the Adaptive Threshold Classifier (ATC) for sentiment decision in Phase 3. The three components are tightly coupled using a well tuned bert-base-uncased backbone and tested on a Sentiment160 set of 1,600,000 tweets. The proposed framework's accuracy, macro-averaged F1 measure, and AUC-ROC on the held-out test partition exceed all the evaluated baselines with scores of 93.8%, 92.6%, and 0.971 respectively. Each novel algorithm contributes significantly to the overall improvement, with the ablation findings showing that the accuracy drops by 1.3%, 1.2%, and 1.2% for the NALF, AWSP, and ATC, respectively, when compared with the vanilla BERT baseline of 90.1%.

Downloads

Published

2026-07-27

Issue

Section

Articles