Compartilhar via


ConversationAuthoringClient.GetModelEvaluationSummary Método

Definição

[Método protocol] Obtém o resumo de avaliação de um modelo treinado. O resumo inclui medidas de desempenho de alto nível do modelo, por exemplo, F1, Precisão, Recall etc.

  • Esse método de protocolo permite a criação explícita da solicitação e o processamento da resposta para cenários avançados.
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

Parâmetros

projectName
String

O nome do projeto a ser usado.

trainedModelLabel
String

O rótulo de modelo treinado.

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço.

Exceções

projectName ou trainedModelLabel é nulo.

projectName ou trainedModelLabel é uma cadeia de caracteres vazia e esperava-se que não estivesse vazia.

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar GetModelEvaluationSummary com os parâmetros necessários e analisar o resultado.

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());

Comentários

Informações adicionais podem ser encontradas na documentação da API REST do serviço: https://learn.microsoft.com/rest/api/language/2023-04-01/conversational-analysis-authoring/get-model-evaluation-summary

Aplica-se a