Skip to content

How to Extend AMAZON.CONFIRMATION Slot Type with Custom Synonyms for Yes/No

0

Hi Team,

I'm seeking guidance on handling a scenario using Amazon Lex. I have a slot named AddAll that requires only two values - Yes or No, so I've used the prebuilt slot type AMAZON.CONFIRMATION. However, I need to support custom phrases for Yes and No. For example, if a user says "add one by one", this should be interpreted as No, but currently, Lex recognizes it as Yes.

Since the AMAZON.CONFIRMATION slot type is built-in, I'm unsure how to add additional synonyms or custom mappings to it. My goal is to leverage the existing prebuilt slot type for standard confirmation responses while also supporting custom phrases for Yes and No.

I considered creating a custom slot type with exhaustive synonyms, but that approach seems difficult since there are so many possible ways users can express Yes or No.

Is there a recommended practice for handling such scenarios, possibly by extending or combining the built-in slot type with custom phrases or validation logic? Your suggestions and insights would be greatly appreciated!

1 Answer
0

In Amazon Lex, you cannot directly extend the built-in AMAZON.Confirmation slot type with custom synonyms. Instead, you should create your own custom slot type to handle the specific phrases you want to map to "Yes" or "No" responses.

Here's the recommended approach:

  1. Create a custom slot type (with a name other than "Confirmation" since that's reserved for the built-in type)

  2. Define your slot values as "Yes" and "No"

  3. Add your custom synonyms to each value:

  • For "Yes": add standard affirmatives like "yeah", "yep", "ok", "sure", etc.
  • For "No": add standard negatives like "nope", "naw", etc., plus your custom phrase "add one by one"
  1. Configure the valueSelectionStrategy when creating or updating your slot type so that when a user enters a synonym, the slot will be filled with the corresponding slot value ("Yes" or "No")

When a user enters a synonym like "add one by one", the model will populate the originalValue field with "add one by one" and the first entry in the resolvedValues field will be "No". With the proper valueSelectionStrategy configuration, the slot value will be filled with "No".

This approach gives you full control over which phrases map to which values, while still maintaining the binary Yes/No structure you need for your AddAll slot.
Sources
Custom slot type - Amazon Lex
Custom Slot Types - Amazon Lex V1
AMAZON.Confirmation - Amazon Lex

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.