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.10.6

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 of steps:

  1. Tracker provides a bag of active features:

    • features indicating intents and entities.
    • features indicating which slots are currently defined.
    • features indicating the results of any API calls stored in slots.
    • features indicating what the last action was.
  2. Convert all the features into numeric vectors:

    We use the X, y notation that’s common for supervised learning.

    The target labels correspond to actions taken by the bot.

    To convert the features into vector format, there are different featurizers available:

    • BinarySingleStateFeaturizer creates a binary one-hot encoding.
    • LabelTokenizerSingleStateFeaturizer creates a vector based on the feature label.

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 - creates numerical representation of stories.
  2. Max History - creates an array of previous tracker states for each bot action or utterance.