Inspiration

We were inspired to create the Political Bias Compass due to the pervasive nature of political polarization in even purportedly neutral news organizations in contemporary United States.

Our group loves staying up to date with the latest news, but it is often difficult to tell if the news you reading is more interested in reporting facts or peddling a certain viewpoint or agenda.

Furthermore, when attempting to see both sides on an issue, it can be difficult to source articles from across the political spectrum on a certain topic or important issue.

The Political Bias Compass seeks to solve these problems and more through assigning standardized scores to qualitative attributes like political bias, and by providing a cohesive overview of an author and news source’s political leanings to ensure an equitable and inclusive distribution of viewpoints.

What it does

The Political Bias Compass aims to aid users in navigating the conflicts and biases prevalent in daily news media. It provides an overall political bias score on a standardized negative 42 to positive 42 scale as well as a factual correctness score, author political bias score, and publishing site bias score. While some products currently exist that review the political bias of a publisher as a whole, there are none that operate on an article-by-article basis like ours.

How we built it

We divided the necessary tasks for our product into three major categories:

  1. Getting data from the article (author, publisher, text)
  2. Analyzing the data (determing bias, factual correction, etc.)
  3. Displaying the analytics

To get the data from a link inputted by the user, we utilized BeatifulSoup, a webscraping tool- using Googlebot and Bingbot as agents to access the article. We then parsed the HTML data, utilizing regular expressions to extract the necessary fields.

Once this was done, we passed the article text through a sentiment analysis program we trained using linear regression to “score” its relative political leaning (-42 (left) to +42(right)). We then utilized the Perplexity API Sonar model to analyze its factual correctness through deep research and also the historical bias of the author(s) and publishing site.

Finally, we used a Flask framework to display our data through minimalistic visuals and plain text.

Challenges we ran into

   As first-time hackers with no web/app design experience we faced significant challenges when developing the UI/UX for our project. Specifically, it was arduous to integrate the output from our linear classification model and non-binary (scored) sentiment analysis into our front-end display. We ended up solving this problem by first creating a wireframe for our finalized UI, programming it more robustly in JavaScript, and then populating that with the outputs from our models.

An additional challenge we faced was the initial development of the web scraper, as we had to navigate dynamic webpages which could not be easily managed by libraries like BeautifulSoup. The approach we eventually settled on Google Bot News and Bing Bot to handle constantly changing websites as well as banner ads. To legally access news content that is behind a paywall, we employed public access news archives like WebArchive and Archive.ph to ensure we were meeting legal standards necessary for our application. 

Accomplishments that we're proud of

We are proud of how our team managed to work together to navigate difficulties and persevered throughout the creation of our product.

We were about to end the night with a minimum viable product, but we instead decided to persevere and ended up with a substantially better end product.

We may not be the best programmers or developers, but because we kept working hard and were not satisfied with mediocrity, we allowed ourselves to achieve much more than we initially thought possible.

What we learned

Throughout our first Hackathon, we have had the opportunity to gain skills not only in software development and artificial intelligence, but also in how to implement a vision on a structured timeline.

We also learned the value of ideating throughout the development of our product, instead of just at the beginning, a thought process which helped us circumvent several obstacles like accessing the news sites and integrating our front/back end.

What's next for Political Bias Compass

Given more time, we would love to expand the purview of the Political Bias Compass to include multilingual capabilities and to also include support for more political parties aside from just Democrats and Republicans.

In an ideal world, further development could include growth on both of these fronts, with Political Compass adding having an added capability to, for example, analyze news in German for German political parties, something partially important in nations with a proportional Democratic system.

Additionally, we would like to provide links to websites that will provide alternative perspectives on the events covered by the entered news source.

Built With

Share this project:

Updates