Rocketbots Academy Part 1

Rocketbots Academy Part 1

Welcome to the Rocketbots Academy, where you’ll begin the first steps in creating your own chatbot in a series of 4 courses that will help you build a chatbot in hours.

What you’ll learn:

  • An Introduction to the Academy
  • The Concept of Context
  • A how-to on DialogFlow
  • Your first Task: create your chatbot.

Crack those knuckles, we’re about to get started!

1. An Introduction to the Academy

Course Objectives

This course will give a comprehensive introduction to building a simple topic discussion chatbot. It will introduce the necessary functions and features that set the foundation for a chatbot that can be released and iterated upon quickly in production such as:
  • Designing a Structure for Your Chatbot
  • Building & Training in DialogFlow
  • Managing Context-Free Conversations
  • Adding Value to Your Chatbot with the Rocketbots Platform
  • Iterating on Your Chatbot in Production
This course is structured into 4 sections. Each section will include:
  1. An introduction to concepts and the definitions necessary for understanding them.
  2. Discussion of best practices and the tools used to achieve them.
  3. A task which will allow you to understand how those concepts and practices work in the real world.
At the end of the course, you will have a simple but complete chatbot which you can continue to iterate upon.

The Project

The tasks surround a fictitious project. The client is Nantucket Orchards, a family run apple orchard in a small but well to do community. The company sells 2 products: Granny Smith Apples & Freshly Squeezed Apple Juice.
After some clever Facebook campaigns by the family’s son Steve, the Orchard has been receiving an increasing amount of queries from neighboring towns regarding their products. More then, Rosa, the customer service clerk can handle.
Luckily, Nantucket Orchard’s product line is very simple and the questions they receive are very similar. The family would like to try and use a chatbot to relieve some of Rosa’s workload so that she can focus on dealing with some of the larger regular clients.

The Tools

For this project we will be using 3 tools:
  1. DialogFlow: a Natural Language Processor (NLP).
  2. The Rocketbots Platform: a Chatbot Operations platform.
  3. Facebook Messenger: a channel which connects customers with Nantucket Orchards.

2. Chatbots and NLPs

Menu Chatbots

A menu bot uses only a Menu or a Quick Reply (seen below) to facilitate interaction. The human user moves through the logical tree, by clicking the buttons offered. With a menu bot, the chatbot will not understand natural language human inputs.
61a4b3d1618876a1891275cfabf536a004fe4c012d2393c4f3cd7c69706386deba62139eabda105f7a267a313e02c8173023092afe8cd615d9eead16e7aa7d31ed9902bcdfe3dc236cec780ea1ea7f02c163d300a8d257da4ef26d639761540f1825cf9c.png
031717f4a54735c9a2fb6ea0f0ea15338be490a744f55af08abaebbdcf542765d0cf6b34d22777face1c81e3a83d7bae05dc936b558c598a3cc17b670ca4821464619275974ee65d4b118a92a115209010392c84b8596aeb84b61598ff5c746ebd835bb5.png

AI Powered Chatbots

An artificial intelligence powered chatbot continues to use a logical tree. However, with the help of a field of AI called Natural Language Processing the human user can use natural language to move through the logical tree rather than press buttons. AI-powered chatbots also often use menus or quick replies to assist in human interaction.

NLP

d7f001db01c21a3cac66820a4b2e946d5d0aabafea4d42a24277cef9f2f1a3a8ae74d04293b2daa42e5657883ced88575aedacea6fb85d4ae1cd6677925dcbdb11961f9000a4cb94a8e10bc239a5ecfbfedab1fcb207427c0eed02d4372a9188a209b6aa.png

Natural Language Processing is what enables chatbots to understand natural language inputs. However, NLP is a large field of science, in our case we are using NLPs which do Natural Language Understanding.
A Note About Natural Language “Understanding”
Although the field is called Natural Language Understanding, the NLP does not “understand” natural language in a human way. The NLU turns written human language into a mathematical string, then these mathematical strings are checked against all existing intents and the NLU will indicate which intent is the best match.

Intents

