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

# NLU

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

# Core

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

# Conversation Design

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

# API Reference

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

# Migrate from (beta)

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

# Reference

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

# Versions

viewing: 1.7.4

# Training Data Format

You can provide training data as Markdown or as JSON, as a single file or as a directory containing multiple files.
Note that Markdown is usually easier to work with.

## Markdown Format

Markdown is the easiest Rasa NLU format for humans to read and write. Examples are listed using the unordered list syntax, e.g. minus `-`, asterisk `*`, or plus `+`. Examples are grouped by intent, and entities are annotated as Markdown links, e.g. `[entity](entity name)`.

```
## intent:check_balance
- what is my balance <!-- no entity -->
- how much do I have on my [savings](source_account) <!-- entity "source_account" has value "savings" -->
- how much do I have on my [savings account](source_account:savings) <!-- synonyms, method 1-->
- Could I pay in [yen](currency)?  <!-- entity matched by lookup table -->

## intent:greet
- hey
- hello

## synonym:savings   <!-- synonyms, method 2 -->
- pink pig

## regex:zipcode
- [0-9]{5}

## lookup:additional_currencies  <!-- specify lookup tables in an external file -->
path/to/currencies.txt
```

The training data for Rasa NLU is structured into different parts:

- common examples
- synonyms
- regex features and
- lookup tables

While common examples is the only part that is mandatory, including the others will help the NLU model learn the domain with fewer examples and also help it be more confident of its predictions.

## JSON Format

The JSON format consists of a top-level object called `rasa_nlu_data`, with the keys `common_examples`, `entity_synonyms` and `regex_features`. The most important one is `common_examples`.

```
{
    "rasa_nlu_data": {
        "common_examples": [],
        "regex_features" : [],
        "lookup_tables"  : [],
        "entity_synonyms": []
    }
}
```

The `common_examples` are used to train your model. You should put all of your training examples in the `common_examples` array. Regex features are a tool to help the classifier detect entities or intents and improve the performance.

## Common Examples

Common examples have three components: `text`, `intent` and `entities`. The first two are strings while the last one is an array.

> - The _text_ is the user message [required]
> 
> - The _intent_ is the intent that should be associated with the text [optional]
> 
> - The _entities_ are specific parts of the text which need to be identified [optional]

Entities are specified with a `start` and an `end` value, which together make a python style range to apply to the string, e.g. in the example below, with `text="show me chinese restaurants"`, then `text[8:15] == 'chinese'`. Entities can span multiple words, and in fact the `value` field does not have to correspond exactly to the substring in your example.

```
## intent:restaurant_search
- show me [chinese](cuisine) restaurants
```

### Regular Expression Features

Regular expressions can be used to support the intent classification and entity extraction. For example, if your entity has a deterministic structure (like a zipcode or an email address), you can use a regular expression to ease detection of that entity. For the zipcode example it might look like this:

```
## regex:zipcode
- [0-9]{5}

## regex:greet
- hey[^\\s]*
```

### Lookup Tables

The supplied lookup table files must be in a newline-delimited format.
For example, `data/test/lookup_tables/plates.txt` may contain:

```
tacos
beef
mapo tofu
burrito
lettuce wrap
```

## Normalizing Data

### Entity Synonyms

If you define entities as having the same value they will be treated as synonyms. Here is an example of that:

```
## intent:search
- in the center of [NYC](city:New York City)
- in the centre of [New York City](city)
```

To use the synonyms defined in your training data, you need to make sure the pipeline contains the `EntitySynonymMapper` component (see [Components](https://legacy-docs-v1.rasa.com/1.7.4/nlu/components/#components)).

## Generating More Entity Examples

It is sometimes helpful to generate a bunch of entity examples, for example if you have a database of restaurant names. However, creating synthetic examples usually leads to overfitting, it is a better idea to use [Lookup Tables](https://legacy-docs-v1.rasa.com/1.7.4/nlu/training-data-format/#lookup-tables) instead if you have a large number of entity values.

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