Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

Conversational Prelude

All of us enjoy conversations


What if learning was also conversational?
Gear up to hop on to the world of Bots and Conversational Agents. Hope you have a
good conversation ahead!

What is a Chatbot?
A chatbot is defined as a program that interacts with humans through an interface and
has been designed in a way to mimic response like humans.

It is also known as a Conversational Agent or Dialogue System.

Voice-Based Assistants

I have used Google Now, Siri and Cortana. Are they also chatbots?

Yes, they are also chatbots, specifically voice-based personal assistants.

Origin of a Chatbot
It would be good to understand some history of Chatbots. How did all this start in
the first place?

In 1966, Joseph Weizenbaum devised a simple program named ELIZA, which


was driven by a script and could engage with humans in a conversation. The
conversations of ELIZA matched that of a real psychologist. This program applied the
idea of a pattern matching to question, in order to figure out responses.

Chatbot Intuition
"Humans have the desire to communicate with
computers in much the same way as they do with
other human." - Joseph Weizenbaum

Evolution of a Bot
Science and Engineering should be taught with a little bit of history.
Ok, so how did Chatbots evolve over the years into something that we are using
today?

 Web Interfaces paved the way for Mobile Interfaces. As more and more users started
using mobile apps, service providers started creating native mobile apps.
 Mobile apps became saturated over a period of time as users got tired of installing and
uninstalling them. Only a few prevailed.
 Apps that survived were mostly messaging apps.

 Messaging apps had captured the mindshare of users. This meant that users are
available and responsive via messaging.
 This lead to opening-up of multiple products and services through the chat platform. A
slew of companies started launching their respective chat platforms.
 With the advent of progress made in Natural Language Processing, it became easier to
build conversational interfaces.

Stages of Bot Adoption


Ok. So like mobile and web revolutions in the past, bots have gone through
multiple stages of adoption. What could be the stages of adoption for bots?
Yes for bots, the stages of adoption are similar to web and mobile.

First Stage:
What are bots? Why do we actually need them? Awareness is very low at this stage.

Second Stage:
We too need a bot interface! Multiple vendors start building and hosting bots.
Third Stage:
Bot First Delivery Model - Bot UI becomes ubiquitous.

Final Stage:
We are bot only. Bots become the new norm or de facto standard.

Personal Bot
So now that we got a peek into the history of bots, what are the various types of bots available?

Several types of bots are getting developed today. First, you must know about Personal Bots.

 Personal Bots are messaging bots serving as a personal assistant. An example would be a


shopping bot hosted via Facebook Messenger.
 These bots have a very specific focus and communicate directly with the users on a one-
on-one basis.


Domain Specific Bot


Good to know. What are the other types of Bots?
Hold your horses; you will learn them - one bot at a time. The next type of bots
is Domain Specific.
They represent single service and are very focused on the domain and the service.
For example - Airline Travel Bot is the be-all and end-all stop companion for all
travel related queries from Booking flights, Travel Enquires to Membership Benefits.

Consumer Bot
Ok. Are there any bots that are chatty and help us stay in touch with our favorite
items?
Yes. Some bots fit that bill. They are called Consumer Bots.
Consumer bots are

 less task-oriented as Business Bots and


 focus more on personal and end user experience.

For example: Mitsuku is a bot built for a Conversational purpose on the Kik Messenger
Platform.

Business Bot
Gotcha. So are all bots just consumer-facing?
You just asked the right question at the right time. Not exactly. There are several bots
for Business Process Functions.
Say you have questions related to HR Policies or Regulation standards. These bots
will guide you through the nuances of the policies in the way you can comprehend them
clearly.

Voice Bots
I am tired of listening about just Chat Bots. Are there any other interesting bots?
Yes. Voice Bots. All your voice-based personal assistants come under this category.
Google Assistant, Amazon Alexa, Microsoft Cortana, and Apple's Siri are a few
examples. They take voice commands to execute a specific task.

Super Bots

So, is there a bot of all bots?


Yup. They are called Super Bots.

They are not specific to a Domain or Business Area.

You can ask any question to them on any topic. They respond well if they can find the
answer, if not they admit that it is beyond their understanding.

For example: Google Assistant

Closing Thoughts
I learned a lot about bots so far.
Are there any other types that I should know?
Several bots are getting developed as you read this response.
You could create a new bot of your choice in the future. What you should understand is
Bots are the new UI.
They can be implemented for any business or consumer-facing scenario.

Anatomy of a Bot
Bots are awesome!

Are you now intrigued to learn more about them? What exactly are bots made of?

