Skip to content

Text classification project using the Passive Aggressive Classifier to distinguish between fake and real news. Analyzes feature space dimensionality, density, and provides insights into model performance. Includes visualizations and a comprehensive result analysis. Future investigations and improvements explored.

Notifications You must be signed in to change notification settings

harsh782patel/Fake-News-Detection-Using-Python

Repository files navigation

Fake News Detection Using Python

Python

This project aims to detect fake news articles using machine learning techniques implemented in Python. It employs a PassiveAggressiveClassifier to classify news articles as either real or fake based on their content.

Overview

Fake news has become a significant issue in today's digital age. This project offers a solution by leveraging machine learning algorithms to automatically identify and flag potentially deceptive news articles. By analyzing textual features and training on a dataset containing both fake and real news articles, the system learns to distinguish between genuine and fabricated information.

Dataset

The project utilizes two main datasets:

  • [Fake.csv.zip]: Contains fake news articles.
  • [True.csv.zip]: Contains real news articles.

These datasets serve as the basis for training and evaluating the fake news detection model. Please note that you need to unzip these files before using them.

Setup

  1. Download the provided datasets:

    • [Download Fake.csv.zip]
    • [Download True.csv.zip]
  2. Extract the contents of the downloaded zip files.

  3. Install the required packages:

    pip install -r requirements.txt

Running the Project

Run the fakenewsdetection.py script to execute the fake news detection system.

python fakenewsdetection.py

Project Structure

  • fakenewsdetection.py: Main script for fake news detection.
  • requirements.txt: List of required Python packages.
  • Datasets/: Directory containing the datasets (Fake.csv.zip and True.csv.zip).

Visualization

The project includes visualizations for:

  • Confusion matrix
  • Feature weights distribution

These visualizations provide insights into the performance of the fake news detection model and the importance of different features in making predictions.

About

Text classification project using the Passive Aggressive Classifier to distinguish between fake and real news. Analyzes feature space dimensionality, density, and provides insights into model performance. Includes visualizations and a comprehensive result analysis. Future investigations and improvements explored.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages