【问题标题】:Is there a way to point a fallback intent to an actual intent in api.ai?有没有办法将后备意图指向 api.ai 中的实际意图?
【发布时间】:2017-10-06 20:51:56
【问题描述】:

请耐心听我说。我会尽量用最简单的方式来解释。我使用 API.AI 构建了一个聊天机器人。下面的树是流程如何进行的简单粗略的表示。前两个级别很简单,它只是提出简单的问题,然后分支到不同的路径。您还可以看到,端点都是一样的。

这里的问题是,对于一个公共端点和多个是/否后备意图,有没有办法将后备意图链接到一个公共意图?

Get name
└── Get email address
    ├── [johndoe@email.com]
    └── Does not give email address
        ├── Know more about person
        │   ├── About short description
        │   │   └── Dont want to know more
        │   │       ├── Read more
        │   │       └── Want to connect with person?
        │   │           ├── Show email address
        │   │           └── Goodbye            
        │   ├── Coding short description
        │   │   └── Dont want to know more
        │   │       ├── Read more
        │   │       └── Want to connect with person?
        │   │           ├── Show email address
        │   │           └── Goodbye
        │   ├── Achievements short description
        │   │   └── Dont want to know more
        │   │       ├── Read more
        │   │       └── Want to connect with person?
        │   │           ├── Show email address
        │   │           └── Goodbye
        │   └── Skills short description
        │   │   └── Dont want to know more
        │   │       ├── Read more
        │   │       └── Want to connect with person?
        │   │           ├── Show email address
        │   │           └── Goodbye
        └── Want to connect with person?
            ├── Show email address
            └── Goodbye

【问题讨论】:

    标签: chatbot dialogflow-es


    【解决方案1】:

    根据您给出的结构,我假设您正在使用 FollowUpIntents,将多个意图分组到一个后备意图的一种方法是使用一个 contextOut,它对于您希望与后备匹配的所有端点都是相同的。

    FollowUp Intent 实际上以相同的方式使用上下文构建其流程,当然,您也可以自己执行此操作。

    因此在以下意图中:

    │   ├── Coding short description
    │   ├── Achievements short description
    │   └── Skills short description
    

    您只需将这些意图的上下文设置为“contextFallback”之类的内容。

    在:

    Dont want to know more
    

    您只需将 contextIn 设置为“contextFallback”。这样,每次触发设置上下文的上下文之一时,您都可以触发并分支到“不想了解更多”意图。导致一个意图(而不是根据您的示例执行相同操作的 4 个意图)

    希望我正确理解了您的问题,否则我将编辑我的答案。

    【讨论】:

    • 这听起来很对。那是我最初的构建。用户表达是“否”,但不知何故,它没有被识别,而是触发了 Small Talk。这就是为什么我不得不求助于 fallbackIntent。
    • 根据我的经验(我已经在打开 smallTalk 的情况下对此进行了测试),这不是它应该如何工作的,smallTalk 应该只在它不匹配任何意图(以及所需的contextIn 用于该特定意图)。也许您可以通过一些屏幕截图来阐明您的设置。 (意图、后备意图、概述以及您认为它没有按您希望的那样做的地方)希望我能以这种方式更好地帮助您,并就我如何设置它提供一些见解。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 2017-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多