How to determine confidence level in DialogFlow

喜欢而已 提交于 2019-12-08 05:36:21

问题


When a user is responding to a question in DialogFlow, is there a way to obtain the confidence levels that was achieved for a specific phrase? Example: Q: What is the capital of Germany? A: Berlin

I would like to read back how well the AI understood the user, e.g.:

He said: "Boerlin" ---> 87.3% confidence level that he said "Berlin"

Is there a way to read back this kind of information?


回答1:


Thomas. Have a look at the Google Apis DetectIntent Documentation.

https://cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2beta1/projects.agent.environments.users.sessions/detectIntent

Using the method is as follows:

POST https://dialogflow.googleapis.com/v2/projects/{DialogFlowProjectName}/agent/sessions/{SessionId}:detectIntent

The body:

{
  "queryInput": {
    "text": {
      "text": "{Question You would like to ask}",
      "languageCode": "en-EN"
    }
  }
}

It Uses OAuth2.0 you can use google OAuth Sandbox to generate a temporary token to use https://developers.google.com/oauthplayground/

In the response there will be a field:

"intentDetectionConfidence": 0.6776556,
 "intent": {
            "name": "{IntentId}",
            "displayName": "{IntentName}"
        }


来源:https://stackoverflow.com/questions/48039722/how-to-determine-confidence-level-in-dialogflow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!