RnewPROMO : GET UP TO 20% OFF ON LIVE CLASSES + 2 SELF-PACED COURSES FREE!! - SCHEDULE CALL Rnew

- AWS Blogs -

How to Create Amazon Chatbot & Integrate with Facebook?



Introduction

Over time we have been trying to develop and innovate technologies that made our life easier. With numerous applications around us to solve this purpose, Chatbots are emerging to be an important part of our lives. One of the solutions around is Amazon Lex which is a powerful platform for building Chatbots. And as rightly said: “Chatbots Will Be Your New Best Friend” ... Forbes Now, we will check through the basic definition of Amazon Lex. But before that, if you want to learn about Amazon and the AWS platform,  consider going for a trending AWS Certification Course.

What is Amazon Lex?

Amazon Lex is an AWS service that helps in building an interface where applications use text and voice. Alexa from Amazon also uses Amazon Lex as a backend engine. It is used to create, natural language chatbots for applications. Amazon Lex uses the power of natural language understanding (NLU) and automatic speech recognition (ASR) to create an interactive user experience that looks lifelike. However, to be a reputed AWS professional much depends on the certification you hold, consider going for industry-recognized Cloud computing certifications.

What is a Chatbot?

“A chatbot is a computer program that connects with the user in a natural language using audio or text mode. It understands what the user says and respond based on a series of rules”.

Features of a Bot:

A). Intent

Intent means a task end-user wants to achieve. Bot can support multiple intents, like flight booking, taxi booking, check price or gold or even start-stop an ec2 instance.

For each intent, you provide the following required information:

  • Intent name– Name for the intent. For example, startec2instance
  • Sample utterances – how the user can ask the bot to achieve the task, like stop an ec2 instance.
  • How to fulfill the intent – It means how can the task asked by the user be achieved, for example to start-stop an ec2 instance, we can create a lambda function which can be called to perform these actions on an ec2 machine.

B). Slot

Intent can have zero or more slots. You can add slots while configuring an intent configuration. When a bot is called Amazon Lex asks the user for the defined slot values. Amazon Lex asks the user all the slot values before fulfilling the tasks asked by the end-user. 

For example, the startec2instance or stopec2instance intent will need slots such as instance name, instance-id, zone-name, etc. In the intent configuration, we can add slots. For each slot, we ask for a slot type and a message for Amazon Lex to ask to the user. Users can answer with a slot value that may have some extra words like “start the ec2 instance with instance id XXX please” or “can we stop and instance by name XXX”. Amazon Lex can still perform the tasks.

C). Slot type

Slots have a type. We can create our custom slot types or use built-in slot types. For example, we can have the following slot types for startec2instance intent:

  • Instancename – What is the instance name?
  • Instanceid – What is the instance id?
  • Region – In which region is the instance?

Features of a Chatbot

  • Conversational Skills - Chatbot has natural language processing (NLP) capabilities to understand and respond in many languages.
  • Integrates with many digital channels – Facebook, Kik, Twilio, Slack and other messaging platforms.

Further, if you're preparing to sit for your Cloud Computing certification? We recommend you to go through various Cloud Computing blogs available on the JanBask Training that has been curated to help you become ready!

AWS Curriculum

ChatBot Use case scenarios 

ChatBot are used to give the users a friendly, interactive graphical user interface to chat and express their interest and needs, and expect the bot to behave as real human and response in the same manner. Chatbot interacts with the user as a real human, understanding the user’s needs and responding similarly.

Some fields where Chatbots are already a success:

  1. Customer Service – answer a large volume of calls asking for the product details or delivery status.
  2. Marketing – ask for user’s expectations and prompt them with the right product that satisfies their needs.
  3. HR – keeping track of employee’s satisfaction by asking them for surveys from time to time.
  4. IT – solution to common issues can be provided using Chatbots to the issue raised in It ticketing tool
  5. Travel – use to book tickets for customers based on their inputs like travel dates, destination and flight options.
  6. Finance money transfer based on the security inputs that can be asked by the Bank as per the predefined slots in the Chatbots.

