Training Data Format
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.
Data Formats
You can provide training data in the following formats:
- Markdown Format: It's easy to read and write for humans.
- JSON Format: A structured format which consists of a top-level object called
rasa_nlu_data, with the keyscommon_examples,entity_synonymsandregex_features.
## 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
Improving Intent Classification and Entity Recognition
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 indicate the range in the string.
Regular Expression Features
Regular expressions can enhance intent classification and entity extraction. For example:
## regex:zipcode
- [0-9]{5}
Lookup Tables
Lookup tables provide a convenient way to supply a list of entity examples. These must be provided in a newline-delimited format.
Example content for a lookup table:
tacos
beef
mapo tofu
burrito
lettuce wrap
Normalizing Data
Entity synonyms can be defined as being equivalent. For example:
## synonym:New York City
- NYC
- nyc
- the big apple
👋 I can help you get started with Rasa and answer your technical questions.