Fake news detector
A text classifier with a Streamlit app, built as a 135-hour TCS iON industry project. The real model runs below.
- 135 hindustry-certified project
- 5,000words in the TF-IDF vocabulary
- 140 KBmodel, small enough to run in a browser
What I built
Two notebooks clean the text and train the model: lower-casing, stripping links and symbols, a TF-IDF vectoriser over the 5,000 most useful words, and a logistic regression classifier evaluated with precision, recall and F1-score.
The Streamlit app takes any article or post, scores it, and also looks up related news and Wikipedia entries so a reader has context, not just a number.
For this site I exported the vectoriser and model weights to JSON and rewrote the prediction in JavaScript. It reproduces the Python probabilities to four decimal places.
Try the model
This is the trained model from the project, running in your browser. Nothing you type leaves this page. The score says how much the text looks like the real-news articles it was trained on. It does not check facts.
How each word moved the score: towards real reporting towards fake
What the model actually learned
The most useful thing I learned came from reading the weights. The words that push hardest towards “real” are reuters, said, washington and the days of the week. The words that push towards “fake” are video, via, image, breaking and watch.
Those are signs of where an article came from, not whether it is true. Agency copy says “WASHINGTON (Reuters) … said on Tuesday”; viral posts say “WATCH this video”. So the model is mostly recognising writing style. It does well on its dataset and can be fooled by a false claim written like a wire report.
What I would do next
Strip agency bylines and datelines before training, test on articles from sources the model has never seen, and compare against a small transformer model. And keep the honest framing the app already has: a probability that text looks like real reporting, not a fact-check.