๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Conversational AI with Rasa: Build, test, and deploy AI-powered, enterprise-grade virtual assistants and chatbots

โœ Scribed by Xiaoquan Kong, Guan Wang


Publisher
Packt Publishing
Year
2021
Tongue
English
Leaves
264
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


Create next-level AI assistants and transform how customers communicate with businesses with the power of natural language understanding and dialogue management using Rasa

Key Features

  • Understand the architecture and put the underlying principles of the Rasa framework to practice
  • Learn how to quickly build different types of chatbots such as task-oriented, FAQ-like, and knowledge graph-based chatbots
  • Explore best practices for working with Rasa and its debugging and optimizing aspects

Book Description

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 (natural language understanding) 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 dialogs, make use of knowledge base actions to answer questions for dynamic queries, and much 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.

What you will learn

  • Use the response selector to handle chitchat and FAQs
  • Create custom actions using the Rasa SDK
  • Train Rasa to handle complex named entity recognition
  • Become skilled at building custom components in the Rasa framework
  • Validate and test dialogs end to end in Rasa
  • Develop and refine a chatbot system by using conversation-driven deployment processing
  • Use TensorBoard for tuning to find the best configuration options
  • Debug and optimize dialogue systems based on Rasa

Who this book is for

This book is for NLP professionals as well as machine learning and deep learning practitioners who have knowledge of natural language processing 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.

Table of Contents

  1. Introduction to Chatbots and the Rasa Framework
  2. Natural Language Understanding in Rasa
  3. Rasa Core
  4. Handling Business Logic
  5. Working with Response Selector to Handle chitchat and FAQs
  6. Knowledge Base Actions to Handle Question Answering
  7. Entity Roles and Groups for Complex Named Entity Recognition
  8. Customization of Rasa
  9. Testing and Production Deployment
  10. Conversation-Driven Development and Interactive Learning
  11. Debugging, Optimization, and the Community Ecosystem

โœฆ Table of Contents


