Your chatbot is cool — but how does it work?

Hrittika B.
UX Collective
Published in
15 min readOct 6, 2019

--

As a product designer in an AI-based startup, it constantly gives me chills knowing about the fact that I made into this start-up without learning enough about the artificial intelligence world unless my naïve UX/UI skills have got me to some stage but in the long run, I had it in my head that I will deal with some serious challenges until this ai based chatbot came into the actual plot.

My Motivation — Using chatbot applications has become non-negotiable. It is a matter of survival, as it is critical to have an external, customer-facing chatbot along with an internal one to serve employees. They have grown into the key operator of digital transformation results. Chatbot ideas contribute to an enjoyable experience of all these qualities into the conversation, making conversation experience easier and convenient for businesses.

Two of the most typical benefits of artificial intelligence and machine learning are chatbots and image recognition (Computer Vision ).

What are Chatbots?

A chatbot is typically an AI (Artificial Intelligence) computer program that can act out a conversation through auditory or textual methods. We design chatbots to comprehend a conclusive human response while behaving like a human conversational partner. Despite being designed for human consumption, chatbots can further communicate and gather information from other chatbots.

Types of Chatbots

There are three types of chatbots

Diagram captured from Chatbot Magazine
  1. Menu-based Chatbots
  2. Keyword-based Chatbots
  3. Contextual Chatbots

The choice of chatbots depends on two criteria:

  1. Target audience and the help they are hoping from the chatbot.
  2. Whether the context of the chat will alter the service or not.

The chatbot I was looking at, was Contextual Chatbot as the vital demand was an Open-Ended Experience required for our bot to learn more through every conversation it had with the user and the best way out for this was through Natural Language Processing (NLP ).

Contextual Chatbots?

Mitsuku, a record-breaking five-time winner of the Loebner Prize Turing Test, is the world’s best conversational chatbot.

While the world debates about contextual chatbots and clicks bots, As a product designer, I only focused on business requirements and my target audience that will fuel the overall usability of the application.

Contextual Chatbots are the most advanced form of the chatbots which run on machine learning and artificial intelligence to record and remember conversations with specified users.

One can decide on the maturity level of the chatbot to understand the depth of conversation a user can have with the bot.

A Technical Perspective for Interaction Designers — The Contextual Chatbot Architecture

A clear pictorial representation of flow between AI, ML and NLP from one of the SAP Blog.

Before I gave my final call to start the design thinking process, I gave a sneak peek on how the entire show works back there and I ended up with a whole new direction to look at it.

A Simple Representation of Conversational Chatbot Work Flow

Is this required? — Yes, because if you design running the architecture in the head, there are great chances you will not compromise any AI feature with your user interaction. Hence, I leave it to you as an option to skip the entire section and jump to the design process.

Typically, the architecture will help us understand how the learning will happen through the interface we will be designing.

Based on the chatbot we build, it may or may not save the conversation history. Hence, for narrow domains, a pattern matching architecture fits in well but in broader domains where we have multiple services, state-of-the-art neural network architectures such as Long Short-Term Memory (LSTMs) and reinforcement learning agents are the best option.

The key components of the chatbot architecture are :

Environment — The core component where the NLP and context interpretation happens.

NLP Engine contains the advanced machine learning algorithms to identify the user’s intent and matches to the list of the intents (the intentions of the end-user, these intentions or intents are conveyed by the user to your bot) supported by the bot by converting whatever the user says into a structured input.

The NLP Engine has two major components:

  1. Intent Classifier — This helps the engine to understand the user’s intents which the input from the user to further match with the intensity that the bot supports.
  2. Entity Extractor — This is a trained model that will extract the key information from the user’s input query.

Want to learn more about deciding intents and extractors?

Agent for Dialog Management manages the actual context of the dialogue. We want our model to be context-aware and look back into conversational history to predict the next action. For example, the user says ‘order a double cheese pizza’, the bot takes the action according to the input, the user then adds ‘ add two comes to the order and replace it with margarita pizza ’. Now, this scenario will call the requirement for the chatbot to remember what the user said previously. The dialog management agent will enable our bot to do this.

The dialog management has two plugins:

  1. Feedback Mechanism — The agent takes the user feedback from time to time to check if the bot is doing fine with the conversation, and it satisfies the user with the bot’s response. This will help the bot learn from the mistakes and improvise for future conversations.
  2. Policy Learning — This will enable the chatbot to take the happy path (which I will design as an Interaction designer) during the conversation that will meet the overall end-user satisfaction by creating a network of happy paths and routes the conversation.

Question and Answer System — The component that handles the frequently asked a question by the user.

Manual Training contains the list of frequently asked queries by the user entered manually by the interaction expert and maps them with the answers for the chatbot.

Automated Training involves the submission of the company’s policy documents and all kinds of the QA type documents to train the bot so it can answer all the user queries with confidence.

Plugins — The component that offers intelligent automation for chatbots used for internal company use like HR management.

Traffic Server — The component handles all the traffic requests from users and routes them to the components and comes back with the correct response to the end-user.

