Hybrid DistilBERT and Machine Learning Pipeline for Twitter Fake News Detection
DOI:
https://doi.org/10.66021/Keywords:
Fake News Detection; DistilBERT; Transformer Embeddings; Logistic Regression; Random Forest; Twitter Misinformation; NLP; Machine Learning.Abstract
The proliferation of misinformation on microblogging platforms, particularly Twitter, poses severe threats to public discourse and societal trust. This paper presents a lightweight, end-to-end fake news detection framework that integrates transformer-based natural language processing with conventional machine learning classifiers. The proposed system employs distilbert-base-uncased to generate contextual, 768-dimensional tweet embeddings through mean-pooling of the final hidden states. These semantic representations are subsequently consumed by two lightweight classifiers, namely Logistic Regression and Random Forest, with model selection governed by the Precision-Recall Area under Curve (PR-AUC) score computed on a held-out validation set. A Tkinter-based desktop graphical user interface (GUI) operationalises the trained model, supporting both single-tweet inference and batch CSV prediction with confidence scores. Experimental evaluation on a structured, balanced dataset of 200 annotated tweets yields a test-set accuracy of 100%, with perfect precision, recall, and F1-score for both classes. The confusion matrix and precision-recall curve confirm zero misclassification across all test samples. These findings substantiate the suitability of transformer-driven semantic embeddings combined with interpretable classifiers for accurate, computationally efficient fake news detection on short-form social media text.