Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Catch-all" for Alexa Skills Kit input not in defined intent

I am building an Alexa app that needs to be able to process answers to a question. I have an SkipIntent intent that has sample utterances to skip a question.

I want to build an AnswerIntent that can take answers that can be anything and process them against the correct answer. I tried using an Amazon.LITERAL type for this with a few samples as such (from this question: How to accept the Free form text as input to Amazon Skill Kit?):

AnswerIntent {bottle|Answer}
AnswerIntent is it {bottle|Answer}
AnswerIntent is it a {bottle|Answer}
AnswerIntent is it an {bottle|Answer}
AnswerIntent a {bottle|Answer}
AnswerIntent an {bottle|Answer}
AnswerIntent {pillow|Answer}
AnswerIntent is it {pillow|Answer}
AnswerIntent is it a {pillow|Answer}
AnswerIntent is it an {pillow|Answer}
AnswerIntent a {pillow|Answer}
AnswerIntent an {pillow|Answer}

This actually works if I prepend the answer with "is it" or one of the other defined prefixes, but it doesn't get the "answer only" piece. It seems to get confused with my SkipIntent which is defined as:

SkipIntent i don't know
SkipIntent don't know
SkipIntent skip
SkipIntent i don't know that
SkipIntent who knows
SkipIntent i don't know this question
SkipIntent i don't know that one
SkipIntent dunno

Am I defining the AnswerIntent correctly? If not, is there a better way to catch an infinite amount of possibilities? Amazon seems to not like the LITERAL method, so I would be open to a better way.

like image 636
rhlsthrm Avatar asked Dec 25 '22 05:12

rhlsthrm


1 Answers

Amazon's Alexa service is not designed for dictation. This has been the consistent response from the Developer Evangelists. So you will not be able to give the exact customer experience you want: being able take any sort of input on its own.

You are going beyond Alexa's design specifications by 'tricking' it into accepting a 'generic slot'. Plenty of people have done this, but it will never perform well, as you have found.

Specifically, for your use case, trying a generic slot on its own is particularly bad. Internally Alexa uses the interaction model to build up a tree of possible sentences that might be recognized. It then takes the input sounds, and matches them against the tree. Whichever branch ends up with the highest confidence is the branch that is selected.

When you add a generic slot, you add a node into the tree that matches almost anything, it competes with branches that mach specific values. E.g. if Alexa has the choice between "X", "Y" and "", it is usually going to pick "". This is why your a generic slot on its own is swallowing the other answers.

If you want a skill that performs with a high quality, you should seek a design that does not use generic slots. You might, for example, use multiple choice in a Question-and-Answer type skill. Or pick questions that have one of a specific set of answers, like colors or US States.

If you are just doing a demo, then, sure, use generic slots. You can do enough takes to get the recording to look good.

like image 68
Joseph Jaquinta Avatar answered Dec 26 '22 18:12

Joseph Jaquinta