Class Projects - Spring 2016


RodBot is a storyboard-based chatbot that delivers news based on how the user is feeling.

What it does

Currently news is categorized by topic — political, entertainment, science, etc. — and many people seek out news based on content. RodBot is an experiment in delivering news based on the emotion they’re feeling in a given moment, a challenge given that few tools or humans categorize articles by emotion.

RodBot seeks to match user emotional inputs with appropriate stories. It also seeks to interact with users as a chatbot and has different manners of speech based on the type of article that is requested. The bot can be a little sarcastic at times, but tends toward fun and loving.

How it works

RodBot users input a single word to describe the type of article they’d like to read. When the “send” button is pressed a GET request is made to the RodBot API. The API maps the compares the input word to a dictionary of 14,182 words that are mapped to eight emotions to approximate what type of article the user might want. After the word is mapped to an emotion or sentiment it is then mapped to BuzzFeed tags such as “LOL”, “Cute”, “WIN”, “FAIL”, etc, which are classifications given by BuzzFeed users that read the articles. RodBot searches for articles in the BuzzFeed API using these tags.

When a user initially inputted word is classified it is mapped to an appropriate BuzzFeed tag and a GET request is made to the BuzzFeed feeds API which returns around 100 articles and one is selected at random. From there a call is made to the BuzzFeed buzz API which returns the contents of the article such as descriptions, images, etc. The first 140 characters of the description, the title of the article, an image, the article url, and a storyboard that matches the classified emotion or sentiment are then packaged in a JSON which is returned to the front end at the end of the GET request.

On the front end the contents of the returned JSON are parsed. First the storyboard is examined to set the tone based on the type of article requested. The storyboard is a list of strings that are chained into the dynamically allocated user response and narrator response div boxes. This process simulates the chat interface message flow. The responses are dynamically given unique tags and passed to the Type.js tool, which adds the contents of the story incrementally into the div. After a div is completed if there are more strings in the storyboard it continues until the storyboard is finished and then displays the article. The title of the article is one the top of the dialog box and the article URL is shown along with the snippet of the description of the article. From there the image in the JSON response is also displayed beneath the presented story to help highlight the tone of the article to the user.

Key Technologies

  • HTML and CSS
  • Python’s Flask.
  • Javascript
  • BuzzFeed API
  • Type.js

Next Steps

With more time and resources we'd like to:

  • Improve the accuracy of providing stories that match user’s desires.
  • Better handle cases when suggested stories fail to match user desires.
  • Improve UI of RodBot’s dialogue page.
  • Add more convenient functions such as speech recognition.
  • Store articles in a database for further analysis and classification.
  • Expand our database from Buzzfeed to articles on Twitter and Reddit, and categorize them through people’s comments on the Internet.
  • Provide a feedback system so that users can respond to the articles they are given which could potentially be used to help in article classification.

RodBot screenshot.

RodBot architecture.