Binary text classifier that distinguishes fake (0) from real (1) news articles using classical NLP techniques and machine learning on news headlines.
dataset/data.csv— 36,429 labelled articles (label, title, text, subject, date)dataset/validation_data.csv— unlabelled articles for prediction (label = 2)
- EDA — class balance, length distributions, stylistic signals, top words per class
- Preprocessing — tokenisation, lowercase, punctuation removal, stop word removal, lemmatisation + stemming
- Embeddings — Bag of Words (top 1,000) and TF-IDF (top 5,000, bigrams, sublinear_tf)
- Feature Engineering — 9 numeric stylistic features (caps ratio, exclamations, word count, etc.)
- Modelling — Naive Bayes, Logistic Regression, Random Forest × 6 input matrices each (18 experiments)
- Prediction — best model applied to validation data, output saved as CSV
| Model | Accuracy |
|---|---|
| NB — TF-IDF + Numeric (stem) ✅ | 99.64% |
| NB — TF-IDF + Numeric (lem) | 99.62% |
| LR — TF-IDF (stem) | 94.37% |
Best model: Naive Bayes with TF-IDF + 9 numeric features. Only 25 misclassifications out of 7,286 test articles.
predictions.csv — same format as validation_data.csv with labels replaced by 0 or 1.