Hello everyone welcome to Master2Teach step-by-step guide. In this video
you will learn how to create ChatBot using Amazon Lex in AWS how to publish
it and create an alias finally you will learn to integrate with facebook
Messenger I will try my best to explain step by step if you haven't subscribe to
our Channel please click on the subscribe button and subscribe to our
YouTube channel in this tutorial we are going to build a coffee bot using AWS
A transactional and interactive chat bot that can help you to get your
favorite coffee for this chat bot demo we will be using an AWS service called
Amazon Lex Amazon Lek is a service that lets
user quickly and easily create conversational chat bot let's start
create at bot using Amazon Lex in AWS open the AWS console page
Head to Amazon lex service or search for the legs here it comes click and
open it Amazon Lex is a service for building conversational interfaces using
voice and text with Lex the same deep learning engine that powers Alexa is now
available to any developer enabling you to bring sophisticated natural language
chat bot to your new and existing application create your bot you can
see the sample boat which is already made to go we are making our custom
bot so select custom bot name your bot I am naming as a Chaaya Chautari
language is default English here we can select the output voice as
well like Salli Jonna you can sample out our different voice okay I am going to
pick with Salli set the session timeout let's say five minutes for now Amazon
other feature is sentiment analysis which will analyze the text or speech
easily like a positive negative natural which is done by comprehend service we
are not going to in this tutorial another I am role is automatically
created on your behalf another Children's Online Privacy
Protection Act we are not making this bot for the children tag not
compulsory for now let's create it here you can see the Chhaya Chautrai bot
environment where the bot will be built here is editor settings channels and
monitoring here in editor we will build the bot as per our requirement and test
the chat bot let's create a new intent give a name coffee item Intent
now we need to fixed the sample utterance like what time is it now I
would like to book for flight I have already prepared a few utterance
lets me copy and paste one by one you can prepare as per your requirements
can I get our coffee item this coffee item is a slot name or simply know it as
a variable for now we will set the values on it like the latte americano
let's add another as well I would like a coffee size may i
have a coffee type can I get a coffee temperature let me get a coffee size
give me a coffee type you can see it seven to ten sample utterance next
lambda initialization we can call lambda function as well
if we need to process like saving data in database for now we are not going
through it before going to the slot let's see the confirmation prompt we can
set the confirmation message like you would like me to order
coffee size coffee type and if the answer is negative mean no
then again we can set another question like what can I help you with
fulfillment return parameter to the client here is one more things to that
is error handling if there is an error what message should be prompt like sorry
but I did not understand that
would you try again please we can set the maximum number of retries let's set
two for now and save it
let's save the intent as well
now let's move to the slot slot here is input data required to
fulfill the intent we are going to create an environment where the
different bases on the different slot types make like a coffee type we can
include the names of the values like coffee latte cappuccino that all those
naming conventions for slot type comes into play here we are going to set some
values for the chat bot click on the slot type plus sign create a slot type
slot type name coffee type now we can insert the values here latte
mocha cappuccino
coffeec
Chai
espresso
smoothie
add the values as per your requirements
let's add another slot type coffee size
values small large
medium
save it one more for coffee temperature
Coffee temp
iced hot
save it as well now now go ahead to save the indent it may
take some time to populate the slot type here
in name place the slot name which we specify as a variable above
select the slot type
in prompt what kinds of coffee would you like
for example
latte mocha
etc
make sure to check the require checkbox let's add another slot as well
Coffee size
select slot type and in the prompt massage like what size
would you like
small medium large
click require as well another for temperature
Coffee temp
select slot type
would you like ice or hot
okay so over we have made already to build
the bot
before that let's save it
yeah one more thing we have to set the final message as a response as well like
thank you for order Coffee size coffee type
save it again
click build to build the bot
okay Chhaya Chautrai bot buildl successfully let's test it in the test bot
give me a latte
okay it's asking me what size okay Large getting information let's change my mind
make it small getting confirmation you would like me to order small latte
is that right yes final message good it's working fine moving forward
next step is publishing a version and create an alias navigate to publish
button and click it to publish a pop-up appear create an alias for versioning beta
version for now
tags not compulsory published your bot is published you can now
connect to your mobile app or continue to chat bot deployment let's move
forward to integrate this bot with facebook Messenger navigate to channel
tap in the Facebook menu after filling these forms we will get a callback URL
which is used with Facebook let's go step by step give a channel
name Master2TeachBot
channel-description describe in a few words step-by-step guide
kms key aws slash lex okay in alias choose from the drop-down
we have only one for now beta another one is verify token give a
unique token that will be used on Facebook later on M2TToken now for the
page access token and app secret key we have to create a new API in the facebook
development account open the Facebook developer page in new tab if you have
already an accounts use it otherwise you can create a new account as well
click getting started register and verify after successfully
verification in my app section navigate to add a new app create a new app
give a display name Master2TeachBot
contact email provide email master2teach@gmail.com
verify that you are not a robot
the next thing that you are going to do is on product setup
navigate to the messenger and click get started
messenger platform scroll down
in the token generation section select your Facebook page
I am going with Master2Teach
grant permission for facebook
then you will get a page access token copy the token code and go to Amazon
Lex channel and paste it in page access token text box
again go to setting' menu a facebook developer account
in basic here you can see the app secret key
click in the show it which you can copy and paste it in the app secret key text
box
now we can activate the channel which will generate the end point URL
here it goes copy the end point URL open the setting page of the new app
just below the page there is a webhook section
click setup webhoot paste the endpoint URL in callback URL and in verify token
write the same token name specify in lex channel M2TToken verify and save it
now the last step to do is you have to select a page to subscribe to your web
hook to the page events select the page and subscribe to it
now let's open the Facebook page and test the bot
may I have a latte
okay here it is in this way you can use Amazon lex to set up your costume chat
bot publish and also integrate with facebook Messenger I hope you learn
from this video tutorial if you have any questions or comments please make sure
to leave a comments in the comment section below also please be sure to
LIKE this video and subscribe to my channel if you haven't already thank you
very much for watching check us out for more in IT tutorial and
guide on website master2teach.com and we will see you again soon
bye
you