Skip to content

A machine learning and deep learning project that classifies news articles as either "true" or "fake" using various models, from simple baselines to advanced neural networks.

Notifications You must be signed in to change notification settings

ShalomOfstein/Fake-News-Classifier

Repository files navigation

Fake News Classifier

A machine learning and deep learning project that classifies news articles as either "true" or "fake" using various models, from simple baselines to advanced neural networks.

Project Overview

This project implements and compares different approaches to fake news detection:

  • Majority Class Classifier (Baseline)
  • Logistic Regression with TF-IDF
  • Fully Connected Neural Network
  • Advanced LSTM Model with Attention Mechanism

The best performing model (Advanced LSTM) achieved:

  • Accuracy: 96.19%
  • Precision: 94.88%
  • Recall: 98.33%
  • F1-Score: 96.58%

Documentation

Key Features

  • Text preprocessing with NLTK
  • Pre-trained Word2Vec embeddings
  • Bidirectional LSTM with attention mechanism
  • Comprehensive model evaluation metrics
  • Training visualization tools

Model Architecture

The advanced model includes:

  • Embedding Layer (Word2Vec)
  • Bidirectional LSTM
  • Attention Mechanism
  • Dropout Regularization
  • Dense Layers

Dataset

The project uses two datasets:

  1. "True and Fake News" dataset by Sameer Patel (link)
  2. "WELFake" dataset by Saurabh Shahane (link)

Dependencies

  • PyTorch
  • NLTK
  • NumPy
  • Pandas
  • Scikit-learn
  • Matplotlib
  • Gensim (for Word2Vec)

Usage

  1. Clone the repository
  2. Install dependencies: pip install -r requirements.txt
  3. Download the pre-trained Word2Vec embeddings
  4. Download the datasets - Sameer Patel, Fake News Detection dataset, WELFake dataset
  5. run the data_preprocessing notebook
  6. Run the training scripts for different models

Authors

About

A machine learning and deep learning project that classifies news articles as either "true" or "fake" using various models, from simple baselines to advanced neural networks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •