question

William James Cartrette avatar image
William James Cartrette asked

Custom Slots and Unknown Values

I'm working on a skill, and submitted the morning that the custom slots and SSML changes came out. I had some time so I implemented custom slots before submitting for certification (then went on vacation for a while). Previously, without custom slots, I would get invalid values to my Lambda and could distinguish between getting an invalid value and an empty slot. For an empty slot, I simply would play back the saved data. But for an invalid slot, I would re-prompt. Now with custom slots, I always get null on anything not in my list, although in the documentation it says [b]"Values outside the list may still be returned if recognized by the spoken language understanding system. Although input to a custom slot type is weighted towards the values in the list, it is not constrained to just the items on the list."[/b] It is not happening, and is necessary for me to implement the changes requested. Am I doing something incorrect or is there a misalignment in documentation/functionality? Message was edited by: William James Cartrette
alexa skills kit
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Most people are rather annoyed when it gives values not on the list. But that [i]is[/i] what the doc says. Note, though, the doc also says it is weighted towards the ones on the list. Axiomatically that means that it is weighted against those not on the list. It may be that whatever is said has a low confidence rating to start with that gets then weighted even lower, past whatever confidence threshold they use to determine if it is worth sending or not. I've got a feature requests somewhere for them to return several interpretations with the confidence value for each, so we can make our own determination. (That's how IBM's speech to text service works on Bluemix.)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

William James Cartrette avatar image
William James Cartrette answered
Yes I think you are right. It appears I may have to abandon custom slots to implement their requirement - what I would like (at least to start) is a switch for "send everything" even if it's not a slot. That way I could implement what I want. Then, add confidence threshold (with option of 100 for only sending enumerated values).
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

William James Cartrette avatar image
William James Cartrette answered
I take it back! I switched back to my pre-custom slots version, and the functionality of the string Slot is now different than before. Previously, if someone tried a slot that I considered invalid (not in my sample utterances), it would return the slot with the value that didn't match. Now, it returns no value if it doesn't match something - custom slot or string slot. I can't seem to tell if someone is giving me an invalid slot so I can re-prompt/act differently. Example: Alexa ask Program for directions to the zoo Old and new behavior, custom or string slots: "slots": { "SlotName": { "name": "SlotName", "value": "zoo" } } this is the problem: Alexa ask Program for directions to the cat new behavior: "slots": { "SlotName": { "name": "SlotName" } } (which is the same result if they asked for directions without the slot being filled) The response I used to get: "slots": { "SlotName": { "name": "SlotName", "value": "cat" } } I want to respond differently in the same intent if someone just asks for directions and if someone asks for directions to a cat but that doesn't seem possible anymore. Anyone else noticed this?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Negritoiu avatar image
Stefan Negritoiu answered
If you want to differentiate between those two types of utterances you can just make two distinct intents: 1) Intent1 matches "Alexa ask Program for directions" 2) Intent2 matches "Alexa ask Program for directions to {place}"
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.