共用方式為


ConversationAuthoringClient.GetModelEvaluationSummaryAsync Method

Definition

[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 System.Threading.Tasks.Task<Azure.Response> GetModelEvaluationSummaryAsync (string projectName, string trainedModelLabel, Azure.RequestContext context = default);
abstract member GetModelEvaluationSummaryAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetModelEvaluationSummaryAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetModelEvaluationSummaryAsync (projectName As String, trainedModelLabel As String, Optional context As RequestContext = Nothing) As Task(Of 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 GetModelEvaluationSummaryAsync 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 = await client.GetModelEvaluationSummaryAsync("<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

Applies to