Frameworks and Tools

Open-Source Chatbot Development with Rasa

Rasa is an open-source chatbot development platform that aims to “make applied research accessible to all developers.” Here's a closer look at its framework, main features, and usability aspects.

By Paul Anton
May 21, 2020

Open-source tools and libraries are conquering the world of software development, in both artificial intelligence (AI) and non-AI application scenarios. Their increased availability makes them a popular choice for developers and enterprises alike. The same holds true for chatbot development—more and more open-source frameworks are becoming available to chatbot developers.

Rasa is an open-source chatbot development platform that aims to “make applied research accessible to all developers.” It comes with different pricing plans, suitable for different needs. It accommodates both the starting developer and the advanced enterprise solution.

Let’s take a closer look at the Rasa framework, its main features, and usability aspects.

The Rasa stack

The Rasa stack comes in three flavors, ranging from fully open source to paid enterprise subscriptions.

Rasa Open Source provides the basic functionality needed for chatbot development—a set of open-source libraries and tools for training, deploying, and integrating conversational agents.

Rasa X is a set of closed source but freely available tools. They offer chatbot developers a way to share assistants with real users and integrate actual user interactions for fine-tuning their conversation models.

Rasa Enterprise provides additional functionality, such as analytics and expert support for advanced model management across different production environments.

Such an ecosystem is advantageous for both chatbot developers and the company behind the stack. The free tools allow anyone interested in prototyping their own conversational agents to do so without any up-front investment (and without the stress of limited free trials). Once advanced functionality is needed, support from Rasa engineers is available, according to custom-made subscription plans.

This allows them to further invest in the development of the ecosystem and tools, with the voluntary contribution of the community. It’s a win-win situation, and the conversational agents are only becoming better in the process! Let us take a closer look at the main components and features of the Rasa stack.

Features and components

Rasa NLU is the component responsible for turning unstructured user input into structured data. It provides customizable pipelines for tackling entity extraction and intent classification, which are crucial NLU tasks for understanding human language.

Under the hood, the NLU pipelines are sequences of models responsible for different text processing tasks. Tokenization, feature extraction, and entity recognition models are all jointly trained in order to classify intent and extract relevant entities in the user’s response. Naturally, the pipelines are customizable and can be adjusted to fit the particular needs of the target domain.

The intents and entities identified by the NLU model can be later used for the modeling of the dialogue response or can be stored for further reference in the conversation.

Rasa Core is the component responsible for dialogue management (i.e., deciding what action the chatbot should do next). It can handle complex interactions, and it integrates contextual information in the response selection.

Under the hood, the Core model uses so-called policies for making dialogue predictions. The policies correspond to out-of-the-box neural architectures trained to learn different kinds of conversational patterns. Basic policies are tuned for simple dialogue management tasks (e.g., match an exact conversation pattern), while more advanced ones are built to tackle nonlinear situations (e.g., when users shortly change the topic of a conversation).

Since the policies are customizable (own models can also be brought in), the chatbot developer has complete leverage over how the dialogue is managed. Find more details about the latest policy on the Rasa blog.

Rasa X is the component of the Rasa stack that allows chatbot developers to easily deploy their bot and to collect interactions with real users. It consists of a web-based chat interface and a dashboard for the management and labeling of real user conversations.

The deployment of the chatbot can be done on either a proprietary server or in the cloud (Google Cloud and AWS instances, for example), as long as the hardware and OS requirements are satisfied. Once the assistant is connected to Rasa X, both technical and nontechnical users can interact with the chatbot over the web (and generate more training data). The retraining of the model using the new data happens while the assistant is in production. This is a nice example of how continuous integration and online learning can contribute to the improvement of the conversational agent.

Lastly, Rasa supports a variety of channels and integrations with existing apps and services. Bots can be deployed onto messaging platforms or websites, and the setup only takes a few configuration steps. The current list of apps and services is supported at the time of writing this article:

Your Own Website
Facebook Messenger
Slack
Telegram
Twilio
Microsoft Bot Framework
Cisco Webex Teams
Rocket.Chat
Mattermost
Google Hangouts Chat
Custom Connectors

Usability and getting started

Following is a list of aspects characterizing the Rasa ecosystem and the open-source tools it provides. Both experienced and inexperienced chatbot developers may find some of the following aspects relevant to their scenario.

Rasa is backed by a vibrant and active community. Like most open-source tools, the benefits of an active community can be quickly quantified: Discussion forums, GitHub repositories, and sample architectures are all publicly available. This makes it easy for starting developers to get some inspiration and start building their own chatbot. Experienced developers may find some architectural details interesting and could contribute to the further development of the models.

The conversational agents are powered by machine learning. The various architectures are made available by the Rasa research team. The language models presented in the Rasa research section used to be available to those with dedicated research teams. By making such architectures available to chatbot developers, anyone can develop contextual agents using state-of-the-art architectures.

The tools are highly customizable. Both the pipelines behind the NLU models and the policies behind the Core dialogue management systems are configurable. They can either be used with their default settings (which works for the basic cases), or they can be customized according to each developer’s needs. The possibility to retrain from scratch on domain-specific vocabulary makes the framework usable in any field.

Python for the win! Since Python is the go-to language for building artificial intelligence (AI) and machine learning models, one can simply use existing knowledge when working with Rasa. This also means that Rasa works seamlessly with various Python libraries. Its plug-and-play architecture makes it easy to integrate models from different popular libraries, such as scikit-learn, Keras, or PyTorch.

The tools allow learning chatbot development in a top-down approach. Chatbot developers have the opportunity to build conversational AI agents using state-of-the-art architectures, without going into too many details. However, when curiosity strikes, the open source nature of the framework makes it possible to dig deeper and learn about the various architectural components that are being used behind the scenes.

Conclusion

Rasa is an open-source alternative for chatbot development. The ecosystem is built to make language processing architectures available beyond the world of machine learning research.

Rasa chatbots are trained on the idea of interactive learning, which has clear advantages over classical hard-coded dialogue systems or reinforcement learning approaches. The former is only suitable for basic use cases and can easily explode in more complex interaction scenarios. The latter suffers from the well-known “cold-start problem.” Interactive learning, on the other hand, relies on user feedback to improve the model accuracy and response quality.

Its different components fit the needs of bot developers, data science teams, and nontechnical organizations alike. Existing projects on the Rasa forums and the Rasa Community Showcase are great places to get some inspiration and get started!

*Featured image via Rasa.com.

Leave a Reply

Your email address will not be published. Required fields are marked *