Skip to content

ncrypt96/Fake-news

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Fake news

This project aims to detect Fake news

We take the URL from the user-> Extract Keywords-> Crawl the web for related articles-> Compare the similarity with each article

Installation

git clone https://github.com/ncrypt96/Fake-news.git
cd Fake-news
pip install -r requirements.txt

Also

import nltk
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('averaged_perceptron_tagger')
nltk.download('wordnet')

Usage

Go to https://newsapi.org/ and get the free API key under the Developer Plan

make a python file inside the cloned folder Fake-news

for example some_file.py

now run python3 some_file.py with the following code in it

Set a thershold value to the score returned for classification

the reccomended threshold is 0.4

from abstractor2 import with_keywords,without_keywords

print("Enter the URL")

url = input()

results = without_keywords(url,"<YOUR API KEY HERE>")

if(results["status"]=="fail"):

    print("Enter the keywords seperated by ',' \n")
    print("Suggested keywords:")
    print(results["suggestions"])

    keywords = input().split(',')

    print(keywords)


    print(with_keywords(url,keywords,"<YOUR API KEY HERE>")["similarity"])

else:

    print(results["similarity"])

About

An attempt to solve the problem of Fake News

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages