Search code examples
alexa-skills-kit

How to capture Alexa utterances that I did not anticipate to improve my Alexa Skill?


I am designing an Alexa Skill and am certainly trying to design an interaction model that anticipates many utterances so that I can implement appropriate handlers. But if the user asks something I didn't anticipate, I would really like to capture this and get notified or at least log this so that I can learn from real world usage and improve the Skill. How can I do that?


Solution

  • Amazon Alexa Development team is phasing out AMAZON. Literal support. Replacement is the AMAZON.SearchQuery. You cannot just do-away by giving the slot name, you need the support phrases with it.

    There is a way of doing this. You may not be able to capture the complete utterance, you can get the most of the what the user said.

    The trick is to use the 5W principle, basic English.. your model will have Why, When, Where, hoW, What in it and rest is the slot. it works 95% of the time.

    Sample model as follows with intent.

    {
      "name": "UseSearchQuery",
      "slots": [{
        "name": "UserInput",
        "type": "AMAZON.SearchQuery"
      }],
      "samples": [
        "isn't {UserInput}",
        "is {UserInput}",
        "How {UserInput}",
        "Where {UserInput}",
        "Why {UserInput}",
        "What {UserInput}",
        "When {UserInput}"
      ]
    }

    I tried the same and I found it working for me... I am able to capture most of what the user is saying.

    Let's say, user, breaches your defense here..!! use the AMAZON.FallbackIntent.

    Hope this works for you! happy coding.

    -A