python - 如果在 Rasa 中无法识别意图怎么办?
问题描述
我关注了Justina Petraityte提供的天气 rasa 聊天机器人,你可以在这里找到 GitHub 存储库。然而,我的聊天机器人永远无法识别我试图向他提供的意图,它必须是位置,而且我不知道如何处理这种情况,因为它在调用天气 API 时会产生错误,因此它是空的。
例如,我试图询问意大利的天气,但是你可以在这里看到。它不承认意大利是一个意图,即使它在data.json
.
例如 :
因此,当意图未被识别时该怎么办?我们还应该把它保存到 stories.md 吗?
域文件内容:
action_factory: null
action_names:
- utter_greet
- utter_goodbye
- utter_ask_location
- action_weather
actions:
- utter_greet
- utter_goodbye
- utter_ask_location
- actions.ActionWeather
config:
store_entities_as_slots: true
entities:
- location
intents:
- greet
- goodbye
- inform
slots:
location:
initial_value: null
type: rasa_core.slots.TextSlot
templates:
utter_ask_location:
- text: In what location?
utter_goodbye:
- text: Talk to you later.
- text: Bye bye :(
utter_greet:
- text: Hello! How can I help?
topics: []
Rasa 核心版本:
(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ pip list :
...
rasa-core (0.9.0a3)
rasa-nlu (0.12.3)
蟒蛇版本:
(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ python -V
Python 3.5.2
操作系统:
Linux 16.04
解决方案
对于每个意图,您必须至少有 2-10 个示例您拥有的训练示例越多越好。
我建议为每个意图使用 Tensorflow、Spacy、CRF 后端组合和 5-10 个示例,对我来说效果非常好! 使用它作为你的 config.yml
pipeline:
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"
batch_size: 64
epochs: 1500
- name: "nlp_spacy"
- name: "tokenizer_spacy"
- name: "ner_crf"
这是一个如何构建以前版本的指南,在完成 tut 之后,您所要做的就是更改配置文件以切换到 TF 后端。
按照这本烹饪书,使用 RASA NLU 使用 python 构建本地聊天机器人: 逐步(食谱)构建您的聊天机器人
推荐阅读
- asynchronous - 获取方法 Future 的结果
扑 - php - 提取电子邮件正文
- excel - VBA - 如何从表中复制内容
- javascript - 在这个非常简单的虚拟应用程序上,错误的处理程序捕获了通量动作,为什么?
- excel - 根据标题名称将两列相乘
- python - 为什么 Python 的 Google 日历快速入门会给我一个 OSError (WinError 10013)(以禁止的方式访问套接字)
- git - Jenkins 为触发分支上的分支构建?
- python - 如何使用“::before”在硒中获取隐藏的href标签
- java - 调用站点 #4 引导方法的异常。代码在 Android Studio 中不起作用,但在 Eclipse 中起作用
- c# - 使用 Z3 进行项目的单元测试