首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我们能不能用沃森的对话来检索意图呢?

我们能不能用沃森的对话来检索意图呢?
EN

Stack Overflow用户
提问于 2017-09-17 12:57:18
回答 1查看 297关注 0票数 1

目前,我们正在使用沃森自然语言分类服务(NLC)来获得用户问题的意图。但是,配置和维护NLC变得越来越困难,所以我想知道是否可能只使用Watson会话部分来获取用户问题的意图,而不是从服务中获取对话的意图。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-17 15:17:05

这种意图来自于谈话后的回应。如果设置参数alternate_intents=true,则返回前10个意图。

您仍将获得剩余的有效负载,但您可以忽略它。我建议创建一个对话框节点,其条件为true,而不是其他任何条件。这将防止在找不到匹配节点时出现SPEL错误。

你的反应会是这样的。

代码语言:javascript
复制
{
  "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和会话使用两种非常不同的学习模式。

  • NLC使用“相对信心”
  • 会话使用“绝对自信”

在亲属的情况下,所有发现的项目的信任将加起来1。在外行术语中,NLC自动假定答案只能在所给出的意图中。

从绝对意义上说,这些秘密只与这一意图有关。这意味着谈话可以理解,你所说的可能并不是在你接受的训练中。这也意味着您的意图列表可以返回空。

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46264337

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档