Cover
Title Page
Copyright and Credits
Dedication
Foreword
Contributors
Table of Contents
Preface
Section 1: The Rasa Framework
Chapter 1: Introduction to Chatbots and the Rasa Framework
Technical requirements
What is ML?
Supervised learning (SL)
Stages of machine learning
Performance metrics
Overfitting and underfitting
Transfer learning (TL)
Introduction to Natural Language Processing (NLP)
Evolution of modern NLP
Basic tasks of NLP
Chatbot basics
Is a chatbot really necessary?
Introduction to chatbot architecture
Introduction to the Rasa framework
Why Rasa?
System architecture
Installing Rasa
The pipeline of a Rasa project
Rasa command line
Creating a sample project
Summary
Further reading
Chapter 2: Natural Language Understanding in Rasa
Technical requirements
The format of NLU training data
The intent field โ€“ storing NLU samples
The synonym field โ€“ storing synonyms and aliases
The lookup field โ€“ providing extra features by using lookup tables
The regex field โ€“ providing extra features by using regular expressions
Using regex and lookup
Overview of Rasa NLU components
Language model components
Tokenizer components
Featurizer components
Entity extraction components
Intent classifier components
Handling frequently asked questions by using a response selector
Configuring your Rasa NLU via a pipeline
What is a pipeline?
Configuring a pipeline
The output of Rasa NLU
The intent field โ€“ the purpose of the user's utterance
The entities field โ€“ key parameters of user's utterance
Other possible fields
Training and running Rasa NLU
Training our models
Testing models from the command line
Starting the Rasa NLU service
Practice โ€“ building the NLU part of a medical bot
What are the features of our bot?
How can we implement our bot in Rasa?
Summary
Chapter 3: Rasa Core
Technical requirements
Understanding the universe of your bot (domain)
Intents and entities
Slots
All possible actions the bot can take (actions)
All the predefined replies to users (responses)
Configuring sessions
Training data for dialogue management (stories)
User messages
Bot actions and events
Auxiliary features (checkpoints and OR statements)
Data augmentation (creating longer stories automatically)
Reacting to user input (action)
Response actions
Form actions
Built-in actions
Custom actions
Understanding the memory of your bot (slots)
The influences of slots on the conversation
Slot types
Automatic slot filling
Setting initial values for slots
Understanding the decision-maker of your bot (policies)
Configuring policies
Built-in policies
Policy priority
Connecting with other services via endpoints
Building custom actions using Rasa SDK
Installing the Rasa SDK package
Writing custom actions
Tracker objects (tracking the states of conversations)
Event objects (records for changes in conversations)
Running custom actions
Using channels to communicate with instant messaging software
Building a tell-the-time bot
Defining the features that our bot should provide
How can we implement those features?
Training models, serving models, and making inferences
Summary
Section 2: Rasa in Action
Chapter 4: Handling Business Logic
Technical requirements
The fallback mechanism in Rasa
Handling fallback in NLU
Handling fallback in policy
Making intents trigger actions
Triggering actions by using built-in intents
Triggering actions by using custom intents
Using forms to complete tasks
Defining a form
Activating a form
Executing a form task
Practice โ€“ building a weather forecast chatbot
Designing the features of this bot
Implementing the bot step by step
Training models via the command line
Running the dialog system
Extending this project
Summary
Chapter 5: Working with ResponseSelector to Handle Chitchat and FAQs
Technical requirements
Defining retrieval intents โ€“ the questions users want to ask
Defining responses โ€“ the answers to the questions
Updating the configuration to use ResponseSelector
Learning by doing โ€“ building an FAQ bot
What are the features of our bot?
How can we implement it?
Summary
Chapter 6: Knowledge Base Actions to Handle Question Answering
Technical requirements
Why do we need knowledge base actions?
How do you use knowledge base actions?
Creating a knowledge base
Creating a custom knowledge base action
Defining NLU data and stories to perform queries from users
How do knowledge base actions work?
How do you customize knowledge base actions?
Modifying ActionQueryKnowledgeBase to customize the behavior
Customizing InMemoryKnowledgeBase
Building your own knowledge base
Learning by doing โ€“ building a knowledge-based music query chatbot
What are the features of our bot?
How do we implement the bot?
Supporting the Neo4j knowledge base
Summary
Chapter 7: Entity Roles and Groups for Complex Named Entity Recognition
Technical requirements
Why do we need entity roles and entity groups?
Using entity roles to distinguish semantics roles in entities of the same type
Using entity groups to divide entities into groups
Configuring Rasa to use entity roles and groups
Updating the entities setting for roles and groups
Updating forms and stories for roles and groups
Components supporting entity roles and entity groups
Learning by doing โ€“ building a ticket and drink booking bot
What are the features of our bot?
How can we implement it?
Summary
Chapter 8: Working Principles and Customization of Rasa
Understanding Rasa's NLU module
How does the NLU training work?
How does NLU inference work?
Understanding how Rasa policies work
Converting trackers to training data
How does policy training work?
How does policy inference work?
Writing Rasa extensions
Writing pipeline and policy extensions
Writing custom slot types
Writing extensions for other functionalities
Practice โ€“ Creating your own custom English tokenizer
Summary
Section 3: Best Practices
Chapter 9: Testing and Production Deployment
Testing Rasa projects
Validating data and stories
Evaluating the NLU performance
Evaluating Dialogueue management performance
Deploying your Rasa assistant to production
When to deploy
Deployment options
Model storage
Tracker stores
Lock stores
High-performance settings for Rasa servers and action servers
Summary
Chapter 10: Conversation-Driven Development and Interactive Learning
Introduction to CDD
Introduction to Rasa X
Installing Rasa X
Using Rasa X
Performing interactive learning
Saving the interactive learning data and exiting
Summary
Chapter 11: Debugging, Optimization, and Community Ecosystem
Debugging Rasa systems
Wrong prediction of results
Code errors
Optimizing Rasa systems
Understanding the community ecosystem of Rasa
Data generation tool โ€“ Chatito
Data generation tool โ€“ Chatette
Data labeling tool โ€“ Doccano
Language-specific libraries
Summary
About PACKT
Other Books You May Enjoy
Index


๐Ÿ“œ SIMILAR VOLUMES


Conversational AI with Rasa: Build, test
โœ Xiaoquan Kong, Guan Wang ๐Ÿ“‚ Library ๐Ÿ“… 2021 ๐Ÿ› Packt Publishing ๐ŸŒ English

<p><b>Create next-level AI assistants and transform how customers communicate with businesses with the power of natural language understanding and dialogue management using Rasa</b></p><h4>Key Features</h4><ul><li>Understand the architecture and put the underlying principles of the Rasa framework to

AI-Powered Developer: Build great softwa
โœ Nathan B. Crocker ๐Ÿ“‚ Library ๐Ÿ“… 2024 ๐Ÿ› Manning ๐ŸŒ English

Use groundbreaking generative AI tools to increase your productivity, efficiency, and code quality. AI coding tools like ChatGPT and GitHub Copilot are changing the way we write code and build software. AI-Powered Developer reveals the practical best practices you need to deliver reliable results

AI-Powered Developer: Build great softwa
โœ Nathan B. Crocker ๐Ÿ“‚ Library ๐Ÿ“… 2024 ๐Ÿ› Manning ๐ŸŒ English

<span>Use groundbreaking generative AI tools to increase your productivity, efficiency, and code quality.</span><span><br><br>AI coding tools like ChatGPT and GitHub Copilot are changing the way we write code and build software</span><span>. AI-Powered Developer</span><span> reveals the practical be

Conversational AI: Dialogue Systems, Con
โœ Michael McTear ๐Ÿ“‚ Library ๐Ÿ“… 2020 ๐Ÿ› Morgan & Claypool Publishers ๐ŸŒ English

This book provides a comprehensive introduction to Conversational AI. While the idea of interacting with a computer using voice or text goes back a long way, it is only in recent years that this idea has become a reality with the emergence of digital personal assistants, smart speakers, and chatbots