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

- [Docs for the new version 2.0 can be found here.](/content/docs/rasa/index.html)

## User Guide

- [Installation](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/installation/)
- [Tutorial: Rasa Basics](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/rasa-tutorial/)
- [Tutorial: Building Assistants](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/building-assistants/)
- [Command Line Interface](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/command-line-interface/)
- [Architecture](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/architecture/)
- [Messaging and Voice Channels](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/messaging-and-voice-channels/)
- [Evaluating Models](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/evaluating-models/)
- [Validate Data](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/validate-files/)
- [Configuring the HTTP API](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/configuring-http-api/)
- [Deploying your Rasa Assistant](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/how-to-deploy/)
- [Cloud Storage](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/cloud-storage/)

## NLU

- [About](https://legacy-docs-v1.rasa.com/1.7.2/nlu/about/)
- [Using NLU Only](https://legacy-docs-v1.rasa.com/1.7.2/nlu/using-nlu-only/)
- [Training Data Format](https://legacy-docs-v1.rasa.com/1.7.2/nlu/training-data-format/)
- [Choosing a Pipeline](https://legacy-docs-v1.rasa.com/1.7.2/nlu/choosing-a-pipeline/)
- [Language Support](https://legacy-docs-v1.rasa.com/1.7.2/nlu/language-support/)
- [Entity Extraction](https://legacy-docs-v1.rasa.com/1.7.2/nlu/entity-extraction/)
- [Components](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/)

## Core

- [About](https://legacy-docs-v1.rasa.com/1.7.2/core/about/)
- [Stories](https://legacy-docs-v1.rasa.com/1.7.2/core/stories/)
- [Domains](https://legacy-docs-v1.rasa.com/1.7.2/core/domains/)
- [Responses](https://legacy-docs-v1.rasa.com/1.7.2/core/responses/)
- [Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/actions/)
- [Policies](https://legacy-docs-v1.rasa.com/1.7.2/core/policies/)
- [Slots](https://legacy-docs-v1.rasa.com/1.7.2/core/slots/)
- [Forms](https://legacy-docs-v1.rasa.com/1.7.2/core/forms/)
- [Retrieval Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/retrieval-actions/)
- [Interactive Learning](https://legacy-docs-v1.rasa.com/1.7.2/core/interactive-learning/)
- [Fallback Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/fallback-actions/)
- [Knowledge Base Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/knowledge-bases/)

## Conversation Design

- [Dialogue Elements](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/dialogue-elements/)
- [Small Talk](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/small-talk/)
- [Completing Tasks](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/completing-tasks/)
- [Guiding Users](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/guiding-users/)

## API Reference

- [Action Server](https://legacy-docs-v1.rasa.com/1.7.2/api/action-server/)
- [HTTP API](https://legacy-docs-v1.rasa.com/1.7.2/api/http-api/)
- [Jupyter Notebooks](https://legacy-docs-v1.rasa.com/1.7.2/api/jupyter-notebooks/)
- [Agent](https://legacy-docs-v1.rasa.com/1.7.2/api/agent/)
- [Custom NLU Components](https://legacy-docs-v1.rasa.com/1.7.2/api/custom-nlu-components/)
- [Rasa SDK](https://legacy-docs-v1.rasa.com/1.7.2/api/rasa-sdk/)
- [Events](https://legacy-docs-v1.rasa.com/1.7.2/api/events/)
- [Tracker](https://legacy-docs-v1.rasa.com/1.7.2/api/tracker/)
- [Tracker Stores](https://legacy-docs-v1.rasa.com/1.7.2/api/tracker-stores/)
- [Event Brokers](https://legacy-docs-v1.rasa.com/1.7.2/api/event-brokers/)
- [Lock Stores](https://legacy-docs-v1.rasa.com/1.7.2/api/lock-stores/)
- [Training Data Importers](https://legacy-docs-v1.rasa.com/1.7.2/api/training-data-importers/)
- [Featurization of Conversations](https://legacy-docs-v1.rasa.com/1.7.2/api/core-featurization/#)
- [Migration Guide](https://legacy-docs-v1.rasa.com/1.7.2/migration-guide/)
- [Rasa OSS Change Log](https://legacy-docs-v1.rasa.com/1.7.2/changelog/)

## Migrate from (beta)

- [Dialogflow](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/google-dialogflow-to-rasa/)
- [Wit.ai](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/facebook-wit-ai-to-rasa/)
- [LUIS](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/microsoft-luis-to-rasa/)
- [IBM Watson](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/ibm-watson-to-rasa/)

## Reference

- [Glossary](https://legacy-docs-v1.rasa.com/1.7.2/glossary/)

## Versions

viewing: 1.7.2

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

- 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_location` if 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`)

2. **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)` or `(num_data_points, time_dimension, num_bot_features)` containing the target class labels encoded as one-hot vectors.
> 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:
>      The vectors `X, y` indicate a presence of a certain intent, entity, previous action or slot e.g. `[0 0 1 0 0 1 ...]`.
>    - `LabelTokenizerSingleStateFeaturizer` creates a vector
>      based on the feature label: All active feature labels (e.g. `prev_action_listen`) are split into tokens and represented as a bag-of-words. For example, actions `utter_explain_details_hotel` and `utter_explain_details_restaurant` will have 3 features in common, and differ by a single feature indicating a domain.
>      Labels for user inputs (intents, entities) and bot actions are featurized separately. Each label in the two categories is tokenized on a special character `split_symbol` (e.g. `action_search_restaurant = {action, search, restaurant}`), creating two vocabularies. A bag-of-words representation is then created for each label using the appropriate vocabulary. The slots are featurized as binary vectors, indicating their presence or absence at each step of the dialogue.

**Note**  
If the domain defines the possible `actions`, `[ActionGreet, ActionGoodbye]`, `4` additional default actions are added: `[ActionListen(), ActionRestart(), ActionDefaultFallback(), ActionDeactivateForm()]`. Therefore, label `0` indicates default action listen, label `1` default restart, label `2` a greeting and `3` indicates goodbye.

## 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. Therefore, `X` is an array of shape `(num_stories, max_dialogue_length, num_input_features)` and `y` is an array of shape `(num_stories, max_dialogue_length, num_bot_features)`. The smaller dialogues are padded with `-1` for all features, indicating no values for a policy.

### 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`. Deduplication is performed to filter out duplicated turns (bot actions or bot utterances) in terms of their previous states. Hence `X` has shape `(num_unique_turns, max_history, num_input_features)` and `y` is an array of shape `(num_unique_turns, num_bot_features)`. For some algorithms a flat feature vector is needed, so `X` should be reshaped to `(num_unique_turns, max_history * num_input_features)`. If numeric target class labels are needed instead of one-hot vectors, use `y.argmax(axis=-1)`.

👋 I can help you get started with Rasa and answer your technical questions.
