This project classifies news articles as Fake or Real using Machine Learning and Deep Learning approaches.
The pipeline uses TF-IDF features for classical models and LSTM embeddings for deep learning to capture context and improve accuracy.
Detecting fake news is crucial in today’s digital era to prevent misinformation from spreading.
-
Process:
- Two separate datasets: one for Fake news and one for Real news
- Combined both into a single dataset
- Cleaned the combined dataset (lowercasing, removing punctuation/special characters, stopwords, and optional lemmatization)
-
Columns:
Column Description titleHeadline of the news article textFull content of the article subjectCategory/subject of the news dateDate of publication label0 → Fake, 1 → Real
- Combined Fake and Real news datasets into one
- Lowercased all text
- Removed punctuation, special characters, and stopwords
- Optional lemmatization
- WordClouds for Fake vs Real news to visualize frequent words
- Checked class distribution
- Combined
title + text_cleanfor richer feature representation - Extracted TF-IDF features (top 5000 unigrams and bigrams)
| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Logistic Regression | ~0.99 | 0.99 | 0.99 | 0.99 |
| Random Forest | ~0.998 | 1.0 | 1.0 | 1.0 |
- Tokenized and padded sequences
- Model architecture: Embedding → LSTM → Dense → Sigmoid
- Validation Accuracy after 4 epochs: ~0.992
| Epoch | Train Accuracy | Validation Accuracy |
|---|---|---|
| 1 | 0.9086 | 0.9858 |
| 2 | 0.9861 | 0.9850 |
| 3 | 0.9886 | 0.9878 |
| 4 | 0.9900 | 0.9916 |