notice

This is unreleased documentation for Rasa Open Source Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

rasa.shared.nlu.training_data.formats.rasa

RasaReader Objects

class RasaReader(JsonTrainingDataReader)

Reader for Rasa NLU training data in JSON format.

Example:

{

  • "rasa_nlu_data" - {
  • "regex_features" - [ {
  • "name" - "zipcode",
  • "pattern" - "[0-9]{5}" } ],
  • "entity_synonyms" - [ {
  • "value" - "chinese",
  • "synonyms" - ["Chinese", "Chines", "chines"] } ],
  • "common_examples" - [ {
  • "text" - "hey",
  • "intent" - "greet",
  • "entities" - [] }, {
  • "text" - "howdy",
  • "intent" - "greet",
  • "entities" - [] } ] } }

__init__

| __init__() -> None

Creates reader.

read_from_json

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

Loads training data stored in the rasa NLU data format.

RasaWriter Objects

class RasaWriter(TrainingDataWriter)

Dumps NLU data as Rasa JSON string.

__init__

| __init__() -> None

Creates writer.

dumps

| dumps(training_data: "TrainingData", **kwargs: Any) -> Text

Writes Training Data to a string in json format.