KEMBAR78
Chatbot Basics | PDF | Menu | Copyright
0% found this document useful (0 votes)
22 views37 pages

Chatbot Basics

The document outlines a class for kids to create their first AI chatbot using API programming, focusing on training the bot to respond to user requests. The class includes a structured format with warm-up activities, teacher-led demonstrations, and student-led projects, utilizing resources like laptops and Code.org accounts. The goal is to develop an AI-based chatbot by adding intents, with specific instructions for creating and training the bot using Dialogflow.

Uploaded by

Usha Rani N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views37 pages

Chatbot Basics

The document outlines a class for kids to create their first AI chatbot using API programming, focusing on training the bot to respond to user requests. The class includes a structured format with warm-up activities, teacher-led demonstrations, and student-led projects, utilizing resources like laptops and Code.org accounts. The goal is to develop an AI-based chatbot by adding intents, with specific instructions for creating and training the bot using Dialogflow.

Uploaded by

Usha Rani N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Topic CHATBOT BASIC

Class Kids create their very first AI Chatbot by API programming


Description and integrating it with their app. This involves learning to train
the bot on user requests and developing appropriate bot
responses.

Class ADV-C37

Class time 55 mins

Goal

● Develop an AI based Chatbot by adding Intents.

Resources ● Teacher Resources:


Required ○ Laptop/PC with WebCam
○ Use your Code.org login credentials
○ Earphone with mic
○ Notepad and Pen

● Student Resources:
○ Laptop/PC with WebCam
○ Use your Code.org login credentials
○ Earphone with mic (optional)
○ Notepad and Pen

Class Structure Warm Up 5 Mins


Teacher-Led Activity 10 Mins
Student-Led Activity 30 Mins
Wrap Up 5 Mins
Project Cues and pointers 5 Mins

Start the video call from H2H

WARM UP SESSION - 5 mins

Teacher starts slideshow from slides 1 to 16.


© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

1
Refer to speaker notes and follow the instructions on each slide.

TEACHER ACTIVITY - 10 mins

Teacher Initiates Screen Share

Say Do

Chatbot is a computer program


designed to simulate conversation
with human users, especially over the
Internet.

Here is what a Chatbot looks like.

Chat with this bot to show


the kid how the bot works:
Teacher Activity 1- OCTA
CHATBOT

This is a chatbot developed to provide


travel information.

Chatbots are programmed with


information and responses to answer
questions. The more you train a
chatbot with answers, the more
questions they can answer.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

2
As you saw a real word chatbot
application, now quickly let me show
the chat bot I made.
Chat with this bot to show
the kid how the bot works:

Teacher Activity 2-
SUPERHERO BOT

This is a SuperHero Chatbot which


talks about my favorite Superhero.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

3
Note: Show the demo of the SUPERHERO BOT to the kid by asking the
following questions. Type the following questions one by one and hit Enter for
every question:

Here is what a chatbot looks like. This is a chatbot developed to get information on a
superhero.

1. What is your name?


OR Who are you?

2. What can you do as HatMan?


OR What can you do?
OR What do you do?

3. What are your powers as HatMan?


© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

4
OR What are your powers?

4. What is your weakness as a HatMan?


OR What are your weaknesses?

Which is your favourite superhero?


You can create a chatbot on your favourite superhero and add information about the
same.

You can also build a chatbot on any topic, for example: your favourite game, about
yourself, etc..
You would like to create a chatbot for?
Note: Ask the student about his/her interest and motivate/encourage the student to

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

5
think of ideas on which a chatbot app can be developed.

From today onwards, we will start


building a chatbot for a restaurant
which will be able to welcome a new
customer and showcase the menu.
We will call this chatbot a Food
Reviewer bot.

Let me first demo this food review


chatbot to show you how it works.
Chat with this bot to show
the kids how the bot
works: Teacher Activity
3-FOOD REVIEWER
CHATBOT.

Note: Show the demo of the FOOD-REVIEWER-BOT to the kid by asking the
following questions. Type the following questions one by one and hit Enter for
every question:

1. First let’s just say:


