Training Data Format
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
Training Data Format
The training data for Rasa NLU is structured into different parts:
- common examples
- synonyms
- regex features
- lookup tables
While common examples is the only part that is mandatory, including the others helps the NLU model learn the domain with fewer examples and also be more confident in its predictions.
Data Formats
You can provide training data as Markdown or as JSON, as a single file or 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.
## intent:check_balance
- what is my balance
- how much do I have on my [savings](source_account)
- how much do I have on my [savings account] {"entity": "source_account", "value": "savings"}
- Could I pay in [yen](currency)?
## intent:greet
- hey
- hello
## synonym:savings
- pink pig
## regex:zipcode
- [0-9]{5}
## lookup:additional_currencies
path/to/currencies.txt
Improving Intent Classification and Entity Recognition
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 needing identification [optional]
Entities are specified with a start and an end value, making a range to apply to the string. For example:
## intent:restaurant_search
- show me [chinese](cuisine) restaurants
Regular Expression Features
Regular expressions can be used to support intent classification and entity extraction. Here’s an example:
## regex:zipcode
- [0-9]{5}
Lookup Tables
Lookup tables provide a convenient way to supply a list of entity examples. For instance:
## lookup:plates
data/test/lookup_tables/plates.txt
Normalizing Data
Entity Synonyms
If you define entities as having the same value, they’ll be treated as synonyms. Here is an example:
## intent:search
- in the center of [NYC]{"entity": "city", "value": "New York City"}
- in the centre of [New York City](city)
👋 I can help you get started with Rasa and answer your technical questions.