Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Artificial intelligence Luis和QnA在同一个应用程序中_Artificial Intelligence_Azure Language Understanding - Fatal编程技术网

Artificial intelligence Luis和QnA在同一个应用程序中

Artificial intelligence Luis和QnA在同一个应用程序中,artificial-intelligence,azure-language-understanding,Artificial Intelligence,Azure Language Understanding,如果我的聊天机器人是使用luis创建的,那么有可能将QnA集成到其中吗?当路易斯没有答案时,我想用路易斯的意图“无”来触发QnA。 我是如何做到这一点的?看看样品。是的,这是可能的 在Luis对话框中添加以下内容 [LuisModel("modelID", "SubscriptionKey")] [Serializable] public class RootDialog : LuisDialog<object> { [LuisIntent("None")] publ

如果我的聊天机器人是使用luis创建的,那么有可能将QnA集成到其中吗?当路易斯没有答案时,我想用路易斯的意图“无”来触发QnA。 我是如何做到这一点的?

看看样品。

是的,这是可能的

在Luis对话框中添加以下内容

[LuisModel("modelID", "SubscriptionKey")]
[Serializable]
public class RootDialog : LuisDialog<object>
{
    [LuisIntent("None")]
    public async Task NoneRes(IDialogContext context, LuisResult result)
    {
            var qnadialog = new QnADialog();
            await context.Forward(new QnADialog(), AfterQnADialog, context.Activity, CancellationToken.None);
    }
    private async Task AfterQnADialog(IDialogContext context, IAwaitable<object> result)
    {
        var answerFound = await result;
        // handle after qna response
    }
}
[Serializable]
[QnAMaker(authKey: "AuthKey", knowledgebaseId: "KnowledgebaseId", defaultMessage: "please rephrase, I could not understand.", scoreThreshold: 0.5, top: 1, endpointHostName: "https://yourAccount.azurewebsites.net/qnamaker")]
public class QnADialog : QnAMakerDialog
{}
因此,当您的LUIS返回None intent时,它将调用QnADialog,在属性本身中,您将给出AuthKey、Knowledgebase ID、默认响应、主机地址等,它将工作

希望这会有所帮助

您可以尝试以下方法:

如果机器人使用多个LUIS模型和QnA Maker知识库(KB),则可以使用Disptach工具确定哪个LUIS模型或QnA Maker知识库最适合处理用户输入。dispatch tool通过创建单个LUIS应用程序将用户输入路由到正确的模型来实现这一点

该工具可用于Bot Builder SDK v4