gpt4 book ai didi

botframework - Microsoft QnA 制造商是否使用 LUIS?

转载 作者:行者123 更新时间:2023-12-01 23:58:11 25 4
gpt4 key购买 nike

我打算使用 QnA Maker,但它在后台使用 LUIS 吗?如果问题的提出方式与 QnA 制作者训练的方式不同,它会回应吗?

最佳答案

does it use LUIS in the background ?

不,但你可以 Combining Search, QnA Maker, and/or LUIS .

根据文档,建议通过以下三种方式将QnA与LUIS一起实现。

  1. Call both QnA Maker and LUIS at the same time, and respond to the user by using information from the first one that returns a score of a specific threshold.

  2. Call LUIS first, and if no intent meets a specific threshold score, i.e., "None" intent is triggered, then call QnA Maker. Alternatively, create a LUIS intent for QnA Maker, feeding your LUIS model with example QnA questions that map to "QnAIntent."

  3. Call QnA Maker first, and if no answer meets a specific threshold score, then call LUIS.

这里我发布了一个用 C# 编写的第三种方法的代码示例。

MessagesController 中首先调用 QnA Maker:

if (activity.Type == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => new Dialogs.MyQnADialog());
}

MyQnADialog中,查看是否有匹配的答案,如果没有,则调用LUIS:

[QnAMakerAttribute("QnASubscriptionKey", "QnAKnowledgebaseId", "No Answer in Knowledgebase, seraching in Luis...", 0.5)]
[Serializable]
public class MyQnADialog : QnAMakerDialog
{

protected override async Task DefaultWaitNextMessageAsync(IDialogContext context, IMessageActivity message, QnAMakerResults result)
{
if (result.Answers.Count == 0)
{
await context.Forward(new MyLuisDialog(), this.ResumeAfterNewOrderDialog, message, CancellationToken.None);
}
context.Wait(this.MessageReceivedAsync);
//return base.DefaultWaitNextMessageAsync(context, message, result);
}
private async Task ResumeAfterNewOrderDialog(IDialogContext context, IAwaitable<object> result)
{
var resultfromnewdialog = await result;
context.Wait(this.MessageReceivedAsync);
}

}

关于botframework - Microsoft QnA 制造商是否使用 LUIS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47736406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com