(Desktop client: https://github.com/ncrypt96/Fake-news-desktop)
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
git clone https://github.com/ncrypt96/Fake-news.git
cd Fake-news
pip install -r requirements.txt
import nltk
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('averaged_perceptron_tagger')
nltk.download('wordnet')
Go to https://newsapi.org/ and get the free API key under the Developer Plan
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"])