Write NLU Data Programmatically

I was trying to write the YML files of rasa using the following python code. But it doesn’t load successfully when I try to start training it.

yaml.dump(data_, file, default_flow_style=False, sort_keys=False)

How can I write the data using Rasa’s format that loads correctly? I am assuming that my training data and config file will change dynamically.

Thanks a lot

1 Like

I will recommend writing a custom training data importer instead of a converter to yaml

1 Like

@Mushahid2521 Heya!

If I get you right; do you want to convert or write .yml for your training data as per Rasa Format? Where do you had data, I mean in excel, txt etc

Yes. Let’s say I have an initial rasa project. I want to open the data files like nlu.yml, stories.yml, rules.yml, domain.yml and append new intents, responses etc and save it back again.

@Mushahid2521 You want to open, write or create?