To help my 6 year-old daughter study independently for her weekly spelling tests using Amazon's Alexa Voice Service (e.g. Amazon Echo).
Features:- Recognizes more than 24,000 kid-safe words
- Edit your spelling list by adding and deleting words
- Practice your spellings with a spelling test
To use the published Spell Master skill you need to enable it from the Alexa app/website. If the link does not work you can search for it with the search term "Spell Master".
Challenges:Amazon has made setting up AVS and Alexa Skills very straight forward. So, the most interesting challenge has come from trying to build out a VUI that aids anyone with their spelling studies while not frustrating them. For example having the user say the word instead of spelling it when trying to add a word to their spelling list created a few issues (i.e. saying the word "golf" could easily be interpreted as "gulf"). Additional challenges we have also come across:
- Getting Alexa to accurately capture all letters being spelt out by the user when spoken at varying speeds and clarity
- Slowing Alexa's speed when she spells out words
- Adding lots of Sample Utterances for a single intent can cause undesired results (sometimes...)
These challenges are all still being worked on and the current build is far from perfect but it is a starting point.
Dialog Sample:User: "Alexa, open Spell Master"
Spell Master: "Welcome to Spell Master. You have added 0 words to your spelling list. To get started you will need to add words to it. To do this, say, add word."
User: "Add word"
Spell Master: "Please spell the word you would like to add."
User: "C L I M B I N G"
Spell Master: "Do you want me to add the word, climbing?"
User: "Yes"
Spell Master: "Climbing, has been added. Please spell another word you would like to add or say cancel."
User: "Cancel"
Spell Master: "You have added 1 word to your spelling list. You can say, start spelling test, add word, delete word, read spelling list, or delete spelling list. What would you like to do?
User: "Start spelling test"
...
Voice User Interface (VUI) Diagrams:See Schematics section. Please note the dialog samples used might not reflect the final dialog used. To see the latest dialog check out src/dialog.json.
Setup OverviewThis project is broken up it two two sections, 1) roll it as your own skill 2) and setting up Alexa Voice Service on the Raspberry Pi. Instructions on how to do build the skill are detailed below.
Roll It As Your Own Skill:Spell Master uses Node.js, Lambda and DynamoDB. Amazon has provided a great write up on how to get an Alexa Skill setup using Node.js and Lambda. I have outlined the steps we followed below referencing the above instructions. There are a few things we did differently so its worth reading through the below instructions:
- Download source files
- Create an `auth.json` file inside the `src` folder. It should look like the below. Remember to replace the APP_ID value with your own Application Id when you have created one.
{
"SKILL_NAME": "Spell Master",
"APP_ID": "amzn1.echo-sdk-ams....",
"TABLE_NAME": "SpellMasterData"
}
- Run `npm install` inside the `src` folder to download the Alexa Skills Kit SDK for Node.js.
- Create a Lambda function and Amazon Resource Name (ARN) by following Step 1 on Amazon's Node.js quick start guide for Alexa Skills. Note: There is no need to select a blue print as suggested (see Step 1.f), you can press next and configure the trigger with Alexa Skill Kit. Once you have done this you can press next again to configure the function. Here you will have the option to select the Code entry type, select Upload a .ZIP file. You will want to .ZIP up all the files in the `src` folder. Make sure to .ZIP the files and not the directory.
Add DynamoDB support:
- Go to the AWS Console and click on DynamoDB. Make sure you are in the same region as your Lambda
- Click on CreateTable and set "SpellMasterData" as the table name and "userId" for the primary key type.
- Continue the steps with the default settings to finish the setup.
- Note: You can create the table manually as outlined or let the Alexa Skill Kit SDK do it for you by giving your Lambda function DynamoDB create table permissions.
Extending role permissions to allow the skill to use DynamoDB (I am sure there is a better way):
- Go to the [AWS Console and click on IAM
- Click on Roles
- Click on the role you created. Mine was named "lambda-dynamodb-execution-role" (see Step 1.i on role creation)
- Under Inline Policies click on Create Role Policy
- Select Policy Generator then click on the Select button
- Effect should be set to Allow
- For AWS Service select Amazon DynamoDb
- For Actions select `GetItem` and `PutItem`
- Add your Amazon Resource Name (ARN) - you can find this on settings page of the Lambda function you created
- Click on Add Statement
Create an Alexa Skill by following Step 2 on Amazon's Node.js quick start guide for Alexa Skills
- The Intent Schema is inside the `speechAssets` folder
speechAssets/IntentSchema.json
.
- Sample Utterances are inside the `speechAssets` folder
speechAssets/SampleUtterances.txt
.
- This skill has one Custom Slot Type: `LIST_OF_SPELLINGS`. This is where you can edit the words that Spell Master supports. For example if you wanted to add support for the word `shin` you would include it as `s.h.i.n.` (spelt out). All words in LIST_OF_SPELLINGS can be found here:
speechAssets/customSlotTypes/LIST_OF_SPELLINGS
Testing your skill
Test out your skill by following Step 3 on Amazon's Node.js quick start guide for Alexa Skills.
Extend / Edit Skill:To add extra functionality edit the index.js
file in the ./src
folder:
- Spell Master uses state based intent handling (thanks to the Alexa Skills Kit SDK for Node.js). This means you can set intent handlers to only work when the skill is in a specific state. Currently Spell Master supports the following states: `MENUMODE`, `ADDWORDMODE`, `DELETEWORDMODE`, `DELETELISTMODE`, `READLISTMODE`, and `SPELLTESTMODE`. Descriptions of these states can be found in the source code.
- Ideas on things to extend: Add cards to show the words the user is spelling, add sounds to make it more engaging.
To edit the dialog of this skill edit the dialog.json
file in the ./src
folder:
- Note: To support more words edit the `LIST_OF_SPELLINGS` Custom Slot Type. I created the initial list of 24,000 words by combining a few of the dictionaries compiled by Dr. Phillip M. Feldman.
Comments