Skip to content

About

A fine-tuned BERT model that classifies news articles as "Real" or "Fake" with 97.5% accuracy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Project Veritas: A High-Accuracy Fake News Classifier

Test Accuracy AUC Language

A deep learning model that automatically classifies news articles as "Real" or "Fake" with 97.5% accuracy, designed to help online platforms combat the spread of misinformation at scale.


1. The Problem & Opportunity

Content moderation teams at news aggregators and social media platforms are overwhelmed by the high volume of articles published daily. This makes it incredibly difficult to:

  • Manually identify misinformation in a timely manner.
  • Reliably and consistently apply content policies.
  • Prevent harmful "fake news" from spreading virally before it can be flagged.

Hypothesis: By leveraging a state-of-the-art Transformer model (BERT), we can build an automated classification tool that acts as a "first line of defense," enabling human moderation teams to focus their efforts on the most high-risk content with greater speed and accuracy.


2. The Solution

This project frames fake news detection as a binary text classification problem. The model architecture fine-tunes a pre-trained BERT model on a labeled dataset of real and fake news articles.

Model Architecture

Key Features

  • High-Accuracy Classification Engine: Ingests the full text of a news article and outputs a probability score indicating the likelihood of it being fake.

  • Long-Form Content Analysis: To handle real-world articles that often exceed the token limits of standard models, the system intelligently segments long texts into overlapping chunks. This ensures the entire context is analyzed before a final, aggregated prediction is made.

Tech Stack

  • Model Framework: TensorFlow 2.0
  • Core NLP Model: BERT ( leveraging the bert-for-tf2 library)
  • Data Manipulation: Pandas, Scikit-learn
  • Visualization: Matplotlib, Seaborn, WordCloud

3. Results & Impact

The model's performance was evaluated against a hold-out test set using Accuracy, Precision, Recall, F1-Score, and Area Under Curve (AUC).

The final, aggregated predictions on the original test articles achieved:

  • Test Accuracy: 97.5%
  • AUC Score: 0.99

ROC Curve

This high level of performance demonstrates the model's capability to reliably distinguish between real and fake news, significantly reducing the need for manual review and enabling platforms to scale their content integrity efforts.


4. Learnings & Future Roadmap

Key Learnings

  • Fine-tuning a large pre-trained model like BERT is a highly effective strategy for domain-specific text classification.
  • The text-chunking method for long documents is a critical and successful preprocessing step for handling real-world data with Transformer models.

Future Roadmap

  • V2 (Deployment): Package the model into a containerized REST API (using Docker and Flask/FastAPI) for easy integration into production content management systems.
  • V3 (Feature Expansion): Enhance the model to perform multi-class classification, identifying not just "Fake" but also categories like "Satire," "Opinion," or "Clickbait" for more granular moderation.

5. How to Use

Prerequisites

Ensure you have the necessary libraries installed. You can create a requirements.txt file and install them via pip.

pip install -r requirements.txt

About

A fine-tuned BERT model that classifies news articles as "Real" or "Fake" with 97.5% accuracy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages