Azure / ibex-dashboard

Custom Analytics Dashboard for Microsoft Bot Framework and other applications as well
http://aka.ms/ibex
MIT License
169 stars 188 forks source link

QnA Dashboard sentiment bug - using incorrect field #362

Open daltskin opened 6 years ago

daltskin commented 6 years ago

There is a bug in the QnA Dashboard which shows the incorrect sentiment. Current code is using the QnA score field eg:

sentiment=toint(todouble(customDimensions.score)*100)


          type: 'ApplicationInsights/Query',
          dependencies: { queryTimespan: 'dialog_sentimentConversations:queryspan' },
          params: {
            query: () => `
              customEvents
              | extend conversation=tostring(customDimensions.conversationId),
                timestamp=tostring(customDimensions.timestamp),
                userId=tostring(customDimensions.userId),
                sentiment=toint(todouble(customDimensions.score)*100)
              | where name=='MBFEvent.QNAEvent'
              | summarize count=count(), sentiment=avg(sentiment), maxTimestamp=max(timestamp) by conversation
              | extend color=iff(sentiment > 80, '#4caf50', iff(sentiment < 60, '#F44336', '#FFc107')),
                icon=iff(sentiment > 80, 'sentiment_very_satisfied',
                iff(sentiment < 60, 'sentiment_dissatisfied', 'sentiment_satisfied'))
              | order by sentiment`,
            mappings: { id: (val, row, idx) => `Conversation ${idx}` }```
morsh commented 6 years ago

@itye-msft - can you take a quick look at it? I saw this, and it seems the query looks at 'score' column instead of searching for a sentiment column.