DEV Community

Sanjeev Deori
Sanjeev Deori

Posted on

FAKE NEWS DETECTION ML MODEL

Fake News Detection App

๐Ÿ“ Overview

Fake news has become a widespread issue in today's digital world. This project aims to detect fake news using machine learning techniques. The model classifies news articles as Fake or Real based on text analysis. The web interface, built using Streamlit, allows users to input news text and get predictions instantly.

๐Ÿ“Œ Features

  • ๐Ÿ“ฐ Pandas for data processing
  • ๐Ÿค– Scikit-learn for machine learning (Logistic Regression)
  • ๐Ÿ’พ Model serialization with joblib
  • ๐ŸŒ Web interface powered by Streamlit

๐Ÿš€ Installation

๐Ÿ“ฅ Clone the Repository

git clone https://github.com/your-username/fake-news-detection.git
cd fake-news-detection
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ฆ Install Dependencies

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Š Dataset

  • The model is trained using a dataset containing labeled fake and real news articles.
  • Preprocessing includes text vectorization using TF-IDF Vectorizer.

๐Ÿ‹๏ธ Model Training

  • The dataset is preprocessed using Pandas.
  • Text features are extracted using TfidfVectorizer.
  • The model is trained using Logistic Regression.
  • The trained model is saved using joblib.

โ–ถ๏ธ Running the Streamlit App

streamlit run app.py
Enter fullscreen mode Exit fullscreen mode

๐Ÿ› ๏ธ Usage

  1. Enter a news article text in the input box.
  2. Click the Detect button.
  3. The model will classify the article as Real or Fake.

๐ŸŽฎ Live Demo

Check out the live demo of the app here: Fake News Detector

  • Deployed at Streamlit Community Cloud

๐Ÿ“Œ Dependencies

# Required Libraries
Python 3.x
Pandas
Scikit-learn
Joblib
Streamlit
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“œ License

This project is open-source under the MIT License.


๐Ÿ’ก Feel free to contribute and improve this project!. If anyone know how to fetch real time data using api keys to get real time data ๐Ÿš€

Top comments (1)

Collapse
 
sripadh_sujith_1487e8db18 profile image
Sripadh Sujith

Amazing bro