Developing A Using Snatchbot
Developing A Using Snatchbot
Snatchbot
STRATEGIC BUSINESS TECHSPACE
- Fasinu Joshua
STRATEGIC BUSINESS TECHSPACE
➢ Leveraging and capitalizing on the
advantages and assets offered by
integrated technologies for information
management, streamlined transactions,
strategic management solutions, and
immersive learning encounters.
DEVELOPMENT
SOLUTIONS
INTRODUCTION TO CHATBOT
A Chatbot refers to a software robot designed to replicate the conversational abilities of a
human being. It is a program capable of engaging in conversations through text or speech by
emulating human behavior. Chatbots find applications in various fields such as customer service
systems, information retrieval systems, marketing, education, management, entertainment,
news, human resource management, analytics, developer tools, utilities, and more.
Originally known as a "chatterbot," the term "Chatbot" was coined by Michael Mauldin in 1994 to
showcase computer programs capable of conversational interactions. Artificial intelligence, of
which chatbots are an application, has been a topic of discussion since 1956 when John
McCarthy introduced the term "Artificial Intelligence." However, Alan Turing was the first to
develop a machine (Bot) capable of imitating or simulating human intelligence.
The objective of this course is to demonstrate the implementation of artificial intelligence in
chatbot development. Therefore, we will primarily focus on the process of building a chatbot, as
indicated by the title of this work. Similar to multiple programming languages available for
writing the same program or various word processing applications for creating a document,
there are several frameworks utilized for chatbot development. A framework serves as a
workshop where you construct your chatbot. In this course, we will utilize Snatchbot as our
chosen framework.
SNATCHBOT
SnatchBot stands out as a highly
robust framework for constructing
intelligent chatbots. With its
impressive range of features and
user-friendly interface, it offers
seamless capabilities for deploying
your chatbot across various
platforms. These include mobile
devices, web applications, and
popular chat services like Facebook
Messenger, SnatchApp, Skype,
Viber, Slack, Twilio, Line, and more.
Notably, SnatchBot simplifies the
process of building aesthetically
like in this image above. See the button at the top right corner, you can click it to ‘create’ a new bot.
However, don’t click it now – we will come back to it.
Broadcasts: The next on the menu list is ‘broadcasts’, it lets you send messages to several of your
users at once. You can browse to learn more
Inbox: Lets you view received messages from your users while you can check Reports to see the
activity of each bot to the very last single messages received or sent. You can export the reports as
an offline XLS document or a JSON file. Don’t be perturbed by these terms, they are just simple
words and abbreviations we use to address technical entities and data.
Once you have built your bot within the SnatchBot framework, it's essential to publish it beyond the
SnatchBot platform itself. Just like you publish your Facebook posts to make them visible to others,
you need to do the same with your bot to enable people to interact with it. While this process might
be complex in other frameworks, it is straightforward with SnatchBot, and you will learn how to do
it in this course.
Before we proceed with deployment, let's locate the bot we have built. To begin, navigate back to
the 'My Bots' section in the menu and click on 'Create Bot' as previously explained. Look for this
option in the right-hand corner of the screen. Once you click on it, SnatchBot will prompt you to
provide information about your bot, similar to creating a bio. Refer to the example below to get an
idea of how it appears.
In the first field, labeled 'Name,' you
should specify the desired name for your
bot. While you can opt for generic names
similar to naming pets, it is crucial to
choose a name that reflects the bot's
capabilities when developing your
project. For instance, if we are creating
a bot for student registration in a
school, which is the project we'll be
building in this course, it is advisable to
give it a name that suggests its function,
such as "AdmissionBOT" or a similar name. Later on, you can rename it to something like "Joe" or any
other preferred fancy name. However, for easy reference purposes, we will temporarily name it
"AdmissionBOT."
Once you have provided a name for your bot, the next step is to describe its purpose. Fill in the Bot
description field with a brief explanation of what the bot does. In this project, we are constructing a
virtual registrar, so we will provide a concise description reflecting that functionality.
After describing our bot, it is time to assign it an image. You have the option to upload an image that
represents your bot or its intended purpose. As we are developing a school admission bot, it may be
fitting to use the school's logo as the bot's profile photo. Please refer to the image below to observe
the progress we have made thus far.
Prior to reaching the
current dialog box,
it's worth noting
that there are other
preexisting bots
known as templates.
SnatchBot provides
a diverse selection
of ready-made bots
that can expedite
your work and
simplify the process
if you prefer not to
start from scratch.
However, for this
specific project, we
have decided to create a bot from scratch, which is why we have chosen the "Blank Bot" option. To
commence building our AdmissionBOT, let's proceed by clicking the "create" button located below.
The first thing we see is a message to create a new interaction.
Interactions represent individual conversations between our bot and the user. They serve as the
fundamental "send and receive" components within the overall bot-user conversation. Here's an example
of an interaction:
BOT: Hi, I'm Joe. I will register you into Strategic Business Techspace. What is your name?
USER: Adeolu Williams.
When you select "Add new interaction," the following page will be displayed:
Bot: Hi, I'm Vision. I am going to register you into Strategic Business
Techspace. What is your name?
User: Micheal
Bot: Micheal, what's your department
User: Science
Bot: What's your Date of Birth?
User: 16th of January 2005
Bot(error): This is not a valid date, kindly change the format
User: 16/01/2005
Bot: What's your email address?
User: fasinujoshu"[Link]
Bot(error): This is not a valid email Address, eg. someone@[Link]
User: fasinujoshua0@[Link]
Bot: What's your Phone Number?
SCRIPT FOR THE CHATBOT
User: 08026847947
Bot(error): This is not a valid phone number. eg. +2340000000000
User: +2348026847947
Bot: Confirm these information
Full name: Micheal
Department: Science
D.O.B: 16/01/2005
Email Address: fasinujoshua0@[Link]
Phone Number: +2348026847947
Are they correct?
user: yes
Bot: Since your Information were correct. Be expecting a message on your
contacts either the email or phone number.
Nice Chatting with you.
for more inquires contact +2348026847947
LET’S START BUILDING NOW!
Within the "Student's Name" interaction, we
have a dedicated page where we can input the
bot's message. This allows us to specify what
the bot will say when the user initiates the
chat. For this particular interaction, we will
enter the message "Hi, I am Joshua. I am
going to register you into Strategic Business
Techspace. What is your name?" This serves
as the bot's first message, prompting the
student to provide their full name.
Please note that the connection we used in this case serves as a fallback, indicating what the bot should do
when it doesn't understand the user's query. We used this fallback connection simply to link another
interaction because we don't have any other specific connections or conditions to be met. To add a specific
connection or condition, scroll down further to the "Add Connection" and "add NLP Connection" sections.
The "Add Connection" allows you to link interactions based on specific conditions. For example, in a typical
Simple Connection, you can set conditions like "Item: If response to this interaction" and "Condition:
contains (whole word) - keywords," then specify the interaction to go to. While this may seem a bit
complex initially, don't worry, it's actually quite straightforward. You can enhance your understanding by
watching our tutorial videos on YouTube at Strategic Business Techspace. These videos cover topics like
adding quick replies and various other functions. However, for the purpose of this course, we are focusing
on developing a simple bot for student registration, and we don't intend to make it overly complex. By
following the simple steps provided, you will be able to achieve the desired outcome.
In our case, we wanted to link the next interaction, "Department," with the previous interaction,
"Student's Name." This way, when the user provides their name, the bot can seamlessly proceed to ask for
their department. We accomplished this by accessing the connections section within the "Student's Name"
interaction and modifying the fallback to link it to the "Department" interaction. The process is
illustrated in the image below and is quite straightforward.
Click on it to retrieve the response from the previous interaction and apply it here.
The syntax for referencing the
previous response will be
[responseTo interaction=ID
fallback=TEXT]. Replace "ID"
with the ID number of the
former interaction (which can
be found below the interaction
name, in this case, 3714140).
Additionally, replace "TEXT"
with the error message you
want to display in case the
response appears, you have the option to add a delay. This ensures
reference doesn't work. In our
that the text doesn't immediately appear but instead waits for a
case, since we want to ask for
specific duration that you specify. To access this feature, locate the
the student's department and
"Chat Bubbles" section, positioned above the Bot Message. Click on
include their name, we can have
"Delayed Response" to enable the delay functionality. You can then
the bot ask, "What is your
input the desired number of seconds for the delay. This allows you to
department, Fasinu Joshua?"
fine-tune the timing of the response, creating a more natural and
assuming "Fasinu Joshua" is the
synchronized conversation flow.
name of the student. To control
the timing of when a text
It's fascinating to see how our interactions and
connections come together. Now, let's proceed to fill in
the remaining information for all our interactions and
link them accordingly. In this step, we will connect the
"Department" interaction with the "Date of Birth"
interaction. This ensures that the bot continues to
prompt the user for their date of birth after they have
provided their department.
In this particular case, we may not need to reference previous responses. Instead, we can simply connect
the "Date of Birth" interaction to the "Email Address" interaction. This allows the bot to ask for the
user's email address once they have responded with their date of birth. Please refer to the image below
for further clarification.
If there is a space available to add an error message, it's
important to include one, as it is mandatory in case the user
enters an incorrect date format.
Now, let's engage in a conversation with our bot and see the progress we have made.
Now, let's consider what happens when the
user responds with their phone number.
We can anticipate that the bot won't be
able to provide an appropriate reply
because we haven't specified which
interaction should be triggered after the
bot has gathered all the necessary data
from the students. Since we have obtained
the required information, we can bring the
conversation to a close.
To achieve this, let's create another
interaction of type "Bot Statement" and
name it "Confirmation." This interaction
will prompt the bot to ask the student to
confirm if their data is correct. We can
accomplish this by calling the user's
response from the previous interactions
where they provided the required data. To
do this, we will utilize the "prior
responses" function.
Simply use the "prior responses" function
to retrieve the data from each interaction
that contains the required information.
Follow the same process we used for the "Department" interaction. Click on "prior responses" in the
horizontal menu of the bot's message and edit the syntax accordingly. Replace "ID" with the ID number
of the interaction whose response we want to call, and replace "TEXT" with a customized error message
if necessary. The ID numbers of the interactions can be found below their respective names in the
interactions menu. Take a look at the example below to understand the process.
underline, or even strikethrough formatting. Just select the appropriate option when highlighting the
text.
Feel free to test your bot now and continue with this lesson.
Now, let's consider how the user will respond to the "Confirmation" interaction with either "yes" or "no"
to confirm if their data is correctly recorded by the bot. We will utilize the "Add Connection" feature
that we mentioned earlier. Follow these steps within the connections section of the "Confirmation"
interaction:
1. Click on "If then go to" to open the field.
2. You will see "If response to this interaction." Click on "item" and select "response to this interaction"
to specify that the condition is based on the user's response to this interaction.
3. Click on "condition" and select "contains (whole word)" to indicate that we are looking for a specific
word or phrase within the response.
4. Click on "keywords" and enter the possible variants of words the user could reply with. In this case,
we expect the user to say "yes," so we will use keywords like "yes," "yeah," "yea," "yep," and "ya" to
cover all the possible ways someone can respond affirmatively. Add these keywords one by one. (Note:
If a dialog box pops up, check the bottom of the dialog box for a "cancel" option and cancel it. The
keyword will be added successfully.)
5. After adding the keywords, you need to select the interaction that the bot will go to if the condition
is met. It will now read, "If response to this interaction contains (whole word) 'yes', 'yeah', 'yea',
'yep', 'ya', then go to..."
6. Click on "interaction" and select the interaction that should happen next. In this case, if the user says
"yes," we can end the interaction and have the bot say goodbye. We can create another interaction
called "Conclusion" where the bot can say something like, "Well done [Student Name], your details
have been recorded. Have a nice day!" assuming [Student Name] is the name of the student.
7. Create another simple interaction and repeat the same process, this time using variants of "no" as the
keywords. The succeeding interaction should be the first interaction ("Student's Name") since "no"
indicates that the student is saying the information is not correct, and we want the bot to start
asking again, starting from the "Student's Name" interaction.
Take a look at the example below to see how it's done.
Now, we understand that if the
user says "yes" or any of its
variants, the bot will proceed to
the "Conclusion" interaction and
end the conversation. On the
other hand, if the user says
"no," the bot will return to the
beginning of the conversation.
But what happens if the user's
response does not contain "yes,"
"no," or any of their variants? This is where the fallback connection comes into play. We need to
determine which interaction should be triggered if none of the conditions are met.
To enhance the bot's intelligence, you can create another interaction specifically for the student's name,
which will be utilized when the user responds with "no." It may seem less intelligent if the bot were to
return to the very first interaction and repeat the same message it initially started with. You already
know how to create this interaction and make it work seamlessly.
Now, let's proceed to the "Conclusion" interaction and finalize everything. With these connections in
place, our bot is ready to go. Let's test it and see how it performs!
11
2
13
4
As mentioned before, this project serves as a simple introduction to the features of Snatchbot and how
to utilize them effectively. There are numerous other functions and capabilities that you can explore
within the platform.
Now, let's swiftly discuss how to customize the design of our bot and deploy it to various channels such as
webchat and social media, enabling people to interact with it. To proceed, navigate to the "Channels"
section located in the left vertical menu. You will see the interface depicted in the image below.
Now, let's focus on the next item in the left vertical menu,
which is "Configure." This feature allows you to edit the
profile of your bot, providing you with additional
customization options.
We have covered all the necessary functions and features, and you have successfully built a simple bot.
Now, let's return to our dashboard, where we can view the number of bots we have created and other
relevant statistics, as explained earlier in this course.
With Snatchbot, you can track the usage of your bots across all the channels you have deployed them to.
You can also access the "Inbox" to read user conversations with your bots and even engage in live chat
with users. Furthermore, you have the option to extract specific data collected by your AdmissionBOT
into an external spreadsheet, such as Google Sheets, using webhooks. Please refer to the Snatchbot
documentation for more information on how to accomplish these tasks. Additionally, you can find more
educational video classes on our YouTube channel by subscribing to "Strategic Business Techspace."
It's worth noting that Snatchbot is currently running premium services in 70% of chatbot instances.
In conclusion, if you need access to the Snatchbot documentation, simply scroll down on the home menu
and click on "Documentation."
- Fasinu Joshua
Josh Digital Concept