The Skill allows users to:
- Set their favorite team
- Show the score of a specific team
- Ask Alexa who’s playing today or yesterday
Here is a demo of Skill:
While building this Skill we learned a few more valuable lessons about extending the capabilities of Alexa.
There are currently 30 different NHL teams that we had to map values for. However, it turns out, there are about 150 different ways you could say the names of these teams. To make the skill as natural as possible to use, we wanted to allow users to say team or city names along with their most popular nicknames.
To handle all these possibilities we had to configure two maps. The first one maps all 150 possible free voice values to their respective three letter team code that displays on the board. For example, ‘Montreal’, ‘Canadiens’, ‘Habs’ and ‘Montreal Canadiens’ would all map to “MTL”. Then the logic of the board can use the unique code name for each team.
The second map is used when Alexa needs to speak back the name of the team. Whenever the skill needs to say the name of the “MTL” team, we convert it to the team’s full name, “Montreal Canadiens”, using the map.
Fuzzy Team Names
We had to create an extension of those maps to handle cities with multiple teams like New York. If a user asked to see the score of the New York game, they could be referring to the Rangers or the Islanders.
Fortunately, in this case, the voice to code map can resolve to multiple values. When a user asks for New York, Alexa can ask the user to clarify their choice. Alexa will respond:
“Do you mean the Islanders or Rangers?”
We expect that this pattern will be reused for several cases in future skills.
Different Voice and Text Spellings
Going back to having the user be able to ask for a team by a nickname, we realized some of these are not English words. At least not by any dictionary definition. Using our Montreal Canadiens example, “Habs” is not an English word.
One team that we had trouble with was the Colorado Avalanche. Their nickname, the “Avs” sounds extremely close to “Habs.” Alexa had some trouble with this, even in a noise free room with a native English speaker. We got Alexa to understand that we mean the Avalanche by changing the spelling from “Avs” to “Aves”. This shows that in domain-specific cases, the Alexa sample utterances need to use different spellings to make the recognition work.
The detection of “Canadiens” was also not as reliable as it could have been. In that case, what helped was to add “Canadians” as one of the Slot values. Surprisingly, Alexa always sends “Canadiens” as the spelling.
Context Specific Intents
With this skill, the user can say the team name in the context of setting their favorite team, or to temporarily show the game of a specific team.
The default behavior when a user only says the team name is to temporarily show a game.
However, when the user says:
“Alexa, ask Fantasy Scoreboard to change my favorite team.”
“Which favorite team would you like?”
In that context, saying just a team name like “Montreal” will update the favorite team. To make these fuzzy entry points context aware, we are using the session.attributes functionality of the Skill Kit. This allows a Skill to add its own value to the session, and Alexa sends it back in the follow-up request. This makes it a lot easier for Skill developers to keep track of the context set by previous requests, instead of having to use their own session stores as Redis.
Giving Alexa a Hand
Although the fixed grammar based voice recognition of Alexa helps, sometimes it will send us values that are not in our custom Slot definitions. While handling hexadecimal numbers, we had to add special handling for some misheard values.
For example, converting:
- Tree to 3
- For to 4
- The to D
We expected the Slot value mapping to handle those for us, but with a bit of user testing, and good logging, catching these cases are easy enough.
Maximum Command Length
Our first skill allowed users to enter a 10 digit phone number, and it works pretty reliably. With this Skill, we need a user to enter a 16 digit hexadecimal unique ID to pair their scoreboard. After a while, we got this working pretty reliable so we decided that we could keep the interface completely voice for this Skill as well.
However, we realized that the UID for iOS users was 32 digits. When testing this we hit a limitation of Alexa that we had not realized before. It turns out that Alexa stops listening after 12 seconds.
In our SMS Skill, when that happens it matches our free form text message Intent and sends the 12-second message. With the Fantasy Scoreboard skill, we have 16 and 32 digit intents. If the users say anything between 16 and 32 digits then no intent is matched at all and Alexa quits without saying anything. This is a problem.
Obviously, it would take a lot of practice for a user to say a 32 digit hexadecimal number in 12 seconds, so in order to make the Skill more user-friendly, we extended it to allow iOS users to say the 32 digit UID in two 16 digit chunks.
With our first two skills submitted, what we have left to explore is the Account Linking functionality. We will integrate that in one of our IoT concepts. The Skill will allow us to link with the account of the user to make pairing easier. Then we can query the status of the device and control it.
Six Oversights to Consider Before Building an IoT Product
In this white paper, we outline six oversights that organizations face when entering the realm of IoT.