An Intent is the fundamental building block of chatbot logic. The purpose of an intent is to create a path between a user’s Intention and the desired action or response to be given when the chatbot is faced with such an intention. An intent is composed of 2 fundamental components:
  • Sample Data
  • Response
Intention vs Intent
For this course, it is critical to understand the difference between these two terms:
Intention: A users mental determination upon some action or result.
Intent: An intent is a single unit of logic inside DialogFlow.

Sample Data

Sample Data is a set of written expressions that represent a users intention(s). Sample data is very important because it tells the NLP of the types of expressions & phrases that are to be classified as a certain intent.
The AI component of the NLP is what allows a chatbot to classify inputs which do not match the existing sample data word for word. As the amount of sample data increases over time, the NLP trains itself by adjusting it’s matching formula. This increases the accuracy of classification.

Responses

A Response is a phrase or expression which is delivered by the chatbot when a respective intent is triggered.

3. DialogFlow

DialogFlow is the NLP we use at Rocketbots to build chatbots. You may access Dialogflow through the following link: Dialogflow

1e754d835ccaedad03e9667330059793e6660c08e5ceaed7f3b54c889b611424a9d7e08b489209c57c835d9f7f5cb00a2f369175e9ba3f79d72bcae285e5b65e5fabdc52459e2579ee5e8bdc071883e7fa58effee648b9db1066c20fcaab4b0c8516e75c.png

Making an Agent

To create an agent, click on Create Agent in the left menu.
iSlx9GFkO1gB11CB9DcUi2MHJ6jeesDALLa2g2MhqbvnH6_sFPkW-eENp7KQOW0mkgbV_k4qi_IuCaJygMIFw5hJySrC0pqkhnjgxBDUj59ys5reR94709I59-DxMWjJn2pnzYpt.png 
807a9657cb2cf38818699dfe57f040fb8239e9a538ac1e4f969cb1984bce9e7310dd865caba393767f15f3e8d8e01cca5f2ced9a58bd348b84e367cc3f6978bbe0331cec5b7fb72c3c190ff7cdef1261f3a255c44d5fb62076c202258aca393583207070.png
Then enter a name and click Create. In this case please use the name StagingYourName. For example StagingRobert.

Default Intents

Once created, your agent will have the following intents:
  • Default Welcome Intent
  • Default Fallback Intent

 

647ea28588a42f049fdb02f79dcfda2aa48283bcc1463ce37afa764a4b183246effe1292ebe36f0d56c606fdbe57fa7dd9e7ec63d19d9905a72b05f7a5d98f5453e5d29c80d0d8e9eb8a73ea81132ba9de36caeff0699c084649fa8599f9fc2395383316.png
Default Fallback Intent
The response used in the Default Fallback Intent will be activated when no other intent has been found to match the user Input.
Default Welcome Intent
This is the message that will be received when the person first opens the chatbot, through Facebook Messenger or any other channel.

Making an Intent

To make an Intent use the Create Intent button at the top.
 42462abbdde137427990dcbe610d0920ab5c415c47421e25a6b3fd4a448f0dcc03ff614b68d19de063ae89f2773866c5c2d8970c824562d45f279ab6a52c53796db03a3181c7831960a1160c8c0c3853652db409fa1c70ff4973c101fddb09261779b6ca.png
Remember an intent is composed of Sample Data and a Response.
User Says
In DialogFlow the area to enter Sample Data is called User Says. This is where you will enter examples of what the user should write to activate this intent.
User Says Best Practice:
  • Use 20 to 40 user expressions for every intention
  • Use both, short simple phrases & long complicated sentences

 

a840d3326d446648cb20c8cd504b378db04dc606fd59f5f81ed6ebb49ce49df791374e0092dc46b3377aa67ae1ad110e02d6dc5148e53fc37e903c61a96d928166e786375b94624d2ffddc2902825800c8bcb6357a6616154f81e16ae69a9a126b833a11.png

Responses

 

