Featurization of Conversations

These docs are for version 1.x of Rasa Open Source.

User Guide

NLU

Core

Conversation Design

API Reference

Migrate from (beta)

Reference

Versions

viewing: 1.8.1

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 trackers 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:

  1. Tracker provides a bag of active features:
  1. Convert all the features into numeric vectors:

We use the X, y notation that’s common for supervised learning, where X is an array of shape (num_data_points, time_dimension, num_input_features), and y is an array of shape (num_data_points, num_bot_features) where the target class labels are encoded as one-hot vectors.

The target labels correspond to actions taken by the bot. There are different featurizers available:

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. Therefore, X is an array of shape (num_stories, max_dialogue_length, num_input_features) and y is of shape (num_stories, max_dialogue_length, num_bot_features).

2. Max History

MaxHistoryTrackerFeaturizer creates an array of previous tracker states for each bot action with the parameter max_history defining how many states go into each row in X.