Bots have several parts. Look up to understand what happens behind the scene.

Parts of a Chatbot
That was a well-animated image of a Chatbot. Could you throw more light on the
anatomy of a Bot?
Yes sure. Bot consists of the following parts.

 Human
 User Interface
 Chat Application
 Natural Language Parser
 Component to Trigger Actions
 Responder

Human in the Loop


Why should you consider a human as a part of the chatbot?

Good Question. It is the human who triggers the conversations, and the response is also


directed towards a human. So that is why the user is a vital component of a chatbot.

User Interface
Why do you need a user interface here?
Another important component is the User Interface (UI).

 UI acts as a medium of communication between the human and the rest of the
components.
 Enough thoughts should go in building a UI that is conducive for generating a
rich experience during conversations.

Chat Application
Yes. I understood the importance of the UI. Can you enlighten me on the other
part of the chatbot?
Next comes the Chat Application on which the bot is hosted. Multiple vendors provide
a platform to host bot.
Facebook, Slack, KiK, etc. are some popular platforms.

Natural Language Parser


A while back, you were mentioning about the advent of NLP so where does all
that happen?
Hold on buddy I am just about to explain that part now. There is a component named
parser that is used to extract the intent and the entity of the input.
Concepts from NLP are leveraged in this component.

Intent and Entity


Now, I get the NLP part but what is the significance of Intent and Entity?

The intent and entity are used to get the context of the conversation and to trigger the
correct action relevant to the question.

Action
I got reasonable clarity on the intent and entity part. So what's next?
After extracting the intent and entity, its time for some action. Based on the context the
right action should be triggered. In some cases, it is an API call, in other scenarios, it is
a DB query.

Responder
You mentioned about the responder, what does that do?
A Responder will respond to the human, based on the response of the action.
This closes the loop

Closing thoughts
That was cool. Is there anything more that I need to know about the anatomy?
That is it for now. More in the upcoming topics

Bot Platforms
Bot Platforms
Can you give me some information on the various Platforms available for building and
hosting bots?

Yes. Before that, you should understand the various AI as a service providers and
channels.

 Service providers provide a platform for you to build and sometimes host your
bots.
 Once you host a bot, you create a channel for interaction between humans and
bots.

Slack - Business Bot Platform


Can you please share some details about Bot Platforms?

Absolutely. There are multiple platforms available today to build and host bots. Here,
you will be learning only a few of the popular ones. Let's get started with Slack.

 Slack is a Business Bot Platform available in mobile and desktop.


 You can do a variety of actions with Slack API.
o Post Messages
o Expose Slash Commands
o Expose Clickable Controls
o Event API Subscription
o Administrative Actions

Consumer Bot Platform


Nice. Can we now move on to the next platform?

Sure. Let's move to Facebook Messenger Platform. Facebook is a leading Consumer


Bot Platform with more than a billion active users. Facebook API provides some really
nice features.

 Content Posting
 Check Delivered Callback
 Receiving Messages
 Predefined Button Actions
 Canned Responses
 Sharing Geolocation Information

Voice Bot Platform

Good. Can you explain about the Voice Bot Platforms?

Alexa is a popular bot from Amazon. Alexa is enabled through a device named Echo.


Customization and third-party integration are supported through the Alexa Skills Kit.

Some of the features include:

 Registering the secondary voice commands for specific actions


 Receiving inputs from clients
 Converse with voice back to user
 Connected Home, integration with IoT devices
Legacy Platforms
Is that all or should I know about any other new platform?
Well there are many new platforms available but don't forget the legacy platforms for
communication like

 Email
 SMS

They are old but still used ubiquitously.

Choosing the Right Platform


Now I am spoilt for choices. How do I choose the right platform?
Good Question. Selecting the right platform is a critical step in building a bot. It is a
tricky process because it is not just a Technology, Business, or Design driven decision.
It is a combination of all of them. Some points to consider before narrowing down on the
platform are:

 Audience: Who are the end users of the bot?


 Use Case: B2B or B2C Scenario
 Features Required: Voice Enabled or just Conversation
 Device Preference

This is not an exhaustive list of points to consider but will help you in choosing the right
platform.

Evaluating the Platform


How could one evaluate the platform?
Build a Proof of Concept (PoC) and get users to converse through the platform. This is
a good way to evaluate your platform.
Just to draw a parallel correlation,
Without habitat, there is no wildlife. It’s that simple. — Wildlife Habitat Canada

Use Case: Conversational Commerce


That was enlightening information on platforms. I now get the hang of things
about bots. I want to understand more about the Use Cases. Can you help with
that?

