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

Preface

The Rasa framework enables developers to create industrial-strength chatbots using state-of-the-art natural language processing (NLP) and machine learning technologies quickly, all in open source.

Conversational AI with Rasa starts by showing you how the two main components at the heart of Rasa work – Rasa NLU and Rasa Core. You’ll then learn how to build, configure, train, and serve different types of chatbots from scratch by using the Rasa ecosystem. As you advance, you’ll use form-based dialogue management, work with the response selector for chitchat and FAQ-like dialogues, make use of knowledge base actions to answer questions for dynamic queries, and more. Furthermore, you’ll understand how to customize the Rasa framework, use conversation-driven development patterns and tools to develop chatbots, explore what your bot can do, and easily fix any mistakes it makes by using interactive learning. Finally, you’ll get to grips with deploying the Rasa system to a production environment with high performance and high scalability and cover best practices for building an efficient and robust chat system.

By the end of this book, you’ll be able to build and deploy your own chatbots using Rasa, addressing the common pain points encountered in the chatbot life cycle.

Who this book is for

This book is for NLP professionals and machine learning and deep learning practitioners who have knowledge of NLP and want to build chatbots with Rasa. Anyone with beginner-level knowledge of NLP and deep learning will be able to get the most out of the book.

What this book covers

Chapter 1, Introduction to Chatbots and the Rasa Framework, introduces all the fundamental knowledge pertaining to chatbots and the Rasa framework, including machine learning, NLP, chatbots, and Rasa Basic.

Chapter 2, Natural Language Understanding in Rasa, covers Rasa NLU’s architecture, configuration methods, and how to train and infer.

Chapter 3, Rasa Core, introduces how to implement dialogue management in Rasa.

Chapter 4, Handling Business Logic, explains how Rasa gives developers great flexibility in handling different business logic. This chapter introduces how we can use these features to handle complex business logic more elegantly and efficiently.

Chapter 5, Working with Response Selector to Handle Chitchat and FAQs, explains how to define questions and their corresponding answers and how to configure Rasa to automatically identify the query and give the corresponding answer.

Chapter 6, Knowledge Base Actions to Handle Question Answering, describes how to create a knowledge base that will be used to answer questions. You will also learn to customize knowledge base actions, learn how referential resolution (mapping mention to object) works, and how to create your own knowledge base.

Chapter 7, Entity Roles and Groups for Complex Named Entity Recognition, explains how entity roles and entity groups solve the complex NER problem, and how to define training data, configure pipelines, and write stories for entity roles and entity groups.

Chapter 8, Working Principles and Customization of Rasa, introduces the working principles behind Rasa and how we can extend and customize Rasa.

Chapter 9, Testing and Production Deployment, explains how to test Rasa applications and how to deploy Rasa applications in production environments.

Chapter 10, Conversation-Driven Development and Interactive Learning, introduces conversation-driven development and Rasa X to develop chatbots more effectively. We will also introduce how to use interactive learning to quickly find and fix problems.

Chapter 11, Debugging, Optimization, and Community Ecosystem, explains how to debug and optimize Rasa applications. We will also introduce some tools to help developers build chatbots effectively.

To get the most out of this book

You will need a version of Rasa 2.x installed on your computer—the latest version if possible. All code examples have been tested using Rasa 2.8.1 on Ubuntu 20.04 LTS. However, they should work with future version releases, too.

You should install Rasa with the following command: pip install rasa[transformers]. This command will install the transformers library, which provides the components we need in the code.

You will also need to install the pyowm Python package to run the code present in Chapter 4, Handling Business Logic. You will also need to install Docker and the neo4j Python package 4.1 to run the code of the custom knowledge base part in Chapter 6, Knowledge Base Actions to Handle Question Answering.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section).

The versions of Rasa change quickly, and the related knowledge base and documents are also rapidly updated. We recommend that you frequently read Rasa’s documentation to understand the changes.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Conversational-AI-with-RASA. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801077057_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The following example demonstrates post-mortem debugging using the pdb command."

A block of code is set as follows:

version: "2.0"
language: en
pipeline:
  - name: WhitespaceTokenizer
  - name: LanguageModelFeaturizer

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

WebChat.default.init({          selector: "#webchat",          initPayload: "Hello",

Any command-line input or output is written as follows:

python -m pdb -c continue <XXX>/rasa/__main__.py train

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: "Click on the Cancel button."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share your thoughts

Once you've read Conversational AI with Rasa, we'd love to hear your thoughts! Please https://packt.link/r/1801077053 for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

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