ConversationAuthoringClient.GetModelEvaluationSummary Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetModelEvaluationSummary (string projectName, string trainedModelLabel, Azure.RequestContext context = default);
abstract member GetModelEvaluationSummary : string * string * Azure.RequestContext -> Azure.Response
override this.GetModelEvaluationSummary : string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetModelEvaluationSummary (projectName As String, trainedModelLabel As String, Optional context As RequestContext = Nothing) As Response
Parameters
- projectName
- String
The name of the project to use.
- trainedModelLabel
- String
The trained model label.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
projectName
or trainedModelLabel
is null.
projectName
or trainedModelLabel
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call GetModelEvaluationSummary with required parameters and parse the result.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConversationAuthoringClient(endpoint, credential);
Response response = client.GetModelEvaluationSummary("<projectName>", "<trainedModelLabel>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").GetProperty("<test>").GetProperty("<test>").GetProperty("normalizedValue").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").GetProperty("<test>").GetProperty("<test>").GetProperty("rawValue").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("f1").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("precision").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("recall").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("truePositiveCount").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("trueNegativeCount").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("falsePositiveCount").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("<test>").GetProperty("falseNegativeCount").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString());
Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").GetProperty("<test>").GetProperty("<test>").GetProperty("normalizedValue").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").GetProperty("<test>").GetProperty("<test>").GetProperty("rawValue").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("f1").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("precision").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("recall").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("truePositiveCount").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("trueNegativeCount").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("falsePositiveCount").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("<test>").GetProperty("falseNegativeCount").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString());
Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString());
Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString());
Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString());
Remarks
Additional information can be found in the service REST API documentation: https://learn.microsoft.com/rest/api/language/2023-04-01/conversational-analysis-authoring/get-model-evaluation-summary