跟踪对LUIS
和QnA Maker
的请求是什么的最佳方法是什么?
我不想在任何数据库中记录语音和响应,我需要类似AppInsights
的东西。
当然可以做到这一点,并且有很多内置的功能。您没有提到您使用的是哪种语言/环境(.net或节点),但是这里有一些出发点:
我想,如果这是您选择的语言,那么等效于node。如果是这样,this example可能会有用。
对于Qna Maker,只要在创建QnA Maker服务时启用了Application Insights,您所需要做的就是在日志中创建并运行查询。 This page提供了许多可以运行的分析示例。
对于LUIS,Hilton提供的链接适用于C#,但对于节点,您需要使用其他方法。 This example将向您展示如何在节点中创建LUIS App Insights助手并将跟踪发送到Application Insights。它没有为您提供示例查询,但是这里有一些我使用并发现有用的查询。如果您要寻找某些特定指标,请告诉我。
过去30天的意图饼图
requests
| where url endswith "messages"
| where timestamp > ago(30d)
| project timestamp, duration, performanceBucket, resultCode, url, id
| parse kind = regex url with *"(?i)http://"botName".azurewebsites.net/api/messages"
| join kind= inner (
traces | extend id = operation_ParentId
) on id
| where message == "LUIS"
| extend topIntent = tostring(customDimensions.LUIS_luisResponse_luisResult_topScoringIntent_intent)
| where topIntent != "None"
| where topIntent != ""
| summarize count() by topIntent
| order by count_ desc
| render piechart
结果低于置信度0.5的查询列表
requests
| where url endswith "messages"
| where timestamp > ago(30d)
| project timestamp, duration, performanceBucket, resultCode, url, id
| parse kind = regex url with *"(?i)http://"botName".azurewebsites.net/api/messages"
| join kind= inner (
traces | extend id = operation_ParentId
) on id
| where message == "LUIS"
| extend topIntent = tostring(customDimensions.LUIS_luisResponse_luisResult_topScoringIntent_intent)
| extend score = todouble(customDimensions.LUIS_luisResponse_luisResult_topScoringIntent_score)
| extend utterance = tostring(customDimensions.LUIS_luisResponse_text)
| order by timestamp desc nulls last
| project timestamp, botName, topIntent, score, utterance, performanceBucket, duration, resultCode
| where score < 0.5
每个会话的平均消息数
requests
| where url endswith "messages"
| where timestamp > ago(30d)
| project timestamp, url, id
| parse kind = regex url with *"(?i)http://"botName".azurewebsites.net/api/messages"
| join kind= inner (
traces | extend id = operation_ParentId
) on id
| where message == "LUIS"
| extend convID = tostring(customDimensions.LUIS_botContext_conversation_id)
| order by timestamp desc nulls last
| project timestamp, botName, convID
| summarize messages=count() by conversation=convID
| summarize conversations=count(), messageAverage=avg(messages)