[英]Microsoft Bot Framework with LUIS not detecting all intents
[英]Connecting LUIS to Microsoft Bot Framework
在假期的周末,我一直在嘗試讓一個使用Microsoft Bot Framework的機器人來工作。 我正在使用3.9.1版的botbuilder軟件包。
我已經在www.luis.ai上創建了一個應用程序和模型。 我已經能夠通過“訓練與測試”功能成功測試自己的意圖。 然后,在我的實際Node代碼中,我有以下內容:
let connector = new BotBuilder.ChatConnector({
appId: 'myId',
appPassword: 'myAppSecret'
});
let bot = new BotBuilder.UniversalBot(connector);
let luis = new BotBuilder.LuisRecognizer('myLuisAppUrl');
let intent = new BotBuilder.IntentDialog({ });
intent.recognizer(luis);
intent.matches('Intent.1', '/execute-report');
intent.matches('Intent.2', '/execute-batch-job');
intent.onDefault('/unknown');
bot.dialog('/', intent);
bot.dialog('/execute-report', [function(session, args, next) {
var result = ((Date.now() % 2) === 0) ? 'Report Ran!' : 'Failed';
session.send(result);
}]);
bot.dialog('/execute-batch-job', [function(session, args, next) {
var result = ((Date.now() % 2) === 0) ? 'Batch Job Ran!' : 'Unable to run Batch Job';
session.send(result);
}]);
bot.dialog('/unknown', [function(session, args, next) {
session.send('What did you ask for?');
}]);
與我的漫游器進行交互時,我總是收到“您要什么?”。 換句話說,在這一點上,我知道:
/unknown
對話框總是被調用,這不是正確的交互。 我在LUIS中的模型看起來正確:
一種。 如果我在LUIS.ai Test應用程序中輸入“運行報告”,則得分最高的意圖是“ Intent.1”
b。 如果我在LUIS.ai Test應用程序中輸入“ Execute Batch Job”,則得分最高的意圖是“ Intent.2”
但是,我的機器人沒有發送適當的響應。 即使已使用/execute-report
和/execute-batch-job
對話框,也不會使用它們。 我不明白我在做什么錯。 對我來說,我相信我已經正確設置了我的機器人。 我看不到我在做什么錯。 有人可以告訴我我在做什么錯嗎? 有沒有辦法在我的Node代碼中看到LUIS返回的響應,類似於LUIS.ai中“測試”應用程序中看到的響應
如果轉到LuisRecognizer的89行,然后在新行中添加以下內容: console.log(result);
您將看到您的機器人已收到的LUIS響應對象。
您的代碼對我來說似乎正確,因此問題可能出在LUIS方面。 您是否發布了應用程序?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.