プロジェクトの分析を取得する

カスタム質問と回答では、Azure 診断ログによりテレメトリ データとチャットのログを保存します。 下の手順でサンプル クエリを実行し、カスタム質問と回答ナレッジ ベースの使用状況分析を取得します。

  1. カスタム質問と回答が有効になっている言語リソースの 診断ログを有効にします

  2. 前の手順で、ログに [Audit]、[RequestResponse]、[AllMetrics] に加えて [Trace] を選択しました。

    Enable trace logging in custom question answering

Kusto クエリ

チャット ログ

// All QnA Traffic
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where OperationName=="CustomQuestionAnswering QueryKnowledgebases" // This OperationName is valid for custom question answering enabled resources
| extend answer_ = tostring(parse_json(properties_s).answer)
| extend question_ = tostring(parse_json(properties_s).question)
| extend score_ = tostring(parse_json(properties_s).score)
| extend kbId_ = tostring(parse_json(properties_s).kbId)
| project question_, answer_, score_, kbId_

一定期間内のプロジェクトおよびユーザーあたりのトラフィック カウント

// Traffic count per KB and user in a time period
let startDate = todatetime('2019-01-01');
let endDate = todatetime('2020-12-31');
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where OperationName=="CustomQuestionAnswering QueryKnowledgebases" // This OperationName is valid for custom question answering enabled resources
| where TimeGenerated <= endDate and TimeGenerated >=startDate
| extend kbId_ = tostring(parse_json(properties_s).kbId)
| extend userId_ = tostring(parse_json(properties_s).userId)
| summarize ChatCount=count() by bin(TimeGenerated, 1d), kbId_, userId_

GenerateAnswer API の待機時間

// Latency of GenerateAnswer
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where OperationName=="Generate Answer"
| project TimeGenerated, DurationMs
| render timechart

すべての操作の平均待機時間

// Average Latency of all operations
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| project DurationMs, OperationName
| summarize count(), avg(DurationMs) by OperationName
| render barchart

未回答の質問

// All unanswered questions
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where OperationName=="CustomQuestionAnswering QueryKnowledgebases" // This OperationName is valid for custom question answering enabled resources
| extend answer_ = tostring(parse_json(properties_s).answer)
| extend question_ = tostring(parse_json(properties_s).question)
| extend score_ = tostring(parse_json(properties_s).score)
| extend kbId_ = tostring(parse_json(properties_s).kbId)
| where score_ == 0
| project question_, answer_, score_, kbId_

事前構築済みカスタム質問応答の推論呼び出し

// Show logs from AzureDiagnostics table 
// Lists the latest logs in AzureDiagnostics table, sorted by time (latest first). 
AzureDiagnostics
| where OperationName == "CustomQuestionAnswering QueryText"
| extend answer_ = tostring(parse_json(properties_s).answer)
| extend question_ = tostring(parse_json(properties_s).question)
| extend score_ = tostring(parse_json(properties_s).score)
| extend requestid = tostring(parse_json(properties_s)["apim-request-id"])
| project TimeGenerated, requestid, question_, answer_, score_

次のステップ