Featurization of Conversations
These docs are for version 1.x of Rasa Open Source.
User Guide
- Installation
- Tutorial: Rasa Basics
- Tutorial: Building Assistants
- Command Line Interface
- Architecture
- Messaging and Voice Channels
- Testing Your Assistant
- Setting up CI/CD
- Validate Data
- Configuring the HTTP API
- Deploying Your Rasa Assistant
- Cloud Storage
NLU
- About
- Using NLU Only
- Training Data Format
- Language Support
- Choosing a Pipeline
- Components
- Entity Extraction
Core
- About
- Stories
- Domains
- Responses
- Actions
- Reminders and External Events
- Policies
- Slots
- Forms
- Retrieval Actions
- Interactive Learning
- Fallback Actions
- Knowledge Base Actions
Conversation Design
API Reference
- Action Server
- HTTP API
- Jupyter Notebooks
- Agent
- Custom NLU Components
- Rasa SDK
- Events
- Tracker
- Tracker Stores
- Event Brokers
- Lock Stores
- Training Data Importers
- Featurization of Conversations
- TensorFlow Configuration
- Migration Guide
- Rasa Open Source Change Log
Migrate from (beta)
Reference
Warning: This document is for an old version of Rasa. The latest version is 1.10.26.
Featurization of Conversations
In order to apply machine learning algorithms to conversational AI, we need to build up vector representations of conversations.
Each story corresponds to a tracker which consists of the states of the conversation just before each action was taken.
State Featurizers
Every event in a tracker's history creates a new state (e.g. running a bot action, receiving a user message, setting slots). Featurizing a single state of the tracker has a couple steps:
Tracker provides a bag of active features:
- features indicating intents and entities, if this is the first state in a turn, e.g. it’s the first action we will take after parsing the user’s message. (e.g.
[intent_restaurant_search, entity_cuisine]) - features indicating which slots are currently defined, e.g.
slot_locationif the user previously mentioned the area they’re searching for restaurants. - features indicating the results of any API calls stored in slots, e.g.
slot_matches - features indicating what the last action was (e.g.
prev_action_listen)
- features indicating intents and entities, if this is the first state in a turn, e.g. it’s the first action we will take after parsing the user’s message. (e.g.
Convert all the features into numeric vectors:
We use the
X, ynotation that’s common for supervised learning,
Tracker Featurizers
It’s often useful to include a bit more history than just the current state when predicting an action. The TrackerFeaturizer iterates over tracker states and calls a SingleStateFeaturizer for each state. There are two different tracker featurizers:
1. Full Dialogue
FullDialogueTrackerFeaturizer creates numerical representation of stories to feed to a recurrent neural network where the whole dialogue is fed to a network and the gradient is backpropagated from all time steps.
2. Max History
MaxHistoryTrackerFeaturizer creates an array of previous tracker states for each bot action or utterance, with the parameter max_history defining how many states go into each row in X.