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.
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 articletitle: Title of the news articleauthor: Author of the news articletext: Text of the article (could be incomplete)label: Label indicating if the article is potentially unreliable (1for Fake,0for Reliable)
- test.csv: Similar to
train.csvbut without thelabelattribute.
The project workflow includes:
- Data Visualization and Exploration (
viz_utils.pyandtextual_eda.ipynb) - Model Building and Training (
model_utils.pyandfake_news_detection_main.ipynb) - Model Deployment (
app.pyfor Flask app)
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.
textual_eda.ipynb: Performs Exploratory Data Analysis, visualizing label distribution, article lengths, author statistics and wordclouds.
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.
- The model and tokenizer are saved for deployment purposes, ensuring the web app uses the same configuration as during training.
- 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)
The model achieved an accuracy of 99% on the splitted test set, demonstrating its effectiveness in detecting Fake news.
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.
The required dependencies are listed in requirements.txt and can be installed via:
pip install -r requirements.txt