dbolya / CompBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An Alexa-integrated web app that has two major functionalities:

When the user expresses that they are unhappy, asks about their appearance, or asks for a compliment, Alexa responds with several unique compliments generated with a Markov chain.

When the user asks to learn something new, Alexa responds with an interesting fact from /r/todayilearned. A main highlight of our project is that our user interface is not an Echo device; instead, we implemented our own interface, created a mascot, and designed a smooth and immersive user experience based around that.

Training Data:

The training data was collected from two different sources using Python: Compliments were collected from the Twitter account @TheNiceBot (using Twitter API and Twython) and the Subreddits (using Reddit API and PRAW) /r/toastme and /r/freecompliments. Facts were gathered from /r/todayilearned. Scripts were written to filter out inappropriate or excessively specific content, and we ended up with a set of 938 compliments and 762 interesting facts.

Markov Chain:

We initially tested the feasibility of various key lengths for the Markov chain using an implementation we wrote in Python. The Markov chain uses the training data to generate text, in our case compliments, using a probability table. We decided that a key length of three words resulted in an acceptably low occurrence of error/incoherence in generated compliments (approx. 15-20%). We then re-implemented it in Javascript to use in our Lambda function for AWS.

Alexa:

We programmed Alexa with a new skill named “Compbot” to understand when the user wants a compliment or a fact. Example utterances include: “I want to learn something new,” “I’m feeling down today,” or “Give me a compliment.” The back-end was written in NodeJS and depending on intent, either generates a response of five compliments or responds with a random fact.

Front-End Interface:

We used a NodeJS library called alexa-voice-service, to help with integrating our interface with Amazon Voice Service. We created a cute mascot based off of one of the logos associated with Amazon Alexa, and animated it on a canvas to respond to user input.

About


Languages

Language:JavaScript 99.8%Language:Python 0.2%Language:HTML 0.1%Language:CSS 0.0%