Sentiment Expert was inspired by my interest in conversational AI combined with explorations in language and thought, along with the spirit of play.

What it does

Sentiment Expert is an Amazon Alexa skill that uses sentiment analysis to measure sentiment in the user's utterance. Rather than just providing raw measurements, Sentiment Expert challenges the user to match target measurements for positive and negative measurements, with higher scores awarded for proximity to the targets.

How we built it

Sentiment Expert was built as an Alexa voice interaction model (a set of JSON files) with an AWS Lambda back end written in Node.js. The back end code makes calls to the sentiment analysis API. This skill was adapted from a previously published Alexa Skill, "Sentiment Match", which was based on the Amazon Comprehend sentiment analysis API. The adaptation to use was done entirely within the hackathon period, per the rules.

Challenges we ran into

Because the authentication token expires after one day, and given the transitory nature of Lambda functions, the skill needs to request the token each time before calling the Sentiment API using the token. It would be possible to persist the token and only request it upon failure of an expired token, but that'll wait until a later version. Adapting the skill from Comprehend's sentiment measurement as a vector that mixes four components (positive, negative, neutral, mixed) to's scalar measurement along a single positive-negative axis required me to adjust both gameplay and scoring to maintain a good level of engagement and relevance.

Accomplishments that we're proud of

The adaptation of existing code from Comprehend to was straightforward, establishing that the framework I created was (for the most part) modular and portable to other measurement systems.

What we learned

The adaptation showed that the general idea of a target-based interactive challenge around linguistic measurements, beyond just a one-way measurement of user input, is possible and transferrable to alternative back end measurement systems.

What's next for Sentiment Expert

I will revisit parts of my code that weren't as modular (i.e. dependent on the measurement platform), to see if I can provide more of a separation. I will also look at using the target-challenge interactivity of Sentiment Expert to create other interactive experiences that challenge the user to meet other targets.

Built With

Share this project: