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?
Thomas. Have a look at the Google Apis DetectIntent Documentation.
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