Photo by 丁亦然 on Unsplash

Rasa-X Is A Unique Approach To Continuous Chatbot Improvement

And Why Conversation Driven Development Is The Future

Cobus Greyling
7 min readAug 13, 2020

--

Introduction

When it comes to chatbot improvement, three elements are paramount:

  • Continuous
  • Incremental
  • Contextual

Most NLU environments have existing tools for conversational improvement. These tools are often characterized by by these traits:

  • High level
  • Statistical Approach
  • Bulk
  • Metrics Focused
  • Hard To Steer

Why This Often Fails: Users Want To Follow The Desire Path

We talk about the happy path, and the repair path. The main aim of the repair path, is to bring the user back to the so-called happy path.

But, should we not rather look at renaming it? Is the happy path not the designed path…and the repair path the desire path of the user?

Design versus Desire

Desire Path

The desire path usually represents the shortest or most easily navigated route between an point of departure and a destination. In parks and open areas, the width and severity of erosion are often indicators of the traffic level that a path receives.

Desire paths emerge as shortcuts where constructed or designed paths take a circuitous route, have gaps, or are sometimes non-existent.

Back to chatobots, instead of forcing our users onto the conversations we designed for them, why not learn what their desired path is implement their preferences?

Left: Desire Path | Right: Designed Path

Accommodation

Landscapers sometimes accommodate desire paths by paving them, thereby integrating them into the official path network rather than blocking them. The image above is of an desire path being blocked and rehabilitated in an attempt to force users on the designed path.

Sometimes, land planners have deliberately left land fully or partially unpathed, waiting to see what desire paths are created, and then paving those.

In Finland, planners are known to visit parks immediately after the first snowfall, when the existing paths are not visible.

The naturally chosen desire paths, marked by footprints, can then be used to guide the routing of new purpose-built paths.

Elements OF A Conversational Approach

From Designed Paths To Accommodation

Rasa took a completely alternative approach compared to other chatbot frameworks. By introducing something they call Conversation-Driven Development (CDD). This approach is encompassed in their Rasa-X environment.

Their approach is novel yet effective.

With Rasa-X, what drives improvement is real conversation. And by studying real user conversations the delta between real conversations (desire) and anticipated (designed) conversations are narrowed.

The whole process is very efficient due to a closed loop from review, to annotating to even doing NLU “development”. As you will see later in this story.

The process is simplified and turned into an administrative task.

Communication between teams and translation of tasks are negated.

Sharing Your Bot

The notion in Rasa-X to create a URL through which you can create a preview for users, reminds very much of feature IBM Watson.

IBM Watson Assistant Preview Link

What this does, is create an avenue to quickly and efficiently share your bot in a way which can be revoked again just as easily. All the while creating user conversations to analyse.

NLU Inbox: Turn NLU Training Into An Administrative Task

Utterances from users which are not part of your training data shows up in your NLU Inbox. These utterances can annotated and classified within the web tool.

Rasa X Overview: Installation & Functionality

Installation

Most probably you want to install Rasa X on your Windows 10 machine to play around with. I would suggestion you first install the Rasa chatbot software.

Installing Rasa X will be really be an extension of your Rasa chatbot. To install Rasa X, open Anaconda Prompt window. Activate your virtual environment and run the command:

pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple

Once you have successfully installed Rasa X, run the command:

rasa x

In your Anaconda window you will see the url where Rasa X is running. Simple open it in your browser.

Rasa X Successfully Started

The user name and password can be found in the initialization string within the anaconda terminal.

Start Talking To Your Bot

Before you can start talking with your bot, you will have to train your first model:

rasa train

And start your bot:

rasa shell

Interactive Learning

You have the ability to talk to your bot and make use of interactive learning while in a conversation. This bridges the gap between practical experience and training data.

Interactive Learning Chat Window

NLU Inbox

When users talk to your assistant — via a messaging channel, the Share your bot feature, or through the Talk to your bot screen — their messages are funneled into the NLU inbox. When you have unprocessed messages in the Inbox, you’ll now see an indicator in the sidebar, alerting you that messages are ready to be reviewed.

List of Functionality Within Rasa X

The NLU model can be trained from the console, with a list of all models available and an indicator which one is currently in production. Switching between models are easy. This is very convenient should you want to roll back to the last model; or even a few models back.

Your Pipeline configuration file is available via the console, with stories and responses.

Creating Intents & Compound Entities

Lastly I would like to spend some time on this one feature of Rasa X; managing and creating intents and entities. I see this as a sign that Rasa X will most probably evolve into a full-blown Graphic development tool.

But with a difference…

Most other GUI’s have their focus on the dialog flow, call flow, state machine, conversation state management…call it what you like. Products that come to mind here are:

  • Microsoft Composer
  • Watson Assistant
  • Microsoft Power Virtual Agents
  • etc.

It is design driven development of the chatbot. Or dialog driven development. The notion of, the more we improve the conversational design the better our chatbot will improve.

Rasa is unique in the sense that they approach this problem from a conversational perspective. Something they refer to as Conversational-Driven Development.

The focus is on improving the Conversational Experience by focusing on:

  • Chatting with your own chatbot and correcting it on the fly (interactive learning).
  • Studying how your users interact with the chatbot.

The reason I say Rasa X is an excellent development tool, is illustrated by their intent and entity management.

Let’s look at a practical example; within Rasa X you can create a new intent for your chatbot.

Create a New Intent

We are naming our new intent:

travel_detail

Once defined, we need to give example utterances for this intent. fifteen to twenty examples are good. We start with the example:

I want to travel from Berlin to Stuttgart by train tomorrow.

We can save the example, and add more examples.

Example Utterance for Intent: travel_detail

The challenge is that within this intent there multiple entities we would like to capture. These entities can be fined graphically within Rasa X, and also contextually.

Intents can be seen as verbs and entities as nouns. The phrase slot filling also refers to capturing entities.

Contextually means that entities are not recognized by the chatbot by asking the user directly for the input, or found via a finite lookup list. But rather entities are detected based on their context within the utterance or sentence.

This is closer aligned with how we as humans detect entities in a conversation.

The word “Berlin” is selected and tagged as Entity type “from_city”

The word Berlin can be highlighted, and very intuitively a popup prompts us to define an Entity type or synonym. For now we are focusing on the Entity type.

We have two cities in the sentence, one the point of departure. The other the destination.

Hence to entity types. In this context, we mark Berlin as an entity type from_city.

Continuing of Entity Annotation

The other entities we are interested in, we mark in the sentence.

Creating Entity Names or Types

Each of the marked portions in the sentence we assign to an entity name we created. The different entities are conveniently marked in the sentence with different colors.

The list of entities are:

date_time
travel_mode
from_city
to_city

Adding more intent examples are easy an the process of becomes almost an administrative task. Below you can see from the color coding which entities are of the same type.

Adding a Second Intent Example

Conclusion

The challenge that an unstructured input environment like chabots pose is that you cannot anticipate every possible variation of user input.

However, user input is a good indicator of what is on the mind of users. And making use of those conversations, following conversation driven development, leads to quicker iterations and rapid improvements.

Read More Here…

--

--

Cobus Greyling

I explore and write about all things at the intersection of AI & language; LLMs/NLP/NLU, Chat/Voicebots, CCAI. www.cobusgreyling.com