Hi
OR Hi there
OR Hello
OR Long time no see

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

6
2. Then questions about the menu can be asked:
Show the menu.
OR What items do we have on the menu?
OR What are the menu items?

In the next class, we will learn how the chatbot can reply on the review of the dish
we want.

I have created this bot for myself to share with my friends. I have trained the bot to
answer the questions about the menu of a restaurant.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

7
NOTE: Open Teacher Activity 3-DIALOGFLOW, login and start developing the
chatbot.

Now let me show you how I created this bot.

1. Click to sign in with your Gmail account or your parents Gmail account

here. After signing in, click to confirm.

2. Click on the top-right corner to go to the Developer


Console.

Wow! Now you are using Google Developer Platform where all google engineers
develop softwares.

3. Now let’s create a bot by clicking Create Agent.

4. I am calling this bot the Food-Reviewer-Bot and I have selected India's


timezone which is +5:30.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

8
5. Click . Dialogflow will start on creating your
bot.

_______________________________________________________________________

Note: If you are not able to create Agent:

1. Open Teacher-Activity-5 and you will get this pop-up directly.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

9
2. Select the country, check the ‘I agree to the..’ checkbox and press the ‘Agree
And Continue’ button.

3. Then click on this icon which you will find at the top-right hand
side of the screen. And make sure the same google account is selected
which you have chosen for dialogflow. Then try creating the agent again.

IF THE POP-UP DOES NOT OPEN DIRECTLY, THEN -

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

10
Click on this icon which you will find at the top-right hand side of the
screen. And select the same Google account which you have chosen for
dialogflow. Then try creating the agent again.

_______________________________________________________________________

6. You can see your bot being created.

7. Now click on the icon to edit your bot settings and enable

beta features. This will help us make the bot extremely

smart. Remember to your settings.

8. Now click Intents.


© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

11
Intents are the topics or questions that a user asks a bot. We are going to
create more intents in the next class. For now, by default, we have two
intents already created.

9. is the ‘Welcome Intent’ in which you can set


welcome responses when a user first says hi or hello, etc to the bot.

Let’s edit the responses. Click on .

➔ Training phrases: Training phrases contain the possible


questions/words/phrases a user can ask. You can add as many training
phrases for the ‘Welcome Intent’ as you want.
Type the phrase and hit Enter to add a phrase.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

12
➔ Responses: Once the training phrases are added, you can set responses
for those training phrases. Responses contain texts that a bot responds
with:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

13
Here, there are 5 responses set for the training phrases of the ‘Welcome
Intent’. You can add more training phrases and responses if you want.

10. Save and train the bot: Now let’s see how these training phrases work with

responses. Click on the button and allow the bot to take some time
to train on the responses. It means that your bot is learning the responses for the
training phrases. You can test the bot once you see the below notification on the
bottom-right corner of your screen:

On your right, type ‘Hi’ and see the response.

Do this 3 times.
© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

14
Each time you type ‘Hi’, you should see a random response from the Text
responses of the ‘Welcome Intent’.

- Try 1:

- Try 2:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

15
- Try 3:

You can see that everytime I said ‘hi’ to the bot, it replied back with one of
the 4 responses set for it.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

16
11. Let’s delete these responses and set only one response to all the training

phrases. Press .

It means that if the user types any of the following words/phrases,

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

17
the bot should reply with the following response:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

18
We are providing only 1 response because we want to test that for all the
training phrases we get the same response or not.

Note: Instead of WhiteHatJr resto restaurant name, ask the student to


mention a restaurant name of his/her choice.

Now click Save and let the bot train itself.

Once you see , we can check its


response to “hi”.

There you go-

- Try 4:

- Try 5:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

19
You can see that if the training phrase “Hi” appears in the sentence, the bot
gives the same reply.

Yay! You have trained the bot to welcome the user.

12. Now let’s check if the user says something which the bot is NOT trained to
reply on.

- Try 6: Yo!

You can see that the bot replies with this statement. But where does this
response come from? This response comes from the Fallback Intent:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

20
Click to edit the Fallback Intent.

Fallback intent has the following responses:

