Can you use multiple intents in one triggerAction? [LUIS]

北城余情 提交于 2019-12-13 02:32:06

问题


I have a QnA bot that should work for a couple of intents and I want to trigger it for None intent, Greeting because I have some unique responses, and IT help because that's the main purpose of the QnA bot. Do I have to copy paste my entire dialog and just change the intent name or can I list multiple intents for the matches method?

  bot.dialog('QnABotRequest', function (session, args) {
       //Code
    }).triggerAction({
        matches: 'Greeting' | 'None' | 'IT Help' //Maybe something like this ?
    });

https://docs.botframework.com/en-us/node/builder/chat-reference/modules/_botbuilder_d_.html#matchtype Where this is defined it says:

{(RegExp|string)[]}

An array of either regular expressions or named intents can be passed to match the users utterance in a number of possible ways. The rule generating the highest score (best match) will be used for scoring purposes.


回答1:


The way to use it is:

.triggerAction({
    matches: [/greeting/i, /none/i, /^it help/i]
 )}

or

.triggerAction({ matches: [
    /(roll|role|throw|shoot).*(dice|die|dye|bones)/i,
    /new game/i
 ]});



回答2:


If you are using azure, then you can try the following

bot.dialog('QnABotRequest', function (session, args) {
       //Code
    }).triggerAction({
        matches: ['Greeting', 'None', 'IT Help'],
    })


来源:https://stackoverflow.com/questions/45223553/can-you-use-multiple-intents-in-one-triggeraction-luis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!