Let's start with a popular use case, Conversational Commerce.

 Consumers can use a bot to add items to their shopping basket.


 Bots can be used for booking tickets and guide you on your travel itinerary.
 You can also book a cab with the help of your Uber or Lyft bot.

Use Case: Business Functions


Please go on. Enlighten me more on these use cases.
Now You will learn about some Business Functions.
 After the advent of the DevOps way of working, collaboration and communication
are inclining towards ChatOps, i.e., Managing DevOps via Chat.
 Legal Bots are reviewing Non-Disclosure Agreements and sharing inputs with the
Legal Team.
 Bots are getting leveraged for Corporate Workflow Managemen

Productivity and Coaching Applications


Are Business Bots similar to Productivity improvement and Coaching?
Not exactly. For Productivity Improvement actions like:

 Reminders
 Creating to-do lists

specific bots are getting developed.

Coaching is a big area where bots are being leveraged.


For example: Personal bots are being used as trainers for weight loss.

Alerts and Nudges


A while back, you spoke about E-Mail and SMS. Those are age-old means of
communication. Can bots perform similar functions?
Absolutely. Bots cannot completely replace some traditional modes of communication
instead could aid in nudging and alters functions like
 you can get a notification from a bot after you have successfully completed a
financial transaction.
 You can get reminders from bots on some specific goals that you have set and
not progressed.
They act as nudging agents in these scenarios.

Intermediaries
Alright. You have given me some bots related use cases. I am tired of listening to
similar examples. Are there any exciting use cases where bots are getting
leveraged?
Yes. As the human in the loop, bots are now acting as intermediaries between humans.

 A ride-sharing bot will connect one human to another.


 Travel bots help connect a group of people who are working towards a similar
goal like Mountain Climbing or Deep Sea Diving.

Artificial Intelligence
So, I have had a perception that Bots are a manifestation of AI. Am I right?
Not exactly. AI is just a significant component of a Bot and not the essence of
a Bot. You are not alone my friend, many have had the same misconception. I am here
to declutter all that.
So what exactly is Artificial Intelligence(AI)?

According to Wikipedia, "Artificial intelligence (AI) is intelligence exhibited by machines.


In computer science, an ideal 'intelligent' machine is a flexible rational agent that
perceives its environment and takes actions that maximize its chance of success at
some goal".

Source: AI Definition from Wikipedia


Gotcha. Can you give more insights on this AI part?
AI is not the one-stop shop for building bots; instead, AI is a set of tools and techniques
that can be leveraged to build a conversational system.
Now that I got some clarity on the AI part, let's get into the Natural Language
aspects.
Sure. All conversations happen through Natural Language.

NLU

What is Natural Language Understanding (NLU)?

NLU is a series of steps that take the input text and extract the intent and entities of the
input.

Training

Grammar
So, do I have to train my bot on Grammar as well?
To a certain extent yes. NLP has a technique called Part of Speech Tagging which
helps understand the construct of the input better.
This, in turn, helps in extracting the entities and intents to perform the desired action.

Conversation Management
Ok. I have a fair idea on AI and NLU now. What next?
 After understanding the Intent and Entities, it is now time to take action and
respond to the input.
 Dialogue agents have two-way communication, so you have to map a correct
response to the input.

Natural Language is unstructured, how do I make my bot efficient at extracting


intent and entities?

Machine Learning is used extensively to train bots at identifying the various aspects of
Natural Language. Most of the NLP tools come with pre-trained models.

Conversation Management

Can you throw some more light on the Conversation Response?

Managing the conversation has a good amount of AI involved.

 AI component understands the context and renders the correct response based
on the input.
 When there is a lot of context switching, humans handle it better, but machines
find it cumbersome.

Context Switching
Ok. So what are the hardships in switching context?
One word might have different meanings in different contexts.
For example,

 Java is a programming language and a coffee variety.


 Python is a snake and a programming language.

Getting the context is very important to render the correct response.

Semantics
So this is all about getting the semantics right, is that correct?
Absolutely. Conversation Management as a field is still at a very nascent stage. A lot of
progress is required to be made in this field.
Closing Thoughts
Thanks that was insightful. You have changed my perception about bots.
You are very welcome. Miles to go, my friend.

Decision Dilemma
From our previous conversations, I get the confidence that I can develop a Bot
even without AI. Am I right?
Absolutely.
AI is not the de facto component in all bots. You should use it as the situation demands.

