General Guidelines For Using AWS Lex

Posted By : Vanshika Madan | 29-Jun-2018

Amazon Lex, which is used for creating a conversational interface using both voice and text input. Amazon Lex can be used for creating various type of bots for different purposes such as Informational bot which answers the questions asked by you, Application bot which is an application specific bot, Device Control bot, which issue control commands to connected devices. Knowing its usage, one should be aware of its guidelines for using it. 

 

Some of the Guidelines for using Amazon Lex:

 

1- Slot Resolution:-  While creating a slot of a custom type, enumeration values or synonyms are included in the slot for training its machine learning models and hence improve its performance. For example:- We define an Intent named ShoppingIntent which have following sample utterance:

"I want to order {Bakery}"

Slot "Bakery" is of custom type BakeryProduct which has all enumeration values from Bread through Cake. While defining a slot, we have an option of choosing slot resolution. There are two options for it:-

 

 

a) Expand Values:- If slot resolution expand values is chosen, then amazon lex will treat slot values provided in the slot type as a training data. So if user values are similar to the slot value, it fills the slot with the value with user input. For example:- if the user says "I want to order bag", lex treats that bag is a BakeryProduct and hence passes the request to a client application for computation.

b) Restrict to Slot values and Synonyms:- Restricting to slot values and synonyms will restrict lex to only slot values defined as synonyms. It will fill the slot only if user input is same as one of the slot values. Here the value "bag"  would not be recognized as it does not match any values defined in slot type.

So choose slot resolution according to your requirement, if you want to restrict it to slot values and synonyms then provide maximum enumeration values to a slot for improving the accuracy of ASR (Automatic Speech Recognition) and NLU (Natural Language Understanding).

 

2- AMAZON.DATE and AMAZON.TIME which is built-in slot types give both absolute and relative dates and times but relative date and time of the region where Lex is processing the request.

 

3- Mapping of utterances:- Mapping of utterances should be done with specific intent and optionally to specific slot values. If the mapping is not done specifically, it contributes to generating confusing training data which downgrade the understanding ability of the lex.

 

4- Closing a conversation:- To discontinue a conversation, it is advocated to create an intent which captures user intent to exit the conversation. For example, CloseIntent with sample utterance "GoodBye, close".

 

5- Unique Id:-  For uniquely identifying conversation with a specific bot, runtime API takes unique user Id for identification. You can set this to any value that meets constrained for setting the value. But it is suggested not to set this to any confidential information such as user email, password etc.

 

These were few of the guidelines that you must keep in mind while using Amazon Lex. Knowing guidelines is as important as knowing its usage.

About Author

Author Image
Vanshika Madan

Vanshika is focused and hardworking person. She aims at achieving new opportunities and secure a position to contribute her skills for growth of the organisation and her professional career.

Request for Proposal

Name is required

Comment is required

Sending message..