Create a Server less Chatbot using Amazon Lex and integrate with Facebook

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:-


No alt text provided for this image

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:-

No alt text provided for this image
No alt text provided for this image


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.

  • If this is your first bot, choose to Get Started; otherwise, on the Bots page, choose Create Under Create Your Own choose Custom Bot.
  • Click CREATE

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

  • 1. Hi

2. Hello

3. Hey

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?

  • Expand Fulfillment and verify Return parameters to the client is selected
  • Leave Response as it is
  • Click Save Intent at the bottom.
  • Click Build at the top right
  • At the Build, your bot pop-up click Build This can take a few minutes usually less than 30 seconds

4.TEST THE CHATBOT:

  • Expand the chatbot on the right, where it says TEST CHATBOT

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Creating facebook page and integrating with lex

  1. For Access page token ,create a Facebook page. 
  2. In facebook developers page

No alt text provided for this image

  • select create new app.
  • Select the option that suits you the best for who can use the app section.(Business app)
  • Click Create app ID

Now choose the messenger option and click setup.

  • Select Messenger -> Settings
  • Under pages select your facebook page and generate token 
  • Note the token
  • For app secret key select Setting -> basic
  • In the app secret key note down the key 
  • Now in the aws lex service -> channel 

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.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

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!!!



To view or add a comment, sign in

More articles by Tejaswini .

  • we care foundations

    SDP3-PS05: Donating the necessary things to the people who are in need. Project Name: WECARE FOUNDATIONS As a part of…

  • DevOps

    Introdution:- DevOps is the acronym given to the combination of Development and Operations. It refers to a…

    1 Comment
  • Access EC2 Windows INSTANCE using PUTTY SOFTWARE and convert KLUNIVERSITY.PEM FILE into KLUNIVERSITY.PPK FILE using PUTTYGEN SOFTWARE

    EC2:- ->Amazon Elastic Compute Cloud is a part of Amazon.com's cloud-computing platform, Amazon Web Services, that…

  • Amazon Cloud Watch Metrics

    I wanted to share some of my reflections with you in the hope that it will inspire you to write more on LinkedIn. I am…

    1 Comment
  • SKILL DEVELOPMENT PROJECT-2

    I wanted to share some of my reflections with you in the hope that it will inspire you to write more on LinkedIn. We…

    1 Comment

Others also viewed

Explore content categories