The Fallback Intent is triggered when a bot doesn’t have responses in its
memory that match the user input or the question. So here, the bot is not
trained to reply when the user says ‘Yo’. It doesn't know what it should reply
with. We can have the bot trained on this.
Let’s train it then.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

21
➔ Go to the ‘Welcome Intent’ and type ‘yo’.

➔ Now press ENTER. You will see that your training phrase ‘yo’ is
added to the list.

➔ Now, let’s click Save and test the bot.

- Try 7:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

22
Here, the case of the user input doesn’t matter - You can type
uppercase ‘YO’ or lowercase ‘yo’. The bot is smart enough to
understand cases and give responses accordingly.

Wow!

Q: How does the ‘Welcome Intent’ work?


A: First, we train the welcome intent with some questions and its responses
and train the chatbot. Then we need to test the ‘Welcome Intent’ by asking
the same questions and checking that the bot replies properly or not.

13. Create a Menu Intend: Now let's create a menu Intent. Now, since this is a bot
for a restaurant, the default or the most common question a user might ask can be
about showing the menu or specialty of this restaurant.

Let’s understand this intent with an example.

1. What is your favorite music?


2. Which is your favorite song?
3. Which song do you like to listen to?
4. Do you have a favorite song?

All these questions refer to the same Intent: Your favorite song

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

23
So Intent means that we train the bot in different ways the same question might be
asked and set response to it.

➔ Now, let’s click . You should see the


pre-built default Intents.

Here, you will find the Fallback Intent. We will talk about this in the
upcoming classes.

➔ Click to create an Intent to answer questions, for


example: “What is the menu?”.

➔ Name it as menu.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

24
➔ Click on the button to add training phrases.

➔ Add Training Phrases - Then add the training phrases which you think the
user might ask about checking the menu, and keep pressing ENTER to add
as many types of questions you think the user can ask.

These are a few Training Phrases I have added. You can add more.
© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

25
NOTE: Ask the student to think and add questions. Help the student think
about more training phrases for the menu when the student performs the activity.

➔ Add Responses: When the user asks for the menu, we want our bot to
display the menu and ask if the user would like to check the review for any
of those dishes. For this, we add the bot’s response in the response
section.

The bot replies with -

Note: The student can customize the food name as per his/her choice.

➔ Save and train the bot: Now click on the button and let the
bot train itself.

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

26
Once you see , we can check its
response to “Show the menu”.

Now every time the user asks for a menu using any training phrase, the user will
get only 1 response as we have added only 1 response to it.

Great! We have created our 1st basic bot to show the menu of a restaurant.

Teacher Stops Screen Share

STUDENT ACTIVITY - 30 mins

Now it's your turn. Please share your


screen with me.

● Ask the Student to press the ESC key to come back to the panel.
● Guide the Student to start Screen Share.
● The Teacher gets into Fullscreen.

Student Initiates Screen Share

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

27
Ask student to Open The student is expected to
Student Activity 1, login and start build the entire bot on
building the bot: his/her own with the
teacher's guidance
1. Create an agent and name the wherever required by
agent. making sure that the student
2. Add more training phrases and follows the steps shown
responses to the ‘Welcome above.
Intent’.
3. Create the ‘menu’ intent and Student Activity
add training phrases and 1-DIALOGFLOW
responses to the ‘menu’ intent.

Update the AVATAR of our Chatbot:

Now, let's see how to set the avatar of our chatbot. Avatar means the image, which will
be shown on the chatbot. I’ll show it later where it’s visible.

So to upload an avatar, first, we need to host the image on the server:

1. Open Student-Activity-2 and upload the image:

2. Select the image which you want to upload.


3. Wait till it loads.
© 2021 - BYJU’S Future School.
Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

28
4. Then automatically, we will be redirected to another page. Then copy the link,
which is marked in the below image. Whenever uploading any image on this
website, copy the second link which has the label “Direct link”:

NOTE: Ask the student to upload his/her image here as we want to display the
student’s image as an avatar for the chatbot.

5. Copy this link. Go to the dialogflow website and click on the setting icon:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

29
6. Paste the link below the AGENT AVATAR URI:

