当我调用 LUIS API 时,我会获得与我的意图相关的置信度分数。我也得到了一个实体列表,但我没有得到相应的置信度分数。如何获得置信度分数?
问问题
113 次
1 回答
1
这在某种程度上取决于您如何调用 API(直接或使用某些连接器/识别器)。我的回答假设您是通过 URL 直接调用的。在这种情况下,您是否获得信心将取决于实体的类型。Regex 或 List 实体之类的东西不会有信心,因为它们只有在 100% 匹配时才会被识别。如果您使用的是机器学习实体,您将获得置信度分数。不确定任何其他实体类型或功能。这是来自我的应用程序的示例有效负载。你可以看到我有一个 orderNumberML 和一个 orderNumber 实体,前者是机器学习的,具有置信度值,而后者是 Regex 没有。你必须进入$instance
属性,因为顶级 json.prediction.entities 只会为您提供列表而无需任何其他上下文。
{
"query":"what is the status of order ABC123 and order DEF456?",
"prediction":{
"topIntent":"viewOrder",
"intents":{
"viewOrder":{
"score":0.999304056
},
"cancelChangeQuantity":{
"score":0.0195436124
},
"escalate":{
"score":0.018896237
},
"qna":{
"score":0.0164053086
},
"changeShipMethod":{
"score":0.0147548188
},
"expediteOrder":{
"score":0.0100477394
},
"mainMenu":{
"score":0.00383487041
},
"requestCoc":{
"score":0.00324145844
},
"orderShortage":{
"score":0.00208944362
},
"Utilities.Help":{
"score":0.00205096183
},
"generalSupport":{
"score":0.001971956
},
"trcSupport":{
"score":0.00169838977
},
"trcEscalate":{
"score":0.00165500911
},
"getPricing":{
"score":0.00135509949
},
"getAvailability":{
"score":0.00125210814
},
"orderOverage":{
"score":0.000846677169
},
"srStatus":{
"score":0.0006817043
},
"shippingProblem":{
"score":0.000577154336
},
"warrantyClaim":{
"score":0.000458181225
},
"getTranscript":{
"score":0.000367239147
},
"None":{
"score":0.000275740429
},
"manageProfile":{
"score":0.0002755769
},
"confirmShipDate":{
"score":0.0001726267
},
"Utilities.Cancel":{
"score":7.628063E-05
}
},
"entities":{
"orderNumberML":[
"ABC123",
"DEF456"
],
"orderNumber":[
"ABC123",
"DEF456"
],
"$instance":{
"orderNumberML":[
{
"type":"orderNumberML",
"text":"ABC123",
"startIndex":28,
"length":6,
"score":0.916349649,
"modelTypeId":1,
"modelType":"Entity Extractor",
"recognitionSources":[
"model"
]
},
{
"type":"orderNumberML",
"text":"DEF456",
"startIndex":45,
"length":6,
"score":0.9027585,
"modelTypeId":1,
"modelType":"Entity Extractor",
"recognitionSources":[
"model"
]
}
],
"orderNumber":[
{
"type":"orderNumber",
"text":"ABC123",
"startIndex":28,
"length":6,
"modelTypeId":8,
"modelType":"Regex Entity Extractor",
"recognitionSources":[
"model"
]
},
{
"type":"orderNumber",
"text":"DEF456",
"startIndex":45,
"length":6,
"modelTypeId":8,
"modelType":"Regex Entity Extractor",
"recognitionSources":[
"model"
]
}
]
}
}
}
}
于 2021-02-05T18:28:23.823 回答