Rasa-X Is A Unique Approach To Continuous Chatbot Improvement
And Why Conversation Driven Development Is The Future
When it comes to chatbot improvement, three elements are paramount:
Most NLU environments have existing tools for conversational improvement. These tools are often characterized by by these traits:
- High level
- Statistical Approach
- 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?
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?
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.
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
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:
In your Anaconda window you will see the url where Rasa X is running. Simple open it in your browser.
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:
And start your bot:
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.
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.
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
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.
We are naming our new intent:
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.
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 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.
The other entities we are interested in, we mark in the sentence.
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:
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.
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.