7. And press the SAVE button:

Great! We have uploaded the image on the server. Now, let’s generate the chatbot link.

Generating the Chatbot Link (Follow the steps below):

1. Choose your bot. When you click on the dropdown list icon, you should see the list
of bots we created in the previous classes. I am going to generate a link for

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

30
Food-reviewer-bot but you can choose any bot:

2. To Integrate this bot using the link, click on “Integrations”:

3. Once you click on the “Integrations”, a new screen will be loaded. Scroll down to
“Text based” section and enable the “Web Demo” option:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

31
4. Once you enable the “Web Demo” option, you will get a popup showing the bot
link:

5. Click ENABLE and you should get the following:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

32
6. The link present in the src tag or source is the bot link. Copy this link and paste it
in the panel and press submit. You can also paste this link in another chrome
tab and see how your bot looks and works in real-time. And on the top-right,
you will see the image, which you have saved:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

33
Great! You have successfully added the avatar to your Chatbot.

Teacher Guides Student to Stop Screen Share

Teacher Initiates Screen Share

WRAP UP SESSION - 5 mins

Teacher starts slideshow from slides 17 to 20.


Refer to speaker notes and follow the instructions on each slide.

PROJECT POINTERS AND CUES - 5 mins

Teacher starts slideshow at slide 21.


Refer to speaker notes and follow the instructions on each slide.

WELCOME BOT

Goal of the Project:

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

34
In Class C37, you created a chatbot
using Google DialogFlow and learned
how to create an intent.

In this project, you will have to


practice and apply what you have
learned in the class and create a
chatbot called “Welcome” for
welcoming people across the world.

Story:

CreBiotech is a company that


manufactures vaccines on various
deadly diseases. They have a plan to
arrange a conference to connect with
people across the world to discuss
issues faced during this corona
pandemic. They have a plan to create
a chatbot to welcome the attendees
where people will be greeted in many
languages. They are looking for
someone who can help them with it
and add training phrases to say
‘Hello’ in different languages.

I am very excited to see your chatbot


and I know that you will do really well.

I will see you in the next class.


Bye Bye!

Teacher Clicks

ADDITIONAL ACTIVITY

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

35
Teacher Initiates Screen Share

Teacher starts slideshow from Slide 22 to 24.

STUDENT ADDITIONAL ACTIVITY

Student Initiates Screen Share

Additional Activity 1
Add more responses to the ‘welcome
intent’.

Additional Activity 2
Add more responses to the ‘menu’
Intent.

Activity Activity Name Links

Teacher Activity 1 OCTA CHATBOT https://www.octa.ai/

Teacher Activity 2 SUPERHERO https://console.dialogflow.com/api-client/de


CHATBOT mo/embedded/9a5b7658-a488-41e0-a2a4-
2f2f04b94005

Teacher Activity 3 FOOD https://console.dialogflow.com/api-client/de


REVIEWER mo/embedded/1c4e09bc-c65f-4625-8afe-1
CHATBOT 36a17c5494c

Teacher Activity 4 DIALOGFLOW https://dialogflow.cloud.google.com/

Teacher Activity 5 GOOGLE https://console.cloud.google.com/cloud-res


CLOUD ource-manager

Student Activity 1 DIALOGFLOW https://dialogflow.cloud.google.com/

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

36
Student Activity 2 HOST IMAGE https://postimages.org/

Project Solution WELCOME https://drive.google.com/file/d/1tecgsC2X-U


CHATBOT ‌ w_OAevg5LbbpLcyQJKxaE7/view?usp=sh
aring

Teacher Reference Visual aid link https://curriculum.whitehatjr.com/Visual+Project+As


Visual aid link set/ADV_VA/ADV_C37_V2_withcues.html

Teacher Reference In-class quiz https://curriculum.whitehatjr.com/Visual+Project+As


In-class quiz set/ADV_VA/ADV+C37+V2+-Quiz.docx.pdf

© 2021 - BYJU’S Future School.


Note: This document is the original copyright of BYJU’S Future School.
Please don't share, download or copy this file without permission.

37

You might also like