Senators Think That Search Engines Misrepresent them: Myth Busted or Confirmed?
Tags: Media Bias, Senate, Bing, Google, Bias

This project is still a work in progress. Please let me know if you have any suggestions at elvin_hu (at) outlook (dot) com!

Problem

Lawmakers are not known to be familiar with technologies. Since the beginning of Donald Trump’s presidential run, Trump and conservative senators have been claiming that search engines are biased against them.

At a recent hearing with Google’s CEO Sundar Pichai, some US senators were not content with how they were portrayed in search engines. This prompted me to investigate how exactly they are portrayed.

Approach

Instead of conducting natural language analysis of web search results, I decided to target something more intuitive: image search results.

My goal is to gather photos from the top search results (from the whole web, not from specific websites) of all 100 senators and Donald Trump, and examined the emotions shown in those photos.

After getting the search results, I then visualized the data in a graph, with the x-axis ranking all senators in the order of “the most conservative” to “the most liberal”, and the y-axis showing their emotion scores. With a bit of research, I decided to use the “Ideology Score” (https://www.govtrack.us/congress/members/report-cards/2017/senate/ideology) from govtrack.us for the ranking, and some APIs provided by Microsoft to get and analyze the photos.

Working with APIs

After setting the goal, as a designer who codes, I realized that I need at least two APIs and some JavaScript libraries: one API for obtaining the image search result from a search engine, another for analyzing the emotion in the photos, and some libraries like d3.js to help me draw the graph on the webpage.

I looked into the developer documentation of a few of the most popular search engines in the US: Google, Bing, Yahoo and DuckDuckGo.

However, Yahoo deprecated their search API in 2016 and DuckDuckGo never offered an image search API at all. Google replaced its old search API which was able to search the whole web with the new custom search API which only allows users to search in specific websites.

Fortunately, Microsoft’s Bing Image Search API (https://azure.microsoft.com/en-us/services/cognitive-services/bing-image-search-api/) meets my criteria perfectly. The API provides an experience similar to Bing’s native image search function by returning images that their algorithm determines are relevant to a user’s query.

As for the emotion analysis API, I had to choose between Microsoft’s Face API (https://azure.microsoft.com/en-us/services/cognitive-services/face/) and Parallel Dot’s Emotion Detection API(https://www.paralleldots.com/facial-emotion). Although Parallel Dot’s API seems to generate better results, the rate limit was so high that it will take the browser 16 hours to finish sending the HTML requests. Also, since I am using the Bing Image Search API already, it is easier for me to manage the Ajax calls, which share similar endpoints and structures in my code.

Challenges

Rate limit

Originally, I hoped that users could get fresh image search results when they visit the website, but due to the Face API’s rate limit of 10 calls per second, I had to manually slow down the processing and would not be able to process images in real-time, at least not without sacrificing the user experience.

SVG drawing

Although I have the 300,000 pieces of data at my disposal, how can I draw them on a graph efficiently? Even with my experience using the d3.js charting library, I decided I shouldn’t reinvent the wheel. In the end, I chose to use plotly.js (https://plot.ly/).

Solution