I have created an intent in lex called MinimumAgeIntent. MinimumAgeIntent has 2 utterances: 1. what is the age limit 2. what is the minimum age a patient needs to be to partake in the study
When I type in the question "where is the capital of turkey" it is matching the minimum age intent. Why is this? What is going on it doesn't make any sense.
In the first picture you can see that it is returning the response as if it matches the minimum age intent.
In the second picture you can see the lambda logs which shows the intent in the request.
Lex maps intent not just for the utterances given, but instead it takes those as an example and try to match for similar user inputs. In your case this might have happened because of the utterances you have given for MinimumAgeIntent
and other intents. When Lex try to map the intent based on the user input, it sees MinimumAgeIntent
as the closest match.
Somethings which you can try
Use non-conflicting utterances for intents. And add different varieties of it such that it covers the user intention in general. Add at least 5 to 10 utterances for each intent.
Use slots appropriately and validate its value on your code.
inputTranscript
so you can validate it on your code. May be not the best idea, but still you can check for mandatory words (prefer validating slots), In your case "age" for MinimumAgeIntent
. And respond back with an appropriate response. InvalidUserInput
and add common user inputs that the bot wont support and respond with a proper error message. Be very careful with this, do not do this unless you know what you are doing and there is no other way.