c0fad2e83f8b613b09f3eecb8c96dd9ec605a4079d0c1684766770b88f58ca2442ec5fcda33ae622adddb9f80d6b641d9e9db0210c198fddfb33d9ad48c5570d1f1f15aef2b6fa24b7322984534c5c792ff9b210656f2508d4356acc75c200d8971edcb6.png
This is where you will enter your response(s). The user will see the exact message you enter as a response in the text response box(s).
Use the add message content button to add a text box, image, card or quick reply. Be sure to play around with these so you know what’s possible with your chatbot.
Responses Best Practices:
  • Use the Facebook Messenger template for best integration with the Rocketbots Platform.
  • Keep messages as short as possible, no one enjoys a wall of text.
  • Use the context of the question in the response, so that a user can know if the chatbot is understanding their question correctly or not.

Saving Your Intent

6c4f87bbaf1a8552d6bc82f23c6d4e7a44a0d4c5ae8ed103f07438c9d03a12cfb6045f7f86be700edaac485b5fca6e58c9ce8b8ca03b9ec249c511a2077ae081138f0338f4782e9eed55f68cd5ddeec4ebb193f1d2574192d4f59f8a3c3e9210ee268e38.png
Remember: after making changes to your intent, click save at the top of DialogFlow to ensure those changes are not lost.

Congrats, you now know enough for your first task!

Those are the basics of chatbots and using DialogFlow. Don’t worry about the other parts of Dialog Flow for now. We will introduce these as we proceed through the course.

4Your First Task: Create your own Chatbot

Learning Objective

Throughout the Rocketbots Academy you will make a single chatbot, in this first task we will practice the basics and learn about how well DialogFlow is able to process natural language.

Chatbot Objectives

An essential element of a convincing chatbot is Small Talk. These intents are there to provide responses to some of the most popular human inputs.
For this task, your chatbot should be able to answer messages with the following 10 Intentions:
√ Hello
√ How Are You
√ Nice to Meet You
√ Are You Busy?
√ What is your Name?
√ Where do you come from?
√ What is your age?
√ Ha Ha Ha
√ Goodbye
√ Are you smart?
Intent Organization Best Practice
As your chatbot grows, staying organized will become even more important.
At Rockebots we use the following naming scheme: Category | Topic | Sample Input. Therefore your intents should have the following names:
  1. Personality | Hello/Goodbye | Hi
  2. Personality | About Agent | How Are You?
  3. Personality | Hello/Goodbye | Nice To Meet You.
  4. Personality | About Agent | Are You Busy?
  5. Personality | About Agent | Name
  6. Personality | About Agent | Origin
  7. Personality | About Agent | Age
  8. Personality | Emotion | Laughter
  9. Personality | Hello/Goodbye | Bye
  10. Personality | About Agent | Are You Smart?
Responses Best Practices:
  • Use the Facebook Messenger template for best integration with the Rocketbots Platform.
  • Keep messages as short as possible, no one enjoys a wall of text.
  • Use the context of the question in the response, so that a user can know if the chatbot is understanding their question correctly or not.

DialogFlow Console

On the right side of DialogFlow, you will see a console. Use this console to test your bots understanding. If you notice that the bot is not classifying some inputs correctly, go back and add those inputs as sample data for the respective intents.
96538b56d76bf25b9334257cfb91fb1f21528430aa6170b885811a6d744ac52f902cab2b328df5535707be3c6039e1dbc32c4098d2b9a09ed189c84eb7c51291eca67992bf32b8325e4d789ac6a1674349ebad6bfe9c6d6df044ea0b79618bf33062b645.png

When You Are Satisfied With What You Have

Remember to click add near the bottom right, then save at the top.
7988f08b3013117060d90833874ca2acaeaff9bc683043ca911b58414110feb2b949256cee532db50f60a571de7fd8e33df44f4af449222f1b74b6555de5c3a0e8130c7ca6838f24733c97cf52e960c42078c591da03cb35c97dd08826018bc513414bf1.png
PHEW!
You’ve done it! You just created your very own chatbot.
 
But it doesn’t end here, we’ve got a lot more to cover in Part 2.

-The Rocketbots Academy Team

Author
Robert Rafferty

Robert is a Growth Hacker enthusiast that’s joining Rocketbots as the Head of Growth. He helps Rocketbots in becoming the voice of all things conversation and is famous for wearing shorts to the office. A graduate of the College of Business at Florida Atlantic University.

Leave your Comment