Skip to content

farmaieshi/Fake-News-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# Fake News Detection using NLP & Machine Learning

001πŸ“Œ Project Overview
In the era of information overload, misinformation and "fake news" have become a significant challenge. 
This project aims to build an automated system that classifies news articles as either **True** or **Fake** 
using Natural Language Processing (NLP) and robust Machine Learning algorithms.

002 πŸ› οΈ Tech Stack
- **Language:** Python 3.x
- **Libraries:** Pandas, NumPy, Scikit-Learn, NLTK
- **NLP Techniques:** TF-IDF Vectorization, N-Gram analysis, Emoji conversion, Stemming.
- **Visualizations:** Matplotlib, Seaborn, WordCloud.

003 πŸ“Š Dataset
The dataset is sourced from the **Fake News Detection Challenge (KDD 2020)** on Kaggle. 
- **True News (0):** Reliable news articles.
- **Fake News (1):** Potentially unreliable or fabricated articles.

004 πŸš€ Machine Learning Pipeline
1. **Data Cleaning:** Removing URLs, special characters, and converting emojis to text to preserve emotional context.
2. **Feature Extraction:** Using **TF-IDF Vectorizer** with `ngram_range=(1,2)` to capture both single words and phrases.
3. **Model Benchmarking:** Evaluated several models including:
   - Passive Aggressive Classifier (Best for online learning)
   - Logistic Regression
   - Naive Bayes
   - Random Forest & Decision Trees
   - Linear SVC
4. **Optimization:** Used **GridSearchCV** with **Cross-Validation** to find the most efficient hyperparameters.

005πŸ“ˆ Key Results
The model achieves a high accuracy rate (approx. 78%+), with the **Passive Aggressive Classifier** 
and **Logistic Regression** showing the most reliable performance for text-based classification.

006 πŸ“ Repository Structure
```text
β”œβ”€β”€ data/                  # train.csv
β”œβ”€β”€ notebooks/             # Text-Analytics.ipynb
β”œβ”€β”€ models/                # fake_news_model.pkl
β”œβ”€β”€ README.md
└── requirements.txt

About

Fake news detection system using NLP and Machine Learning. Features a full pipeline from text preprocessing to model deployment with 78%+ accuracy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors