Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
298 views
in Technique[技术] by (71.8m points)

azure - How to get confidence score for detected entities?

When I call the LUIS API, I get confidence scores associated with my intents. I also get a list of entities, but I don't get the corresponding confidence scores. How do I get the confidence scores?

question from:https://stackoverflow.com/questions/66049546/how-to-get-confidence-score-for-detected-entities

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This somewhat depends on how you're calling the API (directly or with some connector/recognizer). My answer assumes you're calling directly via the URL. In that case, whether you get a confidence or not is going to depend on the type of entity. Things like Regex or List entities aren't going to have a confidence because they only are identified if they are a 100% match. If you are using Machine Learned entities, you will have a confidence score. Not sure about any other entity types or features. Here is an example payload from my application. You can see that I have both an orderNumberML and orderNumber entity, the former being Machine Learned with a confidence value and the latter Regex without. You have to go into the $instance property, as the top level json.prediction.entities will just give you the list without any additional context.

{
   "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"
                  ]
               }
            ]
         }
      }
   }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...