如何有效地进行rasa-nlu、stories数据验证和更新



我正在开发API/Frontend,以添加新数据、故事、响应、实体、添加操作、训练机器人程序、部署机器人程序等。

我正在更新后端nlu.md、stories.md、domain.yml等,然后在后端执行rasa-train、rasa-shell等。

是否有任何rasa命令可以有效地添加nludata?目前,我正在使用python向nlu.md文件添加意图、实体等。

逻辑变得复杂起来。

以下是添加意图的示例代码:

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")

以下是添加实体的示例代码:

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")

但是,我正在寻找一些简单而稳健的方法来实现它。请帮忙。

在RASA中使用交互式学习,您的文件将在其中更新在这种模式下,你在与机器人交谈时向其提供反馈这是一种探索你的机器人能做什么的强大方法修复任何错误的最简单方法。机器的一个优点基于学习的对话是指当你的机器人不知道如何做有些东西,你可以教它!

如何操作-https://legacy-docs.rasa.com/docs/core/interactive_learning/

最新更新