Star Archives: Our New Alexa Skill

Jared Blakney
Mission Data Journal
4 min readJul 8, 2016

This is part of an ongoing commentary for a project that our Labs team worked on. We are interested in non-visual user interfaces. Broadly interfaces that consider the use of people’s other modes of interacting with the world: speaking, hearing, feeling, and gesturing. So we decided to experiment with the Amazon Echo.

This summer we’ve been working with voice-based interfaces and natural language processing. Towards the end of May we attended SpeechTek 2016, a conference in DC where we gained some perspective on the ways speech technologies are shaping human experiences with tech. As a way of understanding how to produce effective interactions for voice-enabled inquiries we decided to experiment by creating a couple Alexa Skills for some content about which we are passionate: Comics and Star Wars.

This post will discuss only the Alexa Skill, Star Archives. The Comic Book Guide Alexa Skill is nearly identical with respect to capabilities, techniques used and challenges experienced. Thus, we’re not going to delve into the details of that skill. If you have an Echo feel free to enjoy both. You can find them here Star Archives and Comic Book Guide .

Star Archives

Our Star Wars Alexa Skill, Star Archives, provides all kinds of information about the Star Wars universe; users can ask Alexa about galaxies, starships, weapons, and characters. To begin we created a schema on what users can ask Alexa. The schema considered everything we believed users would be willing to ask out loud and receive the information via “spoken” voice. As mentioned the schema included information about objects (galaxies, starships, etc.) and about characters. Besides merely definitional information we felt users would enjoy obtaining detailed characteristics and specifications for the “characters,” equipment, and celestial bodies. For example, the schema allows users to ask about characters’ height, hair color, homeworld, and species.

Within the Alexa schema the outcome of an utterance or a behavior must be defined. These outcomes are called intents in the world of natural language processing (NLP). More simplistically, an intent is really the intention of the request. As a result, to complete the model we needed to add a list of sample utterances, what users can say to interact with Alexa. For example, “Tell me about (x)”, “Get information for (person)”.

Once we finished defining our model, we needed to define a Web service for Alexa so that it could interact with users as they conversed with her. The Web service is made up of two parts. First, it consists of a POST request that the Alexa service sends to the our Star Archives web service. When the Alexa service sends this request, it gets back a response for it to return to the user. We can specify what the Alexa service triggers when it sends this POST request. For the Star Archives skill, we connect to the Star Wars API created by Paul Hallett. As an example interaction, the Alexa service triggers a query to the Star Wars API to get information about Luke Skywalker when the user says: “Tell me about Luke Skywalker”. When the Alexa service sends this request, the name Luke Skywalker is stored in a session attribute. This is important because it allows a continuation of future requests about that particular character. Using this technique the user does not have to say Luke Skywalker’s name every time they ask Alexa a question.

We decided to set the skill up this way and have the user first ask about a specific character, galaxy, or starship so as to create a cleaner organization. There’s a large number of things a user can ask about a particular subject, such as a planet’s climate, a starship’s speed, or a character’s hair color. By initially narrowing the initial inquiry, it eliminated the chaos of having users to ask about anything in any order or organization. To distinguish between the different subjects a user can ask about, we used a separate intent for each attribute (height, climate, speed). This minimized the chance of Alexa getting confused.

Challenges

There were a number of challenges we faced while building this skill. One challenge was figuring out how a user can continuously ask questions. We determined that the correct path to take was using a session to persist data.

Another challenge was that we had problems with the skill crashing. This happened because when you ask the Alexa service for something, it makes an API call which can take a long time and if the request takes too long it will timeout and crash. To get around this, we built a timeout into the code so that if the request doesn’t come back in a certain amount of time we will trigger an Alexa response of “can you repeat that?”. The request can then be made again, and the hope is that it will take a shorter time to find the information the next time.

This was just a high level snapshot of what we did to build our Star Archives skill. If you are interested in using it for yourself you can find the Star Archives by simply saying “Alexa, ask Star Archives” or “Alexa, start Star Archives”.

Have a web app, mobile app, or piece of custom software you need designed and developed? Drop us a line

--

--