5

I have slot name "remark". I need a slot type which takes any value given by user to this field.

mnm
  • 1,962
  • 4
  • 19
  • 46

4 Answers4

0

Amazon support staff have responded to similar questions in this way:

From aws dev forum:

The recommended approach for capturing free form text through a slot is to create a custom slot type, and provide enough representative sample/training data as slot values. This will allow Lex to learn from these samples, and recognize a much larger set.

So in your slot value samples, you should add single words, multiple words, and even whole sentences if that is what you expect. This lets Lex know and learn the wide range of data to fill the slot with.
The more sample values you give, the better Lex should be.

Jay A. Little
  • 3,239
  • 2
  • 11
  • 32
  • 2
    good answer, but never works as per my experience. user can write anything in the remarks, and no matter how much data you provide, it still fails to recognize. – sid8491 May 21 '18 at 10:41
0

I have had the same problem, and firstly I tried to proviode wide range of training data but whenever I typed something new it never got captured correctly in the Lex.

So I created a slot without any value and unchecked the required checkbox (important). Then I enabled Lambda initialization and validation hook so that it goes to DialogCodeHook.
In the backend code, in DialogCodeHook, I grabbed the input of user from event['inputTranscript'] and assigned that value to the slot.

Hope it helps.

sid8491
  • 6,622
  • 6
  • 38
  • 64
  • 3
    How did you do it? In my case, it shows an error with the message "The value specified for 'enumerationValues' is invalid. Member must have length greater than or equal to 1". – Mayank Bhushan Nov 08 '19 at 20:17
0

I have been working on lex platform for more than a year now. As per my understanding, it is not possible to capture free text as a slot. The approach to add more training data only to handle free text will make the slot (as thus the intent) greedy and have an negative impact on the overall performance of the bot. The best alternative (in case of custom channel only) is to make use of session attributes to pass free text from the chat interface and pass a pre defined text (one of the values from slot) as input to lex; write logic in lambda to capture the free text from session attributes. Let me know if you need more clarity.

0

You can use the AMAZON.AlphaNumeric inbuilt slot type

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
slyguy
  • 44
  • 3