NLP and Deep Learning For Fake News Classification in Python

NLP and Deep Learning For Fake News Classification in Python

In this project you will use Python to implement various machine learning methods( RNN, LSTM, GRU) for fake news classification.
explanation image


Each project comes with 2-5 hours of micro-videos explaining the solution.

ipython image

Code & Dataset

Get access to 50+ solved projects with iPython notebooks and datasets.

project experience

Project Experience

Add project experience to your Linkedin/Github profiles.

Customer Love

Read All Reviews
profile image

SUBHABRATA BISWAS linkedin profile url

Lead Consultant, ITC Infotech

The project orientation is very much unique and it helps to understand the real time scenarios most of the industries are dealing with. And there is no limit, one can go through as many projects... Read More

profile image

Nathan Elbert linkedin profile url

Senior Data Scientist at Tiger Analytics

This was great. The use of Jupyter was great. Prior to learning Python I was a self taught SQL user with advanced skills. I hold a Bachelors in Finance and have 5 years of business experience.. I... Read More

What will you learn

Understanding the problem statement
Understanding the Sequence problem and their types
Understanding Sequence neural network approach like: RNN, GRU and LSTM
Importing the dataset and importing libraries
Performing basic text cleaning
Perform text preprocessing: Stop word removal, Stemming etc
Text tokenization using keras tokenizer
Sequence data preparation with tokenizer and padding
Train and test split for model validation
Explaining Text vectorization and Word embedding
Build Word embedding layer with Glove
Important parameter before train model
Explaining Sequence model steps
Implementing Simple RNN
Implementing LSTM and GRU
Making Test predictions using the trained model
Comparing Model training and validation loss and performance
Comparing LSTM and GRU performance and computation Time

Project Description

Business Overview


What is Fake News?

Fake news is the deliberate presentation of (typically) false or misleading claims as news, where the claims are misleading by design.

How News and digital media evolved?

The news media evolved from newspapers, tabloids, and magazines to a digital form such as online news platforms, blogs, social media feeds, and many news mobile apps. News outlets benefitted from the widespread use of social media/mobile platforms by providing updated news in near real time to its subscribers.

It became easier for consumers to acquire the latest news at their fingertips. So, These digital media platforms become very powerful due to their easy accessibility to the world and ability to allow users to discuss and share ideas and debate over issues such as democracy, education, health, research and history.

However, apart from advantage, false/fake news articles on digital platforms are getting very common and mainly used with a negative intent for their own benefit such as political and financial benefit, creating biased opinions, manipulating mindsets, and spreading absurdity.

How big is this Problem ?

With the rapid adoption of Internet, social media and digital platforms (such as Facebook, Twitter, news portals or any social media), anybody can spread untrue and biased information. It is virtually impossible to prevent Fake News from being created. There has been a rapid increase in the spread of fake news in the last decade, it's not limited to any one domain like politics but covering various other domains such as sports, health, history, entertainment and also science and research. If we take the 2016 US presidential election, there were lots biased and fake news published to influence. Another example could be of COVID-19, we generally come across many misleading/fake news everyday which can have serious consequences and may lead to create panic among people and spread pandemic more rapidly.

What is Solution?

Therefore, It is important and absolutely necessary to identify and differentiate Fake News from real news. One of the ways is to determine by expert and fact check of every news, but this is time consuming and requires skills which can not be shared. Second, we can automate the detection of Fake News by using the techniques of Machine learning and Artificial Intelligence. The Online news content has diverse unstructured format data(such as documents, videos, and audios), here we will concentrate on text format news. With the advancement of and Natural language processing It is possible now that we can identify the deceptive and fake nature of articles or sentences.

There is widespread study and experimentation happening in this area to identify the Fake news for all medium(Video, audio and Text) news.


Data Description

In our study we used the Fake news dataset from Kaggle to classify unreliable news articles as Fake news using Deep learning Technique Sequence to Sequence programming.

A full training dataset with the following attributes

  • id : unique id for a news article
  • title: the title of a news article
  • author: author of the news article
  • text : the text of the article; could be incomplete
  • label : a label that marks the article as potentially unreliable
    • 1 : unreliable
    • 0 : reliable

Tech Stack

  • Language : Python
  • Libraries : Scikit-learn , Tensorflow , Keras, Glove, Flask, nltk, pandas, numpy

Similar Projects

The goal of this tensorflow project is to identify hand-written digits using a trained model using the MNIST dataset. The MNIST dataset contains a large number of hand written digits and corresponding label (correct digit)

In this tensorlfow project, our goal is to correctly identify digits from a dataset of tens of thousands of handwritten images.

In this project, we are going to predict item-level sales data using different forecasting techniques.

Curriculum For This Mini Project

Business Problem
Data Understanding
Approach : Sequence Problem Neural Network
Simple RNN
Problem with RNN
Steps to Build Many to One Sequence Problem for Text
Data Cleaning
Exploratory Data Analysis
Preparing Training and test datasets
Sequence data transformation
Feature Engineering : Word Embedding
Text based Sequence Neural Network component
Important Hyperparmeters
Building Sequential Neural Network
Training a RNN model
Training LSTM and GRU models
Model Performance comparison: GRU and LSTM
Final Code Walkthrough