Search code examples
node.jsalexa-skills-kitalexa-slot

Steering Alexa towards a specific slot value response


I've defined a custom slot types in the Amazon Developer console, the slot contains a list of names, as below.

homer simpson
ned flanders
principal skinner
comic book guy

I've then defined the sample utterances as below.

PlayAudio to play {Name}

So in the end, I want the user to be able to say something similar to the folliowing:

Alexa, ask the simpsons to play homer simpson

Alexa, ask the simpsons to play ned flanders

Alexa, ask the simpsons to play principal skinner

Alexa, ask the simpsons to play comic book guy

Of course, there is an extremely high chance that Alexa will hear the name incorrectly, so I need to be able to match the name that is heard as closely as possible one of the slot values.

How would I go about doing this, would I have to code it in the function or is there a better way?


Solution

  • You are right that there is a high chance 'that Alexa will hear the name incorrectly'. My solution is to do a bunch of trial and error with human testers to discover what the common mis-interpretations are, and then hard-code fixes for those.

    So I get a tester to say the different names and make a record of what they said. I then look at what Alexa gives me as the slot value, and where there are discrepencies I add a hard-coded substitution to my skill.