0
votes

I followed this Microsoft Documentation to make my implementation of a Bot that uses LUIS to route users questions to QnAMaker: https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=cs

Basically I noticed in the V3 Documentation(https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/tutorials/integrate-qnamaker-luis) (As there is no mention of it in V4) it says:

Add an intent for each QnA Maker knowledge base. The example utterances should correspond to questions in the QnA Maker knowledge bases.

My question is, other than manually copying all the questions from QnA Maker to each individual Intent (Assuming I have multiple KBs) is there an easier way to do this? Eg export the file from QnA Maker or something similar?

1
How did you go with my answer below?Matt Stannett
Hmmm not too well basically I was trying to add intents for my own knowledge base but for kept getting a bad argument when I was trying to do the dispatch create command. But it worked for the sample they provided just not my owntriedgooglingit
Mind posting the exact error message you get when running the dispatch create command?Matt Stannett
ERROR One or more errors occurred. (The remote server returned an error: (400) Bad Request.) Request url: westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/… Response: { "error": { "code": "BadArgument", "message": "Please verify azure search service is up, restart the WebApp and try again" } }triedgooglingit
This is a good idea, might implement it this way instead, appreciate all your help!triedgooglingit

1 Answers

1
votes

This is done using the Dispatch tool. Essentially what it does is downloads the questions from your QnA Maker KBs and creates a new LUIS app with "dispatch" in the name. Inside this new app a intent will be added for each of your QnA Maker KBs, the naming will be q_<kb_name_here>, the questions from the relevant KB will be added to this intent as utterances.

How to do this is outline under the Create the dispatch model section of the documentation that you linked.

You will need to have NodeJS which comes with npm installed to do the following from the command line in your CognitiveModels folder (rough guide):

// install botdispatch package
npm i -g botdispatch

// initialise a dispatch file
dispatch init -n <filename-to-create> --luisAuthoringKey "<your-luis-authoring-key>" --luisAuthoringRegion <your-region>

// add references to luis and qna apps
dispatch add -t luis -i "<app-id-for-weather-app>" -n "<name-of-weather-app>" -v <app-version-number> -k "<your-luis-authoring-key>" --intentName l_Weather
dispatch add -t luis -i "<app-id-for-home-automation-app>" -n "<name-of-home-automation-app>" -v <app-version-number> -k "<your-luis-authoring-key>" --intentName l_HomeAutomation
dispatch add -t qna -i "<knowledge-base-id>" -n "<knowledge-base-name>" -k "<azure-qna-service-key1>" --intentName q_sample-qna

// generate a dispatch model
dispatch create

Then in the LUIS portal you will have to find your new app and Publish it before you will be able to use it. then follow the steps under the Use the dispatch model to take advantage of LUIS for routing.