Fake news detection
Train a model to flag likely misinformation in headlines and learn why such models must be used carefully.
Intermediateโฑ 8โ12 hours๐ช 7 stepsPythonscikit-learnTransformers
What you'll learn
- โText classification end to end
- โData leakage and dataset bias
- โModel limitations and responsible use
What you'll build
- โClean, de-duplicated dataset
- โBaseline and transformer models
- โLeakage check
- โDemo with a clear disclaimer
Step-by-step guide
- 1
Dataset
A public labelled fake/real news dataset; read how it was collected.
- 2
Remove leakage
Drop source names, URLs and boilerplate ("Reuters") that let a model cheat; de-duplicate.
- 3
Baseline
TF-IDF + PassiveAggressiveClassifier or logistic regression.
- 4
Transformer
Fine-tune a small model (DistilBERT) with the Hugging Face Trainer for 2โ3 epochs.
- 5
Cross-dataset test
Test on a second dataset; accuracy will drop. Explain why (topic and time shift).
- 6
Explain
Show which words push a prediction (LIME or model weights).
- 7
Responsible demo
Output "needs checking", never "fake"; link to fact-checking sites.
๐ Make it stand out
- +Claim matching against fact-check databases
- +Multilingual headlines
- +Browser extension prototype