notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.shared.nlu.training_data.formats.rasa_yaml
RasaYAMLReader Objects
Reads YAML training data and creates a TrainingData object.
validate
Check if the string adheres to the NLU yaml data schema.
If the string is not in the right format, an exception will be raised.
reads
Reads TrainingData in YAML format from a string.
Arguments:
string
- String with YAML training data.**kwargs
- Keyword arguments.
Returns:
New TrainingData
object with parsed training data.
is_yaml_nlu_file
Checks if the specified file possibly contains NLU training data in YAML.
Arguments:
filename
- name of the file to check.
Returns:
True
if the filename
is possibly a valid YAML NLU file,
False
otherwise.
Raises:
YamlException
- if the file seems to be a YAML file (extension) but can not be read / parsed.
RasaYAMLWriter Objects
Writes training data into a file in a YAML format.
dumps
Turns TrainingData into a string.
dump
Writes training data into a file in a YAML format.
Arguments:
target
- Name of the target object to write the YAML to.training_data
- TrainingData object.
training_data_to_dict
Represents NLU training data to a dict/list structure ready to be serialized as YAML.
Arguments:
training_data
-TrainingData
to convert.
Returns:
OrderedDict
containing all training data.