【问题标题】:can we retrieve only the intent using watson conversation?我们可以使用 watson 对话仅检索意图吗?
【发布时间】:2017-09-17 12:57:18
【问题描述】:

目前,我们正在使用 Watson Natural Language Classifier 服务 (NLC) 来获取用户问题的意图。但是配置和维护 NLC 变得越来越困难,所以想知道是否可以使用 Watson Conversation 部分仅获取用户问题的意图,而不是服务对话的响应。

【问题讨论】:

    标签: watson-conversation watson


    【解决方案1】:

    意图来自对话响应的一部分。如果您设置参数alternate_intents=true,则返回前 10 个意图。

    你仍然会得到剩余的有效载荷,但你可以忽略它。我建议创建一个条件为true 的对话节点,仅此而已。当找不到匹配的节点时,这将防止 SPEL 错误。

    您的回复将如下所示。

    {
      "alternate_intents": true,
      "context": { 
        "conversation_id": "6c256e10-ba3b-4d2b-84fc-740853879d4f",
        "system": { 
          "_node_output_map": { "True": [0] },
          "branch_exited": true,
          "branch_exited_reason": "completed",
          "dialog_request_counter": 1,
          "dialog_stack": [ { "dialog_node": "root" } ],
          "dialog_turn_counter": 1
        }
      },
      "entities": [],
      "input": { "text": "test" },
      "intents": [
          { "intent": "intent1", "confidence": 1.0 },
          { "intent": "intent2", "confidence": 0.9 },
          { "intent": "intent3", "confidence": 0.8 },
          { "intent": "intent4", "confidence": 0.7 },
          { "intent": "intent5", "confidence": 0.6 },
          { "intent": "intent6", "confidence": 0.5 },
          { "intent": "intent7", "confidence": 0.4 },
          { "intent": "intent8", "confidence": 0.3 },
          { "intent": "intent9", "confidence": 0.2 },
          { "intent": "intent10", "confidence": 0.1 }
      ],
      "output": {
        "log_messages": [],
        "nodes_visited": [ "True" ],
        "text": [ "" ]
      }
    }
    

    您只需要参考json_response['intents']。此外,如果您只关心意图,则无需继续发回上下文。


    只是补充一下。 NLC 和 Conversation 使用两种截然不同的学习模型。

    • NLC 使用“相对置信度”
    • 对话使用“绝对自信”

    在相对的情况下,找到的项目的所有置信度加起来为 1。通俗地说,NLC 自动假设答案只能在给出的意图中。

    对于 Absolute,置信度仅与该意图相关。这意味着对话可以理解您所说的内容可能不在所接受的培训中。这也意味着您的意图列表可以返回为空。

    所以,如果以前给你 90% 的东西现在给你 60%,请不要惊慌。他们只是得分不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多