Inspiration

A survey of the millennial generation found that two thirds of respondents said they consume news online regularly, often on a social networking site. The volume and availability of news has grown exponentially through social media and more young people than ever before are engaging with political candidates. However, news can come from anywhere and articles that are shared on social media tend to be polarizing or biased towards one side.

What it does

barometr is a Chrome extension that measures the political bias in articles. We measure it in two ways: bias indicator and sentiment analysis. The bias indicator notes the party leaning of the articles. The sentiment analysis indicates whether the article is postive or negative. We use a barometer, or scale, to make the measurements to most accurately educate our users in a visually appealing way. And barometr improves over time as we have created a machine learning model.

How we built it

MACHINE LEARNING MODEL - NEURAL NETWORK

To determine political bias, we have created a neural network. Essentially what we do is pull each word from an article and create a new node for that word. At first that node is given an arbitrary value from 0 to 1 (0 being no right bias and 1 being strongly right biased). That node is also given a weight. All the nodes in the article are summed up to give a final score from 0 to 1 which determines the overall article bias. As more articles are looked at, our model learns. That is how our bias indicator improves over time. The model adjusts it's weights and values accordingly.

The neural network model powers Barometr on the backend to serve bias indicator and sentiment measurements for the articles.

CHROME EXTENTION

We created a Chrome extension through web development in Javascript and HTML. The biggest challenge was realizing and designing the extension architecture.

Our control flow begins with content.js in the extension. The content.js file retrieves the text from the website the user is currently reading. We read the text by essentially considering each webpage as a tree. Our code does a DFS traversal to extract the element and then the node, or text, within the element. As we extract the text, we build a JSON output string. We then send the JSON output to the server for processing.

Once the server has processed the webpage text and performed the analysis, we GET the JSON output through the popup.js file in the extension. The JSON is then input into the barometer UI code which renders the extension popup visualization.

The general architecture is reflected in the main manifest.json file. Here we indicate the default_popup as popup.html which is our popup UI that has popup.js in the backend. Our content script is content.js which is the script that pulls the text from the webpage.

AMAZON WEB SERVICES

We set up an EC2 node to host our services. The AWS node is our server backend where we receive and send information to. This is how our Chrome extension is connected to our neural network.

What's next

Lunch

Share this project:
×

Updates