Using AI
In what scenarios should I use AI?
Scenarios that demand

 High use of Natural Language Understanding


 Frequent Context Switching
 Predictive Analytics
 Sentiment Analysis
 Image Recognition

require the use of AI.

Using AI
Got it. So from what I understand, situations where there are many unstructured
components, AI can be used. Am I right?
Yes. Where there is a lot of complexity in the input, AI can help reduce the complexity.

Not to use AI
What are the scenarios where I need not use AI?
Scenarios where bots

 Send Financial Reports


 Perform News Aggregation
 Send reminders and alerts

do not require any use of AI

Not to use AI
What are the scenarios where I need not use AI?
Scenarios where bots

 Send Financial Reports


 Perform News Aggregation
 Send reminders and alerts

do not require any use of AI

Conversation Types
That was a lot of information on Bot. Now I want to understand more about
conversations. What are the types of conversations that one can have with a bot?
Ah! So now you want to get into the weeds. Conversations can be broadly classified into

 Task Led
 Topic Led

Task Led
Can you throw some light on Task Led Conversations?
As the name suggests, these conversations mostly happen with an objective of
accomplishing a specific task. Completing a stipulated task will be the expected
outcome of the conversation.

Example
An example would give more clarity. Can you share one?
Say you are using a bot to order coffee. The successful outcome of conversation would
be taking the order of a coffee.

Coffee Example
Cool. So if I just converse with a bot saying give me coffee, is the task
accomplished?
It is not as easy as you think my friend. People across the globe have a variety of
preferences to order a cup of coffee. So each preference has to be modeled as a flow-
through its entirety.

Modeling Flow
Gotcha. So what exactly happens during each flow?
I think you need some coffee first to be more attentive. Ok, let me not wait until then.
During each conversation

 the Entities are extracted


 based on the entity, the intent is mapped to each of them.

Sometimes what happens is the conversations go out of context. It is very important to


bring them back to the right context.
PROCAFFEINATING - The tendency to not start
anything until you have had a cup of coffee. Topic
Led Conversations
Can we move to topic led conversations?
Absolutely. Unlike task led, topic led conversations are long. It depends on the users'
engagement with a specific topic.

More on Topic Led Conversations


So does a chatbot become a chatterbot in topic led conversations?
In a way yes. Topic led conversations can go in multiple directions. They do not have
a well-defined end state. They are more designed to keep the customer engaged on
specific topics.

Example
Again, I am used to learning by examples. Can you share one?
Sure. Say you are conversing with a bot on a movie you recently watched or on some
company you have invested in the stock market. You can converse on different
dimensions on the same topic.

Takeaway
So what I understand is that Topic led conversations are mostly used for user
engagement, and task led conversations are used for business scenarios. Am I
right?
Awesome. High Five. You are getting there.

Interacting with Bots


So, is text the only mode of interaction with Bots?
Not exactly, the text is one of the modes of interaction. Some of the ways of interacting
are

 Files
 Audio
 Video
 Emojis
 Buttons

The list goes on...

Files
Now it makes perfect sense. When should I leverage this feature while designing
a bot?
Good Question. Files are used in scenarios where a lot of information has to be
processed, and your chat window is small to accept all that information in one go. You
can also use them when you have tables.

How can files be used as a means of interaction with Bots?

Say you are interacting with a Tax Filing Bot. Instead of entering all the fields in your tax
filing document, you can just upload the file. Since the data is structured, it can be easily
parsed for further processing.

Audio
Can you throw some light on Audio Interactions?
Sure. For personal assistants like Google Assistant, Siri, Amazon Alexa, etc. the mode
of interaction is Voice. This type of interface is called Vocal User Interface. You
trigger commands like Ok Google "How is the weather in New York?" and you get a
response back with the required details.
That was useful. But how do we address the accent issue with voice interface?
Good question. Voice might not be a useful interface in every scenario. Voice is
recommended only for private interactions. A lot of training is required to get the bot to
understand various accents.

Video
Now I understand how Audio interactions happen. I am really intrigued about
videos. Can you help?
Sure. Video interactions happen in the following scenario. Say you are interacting with a
bot to troubleshoot a specific problem and you need an approach. Your bot can respond
with a video that will help you troubleshoot the problem. This is one of many scenarios
where videos can be used as a means of interaction.

Emojis
Somewhere above, you did mention emojis as means of interaction? Is that the
way forward in terms of communication?
Not exactly. Emojis are more of reactions to conversations. These reactions can also be
used to take actions, acknowledge, and respond.

Emojis
Can you give me some example of how Emojis are used for conversations?

Sure. Look at the image above. The same conversation can be reacted with emojis and
expressed with the help of emojis.

