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).

Version: 2.x

rasa.nlu.training_data.formats.readerwriter

TrainingDataReader Objects

class TrainingDataReader()

read

| read(filename: Union[Text, Path], **kwargs: Any) -> "TrainingData"

Reads TrainingData from a file.

reads

| reads(s: Text, **kwargs: Any) -> "TrainingData"

Reads TrainingData from a string.

TrainingDataWriter Objects

class TrainingDataWriter()

dump

| dump(filename: Text, training_data) -> None

Writes a TrainingData object in markdown format to a file.

dumps

| dumps(training_data: "TrainingData") -> Text

Turns TrainingData into a string.

prepare_training_examples

| @staticmethod
| prepare_training_examples(training_data: "TrainingData") -> OrderedDict

Pre-processes training data examples by removing not trainable entities.

generate_list_item

| @staticmethod
| generate_list_item(text: Text) -> Text

Generates text for a list item.

generate_message

| @staticmethod
| generate_message(message: Dict[Text, Any]) -> Text

Generates text for a message object.

generate_entity

| @staticmethod
| generate_entity(text: Text, entity: Dict[Text, Any]) -> Text

Generates text for an entity object.

JsonTrainingDataReader Objects

class JsonTrainingDataReader(TrainingDataReader)

reads

| reads(s: Text, **kwargs: Any) -> "TrainingData"

Transforms string into json object and passes it on.

read_from_json

| read_from_json(js: Dict[Text, Any], **kwargs: Any) -> "TrainingData"

Reads TrainingData from a json object.