azure - 有没有办法将 QnA 问题转换为 LUIS 意图表达
问题描述
我遵循此 Microsoft 文档来实现使用 LUIS 将用户问题路由到 QnAMaker 的 Bot:https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?视图=azure-bot-service-4.0&tabs=cs
基本上我在 V3 文档中注意到(https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/tutorials/integrate-qnamaker-luis)(因为在 V4 中没有提到它)它说:
为每个 QnA Maker 知识库添加一个意图。示例话语应与 QnA Maker 知识库中的问题相对应。
我的问题是,除了手动将 QnA Maker 中的所有问题复制到每个 Intent(假设我有多个 KB)之外,还有更简单的方法吗?例如从 QnA Maker 或类似的东西导出文件?
解决方案
这是使用Dispatch工具完成的。本质上,它的作用是从您的 QnA Maker KB 下载问题并创建一个名称中带有“dispatch”的新 LUIS 应用程序。在这个新应用程序中,将为您的每个 QnA Maker KB 添加一个意图,命名为q_<kb_name_here>
,来自相关 KB 的问题将作为话语添加到此意图中。
如何执行此操作在您链接的文档的创建调度模型部分下进行了概述。
您需要安装随附的NodeJSnpm
,以便从文件夹中的命令行执行以下操作CognitiveModels
(粗略指南):
// 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
然后,您必须在 LUIS 门户中找到您的新应用并发布它,然后才能使用它。然后按照使用调度模型利用 LUIS 进行路由下的步骤进行操作。
推荐阅读
- c# - 循环属性 c#
- c++ - 移动运算符破坏原始指针
- flutter - 在 Flutter 应用程序中加密敏感数据
- javascript - 以不同用户身份运行 Google 表格插件
- python - 使用 OpenCV 计算鸟瞰图
- javascript - Material UI react js中自动完成组件中的默认选择
- c# - 反序列化 JSON 对 C# 对象的响应错误
- selenium - 查找和元素的问题:Selenium 在页面上找不到特定按钮
- c - 如何将 Esc 映射到 Motif 小部件中的操作
- java - Java 11 和 spring boot - 从 spring boot 应用程序的 fat jar 中的依赖 jar 加载资源