How to Use Amazon Lex in Salesforce?
Amazon spread around “Amazon Lex” in December 2016. It operative the technology used by Alexa, Amazon’s voice-activated virtual assistant which lets user control things with voice commands such as automated response, play music, set alarm, ordering groceries, etc. It provides a deep learning-powered natural-language understanding as well as automatic speech recognition. It is now as a service that allows developers to take advantage of the same features used by Amazon Alexa. So, till now there is no need to waste time in setting up and managing the infrastructure for your bots.
In Salesforce, there are multiple use cases where we want to automate chat processes. In terms of this, We can implement AWS Lex to achieve this.In terms to accomplish this, we need to manage things. Amazon Web Service account used to store response’s database as intent’s, and salesforce dev environment used to host ChatBot Application.Prerequisites
- Salesforce Dev Org
- AWS Account
- Microsoft Azure Subscription
LEX -RELATED TERMINOLOGIES
Bot: It consists of all the components related to a conversation, which includes:
- Intent: Intent represents a goal, needed to be achieved by the bot’s user. For an example, our goal is to purchase Pens.
- Utterances: Utterance is a text phrase that invokes intent, provided by admin. In case, If we have more than one intent, we need to provide different utterances for them. It builds a language model based on utterance phrases provided by Admin, which then invoke the desired intent. If we take an example, we need a single intent “OrderPen”. Some sample utterances would be: 1. I want to order some pens 2. Can you please order a pen for me
- Slots: A slot is a unit of data/Information that the user needs to supply in order to fulfill the intent. For instance, purchasing a Pen requires PenType and PenName as slots for intent “OrderPen” (here we can understand this with these two points for making the example simpler, otherwise there are also too many points based on which one will purchase/select a Pen.). These are a string, date, an input, city, location, boolean, number etc. that are needed to reach the main goal of the intent. Each slot has a name, slot type, a prompt, and is it required. Slot types are the reasonable values a user can respond with, which can be either a custom defined thing or any one of the services from Amazon pre-built types.
- Prompt: In terms of prompt, is a question that Lex uses to ask the user to supply some correct data (for a slot) that is needed to the fulfillment of an intent e.g. Lex will ask “what type of Pen you want to buy?” to fill the slot PenType.
- Fulfillment: For Fulfillment, It provides the business fundamentals that is executed after getting all the necessary required slot values, needs to get the goal. Amazon Lex also supports the use of Amazon Lambda functions for the fulfillment of business logic/Fundamentals and for validations.
Here we can better understand of Chatbot process: There is an example regarding chatbot process from a user to LEX ChatBot.
Note: In above screen, ‘PERSONAL ASSISTANT’ is a Bot name and ‘ME’ as a User commond.
Me (User): Want to Book a hotel.
Bot: What city will you be staying in?
Me (User) : In Delhi.
Bot: What day you want to check in?
Hope it helps you, Thank you 🙂