What is Amazon Lex inbuilt slot type for description or notes?

被刻印的时光 ゝ 提交于 2021-02-11 05:33:01

问题


I have configured my AWS Lex bot to 'Schedule A Meeting' and 'Add Notes' tasks.

While meeting scheduling I have a slot 'Meeting Description' where user can add single word to a sentence. Similarly for adding notes I have 'Notes'.

For this slot I am not finding any inbuilt slot type like 'AMAZON.Description' or anything which can store a word or a sentence. I tried with 'AMAZON.VideoGame', 'AMAZON.FoodEstablishment' etc. But found intermittent issue with those. Some times they work and some times they don't.

Does any body know what type of slot type I can use for my case? Please share.


回答1:


You will want to use a Custom SlotType if you want to catch an input of anything.

When you "train" this SlotType by giving it values, you should include a wide variety, such as numbers, single letters, single words, phrases, and whole sentences.

Even that won't always catch what you want though. So even better than that, is to use your Lambda Function to parse and validate the entire input yourself. And most likely, just set your slot value to be the entire input string.

For example:

User: "Add to my notes"
Bot: "Ok, what would you like me to save in your notes?"
User: "Buy more toilet paper."

Now the user expects the entire phrase to be in the note. You will have to use utterances in your Custom SlotType like this:

I want to {note}
Go {note}
Buy {note}
{note}

Those utterances will sometimes leave out some words and in the example, place only "more toilet paper" without the "buy" as your slot value. This is why you will want to parse the entire input yourself. So in Lambda you can get the entire input from inputTranscript.

userInput = event.inputTranscript            // "Buy more toilet paper"
slotNote = event.currentIntent.slots.note    // "more toilet paper"

Then you can compare those two and do some fancy validation yourself, or just save the user input directly into the note slot.

userInput = event.inputTranscript            // "Buy more toilet paper"
event.currentIntent.slots.note = userInput   // overwrites note slot value with correct full user input.


来源:https://stackoverflow.com/questions/62058978/what-is-amazon-lex-inbuilt-slot-type-for-description-or-notes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!