Front-End System — The front face of the chatbot interaction, which will take down all the client input queries.

What have these anyway got to do with UX?

Seriously, why do we need to bother about the architecture while we designers are only concerned about the front face? — Well to answer that, let’s look at how these soldiers will boost the chatbot we will design. Read this — everything is linked

  1. The NLP will measure customer sentiment and will handle the negative bias.
  2. The next best action of the Dialog Manager will enhance the user’s journey every time he gets back to interact with the chatbot.
Text segmentation in NLP.

3. The Segmentation will do a promising classification based on the real-time data sets from the user input queries that will add up to conclude the bot with the next best action.

4. The Machine Learning Algorithm will create the most impactful actions by the chatbots that will enhance the overall platform usability.

The Design Thinking Process for Contextual Chatbots

My Design Inspiration — The more data our chatbot can collect in case of contextual interaction and send it to a well-structured database, the more our NLP and ML get fueled up to generate a revolutionary AI Experience. Hence, we need to design a visual courier of inputs and outputs in the form of conversational messages, which we define as the chatbot.

Connecting the dots of the design thinking process for contextual Chatbots with my defined steps.

We can design a chatbot either from scratch or within the constraints of the existing platform. In my case, it was a complete scratch work, which I will talk in my next article :). I am briefing down the basic concepts that every bot designer can follow up. Before we go deep down into the process, I want you to think more of it as a movie and I will walk you through each step which will include the direction and crafting of the movie. So Action!

1. Scope and Requirements — Decide what your movie is all about

Try to ask why you need a chatbot and if so, then which category do you need your platform?

  1. Know what the business is asking from your chatbot.
  2. Be very specific about what the chatbot can offer
  3. Understand the limitations and opportunities of the platform which will be the home for your chatbot.
  4. Know that contextual chatbots are not potential enough to handle every potential customer interaction. Hence, list down specific sets of use cases first.
  5. Answer to the Questions, Is it going to be the first touch of new user landing in your platform? Is it better suited for every onboarding user to respond to common support queries?
  6. Research more about the use cases by interviewing the expected end-users for the platform. We can do a rapid interview using contextual inquiry to understand real-time conversations between the bot and the user.

2. Identifying Inputs — Have all the tools ready to start your movie

We must identify all the inputs for the chatbot. Before that, we need to focus on the following parameters :

  1. Conversation Flow.
  2. Add proper intents.
  3. Enrich the chatbot’s knowledge base.

All of this can be done either live or after the conversation with the chatbot through a method called Supervised Learning. The various practices of supervised learning are :

  1. Live coaching — When the bot is not confident enough, or it does not recognize any human intent. Our baby AI can learn with the help of the human who can direct them the right intents during the initial conversation.
  2. Daily training — Every day the user goes through all the conversations and accepts or rejects the intent qualified by the bot.
  3. Weekly Improvement — Every week, the team can gather and add new features to the bot by studying the unexpected user behaviors that the bot needs to adapt to.

A chatbot can communicate through three primary gateways.

  1. user (human intervention — a classic example of supervised learning) — It could be any kind of query in the form of text or voice.
  2. device — there could be chances of sensors injected in the device.
  3. Automation intelligence system- any data from the user’s history or pre-fetched API data sets.

3. Experience Mapping — Know your characters and their behavior for the movie.

Understand the users first and now craft a Compatible Chatbot

An Important Read —

Having clarity about every use-case is one of the simplest practices a chatbot creator must undertake to avoid deeper problems later. We create experiences mapping to understand the following parameters:

  1. Notice the similar customer inquiries or needs that occur frequently
  2. What is the limited range of potential outcomes for the user’s requirements? How fast can the user enjoy the rapid response, which is typically short transactional conversations?
  3. To realize what value of a chatbot will bring to the end-user so we can reference it throughout the design process.
There are several ways of understanding Customer Journey through the platform that will surround the script we will write for the chatbot conversation with the user.

There are several tools for user journey mapping.

I recommend using xmind for level 1 brainstorming

Another Interesting Read

4. Build Conversation and Intelligence — Start scripting for the movie

This is the most crucial step out of all being listed down here. We could further divide the steps into:

Understand chatbot UI Elements — Before writing the entire script for the chatbot, one needs to find out all the chatbot UI elements. There are several platforms like Facebook, Telegram which can help you with the chatbot templates and UI components for building out a classic chat experience.

Links for the Chatbot UI elements and templates :

Build a Chatbot Character — A chatbot is nothing but sheer imagination of your platform who will do the most crucial job of collecting the user’s intent. One needs to understand the customer’s personas and craft a compatible chatbot counterpart to keep the users engaged with them. Select a tone for the chatbot and build the whole persona around it as a personality is not only a way to engage the users and create empathy but it is also an easy way to reduce the number of topics and words that will be used in the interaction. For example, Should users perceive your chatbot as female or male? Is the chatbot young or old? Is it casual and friendly with lots of emojis or formal and polite? Do your chatbot answer almost curt responses or does it compose lengthier sentences?

Set up the dialog flow — One needs to keep the following pointers in the head before starting to write the conversation script between a bot and the user.

