Create a Server less Chatbot using Amazon Lex and integrate with Facebook
Hello everyone, I am B.Sai Venkata Tejaswini(190030155). This is an article based on building a Serverless AWS chatbot along with Facebook integration.
INTRODUCTION:
Amazon Lex:-
Amazon Lex is an AWS service for building conversational interfaces for applications using voice and text. With Amazon Lex, the same conversational engine that powers Amazon Alexa is now available to any developer, enabling you to build sophisticated, natural language chatbots into your new and existing applications. Amazon Lex provides the deep functionality and flexibility of natural language understanding (NLU) and automatic speech recognition (ASR) so you can build highly engaging user experiences with lifelike, conversational interactions, and create new categories of products.
Use Cases:
1. Informational Bots: Chatbots for everyday consumer requests. Examples: NEWS updates, Weather information, Game scores, etc.
2. Application Bots: Build powerful interfaces to mobile applications. Examples: Book tickets, order food, Manage bank accounts, etc.
3. Enterprise Productivity Bots: Streamline enterprise work activities and improve efficiencies. Examples: Check sales numbers, Marketing performance, Inventory status, etc.
4. Internet Of Things (IOT) Bots: Enable conversational interfaces for device interactions. Examples: Wearables, Appliances, etc.
AWS Lambda:-
Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service.
Intents,Utterences,Slots,Fulfillment in Amazon Lex:-
FLOW OF THE PROJECT DEPLOYMENT:-
We will learn how to use chatbot using LEX and integrate with LAMBDA triggers again with real time Facebook applications
Diagram:-
WorkFlow:-
1.Create a Lambda Function.
2.Create a bot.
3.Build and test the Bot.
4.Create a Facebook page and integrate with the messenger.
Steps:
Create an Amazon Lex Bot
Sign in to the AWS Management Console and in the Find Services, search box type lex and choose Amazon Lex.
• Make sure you are in the N. Virginia region at the top right.
Steps2: for creating an Intent.
Click the Create Intent button,
On the Add intent pop-up click Create intent
Name the Intent, Coffee and click Add.
The box will disappear
Under Sample utterances open it up there will be an small black arrow on the left to expand
Sample utterances
2. Hello
3. Hey
Recommended by LinkedIn
Step3:create a Slot.
Before you save your intent, we want to humanize it a little more by configuring a confirmation step with "Your order details are {PizzaType}pizza with {PizzaCrust}crust".
Let's add that now.
• Expand Confirmation prompt a
Check Confirmation prompt
Under Confirm type in the following
Give me a {CoffeeType}
Let me get a {CoffeeSize}
Can I get a {CoffeeTemp}
May I have a {CoffeeType}
I would like a {CoffeeSize}
Can I get a {CoffeeType}
Sorry, I could not understand that , Would you try again,Please?
4.TEST THE CHATBOT:
Creating facebook page and integrating with lex
Now choose the messenger option and click setup.
1.Provide the page access key and app secret key
2.Select activate
3.Now you can see the URL copy and paste in the webhook in facebook developer page
4.Messenger > setting> webhooks> add the URL and subscribe for message
5.Now in the facebook page under send message select test button
6.Now test the bot , it should work successfully.
CONCLUSION:
we have created the chatbot and this is my AWS project as a part of peer mentoring through which we can book a Coffee.I sincerely thank our Mentor and guide Mr. Naresh Vurukonda sir for giving us this opportunity to do real time projects and many interesting tasks in AWS with their constant support and effort. Hope you have enjoyed reading this article.
Thank you!!!