As you might have already witnessed Cloud computing has changed the way organizations work and if you are a beginner who wants to Start a Career in Cloud Computing in 2022! It's a perfect time to learn, get certified, and boost your career. 

1). Demo: Using Amazon Lex for creating a Chatbot 

Exciting. isn’t it.

Steps to be followed:

  • Create a free tier AWS account if you don’t have one yet.
  • Login to AWS account and go to Amazon Lex

Amazon Lex service dashboard

  • Press the Create button.

Amazon Chatbot and  Integrate with Facebook

  • Select the “Custom Bot” Option.
    • Provide a Bot Name.
    • Session Timeout.
    • IAM role is automatically selected.
    • For COPPA, select the “NO” button. Read the link for more information.
  • Click on the ‘+’ button to Create an Intent.

Amazon Chatbot and  Integrate with Facebook oneGive a meaningful content name. In my case, I gave “WhatisurName”

steps to create Amazon Chatbot and  Integrate with Facebook

  • Enter Sample Utterances, that you expect your user to ask to your bot.

  • In Slots, choose the responses based on the inputs expected from the user.

Like in the case here, we expect the user to Hi, Hey or Hello as above. The Bot will reply to the user with his Name and this seems to be a more human-like response. We will test this in a minute …  Other things the bot will ask for is the place the user lives and his / her date of birth.

Steps to create Amazon Chatbot and  Integrate with Facebook

  • Press the “Save intent “ button to confirm your changes.

save intent

  • Press the “Built” button to build the bot.

Steps Amazon Chatbot and  Integrate with Facebook

 Once the Built is complete you can test your Bot by using “Test Bot” option on right.

Amazon Chatbot and  Integrate with Facebook steps

  • Once testing is complete press the Publish button to publish your changes.

Amazon Chatbot and  Integrate with Facebook StepsOnce Published you will get the following pop-up

Amazon Chatbot and  Integrate with Facebook Steps

Hooray, your first Amazon Lex ChatBot created successfully.

Now, that you have got a taste of this, take this 2-minute free AWS Quiz to check your Cloud computing knowledge and stay updated with the latest updates and innovations in AWS.

2). Demo: Integrating Amazon Lex Chatbot with Facebook.

So, guys as your first Amazon Lex Chatbot is ready, it’s time to expose it to the outer world. Let’s learn how to interact with websites like Facebook as it is the largest used website for personal social circle as well as running Business campaigns and promotions.

For this you need a Facebook account. J .. I am sure you have one. 

Steps to be followed.

  • Login to your Facebook account.
  • Click on Create Page. Enter the necessary details or skip them.
  • Click on Create Page. Enter the necessary details or skip them.
  • Got to Facebook for Developers Login with your Facebook id.
  • Select “My Apps” and click “Create APP” option.

Amazon Chatbot and  Integrate with Facebook steps 11

create new app id facebook

  • Now go to Settings > Basic option on left. Here you will find the App Secret, Take a note of it.

Amazon Chatbot and  Integrate with Facebook steps 15

  • Go to Products and choose Messenger, click settings.
  • In section “Access Tokens”, Add the page you just created, in my case it is “TestBot”.
  • Click “Generate Token” a pop-up will appear with your page token. Copy the token

token generated Amazon Chatbot and  Integrate with Facebook

  • Got back to Amazon Lex, Channels. Enter the following values:
    • Channel Name
    • Channel Description
    • IAM Role – predefined
    • KMS Key – aws/lex
    • Alias – Name that we enter when we published the bot.
    • Verify Token – APP name
    • Page Access Token – Page Access Token, obtained in step 9.
    • App Secret Key – Obtained in step 6.
    • Click Activate, and you will get the Call Back URL, copy it.

