Google智能助理触发"默认后备意图"而Dialogflow没有

时间:2018-04-17 12:58:46

标签: actions-on-google dialogflow

我创建了一个聊天机器人,其中只包含一个额外的意图(depr_intent)以及Default Welcome IntentDefault Fallback Intent。这个意图仅包括以下培训短语:"是什么原因导致一个人感到抑郁?如何治疗?"。我将ML CLASSIFICATION THRESHOLD设置为0.2。

当我进入Dialogflow"我是一个沮丧的人"然后触发depr_intent并且Dialogflow的json响应如下:

{
  "id": "*****************************",
  "timestamp": "2018-04-17T12:41:07.662Z",
  "lang": "en",
  "result": {
    "source": "agent",
    "resolvedQuery": "I am a depressed person",
    "action": "5",
    "actionIncomplete": false,
    "parameters": {},
    "contexts": [],
    "metadata": {
      "intentId": "*****************************",
      "webhookUsed": "true",
      "webhookForSlotFillingUsed": "false",
      "webhookResponseTime": 253,
      "intentName": "depr_intent"
    },
    "fulfillment": {
      "speech": "...",
      "source": "agent",
      "displayText": "...",
      "messages": [
        {
          "type": 0,
          "speech": "..."
        }
      ]
    },
    "score": 0.25
  },
  "status": {
    "code": 200,
    "errorType": "success",
    "webhookTimedOut": false
  },
  "sessionId": "****************************"
}

请注意上面的json回复,这个问题的分数是0.25。但是,当我在Google智能助理上输入完全相同的短语("我是一个沮丧的人")时输入"与我的测试应用对话"然后触发Default Welcome Intent),然后触发Default Fallback Intent响应"抱歉我没有找到与您的问题相关的任何内容&#34 34;而不是depr_intent。 Google智能助理的DEBUG部分包含以下内容:

{
  "response": "Sorry I did not find anything relevant to your question.",
  "expectUserResponse": 1,
  "conversationToken": "CiZDIzVhZD...",
  "audioResponse": "//NExAARsA...",
  "debugInfo": {
    "assistantToAgentDebug": {
      "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=*************************' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: [token]'  -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"*************************\",\"locale\":\"en-US\",\"lastSeen\":\"2018-04-17T12:46:56Z\"},\"conversation\":{\"conversationId\":\"1523969239924\",\"type\":\"ACTIVE\",\"conversationToken\":\"[]\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"I am a depressed person\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"I am a depressed person\",\"textValue\":\"I am a depressed person\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}'",
      "assistantToAgentJson": "{\"user\":{\"userId\":\"A****************************\",\"locale\":\"en-US\",\"lastSeen\":\"2018-04-17T12:46:56Z\"},\"conversation\":{\"conversationId\":\"1523969239924\",\"type\":\"ACTIVE\",\"conversationToken\":\"[]\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"I am a depressed person\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"I am a depressed person\",\"textValue\":\"I am a depressed person\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}"
    },
    "agentToAssistantDebug": {
      "agentToAssistantJson": "{\"conversationToken\":\"[]\",\"expectUserResponse\":true,\"expectedInputs\":[{\"inputPrompt\":{\"richInitialPrompt\":{\"items\":[{\"simpleResponse\":{\"textToSpeech\":\"Sorry I did not find anything relevant to your question.\"}}]}},\"possibleIntents\":[{\"intent\":\"assistant.intent.action.TEXT\"}],\"speechBiasingHints\":[\"$Employee_names_MP\",\"$Employee_names_JT\",\"$Greeting_type\",\"$Objective_whoswho\",\"$Locations\"]}],\"responseMetadata\":{\"status\":{\"message\":\"Success (200)\"},\"queryMatchInfo\":{}}}"
    },
    "sharedDebugInfoList": []
  },
  "visualResponse": {
    "visualElementsList": [
      {
        "displayText": {
          "content": "Sorry I did not find anything relevant to your question."
        }
      }
    ],
    "suggestionsList": [],
    "agentLogoUrl": "https://www.gstatic.com/voice/opa/partner_icons/generic_3p_avatar.png"
  },
  "clientError": 0,
  "is3pResponse": 1
}

为什么会这样?

实际上,即使我将ML CLASSIFICATION THRESHOLD设置为0.05,Google智能助理也会发生同样的事情。此外,请记住,如果我进入谷歌助理,那么是什么原因导致一个人感到沮丧?然后触发depr_intent(显然同样适用于Dialogflow)。最后请注意,我在这个基本机器人上使用webhook的事实并没有什么不同(我认为),因为即使没有webhook也会触发相同的意图。

**

更新

**

当我进入Google智能助理时#34;为什么我是一个沮丧的人?#34;评分为0.2800000011920929(记住ML CLASSIFICATION THRESHOLD为0.2)然后触发depr_intent。就个人而言,我倾向于认为Google智能助理的最低ML CLASSIFICATION THRESHOLD0.25。但是,我输入了两个不同的短语,每个短语的分数为0.25,而Google智能助理在另一个短语中触发depr_intent而在另一个短语中触发Default Fallback Intent(同时在Dialogflow上触发depr_intent )。因此,我真的不知道发生了什么。但是,如果我们接受Google智能助理可能只有0.25最低ML CLASSIFICATION THRESHOLD,那么可能是前一个短语略高于0.25而后一个高于0.25 $XDG_CONFIG_HOME/git/ignore 1}}。

0 个答案:

没有答案