triedgooglingit
triedgooglingit

Reputation: 85

Is there a way to convert QnA Questions into LUIS Intent Utterances

I followed this Microsoft Documentation to make my implementation of a Bot that uses LUIS to route users questions to QnAMaker: https://learn.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://learn.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?

Upvotes: 0

Views: 625

Answers (1)

Matt Stannett
Matt Stannett

Reputation: 2728

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.

Upvotes: 1

Related Questions