Skip to content

Using Machine Learning and NLP to segregate the unreliable and reliable news articles

License

Notifications You must be signed in to change notification settings

Karan-Malik/FakeNewsDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FakeNewsDetection

Using Machine Learning and NLP to segregate the unreliable and reliable news articles

About this Project

This project analyzes about 18k news articles and their titles, lemmatizes and cleans them and then uses them as features, which are then used in Logistic Regression, to classify them as reliable (0) or not reliable (1). It is able to achieve a test set accuracy of 95.8%.

Dataset

The dataset used is available on Kaggle. It contains over 20000 news articles along with their authors, titles and labels classifying them as reliable or not reliable.

It is present as train.csv in the repository. To access the data online, follow this link.

How to Run the Model on your System

  1. Use this link to download the dataset and set the folder containing the downloaded data as the working directory.

  2. Make sure you have all the libraries used in the fake_news.py file. In case you need to download any of the libraries, use this command:

pip install 'your library name'
  1. Once you have all the libraries imported, copy the code from fake_news.py and run it.