Search code examples
alexa-skills-kitalexa-slotjovo-framework

How to extract a custom slot from a user random input in Alexa Skill


We have an intent with a custom slot called topic. The values of this slots could be for example:

Sports, Science, Cinema, TV

So our sample Utterances are like this:

{topic}
tell me about {topic}
what do you know about {topic}
i love {topic}

This works correctly if the users uses phrases like the ones in the sample utterances. But, is there a way to achieve the following?

We want the user to be able just to say anything between and after the {topic} . Something like:

{any} {topic} {any} - {what do you think about} {sports} {my friend?}

or

{any} {topic} - {i hate everything related with } {sports}

Is there a way for Alexa Skill to extract the {Topic} from any random phrase?


Solution

  • There is a reason to keep User's input organized (you just increase the probability of correct slot recognition) with sample utterances. But :) some time ago I've found this topic: https://stackoverflow.com/a/53334157/2823106, actually it's a hack on Alexa but you can create the catchAll slot and try something like {catchAll} {Topic} {catchAll}. The problem I expect here is that Alexa won't recognize the Topic correctly but give it a try.