Best AI powered Fake News Detection

AI powered Fake News Detection

Introduction

A simple project based on AI-powered Fake News Detection System which makes use of Natural Language Processing (NLP) and Machine Learning techniques. This project is specially designed for students to understand how text classification works in real applications. It allows users to enter news content and get results whether the news is classified as True or Fake.

The system includes model artifacts, preprocessing utilities, training and testing scripts, and a lightweight Flask-based web interface to make the application user-friendly. It also contains a small feedback mechanism to improve predictions. The concept of this project is directly connected with real-life problems of misinformation and is an excellent choice for students who want to learn how to build and deploy end-to-end ML-based web applications.

Project Overview

Parameter Details
Project Name AI-powered Fake News Detection
Language/s Used Python, HTML, CSS, JavaScript
Type Machine Learning Web Application
Developer UPDATEGADH

Download New Real Time Projects :-Click here

Available Features

  • News Classification — A web interface accepts pasted news text and returns a prediction of True or Fake.
  • Confidence Score — The model outputs a percent confidence for its prediction (derived from model probabilities).
  • Pre-trained Model & Vectorizer — models/fake_news_model.pkl and models/tfidf_vectorizer.pkl are provided for immediate inference.
  • Training & Testing Scripts — train_model.py and test_model.py enable retraining and evaluation using the included datasets.
  • Text Preprocessing Utilities — sentimentFunc.py (helper functions) provides preprocessing and feature preparation used by training and inference.
  • Static Web UI — The templates/main.html and static/ assets (style.css, images, placeholder JS) implement a simple user interface for interaction.
  • Datasets Included — data/dataset_true.csv and data/dataset_fake.csv are present for model training or experimentation.
  • Feedback Storage — An SQLite database file feedback.db together with feedback_db.py implements user feedback recording for later review and model improvement.

Installation Guide (VS Code)

Follow these steps to run the project locally using Visual Studio Code.

  1. Extract project and open folder in VS Code
    • Extract the ZIP to a folder, then open that folder in VS Code: File → Open Folder.
  2. Create a Python virtual environmentpython -m venv venv Activate it:
    • Windows: venv\Scripts\activate
    • macOS / Linux: source venv/bin/activate
  3. Install dependencies
    If a requirements.txt exists, install it: pip install -r requirements.txt If not present, install the common dependencies used by the project: pip install flask scikit-learn pandas numpy nltk
  4. (Optional) Download or verify NLTK resources — if preprocessing uses NLTK: # run inside Python REPL import nltk nltk.download('stopwords') nltk.download('punkt')
  5. Run the application python main.py After launching, open the browser at: http://127.0.0.1:5000/
  6. Train or test the model (optional)
    To retrain using provided datasets: python train_model.py To run tests or evaluation: python test_model.py

Usage

This project is straightforward to use and supports different roles:

  • General User / Reader
    1. Open the web interface in your browser.
    2. Paste the news article or news snippet into the input area.
    3. Click the button to get a prediction. The UI returns True or Fake together with a confidence percentage.
    4. Optionally, submit feedback through the interface — feedback entries are saved into the project’s feedback.db.
  • Developer / Researcher
    • Use train_model.py to retrain models with data/dataset_true.csv and data/dataset_fake.csv.
    • Inspect sentimentFunc.py to understand preprocessing steps (tokenization, cleaning, vectorization).
    • Update or replace models/tfidf_vectorizer.pkl and models/fake_news_model.pkl after retraining.
  • Admin / Maintainer
    • Use feedback_db.py to access or export feedback from feedback.db. This enables manual review of misclassifications or user-reported issues.
    • Monitor model performance by running test_model.py and analyzing the evaluation metrics it prints.

Contributing

Contributions that improve accuracy, usability, or documentation are welcome. Suggested contributions include:

  • Expanding the labeled dataset with reliable sources for broader coverage.
  • Improving preprocessing and feature engineering (e.g., n-grams, stopword handling, lemmatization).
  • Integrating more advanced models (transformers or fine-tuned BERT variants) in place of the classical ML pipeline.
  • Enhancing the web UI for accessibility and better UX.

When contributing, follow standard practice: fork the project, create a feature branch, commit changes with clear messages, and submit a patch for review. Include unit tests and documentation for non-trivial changes.

License

This project is provided under the MIT License. The license in the repository allows use, modification, and distribution under the terms stated in the license file. The codebase is released for educational and learning purposes.

Final Thoughts

From a student’s perspective, this project is a compact but complete introduction to building an ML-powered web application. It demonstrates how raw text can be transformed with simple NLP preprocessing, vectorized using TF–IDF, classified with a model, and then served via a Flask interface — the essential pipeline many production systems use in simplified form. The included datasets, pre-trained artifacts, and feedback mechanism make it useful both as a learning resource and as a base for experimentation: students can try improving the model, add new metrics, or replace the classifier with a deep learning approach. Real-world applications include media monitoring, preliminary fact-checking assistance, and educational demos that show how automation can help identify possible misinformation so human experts can make final determinations.

We have projects Available in all languages:–Click Here


ai powered fake news detection github
ai powered fake news detection python
ai powered fake news detection example
ai powered fake news detection pdf
ai powered fake news detection project
fake news detection app
fake news detection using nlp
fake news detection web app

Share this content:

Post Comment