How to do rasa nlu, stories data validation and updation effectively?

537 views Asked by At

I am developing APIs/ Frontend to add new data, stories, responses, entities, add actions , train bot, deploy bot etc .

I am updating backend nlu.md, stories.md, domain.yml etc and then execute rasa train, rasa shell etc in the backend.

Is there any rasa command available to add nludata effectively? Currently, i am using python to add intents, entities etc to nlu.md file.

Logic has become complicated.

Below is sample code to add intents:

 pathnlu = bot_name + "/data/nlu.md"
            print("Bot id is", args['bot_id'])
            if str(os.path.exists(pathnlu)):
                f = open(pathnlu, "a")
                f.write("\n")
                f.write("## intent:")
                f.write(intent.intent_name)
                f.write("\n")
                f.write("- ")
                f.write(intent.intent_description)
                f.close()
                print("Intent ", intent.intent_name, " Created ")
            else:
                print("Unable to Create Intent")

Below is a sample code to add entities :

 pathnlu = bot_name + "/data/nlu.md"
                print("Bot id is", args['bot_id'])
                if str(os.path.exists(pathnlu)):
                    f = open(pathnlu, "a")
                    f.write(intent.intent_description + "(" + entities + ")" + remaining_intent)
                    f.close()
                    print("entity", entities, " Added")
                else:
                    print("Unable to add entities")

But, I am looking for some simple and robust way to accomplish it. Please help.

1

There are 1 answers

1
datamansahil On

Use Interactive learning in RASA, where your files will get updated and In this mode, you provide feedback to your bot while you talk to it. This is a powerful way to explore what your bot can do, and the easiest way to fix any mistakes it makes. One advantage of machine learning-based dialogue is that when your bot doesn’t know how to do something yet, you can just teach it!

How to do it? - https://legacy-docs.rasa.com/docs/core/interactive_learning/