I have a chatbot that routes to the appropriate KB in QnAMaker based on intent. E.g. if the question is related to Project management, then it will route to the Project management KB.
My dilemma now is how to run active learning based on the intent and routing the suggestions back to the appropriate KB.
Appreciate anyone's advice on this.
I have taken the Active learning example from Microsoft to initialize the dialog in the constructor but am unable to detect the input query.
public async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken))
{
// Handle Message activity type, which is the main activity type for shown within a conversational interface
// Message activities may contain text, speech, interactive cards, and binary or unknown attachments.
// see https://aka.ms/about-bot-activity-message to learn more about the message and other activity types
if (turnContext.Activity.Type == ActivityTypes.Message)
{
DialogContext dialogContext = await _dialogs.CreateContextAsync(turnContext, cancellationToken);
DialogTurnResult results = await dialogContext.ContinueDialogAsync(cancellationToken);
switch (results.Status)
{
case DialogTurnStatus.Cancelled:
case DialogTurnStatus.Empty:
await dialogContext.BeginDialogAsync(_dialogHelper.ActiveLearningDialogName, _qnaMakerOptions, cancellationToken);
break;
case DialogTurnStatus.Complete:
break;
case DialogTurnStatus.Waiting:
// If there is an active dialog, we don't need to do anything here.
break;
}
await _accessors.ConversationState.SaveChangesAsync(turnContext);
}
else if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate)
{
if (turnContext.Activity.MembersAdded != null)
{
// Send a welcome message to the user and tell them what actions they may perform to use this bot
await SendWelcomeMessageAsync(turnContext, cancellationToken);
}
}
else
{
await turnContext.SendActivityAsync($"{turnContext.Activity.Type} event detected", cancellationToken: cancellationToken);
}
}
I expect the active learning result to be displayed based on the intent and routing to the correct QnA KB.