Reputation: 1
Answer for slot by Amazon Lex doesn't when user input are more than 2 words.
I am having troubles with Amazon Lex and Lambda when the user input would not go through when there is more than 2 words when used the "AMAZON.AlphaNumeric" slot type. Does anyone know how to counter this issue?
I hope to see the user input accepting more words and also detecting the words input by the custom slot types on Amazon Lex.
Upvotes: 0
Views: 463
Reputation: 75
Unfortunately, Lex doesn't really have a built in way to capture free-form text in the way you've described.
The AlphaNumeric
slot type isn't meant to capture more than a couple of words which is why it's not working for your purpose. It is primarily suggested for capturing things such as vehicle identification numbers, ID numbers, or certain postal codes. It also supports regular expressions to restrict these further.
If you want to configure your Lex to accept more free-form text like you've shown in your screenshot, you'll need to create a Lambda function to access the inputTranscript
.
It's recommended that you create a custom slot type and train it with data that is similar to what you expect from the user. I have sometimes had it work with the AlphaNumeric
slot type but this unreliable in some cases. As you've already experienced, Lex slots tend to leave out words and phrases which is why you'll need to create a Lambda to access the inputTranscript
. The inputTranscript
is the last text received from the user in its entirety.
This post goes into more detail on how to accomplish this. I think it will help you. Good luck and let me know if you have more questions.
Upvotes: 1