Version: 3.x

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",
  • "regex_features"0 - [] }, {
  • "text" - "howdy",
  • "intent" - "greet",
  • "regex_features"0 - [] } ] } }

__init__

def __init__() -> None

Creates reader.

read_from_json

def 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__

def __init__() -> None

Creates writer.

dumps

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

Writes Training Data to a string in json format.