Skip to content

ashutoshkr45/Fake-News-Detection-LSTM-NLP

Repository files navigation

Fake News Detector

DESCRIPTION

This project aims to detect fake news using a Deep Learning model. The primary focus is on political news, particularly during the 2016 USA elections. The model processes the title, author, and text of articles to classify them as Reliable or Fake.

DATASET

The dataset is sourced from a Kaggle competition and can be accessed here. It includes:

  • train.csv: Contains articles with the following attributes:
    • id: Unique ID for a news article
    • title: Title of the news article
    • author: Author of the news article
    • text: Text of the article (could be incomplete)
    • label: Label indicating if the article is potentially unreliable (1 for Fake, 0 for Reliable)
  • test.csv: Similar to train.csv but without the label attribute.

OVERVIEW

The project workflow includes:

  1. Data Visualization and Exploration (viz_utils.py and textual_eda.ipynb)
  2. Model Building and Training (model_utils.py and fake_news_detection_main.ipynb)
  3. Model Deployment (app.py for Flask app)

MOTIVATION

With the proliferation of misinformation, especially during critical events like elections, there is an urgent need for automated systems to help identify and curb the spread of fake news. Fake news can have severe implications on public opinion and democracy. This project aims to address this issue by developing a robust model capable of detecting unreliable news articles. By leveraging Deep Learning techniques, the goal is to provide an efficient and accurate solution to assist in maintaining the integrity of information in the digital age.

TECHNICAL ASPECTS

Data Visualization and Exploration

  • textual_eda.ipynb: Performs Exploratory Data Analysis, visualizing label distribution, article lengths, author statistics and wordclouds.

Model Building and Training

  • fake_news_detection_main.ipynb: Involves text preprocessing, tokenization, sequence padding, and model creation. Utilizes a vocabulary size of 5000, sequence length of 30, and embedding vector dimension of 50.

Saving and Loading Models

  • The model and tokenizer are saved for deployment purposes, ensuring the web app uses the same configuration as during training.

Model Deployment

  • Flask App: The web app is built using Flask, HTML, and CSS. It processes user input, predicts the reliability of news articles, and displays the result.
  • Web App Link: Fake News Detector Web App (RENDER)

RESULTS

The model achieved an accuracy of 99% on the splitted test set, demonstrating its effectiveness in detecting Fake news.

CONCLUSION

The project successfully demonstrates a high-accuracy Fake News Detection model. Both Jupyter notebooks are well-documented, providing clear insights into the data processing and model development stages. The test.csv file is also included in the repository, and the model tends to perform better on this data due to similar domain.

REQUIREMENTS

The required dependencies are listed in requirements.txt and can be installed via:

                            pip install -r requirements.txt

About

LSTM-based Fake News Detection using TensorFlow and Flask, deployed on Render. Trained on a diverse dataset of news articles, primarily political news from the 2016 USA elections. 📰🤖

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages