这在一定程度上取决于您调用 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"
]
}
]
}
}
}
}