I have a QnA with almost 200 questions. My clients are asking to add LUIS services in our bot. I tried to implement Bot with QnA and LUIS together but I am wondering what shall I put in the utterances? all the QnA questions?
these questions are really vivid and no pattern between them. In such case, how to make LUIS recognize the most matched question?
Please comment.
thanks, Vivek
I presume you've designed your bot so that "QnAMaker question" is just one LUIS intent among multiple intents. If that's the case, just add as many QnA question utterances as you like so that LUIS will come to understand what a QnA question looks like as distinct from the other intents. It may take a lot of training and you should be prepared for low confidence scores, so just plan to accommodate that.
If you have multiple QnA knowledge bases each with their own LUIS intent, you may need to add every single question as an utterance to ensure that LUIS knows which specific knowledge base each question applies to. However, you can also write some failsafe code to account for situations where LUIS guesses the wrong knowledge base. It might look something like this:
[LuisIntent("KnowledgeBase2")]
public async Task KnowledgeBase2Handler(IDialogContext context, LuisResult result)
{
if (KnowledgeBaseContains(result.Query, knowledgeBase2))
{
// Answer the question with the correctly-selected knowledge base
}
else
{
foreach (var kb in knowledgeBases)
{
if (KnowledgeBaseContains(result.Query, kb))
{
// Answer the question with the correct knowledge base
// that LUIS didn't guess
}
}
}
}