A deep learning-based Fake News Detection application built using TensorFlow, FastAPI, and Streamlit. The model leverages Natural Language Processing (NLP) techniques with TextVectorization and an LSTM (Long Short-Term Memory) network to classify news articles as Real or Fake.
Note: I wasn't able to get any server hosting service for free which can handle my model loading with all those parameters thats why there is only a local hosting option here!
This project was built to strengthen my understanding of Deep Learning and Natural Language Processing (NLP) by implementing a complete end-to-end machine learning application.
The primary goals of this project were to:
- Learn text preprocessing using TensorFlow's TextVectorization layer.
- Build and train an LSTM-based neural network for text classification.
- Deploy a trained deep learning model using FastAPI.
- Create an interactive web interface using Streamlit.
- Understand how machine learning models are served in production.
- TensorFlow
- Pandas
- NumPy
- FastAPI
- Streamlit
News Article
│
▼
TextVectorization
│
▼
LSTM Model
│
▼
FastAPI Backend
│
▼
Streamlit Frontend
Note: TensorFlow currently does not support Python 3.14. This project uses Python 3.13, so make sure to create and activate a Python 3.13 virtual environment before installing the dependencies.
git clone https://github.com/SubhamJM/Fake-News-Detector.git
cd Fake-News-DetectorWindows
pip install -r requirements.txtLinux/macOS
pip3 install -r requirements.txtFrom the project root directory, run:
python api/main.pyor on Linux/macOS:
python3 api/main.pyOpen another terminal in the project root and run:
streamlit run app/app.pyThe Streamlit application will open automatically in your browser.
- Fake news classification using an LSTM neural network
- Text preprocessing with TensorFlow TextVectorization
- REST API powered by FastAPI
- Simple and interactive Streamlit interface
- Example of a Fake news:
- Example of a Real news: