Rasa Core:如何为一个意图组合多个话语

Rasa Core: How to combine multiple utterances for an intent

在我的 stories.md 文件中,如果我有这样的东西

* mood_greet
 - utter_happy
 - utter_open_question

只有第一个明确的动作,即 utter_happy 出现,没有跟进 utter_open_question。我已经跟进了所有问题,我找到的唯一解决方案是将第二个问题附加到第一个对话中,并将它们放在 action 函数中。

对于像我这样的初学者,我们将不胜感激。

也许您使用的旧 Rasa 版本存在错误。对于您展示的示例,执行 utter_happyutter_open_question 实际上是预期的行为。

例子

故事文件:

## Story 1
* greet
  - utter_hello
  - utter_how_can_I_help

域文件:

intents:
  - greet

actions:
  - utter_hello
  - utter_how_can_I_help

templates:
  utter_hello:
    - text: "Hi"
  utter_how_can_I_help:
    - text: "How can I help you?"

如果您现在按照 here and then run Rasa Core as described here 所述训练 Rasa Core,然后通过发送消息 /greet 触发意图 greet,它将发出:

Hi
How can I help you?

您出现这种行为的可能原因是: * 您没有在域文件中放置 utter_open_question 的模板 * 有问题 policy configuration * 你没有使用 Rasa NLU 并发送了像 "Hello" 这样的消息。在没有 NLU 的情况下使用 Rasa Core 并通过发送带有前缀 / 和意图(例如 /<intent_name>)的消息来触发意图,或者将 Rasa Core 与 NLU 连接。