AlexaCricket skill allows you to retrieve information related to cricket sport. Here different types of information can be extracted. For example How many crickets series are going on, summary of each cricket series, information related to a specific team. Information related to a specific cricket series includes which teams are playing and how many matches each team has won whereas information related to a specific team includes ranking of that team, names of the captains for different format of matches and coach.
To accomplish, Amazon Alexa has been used to interact with user via voice along with Amazon AWS Lambda service is used maintain back end logic. This application can be accessed from any device which supports Amazon Alexa.
Terminologies- Amazon Alexa: Allows hands-free convenience with voice control.
- AWS Lambda: Communicates with an external web service to retrieve information of interest.
- Dialog and Session state: Back end logic hosted on AWS lambda maintains two models (1) a one-shot ask (2) a multi-turn dialog model.
- SSML: Using SSML tags to control how Alexa renders the text-to-speech.
The philosophy behind this application is very simple one can retrieve information of his interest with voice control. At the moment only one sport (Cricket) is added but it can be expanded to other sports easily. As underlying foundations are made so by adding more sports it can be made an ultimate guru of the sports.
What Can The Skill Do?The skill implements following use-cases:
- # 1: You are looking to listen which teams are playing matches.
- #2: You are looking to listen summary of a specific match series.
- #3: You are looking to listen statistics of a specific team.
The deployment of this skill has to done on servers to host two different services.
AWS Lambda Setup
- Go to https://console.aws.amazon.com to sign-in using your credentials.
Note: Make sure that AWS account is set in US-EAST to make use of the Amazon Alexa.
- Select lambda option.
- Select create a lambda function option.
- Select Node.js 4.3 from the drop down menu and alexa-skills-kit-color-expert from the below shown cards.
- On Configure triggers page, select Alexa Skills Kit option to link Lambda services with Alexa.
- Give Name.
- Select Node.js 4.3 from the drop menu.
Upload source code by changing code entry page.
In source code folder, select all JS files (In my case there are two) and compress them as a zip file. Make sure that no folder structure is used to maintain source code.
- On configuration page, most of the default options will work however you have to select those to activate.
Make a note of the long string shown in the right top corner next to ARN label. We will use it later.
- On Triggers page, make sure that Alexa Skills kit is mentioned.
- At this pint your service at AWS lambda server is complete. Now your dashboard will look like following:
- Your Lambda service is ready to use.
Alexa Skill Setup
Next step is to create a Alexa skill which will make use of the ASW lambda service.
- Go to https://developer.amazon.com and sign-in using your credentials.
- Select Alexa Skills Kit option.
- Select Add a New Skill option in the right top corner to create a skill.
- Select Skill Type. In my case it is Custom.
- Give Skill Name.
- Give Innovation Name. JFI: This is the string you will tell Alexa voice control to activate your skill. So I would recommend to use short and descriptive string.
- On Interaction Model page, copy contents of IntentSchema.json to Intent Schema.
- Select Add Slot Type. Use 'LIST_OF_TEAM' as a name and copy contents of LIST_OF_TEAM file to slot options.
- Copy contents of SampleUtterances.txt to SampleUtterances. It informs skill that which words will be used by user to interact with our skill. Moreover it also defines that how our back end code at AWS lambda will receive these words.
- Goto Configuration page.
- Make sure that Service Endpoint type is AWS lambda.
- In the text field also type the AWS lambda key which you noted above.
- On the Publishing Information and Privacy & Complaince pages, just select the default options to get our skill ready to use.
How to use
- Goto https://echosim.io if you don't have Alexa Echo device and following below mentioned user interaction sequence to play with your skill.
Example user interactions:
dialog model:
- User: "Alexa, Open cricket."
- Alexa: "Cricket, do you want to get update"
- User: "yes"
- Alexa: "blah series going on blah blah blah? Do you want to get details of any series?"
- User: "yes"
- Alexa: "give me series number??"
- User: "one|two|..."
- Alexa: "This series is played b/w XX and XY. XX has won xx matches and xy has won xx matches. Do you want to get detail of any team?"
- User: "yes"
- Alexa: "Give me team name?"
- User: "England"
- Alexa: "Give detail about the team captain & ranking & coach."
- User: "No."
- Alexa: "Good bye!"
one-shot model:
- User: "Alexa, Open cricket."
- User: "summary of series number one|two|..."
- User: "Alexa, Open cricket."
- User: "summary of team named england|ireland..."
Comments