【发布时间】:2019-06-03 12:22:04
【问题描述】:
我目前遇到一个问题,如果用户在 nlu 文件中输入了一个未经训练的单词,nlu 将返回:
"intent": {
"name": null,
"confidence": 0.0
}
在其他情况下,效果很好!有没有办法捕获这些错误并让 rasa 返回默认错误消息?请告诉我。谢谢!
【问题讨论】:
标签: rasa-nlu
我目前遇到一个问题,如果用户在 nlu 文件中输入了一个未经训练的单词,nlu 将返回:
"intent": {
"name": null,
"confidence": 0.0
}
在其他情况下,效果很好!有没有办法捕获这些错误并让 rasa 返回默认错误消息?请告诉我。谢谢!
【问题讨论】:
标签: rasa-nlu
不清楚你是如何使用这个 nlu 响应的。
def run(self, dispatcher, tracker, domain):
intent = tracker.latest_message.intent["name"]
def default_output_attributes():
return {"intent": {"name": None, "confidence": 0.0}, "entities": []}
到
def default_output_attributes():
return {"intent": {"name": "YOUR_CUSTOM_NAME", "confidence": 0.0}, "entities": []}
但请谨慎使用第二个。升级 rasa_nlu python 包时可能需要小心。
【讨论】: