tombraider
tombraider

Reputation: 1167

Alexa Custom Slot picking up additional words

I'm trying to create a custom slot for a UK postcode (e.g. CB1 1PT). I managed to get this working around October time, however, I've come back to the project and it looks like Amazon have updated a number of things.

Here is my Intent Schema:

{
  "intents": [
    {
      "intent": "GetOutages",
      "slots": [
        {
          "name": "postcode",
          "type": "LIST_OF_POSTCODES"
        }
      ]
    },
    {
      "intent": "GetCoverage",
      "slots": [
        {
          "name": "postcode",
          "type": "LIST_OF_POSTCODES"
        }
      ]
    },
    {
      "intent": "AMAZON.StopIntent",
      "slots": []
    },
    {
      "intent": "AMAZON.CancelIntent",
      "slots": []
    }
  ]
}

The Custom Slot type:

LIST_OF_POSTCODES S L six six D Y | C B one one P T | R G five four W L | G U one five one P B

A few sample utterances:

GetOutages  outage info for {postcode}
GetOutages  fault info for {postcode}
GetOutages  information for {postcode}
GetOutages  outage information for {postcode}
GetOutages  fault information for {postcode}

The problem is, when I try to retrieve the value from the slot, it appears to be picking up the full sentence:

{  
   name:'GetOutages',
   slots:{  
      postcode:{  
         name:'postcode',
         value:'information for r g 54 w l'
      }
   }
}

Does anyone have any advice?

Upvotes: 0

Views: 269

Answers (1)

Tom
Tom

Reputation: 17854

Not really a proper answer, but some thoughts...

You provide sample utterences, but in the rest of your utterances are there any that are so short/generic that they could get inadvertently matched, and then most of the user's actual utterance getting put in postcode?

Also, I gotta wonder what your list of words is for that slot? Since it is limited to 65K items you can't supply all the postcodes, so what shortcut are you taking?

Finally, what you really need, of course, is a built-in slot type for UK postcode like they have for US zipcode. Here is the ASK feature request for it, and note the link to the suggested stop gap:
https://forums.developer.amazon.com/content/idea/41072/built-in-slot-type-for-uk-postcodes.html

correction: there are various address and city built-ins, but they don't support US zipcode either, so I guess people must be using AMAZON.NUMBER.

Upvotes: 1

Related Questions