Fake News Detection
NLP-based fake news detection system with full pipeline: TF-IDF baseline, BERT/RoBERTa/DeBERTa fine-tuning, cross-dataset evaluation, and SHAP/LIME interpretability analysis. Trained on the LIAR dataset (12,800 political statements).
Overview
This NLP specialization project offers a complete fake news detection system. The pipeline covers exploratory analysis, preprocessing, baseline models (Naive Bayes, Logistic Regression, XGBoost), transformer model fine-tuning (BERT, RoBERTa, DeBERTa), evaluation on an external dataset (out-of-distribution generalization), and interpretability analysis with SHAP and LIME. The LIAR dataset contains 12,800 political statements labeled by PolitiFact fact-checkers. The project also includes an ethical bias analysis.
Exploring the LIAR dataset
The LIAR dataset holds 12,800 political statements labeled by PolitiFact fact-checkers on six truth levels. The pipeline starts with exploratory analysis and preprocessing, with a six-class task and a binary version.
Baselines versus transformers
More than six models compared on the same test set: Naive Bayes, logistic regression and XGBoost baselines on TF-IDF, then fine-tuned BERT, RoBERTa and DeBERTa, plus ensembles. The pipeline is progressive: the TF-IDF baseline is the reference the transformers are measured against.
LIME interpretability
To make model decisions readable, every prediction can be explained with SHAP and LIME. Here LIME shows the words pushing RoBERTa toward FAKE or REAL, on a correctly classified statement and on an error.
Out-of-distribution generalization
Models trained on LIAR are evaluated on external datasets never seen in training, to measure out-of-distribution robustness. The result is counter-intuitive: logistic regression holds up better than RoBERTa and the ensemble.
Bias and ethics
A bias audit is built into the evaluation pipeline: accuracy per topic and the gap between predicted and actual FAKE rate per speaker, to spot where the model over- or under-detects.
Gallery
Challenges
- Multi-class classification of political statements with contextual nuances
- Model generalization on unseen external datasets
- Model decision interpretability to ensure trust
- Detection and analysis of prediction biases
Solutions
- Progressive pipeline: TF-IDF baseline → BERT/RoBERTa/DeBERTa fine-tuning
- Cross-dataset evaluation to measure out-of-distribution robustness
- SHAP and LIME analysis for prediction explainability
- Ethical bias audit integrated in the evaluation pipeline
Results
- 5 notebooks covering the complete EDA → interpretability pipeline
- Comparison of 6+ models (baseline + transformers)
- SHAP/LIME interpretability analysis on predictions
- Generalization evaluation on external dataset