Amazon Chatbot and  Integrate with Facebook

  • Go to the Facebook Developer APP ID page.
    • Select Webhook.
    • Click on “Add Callback URL
    • Enter the Callback URL, obtained in Step 10 and App Id Name in Verify Token and click “Verify and Save”

edit call back url Amazon Chatbot and  Integrate with Facebook

 

Amazon certification can boost your salary potential. Even today the public cloud market costs $236 billion and AWS retains a significant lead over its competitors including Google, IBM, and Microsoft. If you are a beginner, check out the AWS Developer learning path and discover the complete future Career scope with a roadmap.

Done. Facebook is Integrated with your Amazon Lex Chatbot.

3). Demo: Facebook-Chatbot testing.

  • Go to the Facebook page you created.
  • Click on “Add Button”
  • Choose the following options.
  • Click on “Send Message” >> “Test Button”

Chat window just like Facebook messenger will appear.

Amazon Chatbot and  Integrate with Facebook

Now ask the same utterances as the user may ask.

Done.

Conclusion

Well, so today we learned, what is the power of Amazon Lex, what are Chatbots and how they are very useful for the present day Business, and how it is needed to reach your customers in a friendly and interactive way. Enroll in a professional in-demand AWS Certification Course to get a better understanding of the subject. 

How they can bring more customer traffic to your business, by replying to maximum user queries. How it can save a lot of Operation costs as human telephone callers can be replaced by automated Chatbots. Amazon Lex developers are also in Demand as per LinkedIn. Hope you find this tutorial helpful and knowledgeable. Don’t forget to join the professional JanBask AWS Community for the right career guidance and expert advice. 

 happy learning. 

fbicons FaceBook twitterTwitter google+Google+ lingedinLinkedIn pinterest Pinterest emailEmail

     Logo

    Ish Kumar

    A DevOps Engineer by profession and a Technical Blogger by passion. I love to learn anything about DevOps and Cloud computing and at the same time share the knowledge among those who are willing to learn and share the same passion with me.


Comments

Trending Courses

AWS Course

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53
AWS Course

Upcoming Class

-1 day 04 Feb 2023

DevOps Course

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing
DevOps Course

Upcoming Class

5 days 10 Feb 2023

Data Science Course

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning
Data Science Course

Upcoming Class

-1 day 04 Feb 2023

Hadoop Course

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation
Hadoop Course

Upcoming Class

-1 day 04 Feb 2023

Salesforce Course

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL
Salesforce Course

Upcoming Class

6 days 11 Feb 2023

QA Course

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing
QA Course

Upcoming Class

-1 day 04 Feb 2023

Business Analyst  Course

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum
Business Analyst  Course

Upcoming Class

1 day 06 Feb 2023

MS SQL Server Course

MS SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design
MS SQL Server Course

Upcoming Class

5 days 10 Feb 2023

Python Course

Python

  • Features of Python
  • Python Editors and IDEs
  • Data types and Variables
  • Python File Operation
Python Course

Upcoming Class

12 days 17 Feb 2023

Artificial Intelligence  Course

Artificial Intelligence

  • Components of AI
  • Categories of Machine Learning
  • Recurrent Neural Networks
  • Recurrent Neural Networks
Artificial Intelligence  Course

Upcoming Class

6 days 11 Feb 2023

Machine Learning Course

Machine Learning

  • Introduction to Machine Learning & Python
  • Machine Learning: Supervised Learning
  • Machine Learning: Unsupervised Learning
Machine Learning Course

Upcoming Class

19 days 24 Feb 2023

Tableau Course

Tableau

  • Introduction to Tableau Desktop
  • Data Transformation Methods
  • Configuring tableau server
  • Integration with R & Hadoop
Tableau Course

Upcoming Class

-1 day 04 Feb 2023

Search Posts

Reset

Receive Latest Materials and Offers on AWS Course

Interviews