Skip to content

zenUnicorn/Fake-News-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Fake-News-Detection

Fake News Detection with Python (Machine-learning)

What is a Fake news

Fake news is news blogs, articles, or posts that are deliberately and verifiably incorrect with the sole aim to sway people's view of actual/true facts, activities, and claims. It's about material given as news that the promoter knows to be fake, based on manifestly inaccurate facts or comments or events that did not occur. "Fabricated material that seems to be news media content but lacks the news industry's editorial guidelines and techniques for ensuring information accuracy and trustworthiness," according to Wikipedia. Misinformation (false or misleading information) and disinformation (false or misleading information) are comparable terms (false information purposely spread to mislead people).

Prerequisites

  1. Python3
  2. Jupyter Notebook
  3. Sci-kit learn

Install Sci-kit learn:

  pip install -U scikit-learn

Install Jupyter notebook:

pip install notebook

Launch it with this command:

jupyter notebook

The Dataset can be downloaded here: https://www.kaggle.com/datasets/hassanamin/textdb3/download

Libraries:

import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB

To test this model:

Just modify the text of the news_headline variable. You should add a news headline to it and run the code, it will definitely predict if it is true or fake.

Happy Coding. 🥳

About

Fake News Detection with Python (Machine-learning)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published