import yaml
with open('../data/nlu.yml',' r') as file:
nlu = yaml.load(file, Loader = yaml.FullLoader)
examples = []
example = ''
for intent in nlu:
if intent['intent'] == 'cannot_login':
examples = intent['examples']
if len(examples) > 0:
example = examples.split('-')[1]
print(example)
Cheers @ChrisRahme. Indeed I need this a custom action. to be honest I thought that Rasa would have a specific command/ default action to perform this. I should have thought to read the file earlier… Let me check and revert.
Yeah, since you can read the domain in a custom action (the domain variable`), it would have made sense to be able to do so for the NLU files. But oh well