notice
This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.shared.nlu.training_data.formats.readerwriter
TrainingDataReader Objects
Reader for NLU training data.
__init__
Creates reader instance.
read
Reads TrainingData from a file.
reads
Reads TrainingData from a string.
TrainingDataWriter Objects
A class for writing training data to a file.
dump
Writes a TrainingData object to a file.
dumps
Turns TrainingData into a string.
prepare_training_examples
Pre-processes training data examples by removing not trainable entities.
generate_list_item
Generates text for a list item.
generate_message
Generates text for a message object.
Arguments:
message
- A message
Returns:
The text of the message, annotated with the entity data that is contained in the message
generate_entity_attributes
Generates text for the entity attributes.
Arguments:
text
- The text that is annotated with the entityentity
- Entity datashort_allowed
- IfTrue
, allow shorthand annotation with parenthesis
Returns:
The annotation text that should follow the given text
generate_entity
Generates text for one or multiple entity objects.
Arguments:
text
- The un-annotated textentity
- One or multiple entity annotations for one part of this text
Returns:
Annotated part of the text
JsonTrainingDataReader Objects
A class for reading JSON files.
reads
Transforms string into json object and passes it on.
read_from_json
Reads TrainingData from a json object.