rasa-nlu - rasa nlu 中相似词的意图识别不正确
问题描述
当用户询问包含在定义意图中使用的一些关键字(帮助词构建句子)的out_of_scope问题时,它会选择定义的意图(我没有使用任何实体方法)。
配置.yml
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline: supervised_embeddings
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MemoizationPolicy
max_history: 5
- name: KerasPolicy
epochs: 400
batch_size: 100
validation_split: 0.2
max_history: 5
- name: MappingPolicy
- name: "FallbackPolicy"
nlu_threshold: 0.7
core_threshold: 0.5
fallback_action_name: "action_default_fallback"
以下是我的意图
intent: ask_faq_how_many _vegetarian_restaurants_are_there_nearby
- how many vegetarian restaurants are there nearby
- vegetarian restaurants near by
- please tell me how many vegetarian restaurants are there
如果用户问:
- “我有什么素食选择”?
- “你喜欢素食吗?”
- “素食”
然后 nlu 选择 ask_faq_how_many _vegetarian_restaurants_are_there_nearby 作为意图。
以上 3 个问题与任何意图无关,用户可以使用上述关键字进行许多其他闲聊,并且训练所有关键字可能需要很长时间。有什么方法可以告诉 nlu 不要仅根据几个关键字来选择意图?
解决方案
我建议建立一个映射尽可能多的实体的意图。因此,如果在输入中未找到这些实体,则在针对此意图的自定义操作中,尽管基于使用的关键字有很强的信心,但您知道映射是错误的。
在您的情况下 ask_faq_how_many_vegetarian_restaurants_are_there_nearby,创建映射(1)数字方面的训练示例,以及(2)您想要实际上是餐厅的商店。
- how [many](number) vegetarian [restaurant](shops)s are there nearby
- are there [many](number) vegetarian [restaurant](shops)s nearby
意图越具体,带有正确关键字的闲聊消息的置信度就会降低,缺失的实体应该确认匹配是错误的。
希望这可以帮助!
推荐阅读
- python - 如何使用 pandas 进行动态 matplotlib 绘图?
- c++ - 二值图像中覆盖所有真值像素的最短路径是什么?
- python - 使用python计算从点到多边形最近边缘的距离的问题
- node.js - schema.methods 不是函数
- sql-server - 将两行表之间的绝对时间差获取到另一个表中
- amazon-web-services - 构建映像时 dockerfile 中的 AWS 凭证
- google-cloud-platform - 在 Google Cloud 上运行 Batch python 进程
- python - 从 tf.data.Datasets 构建 tf,estimator.DNNClassifier
- java - BottomNavigationView 高度未包裹到底部
- python - 多选菜单 Python