2016-12-02 51 views
0

我有一個bot使用兩個LUIS應用程序作爲LuisRecognizers來猜測客戶意圖。我的問題是爲什麼機器人會迴應分數最低的意圖?我仔細檢查了這一點,如果我手動檢查通過路易斯dashbord得分,然後我收到了類似的東西:IntentA分數0.92和IntentB分數爲1.如果我通過相同的輸入通過botframework它與IntentA有較低的分數響應。我錯過了什麼嗎? 我試圖玩intentThreshold,recognitionMode或recogniseOrder,所有在文檔中提到,但沒有收到更好的結果。具有較低分數意圖的Botframework響應

+0

你在使用node.js嗎?您使用哪個網址與LUIS交談? –

+0

你說得對,我正在使用node.js和這個網址https://api.projectoxford.ai/luis/v2.0/apps – jano

回答

1

如果考慮C# code of BotFramework你可以看到功能「從最好的意圖」實施類似如下:

protected virtual IntentRecommendation BestIntentFrom(LuisResult result) 
{ 
    return result.Intents.MaxBy(i => i.Score ?? 0d); 
} 

如果你想測試這一點,你可以覆蓋在你的LuisDialog,看其機制的細節(通過記錄大量的意圖)。 ,您可以看到最高分數將在決策點選擇。 此外,您還可以在NodeJs找到路易斯識別:

LuisRecognizer.recognize(utterance, model, (err, intents, entities) => { 
       if (!err) { 
        result.intents = intents; 
        result.entities = entities; 

        // Return top intent 
        var top: IIntent; 
        intents.forEach((intent) => { 
         if (top) { 
          if (intent.score > top.score) { 
           top = intent; 
          } 
         } else { 
          top = intent; 
         } 
        }); 
        if (top) { 
         result.score = top.score; 
         result.intent = top.intent; 

         // Correct score for 'none' intent 
         // - The 'none' intent often has a score of 1.0 which 
         // causes issues when trying to recognize over multiple 
         // model. Setting to 0.1 lets the intent still be 
         // triggered but keeps it from trompling other models. 
         switch (top.intent.toLowerCase()) { 
          case 'builtin.intent.none': 
          case 'none': 
           result.score = 0.1; 
           break; 
         } 
        } 
        cb(null, result); 
       } else { 
        cb(err, null); 
       } 
      }); 

再次同C#代碼,識別choosees的最高分,如果存在在路易斯的應用模型。 因此,這個問題並不來自客戶端。 因此,建議可以考慮接收到客戶端的LUIS的JSON響應。

0

您是否從LUIS儀表板中試過您的已發佈型號?我遇到了同樣的問題,因爲LUIS目前沒有正確發佈我的模型,並且沒有捕獲到我所做的更改,所以受過訓練的模型在儀表板中完美工作,但未發佈。

我第二天就試過了,它在儀表板和botframework中都正確地發佈了一切。

相關問題