Built to order

Fake News Detection using NLP & Machine Learning

A fake-news detector that classifies news articles as real or fake using NLP. Compares TF-IDF + Logistic Regression against LSTM and transformer baselines on a labeled dataset, and ships a clean web app where you paste any article for an instant verdict with confidence score.

Computer / ITAI & Machine LearningWeb Development PythonWeb DashboardNatural Language ProcessingMachine LearningData Sciencescikit-learnDeep LearningText ClassificationSoftware
Illustrative mockup of the Fake News Detection using NLP & Machine Learning interface.
More project photos (3)

The problem

Fake news spreads faster than the truth — studies show false stories can reach thousands of people within hours on social media. This project builds a working solution: a machine learning system that reads a news article and tells you whether it's likely real or fake, using natural language processing. It is a complete fake news detection using machine learning project that doesn't stop at a notebook — it includes a deployed TruthLens web app where anyone can paste article text and get an instant verdict with a confidence score. The heart of the project is a fair, honest model comparison. A classical TF-IDF + Logistic Regression baseline goes head-to-head with an LSTM sequence model and a fine-tuned transformer (BERT/DistilBERT) baseline, all trained and evaluated on the same labeled news dataset with a proper train/validation/test split. You get real metrics — accuracy, precision, recall, F1 — and a real story to tell in your viva about why different models perform the way they do.

SYSTEM FLOW

5 components 5 connections

Live flow
Drag to explore
100%
userReader

Pastes a news article into the TruthLens app for an instant verdict.

Follow the working sequence

How it works

  1. Data preparation — a labeled dataset of real and fake news articles is cleaned: lowercased, tokenized, stripped of stopwords, URLs and noise, then lemmatized
  2. Feature engineering — for the classical model, text is converted to TF-IDF vectors that weight the words most characteristic of fake vs real writing
  3. Training — the Logistic Regression baseline trains in minutes; the LSTM learns word sequences via embedding layers; the transformer is fine-tuned with a classification head
  4. Evaluation — all three models are scored on a held-out test set with accuracy, precision, recall, F1-score, and ROC-AUC
  5. Deployment — the best model is served through the TruthLens Flask web app: paste an article, and it returns a verdict plus a confidence score in under a second

Project features

  • Paste-and-check web app: paste any news article into the TruthLens app and get a real/fake verdict with a confidence percentage instantly
  • Three-model comparison: TF-IDF + Logistic Regression baseline vs LSTM neural network vs fine-tuned transformer (BERT/DistilBERT)
  • Complete NLP pipeline: tokenization, lowercasing, stopword removal, lemmatization, and TF-IDF feature extraction built from scratch
  • Confusion matrices and classification reports for every model, with visualizations you can drop straight into your report
  • Live model-switching in the TruthLens app: compare predictions from the baseline and deep models on the same article
  • Trained model files included — no GPU needed to run the app
  • REST-style prediction flow inside the Flask app, ready to demo and extend

What is included

  • Full source code (preprocessing, training notebooks, and the TruthLens Flask app)
  • Trained model files for all three approaches — ready to run, no training required
  • Labeled dataset access guide and preprocessing scripts
  • Project report (PDF) with methodology, model comparison tables, and result analysis
  • Presentation (PPT) for your project demo and review
  • Viva Q&A document covering NLP concepts, model choices, and likely examiner questions
  • README with setup, training, and deployment instructions

Advantages

  • Paste-and-check web app gives an instant real/fake verdict with a confidence percentage for any article pasted into the TruthLens app.
  • Three-model comparison (TF-IDF + Logistic Regression vs LSTM vs fine-tuned BERT/DistilBERT) with confusion matrices and classification reports ready for the report.
  • Complete NLP pipeline built from scratch — tokenization, lowercasing, stopword removal, lemmatization and TF-IDF — strong viva material.
  • Live model-switching in the app lets the examiner compare baseline and deep-model predictions on the same article.
  • Pre-trained model files are bundled, so the app runs with no GPU needed.
  • REST-style prediction flow inside the Flask app is ready to demo and extend.

Disadvantages

  • Accuracy depends on the training data's domain — articles from topics not covered in the dataset may classify less reliably.
  • Satire, opinion pieces and partially-true articles sit in a grey zone the binary classifier was not designed for.
  • Very short texts (headlines only) give the model less signal than full articles.
  • Transformer fine-tuning is slow on CPU, so the project ships pre-trained weights to sidestep retraining at demo time.

Limitations & prerequisites

  • Accuracy depends on the training data's domain — articles from topics not covered in the dataset may classify less reliably
  • Satire, opinion pieces, and partially-true articles sit in a grey zone the binary classifier wasn't designed for
  • Very short texts (headlines only) give the model less signal than full articles
  • Transformer fine-tuning benefits from a GPU; on CPU it is slow, so we ship the pre-trained weights with the project
Components & software requirements
  • Python, scikit-learn, NLTK, TensorFlow/Keras, Transformers (Hugging Face), Flask, HTML/CSS/JavaScript, pandas, NumPy, Matplotlib/Seaborn
Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Wang (2017), ACL 2017

Get a quotation