Reader small image

You're reading from  Conversational AI with Rasa

Product typeBook
Published inOct 2021
PublisherPackt
ISBN-139781801077057
Edition1st Edition
Tools
Right arrow
Authors (2):
Xiaoquan Kong
Xiaoquan Kong
author image
Xiaoquan Kong

Xiaoquan is a machine learning expert specializing in NLP applications. He has extensive experience in leading teams to build NLP platforms in several Fortune Global 500 companies. He is a Google developer expert in Machine Learning and has been actively involved in contributions to TensorFlow for many years. He also has actively contributed to the development of the Rasa framework since the early stage and became a Rasa Superhero in 2018. He manages the Rasa Chinese community and has also participated in the Chinese localization of TensorFlow documents as a technical reviewer.
Read more about Xiaoquan Kong

Guan Wang
Guan Wang
author image
Guan Wang

Guan is currently working on Al applications and research for the insurance industry. Prior to that, he was a machine learning researcher at several industry Al labs. He was raised and educated in Mainland China, lived in Hong Kong for 10 years before relocating to Singapore in 2020. Guan holds BSc degrees in Physics and Computer Science from Peking University, and an MPhil degree in Physics from HKUST. Guan is an active tech blogger and community contributor to open source projects including Rasa, receiving more than10,000 stars for his own projects on Github.
Read more about Guan Wang

View More author details
Right arrow

Chapter 9: Testing and Production Deployment

In this chapter, we will introduce how to test Rasa projects. We will then discuss how to verify NLU data and stories, as well as how to evaluate the performance of NLU models and Dialogue management models. Through testing, we can find errors in projects as early as possible. We can also comprehensively evaluate the performance of bots.

Moving on, we will discuss how to deploy Rasa applications in production environments. We will discuss the choice of deployment methods, model storage, tracker stores, and locker stores. By properly deploying Rasa applications, we can implement model version management, load balancing, service expansion, and other functions in production environments.

We will cover the following topics:

  • Testing Rasa projects
  • Deploying your Rasa assistant to production

Let's talk about validation and evaluation first, because they are executed before deployment in the software development process...

Testing Rasa projects

In this section, we will start by discussing how to validate data and stories. This step is used to find obvious bugs. Later, we will discuss how to evaluate NLU performance and how to read the corresponding reports. Finally, we will introduce the test story format and learn how to use test stories to evaluate the performance of Dialogue management.

Validating data and stories

If developers can quickly detect whether there are errors and where these potential errors are in NLU data and stories, this can help developers greatly improve work efficiency. In Rasa, there is a command for this purpose:

rasa data validate

The preceding command will detect errors in the data and configuration. Common errors include the following:

  • Inconsistency of the training data (the same training data appearing in two or more different intents)
  • The intents in the training data being inconsistent with the intents in the domain file (fewer or more intents)
  • ...

Deploying your Rasa assistant to production

Here we introduce how to deploy your Rasa assistant to production.

When to deploy

It is common to use the minimum viable product or MVP strategy during the product development process. MVP is all about building a usable product prototype that fulfills the key requirements in the most efficient and simple way and then iterating to fine-tune the product details.

In Rasa, the official recommendation is that a product can be put into production as an MVP as soon as it can handle the most important (but not every) "happy path" of Dialogue. It's recommended to use Rasa X to have early users test the product prototype. This is in order to continuously improve the model until the product prototype reaches the MVP standard and you are ready to deploy it to a production environment.

Deployment options

When we want to deploy a Rasa assistant on a large scale, we normally use solutions based on Kubernetes or OpenShift. Rasa...

Summary

In this chapter, we discussed two very important stages in the development of a Dialogue system: testing and deployment. Testing is very important for us to ensure the intelligence of a Dialogue system. We must find the current problems of the Dialogue system through testing and correct these problems. We also discussed how to deploy Rasa projects to production environments. A real large-scale Dialogue system needs to be accessed by tens of thousands or even millions of users at the same time. Such a Dialogue system must have very good horizontal scalability. Fortunately, Rasa considered these issues at the beginning of the design and provided corresponding solutions. By using a central storage system, tracker store, and lock store, we are able to extend our service smoothly.

In the next chapter, we will discuss a user-centered methodology and the tools required for developing Dialogue systems.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Conversational AI with Rasa
Published in: Oct 2021Publisher: PacktISBN-13: 9781801077057
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Xiaoquan Kong

Xiaoquan is a machine learning expert specializing in NLP applications. He has extensive experience in leading teams to build NLP platforms in several Fortune Global 500 companies. He is a Google developer expert in Machine Learning and has been actively involved in contributions to TensorFlow for many years. He also has actively contributed to the development of the Rasa framework since the early stage and became a Rasa Superhero in 2018. He manages the Rasa Chinese community and has also participated in the Chinese localization of TensorFlow documents as a technical reviewer.
Read more about Xiaoquan Kong

author image
Guan Wang

Guan is currently working on Al applications and research for the insurance industry. Prior to that, he was a machine learning researcher at several industry Al labs. He was raised and educated in Mainland China, lived in Hong Kong for 10 years before relocating to Singapore in 2020. Guan holds BSc degrees in Physics and Computer Science from Peking University, and an MPhil degree in Physics from HKUST. Guan is an active tech blogger and community contributor to open source projects including Rasa, receiving more than10,000 stars for his own projects on Github.
Read more about Guan Wang