是否有任何方法可以获取置信度,例如使用cloudwatch的指标还是创建新指标来获取它?
答案为否。 AWS LEX不为匹配的意图提供置信度。不知道为什么,但是我认为这是一个很大的缺点。大多数意图引擎,例如Google Dialogflow,Microsoft LUIS,IBM Watson,都提供了置信度信息,而LEX没有。您可以看到official documenataion]中提到的Lex对lambda函数的响应中没有置信度字段。
{
"currentIntent": {
"name": "intent-name",
"slots": {
"slot name": "value",
"slot name": "value"
},
"slotDetails": {
"slot name": {
"resolutions" : [
{ "value": "resolved value" },
{ "value": "resolved value" }
],
"originalValue": "original text"
},
"slot name": {
"resolutions" : [
{ "value": "resolved value" },
{ "value": "resolved value" }
],
"originalValue": "original text"
}
},
"confirmationStatus": "None, Confirmed, or Denied (intent confirmation, if configured)"
},
"bot": {
"name": "bot name",
"alias": "bot alias",
"version": "bot version"
},
"userId": "User ID specified in the POST request to Amazon Lex.",
"inputTranscript": "Text used to process the request",
"invocationSource": "FulfillmentCodeHook or DialogCodeHook",
"outputDialogMode": "Text or Voice, based on ContentType request header in runtime API request",
"messageVersion": "1.0",
"sessionAttributes": {
"key": "value",
"key": "value"
},
"requestAttributes": {
"key": "value",
"key": "value"
},
"recentIntentSummaryView": [
{
"intentName": "Name",
"checkpointLabel": Label,
"slots": {
"slot name": "value",
"slot name": "value"
},
"confirmationStatus": "None, Confirmed, or Denied (intent confirmation, if configured)",
"dialogActionType": "ElicitIntent, ElicitSlot, ConfirmIntent, Delegate, or Close",
"fulfillmentState": "Fulfilled or Failed",
"slotToElicit": "Next slot to elicit
}
]
}