More on Emojis

Is that all? Any interesting examples?

Yes. Look at the image above. You can create polls and get a response from emojis.
You can also aggregate the response and perform analytics using those numbers

Buttons
That was insightful. Can you now talk about Buttons?

Yes. Buttons are a wonderful way to navigate a conversation. You can confine the user
to a pre-defined set of responses and guide the user in the desired direction.

Buttons

So should I use buttons only for canned responses?

Not just for Canned Responses. It can also be used for other scenarios. Look at the
image above. You want to collect orders based on some predefined inputs. You can
leverage buttons in those scenarios.

Takeaway
Thanks a bunch. It was an eye-opener for me knowing so many more ways of
interacting.
You are very welcome my friend.
Context

I have been intrigued by this thought on how a bot understands the context. Can
you throw some light on that?

Roger that. Say you are in a conversation with a Travel bot. You are chatting about the
Eiffel Tower. The conversation goes as shown in the image above.

In the above conversation, it refers to Eiffel-Tower the context of the discussion.

This can be achieved with sufficient training on varied topics to understand the context

Context

Got it. Although there was never a mention of the Eiffel Tower in the following
questions, the word  it specifies the context. Am I right?

You are getting there my friend. Let us take another example. Look at the image on the
top. You will get more clarity on the intent and context.

Context and Intent


I saw the travel booking example in the previous card, but I am still unclear on
how to train a bot on the context and intent. Can you help to clarify?
Sure. Some of the variables in the conversation have limited scope like start and end
date; some have a global scope like User Information. These variables are tightly
coupled with the intent and context of the discussion.

Context and Intent


Why are Context and Intent so Important?
Bots are normally used to a request to response setup. They should not time out after
multiple conversations and should remember the context from the beginning.

Context and Intent


I still feel there is an overlap between Context and Intent. Can you please help me
clarify?

Look at the Image above. Hope you got the answer to your question.

Getting the Context


Are there some tips and tricks to get the context right?
Yes. You can get the context from

 Pronouns
o Words like "it", "this", "hers", and "his" are pointers for getting the context.
 Rich Controls

Memory
I got the hang of what context and intent are for a Bot. How different is a
memory?
Memory is generic when compared to context. Here, a bot should be able to pull intents
at various time steps and take actions.

Amnesia
Do bots suffer from Amnesia?
If you do not train them well, then they can suffer from Amnesia.

Closing Thoughts
That was very informative. Now I have some clarity on Context and Memory.
Very Good. Getting a bot to understand the context and memory is one of the most
challenging parts in designing a bot. It is also a good area of growth from a technical
standpoint.

Human In the Loop


So far, I have understood multiple aspects of building bots and enabling
conversational experience. Is there anything additional I have to know?
Yes. You should understand a very important aspect of building conversational systems
i.e. Human-in-the-loop

Humans or Bots

Ok. So, are humans going to work with bots or bots going to replace humans?

To say the truth, it is a little bit of both.

HITL
I am getting confused now. Can you help me understand this concept?
Sure. The steps to handle Natural Language Understanding are Understand -> Act ->
Respond.
Let us take an example: You ask a bot

“What’s the status of SE 123?”

Decomposing the above question


 Understand: User wants to understand the flight status of Flight SE 123.
 Act: Query Database or Hit API to find the flight status.
 Respond: Reply based on the output received from the previous step.
Having a human intervention in any of the above steps is called Human-In-The-Loop.

Human Intervention
When should Humans Intervene in this process?
Humans should intervene when

 Algorithms find it difficult to understand new scenarios


 Algorithms have no clue how to perform a certain action
 Unsuccessful actions
 Input is out of scope

Best Practices
Are there any best practices for this scenarios?
Well, nothing is written in stone, but a few good practices can make things better if
implemented correctly.

 Data Collection should be done properly


 Gauging possible outlier scenarios and include them during training
 Handling exception scenarios should be thought out well.

The Story So Far


I am overwhelmed. I felt that I learned a lot. Is that all?
Well, you have barely scratched the surface. But let us play back what you learned.

 Understood the definition of a Bot and some History


 Architecture and Parts of a Bot
 Various platform to build and host bots
 Natural Language Understanding, getting the intent and context right
 When to use and when not to use Artificial Intelligence?
 Conversational Experience, i.e., Task Led and Topic Led Conversations
 Rich Interactions, using other means of Interactions
 Importance of Memory and Context
 Human in the Loop

Hope you enjoyed learning! May the force be with you when you build a bot!

You might also like