Experiencing with Amazon Alexa Skill development.
This short article is about my second experience on implementing the very simple game of the Hangman with Natural Interfaces using this time the voice only Skill capability of the Amazon Alexa platform.
As already documented on my previous post about experiencing with Hangman game with Face and Eye Detection interfaces I chose this very basic and primitive game as a test case for implementing interactive bots and natural interface experiments on different platforms.
The Alexa Skill game
As said the game experience is super simple. Once opened the skill Alexa will think a secret word and the user will need to discover this word a letter at a time or just trying to guess the entire word.
The user can ask at any time Alexa to recap for what letters he has already discovered, unsuccessfully tried and how many are missing and he can also get a hint just asking for what is the meaning of the secret word.
To open the skill just say: “Alexa, open hangman game”
Once the game is started the user can say:
- “Try letter c”: to check if the secret word contains the letter C
- “Try letter bravo”: to check if the secret word contains the letter B
- “Try letter house”: to check if the secret word contains the letter H
- “Recap”: to check how many letters have been discovered and how many have to be discovered yet
- “What is the meaning”: to get a hint and let Alexa tells the meaning of the secret word
- “Try word cutter”: to check if the secret word is cutter
- “I give up”: to get the secret word and start a new game
The game automatically persist its status and it allows the user to continue a previous game once he restarted the skill.
Implementation and impressions
The source code of this simple Alexa Skill is available on https://github.com/JacopoMangiavacchi/Hangman-Alexa-Skill
The Skill app logic is developed using the super easy Alexa Skills Kit SDK for Node.js and it is deployed using AWS Lamda, the awesome AWS Serverless platform for easily build and deploy microservices.
The Skill also use the AWS DynamoDB nosql database for storing the game session and allow the skill to persist the game across different conversation with the user.
Moreover the DynamoDB integration is really straight forward and with a single line of code it allows you to solve the native Alexa synchronous communication model and the skill session timeout limitation. It practically auto persist state and session attributes on closing the skill and it allows end user to automatically rehidratate skill and all session data at any time continuing on a previous conversation.
The hangman game logic itself is developed as an external module developed using the modern and more type safe language TypeScript from Microsoft.
Another very cool feature I have found in the Alexa Skill Kit sdk, unfortunately missing on some other Voice/Bot/NLP frameworks, is the support for SSML tagging. With SSML you can totally customize your skill voice messages and honestly this is just like the advent of colors and graphics on traditional computer user interfaces.
A voice first interface without SSML is nowadays just the equivalent of a 3270 screen or generally any other character based program user interface.
I have found the Interaction Model Builder, currently in Beta, a very promising tool. It allows developers to manage not particularly complex user conversation interaction directly in the web based authoring tool and definitely it also help a lot on the data entry of intents, slot values and sample utterances instead of manually dealing with different JSON files.
I haven’t played enough yet with Card support for adding advanced extra voice visual features. I only used a very simple welcome card on this simple skill but I promised myself to investigate more on this hybrid “voice first, plus touch” scenario once I will be able to get in touch with the new amazing Echo Show device.
Indeed I’m really, really exited about all the new user interaction opportunities that this new kind of devices introduce with voice, touch and camera and face/body detection.
See ya therefor at my next natural hangman experiment 😉
Source: Chatbots Magazine