An Amazon Lex bot uses a custom slot type with three values: "comedy", "adventure", and "documentary". Users sometimes say words like "funny", "fun", or "humor", and Lex fails to map these to the existing slot values. You cannot change the Lambda fulfillment code or the DynamoDB data. What is the best way to make Lex accept those utterances as the same category?
Choose an answer
Tap an option to check your answer.
Correct answer: Add the unrecognized words as synonyms for the existing slot values in the custom slot type..
Why this is the answer
Adding the unrecognized words as synonyms for the existing slot values is the most effective solution. This allows Lex to map utterances like "funny" to "comedy" or "humor" to "comedy" without altering the core slot values. Lex's built-in natural language understanding (NLU) will then correctly interpret these variations as referring to the defined slot values. Adding the unrecognized words as new enumeration values would expand the slot type unnecessarily and might require changes to downstream logic that expects only "comedy", "adventure", and "documentary". Creating a new custom slot type is overly complex and doesn't address the core issue of mapping variations to existing categories. Using AMAZON.SearchQuery is inappropriate as it's designed for broad, open-ended searches, not for mapping specific variations to a fixed set of categories.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed