【问题标题】:How to get confidence score for detected entities?如何获得检测到的实体的置信度分数?
【发布时间】:2021-05-08 23:38:12
【问题描述】:

当我调用 LUIS API 时,我会获得与我的意图相关的置信度分数。我也得到了一个实体列表,但我没有得到相应的置信度分数。如何获得置信度分数?

【问题讨论】:

  • 它是什么样的实体?预建实体?预建域实体?还是你身边的创造者?

标签: azure microsoft-cognitive azure-language-understanding azure-cognitive-services luis.ai


【解决方案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"
                  ]
               }
            ]
         }
      }
   }
}

【讨论】:

  • 这解决了您的问题吗?如果是这样,请考虑接受并支持此答案,以便其他人可以找到它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-09-16
  • 2014-01-27
  • 1970-01-01
  • 1970-01-01
  • 2021-06-03
  • 1970-01-01
  • 2015-04-21
相关资源
最近更新 更多