Skip to content

About

A smart Streamlit web app that detects whether a news article is real or fake using a trained ML model. Users can input text or paste a URL to verify news. Real news articles can also be summarized. Includes clean UI, error handling, and performance logging. Built with Python, Streamlit, scikit-learn, NLTK, and Newspaper3k.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

📰 NewsVerifier – Real or Rubbish?

NewsVerifier is an intelligent web application built using Streamlit that detects whether a news article is REAL or FAKE. It also provides a summarization feature for real news and supports both manual input and URL-based verification.

▶️ Launch App 🚀

Link : https://newsverifier-subhadeep.streamlit.app/

🚀 Features

  • 🧠 ML-powered Fake News Detection (Logistic Regression)
  • 🌐 Verify via URL or Manual Text Input
  • 🔍 Text Summarizer using NLTK for REAL news
  • 📁 Logs all predictions with timestamps and source
  • 📊 Displays performance metrics for predictions and summaries
  • ✅ Clean and interactive UI with error handling

📁 Project Structure

NewsVerifier/
├── app.py
├── model/
│   ├── fake_news_model.pkl
│   └── vectorizer.pkl
├── utils/
│   └── news_utils.py
├── fake_news_dataset.csv
├── train_model.py
├── requirement.txt      
└── README.md
    

📦 Installation

  1. Clone this repository
  2. Create a virtual environment: python -m venv venv
  3. Activate it:
    • venv\Scripts\activate (Windows)
    • source venv/bin/activate (Linux/macOS)
  4. Install dependencies:
    
    pip install -r requirements.txt
            

▶️ Prepare Dataset

Run prepare_data.py
    

This will merge True.csv and False.csv and keep the dataset ready for prediction.

▶️ How to Run

streamlit run app.py
    

This will open a web browser with your app running locally.

📘 Dataset

The model is trained on a labeled fake news dataset with "real" and "fake" labels. During training, 'real' is mapped to 1 and 'fake' to 0.

🧠 Summarizer

Summarization is only available for news predicted as REAL. It uses NLTK's sentence tokenizer to generate a condensed version of the article in ~10 lines.

🧠 Machine Learning Model

  • Binary classification model (Real = 1, Fake = 0)
  • Trained on a labeled fake news dataset
  • TF-IDF Vectorization for text representation
  • Pickled model and vectorizer for deployment

📦 Required Libraries


streamlit
scikit-learn
pandas
numpy
nltk
newspaper3k
lxml
sumy

🖼️ Screenshots

🔹 Home Page

🔹 Real News

🔹 Fake News

👨‍💻 Developer

Project by Subhadeep Ghosh.
For contributions or issues, feel free to contact.

📌 Disclaimer

This project is developed solely for educational and research purposes. It is not intended for production use or to serve as a definitive fact-checking tool. The predictions made by the model may not always be accurate, and users are encouraged to verify news from official and reliable sources only.

About

A smart Streamlit web app that detects whether a news article is real or fake using a trained ML model. Users can input text or paste a URL to verify news. Real news articles can also be summarized. Includes clean UI, error handling, and performance logging. Built with Python, Streamlit, scikit-learn, NLTK, and Newspaper3k.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages