nlp - 拉莎 NLU : How to use multiple categorical slots with same values?

标签 nlp artificial-intelligence chatbot rasa-nlu

我刚刚开始使用 Rasa NLU,在理解具有相同值的分类槽的用法时遇到一些问题。我有 3 种不同类型的风险,每种风险都有一个分类槽,其值是:

鉴于每种风险的意图相同,机器人如何区分这三种风险并了解要填补哪个位置。 或者我是否需要为每个使用不同的意图?

现在我看到的是(我删除了不相关的日志):

How tired are you?
1: low (low)
2: medium (medium)
3: high (high)
medium
DEBUG:rasa_core.processor:Received user message 'medium' with intent '{'name': 'inform', 'confidence': 0.88372623999657118}' and entities  '[{'start': 0, 'end': 6, 'value': 'medium', 'entity': 'fatigue', 'extractor': 'ner_crf'}]'
DEBUG:rasa_core.processor:Current slot values: 
    fatigue: medium
    injury: None
    stress: None
How stressed are you?
1: low (low)
2: medium (medium)
3: high (high)
low
DEBUG:rasa_core.processor:Received user message 'low' with intent '{'name': 'inform', 'confidence': 0.88762049990079372}' and entities  '[{'start': 0, 'end': 3, 'value': 'low', 'entity': 'fatigue', 'extractor': 'ner_crf'}]'
DEBUG:rasa_core.processor:Current slot values: 
    fatigue: low
    injury: None
    stress: None

所有用户回复都有通知的意图。 一个示例故事是:

* _greet[]
 - utter_ask_fatigue
* _inform[fatigue=low]
 - utter_ask_injury
* _inform[injury=medium]
 - utter_ask_stress
* _inform[stress=low]
 - utter_on_it
 - action_reply

最佳答案

您可以使用一个实体和四个插槽来做到这一点

实体可以定义为“信息”类型,具有文本值(即低、中、高)。

四个槽:第一个是“info”,它将由先前定义的识别实体“info”自动填充。另外三个是“疲劳”、“压力”和“伤害”,可以通过机器人操作来填充,例如action_fill_fatigue、action_fill_stress和action_fill_injury。

一个例子就可以清楚地说明这一点:

* _问候[]
- utter_ask_fatigue
* _inform[info=low]
- action_fill_fatigue
- utter_ask_injury
* _inform[info=medium]
- action_fill_injury
- utter_ask_stress
* _inform[info=low]
- action_fill_stress
- 发言
-action_reply

关于nlp - 拉莎 NLU : How to use multiple categorical slots with same values?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47868536/

相关文章:

python - InvalidArgumentError : Received a label value of 8825 which is outside the valid range of [0, 8825) SEQ2SEQ 模型

python - 每次用户再次询问时如何更改响应?

android - 是否可以跳转 Dialogflow 后续 Intent ?

machine-learning - 基于CSV文件的搜索引擎

python - 使用 gensim 将 LDA 应用于语料库进行训练

algorithm - 如何为 pacman 实现 BFS 算法?

java - 在java中使用NPC AI的用户脚本

python - 实现朴素贝叶斯文本分类,但我总是得到零

algorithm - 从全文搜索结果中提取小的相关位文本(如 Google 所做的那样)

algorithm - 模拟退火中T代表什么?