Inspiration

With how fast misinformation can spread nowadays, particularly through social media, fake news articles are running rampant online. This was a topic of hot debate following the 2016 presidential election. We wanted to build software to help combat this issue.

What it does

Our hack is a Google Chrome Browser Extension that helps check the authenticity of news articles online. Users can click the extension button to analyze the headline of the article they are viewing. The extension uses a Natural Language Processing Model built with Google Cloud to compare the headline to known Fake News headlines. It also uses a PageRank API to check the relevance of the website and offers articles from other sources relating to the keywords of the headline.

How we built it

The Chrome extension was built in HTML and CSS with dynamic content and styling via Javascript. We built a Python web server in Flask that receives the URL of the news article being inspected from the Javascript and does the following: (1) Pulls 3 related news articles using the Bing News API (2) Sends the headline to the Google Cloud NLP model we built and receives a "fakeness" score (3) Sends the website domain to a PageRank API and receives a score that represents the website's relevance. --- The Flask server passes this information back to the Javascript, which dynamically fills content and does styling in the HTML/CSS front-end, according to the data it receives.

The Google Cloud NLP model was built by finding and processing a dataset of 10,000+ legitimate news headlines and 10,000+ fake news headlines. We labeled this data and trained the Google Cloud NLP model to classify data into one of the the two labels with some probability. If the probability that an article is fake is >80% then we show a warning to the user.

Challenges we ran into

Originally we were hoping that our NLP model would learn what language constitutes a fake news headline; however, it instead learned what types of topics are often the target of fake news articles and gives a high probability of "fakeness" for most articles in those vulnerable categories. We handled this by adapting the warning our front-end gives to more accurately reflect what the NLP model is recognizing, and suggesting that the user view the related articles to check the legitimacy of the article they are viewing.

Accomplishments that we're proud of

We had never built a Flask web server prior to creating this project. We learned it overnight in order for us to be able to do the content analysis we wanted to do in Python.

What we learned

  • How to create a Flask web server
  • How to dynamically style HTML/CSS via Javascript
  • How to train a classification model in Google Cloud
  • How to deploy a Google Chrome extension

What's next for FakeNews Chrome Extension

We would like to host the Flask server on a remote VM, so that we can publish it on the Chrome Web Store. We also would like to decrease some of the latency experienced due to the processing time for the NLP model.

Share this project:

Updates