How To Enhance Amazon Lex Response For Our AWS Chatbots

Posted By : Ravindra Singh | 26-May-2018

Introduction :

Responses are the last and final element of a bot’s intent, and are displayed to users after the fulfillment of the intent is complete. When the user gives the input to the Lex then Lex call to the lambda function and lambda function return the response back to the lex after completing the business logic. A response can include anything from a simple goodbye message, to a responseCard of pictures with different buttons that invoke another intent by clicking on these buttons, to a prompt.  Responses might be the main element of an intent for an intent that helps guide the user toward different bot functions.

 

The response consists of messages that are dynamically selected from a group of predefined messages that are created on Lex console, For example, in a CarReservation chatbot, your first message group could contain different ways that the bot can be greeting to the user: “Hello,” “Hii,” and “Greetings.” The second message group could contain different forms of introduction: “I am the CarReservation chatbot” and “This is the CarReservation chatbot.”  A third message group could communicate capabilities: “I can help with the Car and Hotel Reservation,” and so on.  Amazon Lex uses these message from each group to dynamically generate the responses in a conversation for the chatbot.

 

The conversation could include the following messages:

Source : https://aws.amazon.com/blogs/machine-learning/enhance-your-amazon-lex-chatbots-with-responses/

 

 

Another conversation might include these messages:

Source : https://aws.amazon.com/blogs/machine-learning/enhance-your-amazon-lex-chatbots-with-responses/


The response should be simple, that suggesting the user, or in other words, we can say the response is sent back to Lex with statements that triggers another intent.  For example, the user wants to respond with “Hotel reservation.” If “Hotel reservation” matches the utterance for an intent to help book a hotel, that intent is triggered seamlessly.

 

 

Responses have following components:

1-> Messages : Every response requires at least one message.

2-> Response cards : 
Responses are available in the Amazon Lex console and also we set dynamically from lambda function.

3-> SlotType : SlotType tells the lex, what type of next action would be taken.

4-> DialogAction : DialogAction store all above values, then sent to lex.

Source : https://aws.amazon.com/blogs/machine-learning/enhance-your-amazon-lex-chatbots-with-responses/

 

 

A closing response :

For responses that user reply with “No” as an input, Then you can create a closing message. This is also a nice way to conclude the conversation if the user is finished.

Source : https://aws.amazon.com/blogs/machine-learning/enhance-your-amazon-lex-chatbots-with-responses/

 


Response cards :

Response cards are the next best way to represent a response in the form card to better understating by the user, we can also set response card from the Amazon Lex console and also dynamically from Lambda function.  A response card contains a set of appropriate message responses that a user can select from and also things are represented by an image or graphics for best understating the type of response is shown to the userwhile increasing your bot’s accuracy.

Source : https://aws.amazon.com/blogs/machine-learning/enhance-your-amazon-lex-chatbots-with-responses/

 

 


Thanks

 

About Author

Author Image
Ravindra Singh

Ravindra is Sr. Associate Consultant Development- Java (Backend Developer). And Familiar with AWS Cloud Machine Learning Programming (AWS Lex, Lambda, Polly, Elasticsearch ), And also having good experience in Spring Boot Microservice Architecture Applica

Request for Proposal

Name is required

Comment is required

Sending message..