An example of Chatbot Conversation Flow Scripting.
  1. User Requirements — List down all the user’s requirements and stick the conversation around those pointers only.
  2. Dead End — Prevent the user to get stuck in the dead-end of the conversation.
Avoid repetition.
  1. Linguistic Repertoire — People are neurologically hard-wired for the rapid onset of boredom when repeatedly exposed to the same stimulus, hence, avoid the linguistic repertoire to keep the customers engaged.
  2. Conversation Continuity — When setting up the script, think about the fact that every question comes from something and should lead to something. A farfetched continuity will set apart your chatbot from others.
  3. Follow one with the next — Provide quality, control, and create a natural dialogue. For eg: If you start with an answer a question, ensure that each answer is succinct, complete and leads to appropriate next question. Hence, determining the next question is the real trick to keep the users engaged and helps them to move forward through the content easily.
  4. Divide Conversation Categories — Divide your conversation script into two categories — Don’t know categories (one which can be mapped to various possibilities and analyzing all of them is not possible) and known category (the sure-shot flow for the conversation where one knows the possible definite options )
  5. Create Happy Path — Visually map the conversational paths that are available and select all your happy path.

I used a tool called Botsociety to test and create my conversation flows for the chatbot.

Final Step! The visual design for a chatbot —

The Entry — Everything has a beginning, a middle and an end.

A facebook messenger chatbot.
  • Ensure that you are providing a great first message which tells the following about the bot to the users — who you are?, How the chat solution can uniquely help them? What can they do with this chat?
  • make them familiar with the key expectations or the key offerings
  • give users hints about future conversation building.
  • When users first come to chat with a bot, they can ask anything they want. However, this can cause problems in advancing a dialog using predetermined responses. Hence, the users should lead to a closed intent conversation rather than open-ended questions, which will allow the user to respond in different ways. For eg: add buttons offering specific targets to avoid dead-end conversations.

Interesting Read

The Midway Conversation

Dramatic Pause Effects by the Chatbot
  • Tackle Missing Inputs — Chatbot technology is not well enough capable of understanding every user’s responsibility to reply meaningfully. Hence, create fall back scenarios. It could also apply the same to handle small talks by the user by providing non-repetitive fail messages and guiding the user back to the existing flow.
  • Bot Intelligence — Use the chatbot interaction to recommend, suggest and analyze the user’s context, motives, and expectations.
  • Maintain Record — Keep track of the user’s previous interactions, their choices, queries, messages, and demographics.
  • Avoid Long Chats — Visually access the conversational flows to judge whether the users are going through too many conversations through a chat testing platform.
  • The Old Way of Typing — It’s always about “how you say it”. Hence the fonts, legibility, formatting, line spacing which we usually follow in our ancient typing traditions must be followed as an important aspect for bot’s conversation scripts as they will convey some meaning to the recipient and will be simultaneously perceived specifically.
  • Message Frequency — One needs to figure out how a chatbot responds. Does it respond immediately? If not, does it show it’s composing an answer? And how? Perhaps through visual design elements like “iOS dancing dots ”. Ideally, when does it need to break up its answer into multiple messages instead of one multi mega-reply.
  • Deadlock Situations — Handling impossible situations through an omnichannel approach by providing links to web-views in case of impossible interactions.
Omnichannel approach
OmniChannel representation for contextual chatbots
  • Zero Scrolling — Limit the length of the answers as people hate scrolling.
  • Unknown Symbols — No unknown symbols or accidental changes to your content when importing or exporting it.
  • Visibility of a Background Process — the more you tell your users about how you are providing them with a piece of information from a document or that your bot is connecting to a service, the more they empathize with your chatbot.
  • Acknowledgment and Natural Delay — A trick I prefer to use is to make the chatbot act as a person, would take a dramatic pause. No matter how quickly information is received or processed, a slight delay is natural in conversation and is less intimidating to the end-users.
  • Ask followup questions — If the user poses a question that your bot can’t identify, define how your bot should follow up. Asking the user to rephrase the question once can help to match and If the bot isn’t able to match the question, provide topics that fall within the context of your users’ queries or to point them to an external source containing the information they are looking for.

The Exit — A Graceful approach to leave a good impression on the customer.

  • Feedback — Ask only one feedback question and make it count.
  • Graceful Exit — Represent a genuine and polite exit from the chat window as that can impact the user gratefully.
  • Negative Feedback — Provide new information or external links in case of negative feedback.

A final check if everything is within constraints can be checked by doing a heuristic evaluation on the chatbot.

5. Usability Testing Of Chatbots — So how will the movie do finally ?!

Too l I used for final chatbot testing and analysis.

Get Screen Recording of a user’s interaction and analyze

Test on different platforms — Mobile and web application.

You are finally ready to go out and design your chatbot now.

This article is completely open to more edits and suggestions. In case, I left any point or you wanted to know more ! Give a heads up :)

Disclaimer: This disclaimer informs readers that the views, thoughts, and opinions expressed in the text belong solely to the author, and not necessarily to the author’s employer, organization, committee or other group or individual.

--

--