Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 Fake News Detection

A Natural Language Processing (NLP) project that classifies news articles as FAKE or REAL using TF-IDF Vectorization and Logistic Regression.


📌 Project Overview

This project uses machine learning and NLP techniques to detect whether a news article is fake or genuine.

The workflow includes:

  • Loading and merging real/fake news datasets
  • Data preprocessing
  • Text cleaning
  • Feature engineering
  • TF-IDF vectorization
  • Logistic Regression model training
  • Performance evaluation
  • Custom prediction function

🛠 Technologies Used

  • Python
  • Jupyter Notebook
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • NLTK
  • WordCloud

📂 Dataset

Dataset contains:

  • Fake news articles
  • Real news articles

Source: Kaggle Fake and Real News Dataset


📊 Exploratory Data Analysis

Performed:

  • Fake vs Real distribution analysis
  • Text preprocessing
  • Word cloud generation

Fake vs Real Distribution

Distribution


Fake News Word Cloud

Fake WordCloud


Real News Word Cloud

Real WordCloud


⚙️ Model Training

Model used:

Logistic Regression

Text vectorization:

TF-IDF Vectorizer

Train/Test split:

  • 80% Training
  • 20% Testing

📈 Results

Accuracy achieved:

98%

Confusion Matrix

Confusion Matrix

Classification performance:

  • Precision: 98–99%
  • Recall: 98–99%
  • F1 Score: 98%

🚀 Custom Prediction

Example:

predict_news("Breaking news about election fraud...")

Output:

🚨 Fake News

Installation

git clone https://github.com/YOUR-USERNAME/fake-news-detection.git
cd fake-news-detection
pip install -r requirements.txt
jupyter lab

Future Improvements

  • Deploy with Streamlit
  • Try Naive Bayes / Random Forest
  • Use advanced NLP models (BERT)

👩‍💻 Author

Siva Priyanka

Passionate about Machine Learning, NLP, and building real-world AI projects 🚀

About

NLP fake news detection project using TF-IDF and Logistic Regression with Jupyter Notebook.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages