change directory and sample name to remove hierarchical, edit comments
This commit is contained in:
Родитель
df17920061
Коммит
68c535a388
|
@ -96,7 +96,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Dialo
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Dialogs.Tests", "tests\Microsoft.Bot.Builder.Dialogs.Tests\Microsoft.Bot.Builder.Dialogs.Tests.csproj", "{2F77CA1D-E6F0-4DEA-96BB-8A039F4D0FF8}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical", "samples\Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical\Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical.csproj", "{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis.Dispatch", "samples\Microsoft.Bot.Samples.Ai.Luis.Dispatch\Microsoft.Bot.Samples.Ai.Luis.Dispatch.csproj", "{91178F5C-303C-43B8-9284-84125FB07FFF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -411,14 +411,14 @@ Global
|
|||
{2F77CA1D-E6F0-4DEA-96BB-8A039F4D0FF8}.Documentation|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2F77CA1D-E6F0-4DEA-96BB-8A039F4D0FF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2F77CA1D-E6F0-4DEA-96BB-8A039F4D0FF8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Documentation|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Documentation|Any CPU.Build.0 = Debug|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -468,7 +468,7 @@ Global
|
|||
{0F639EB4-FB64-4909-8A10-FB93E7BE3AFB} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
|
||||
{B71A123F-09FE-45D7-9644-4EE3E1E221AE} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
|
||||
{2F77CA1D-E6F0-4DEA-96BB-8A039F4D0FF8} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
|
||||
{1A5ED921-4613-4DCB-9AE3-1F93EFCC1F65} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
|
||||
{91178F5C-303C-43B8-9284-84125FB07FFF} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7173C9F3-A7F9-496E-9078-9156E35D6E16}
|
||||
|
|
|
@ -7,19 +7,19 @@ using Microsoft.Bot.Builder.Ai.QnA;
|
|||
using Microsoft.Bot.Schema;
|
||||
|
||||
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch
|
||||
{
|
||||
/// <summary>
|
||||
/// This bot demonstrates how to use a LUIS model generated by the Dispatch tool in hierarchical mode.
|
||||
/// This bot demonstrates how to use a LUIS model generated by the Dispatch tool.
|
||||
///
|
||||
/// See https://aka.ms/bot-dispatch for more information on Dispatch tool.
|
||||
/// See https://aka.ms/bot-dispatch for more information on the Dispatch tool.
|
||||
///
|
||||
/// This example assumes the LUIS app from Dispatch is generated from two LUIS apps and one QnAMaker service:
|
||||
/// * A LUIS app named "homeautomation", for handling messages about turning lights and appliances on and off
|
||||
/// * A LUIS app named "weather", for handling requests for weather forecasts and conditions
|
||||
/// * A QnA Maker service named "faq", for answering questions about using the hypothetical home automation system.
|
||||
///
|
||||
/// Generate the LUIS app using Dispatch tool with the -hiearchical flag set to true. This will create one intent
|
||||
/// Generate the LUIS app using Dispatch tool. The tool creates a LUIS app with one intent
|
||||
/// for each of the constituent LUIS apps and QnAMaker services: "l_homeautomation", "l_weather", "q_faq".
|
||||
/// The bot can use the intents to route the user messages to the appropriate LUIS app or QnA Maker.
|
||||
///
|
||||
|
@ -38,11 +38,11 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
|||
|
||||
// App ID for a LUIS model named "homeautomation"
|
||||
private static LuisModel luisModel1 =
|
||||
new LuisModel("<YOUR-APP-ID>", "<YOUR-LUIS-SUBSCRIPTION-KEY>", new System.Uri("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/"));
|
||||
new LuisModel("<YOUR-LUIS-APP-ID>", "<YOUR-LUIS-SUBSCRIPTION-KEY>", new System.Uri("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/"));
|
||||
|
||||
// App ID for a LUIS model named "weather"
|
||||
private static LuisModel luisModel2 =
|
||||
new LuisModel("YOUR-APP-ID", "<YOUR-LUIS-SUBSCRIPTION-KEY>", new System.Uri("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/"));
|
||||
new LuisModel("YOUR-LUIS-APP-ID", "<YOUR-LUIS-SUBSCRIPTION-KEY>", new System.Uri("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/"));
|
||||
|
||||
public async Task OnTurn(ITurnContext context)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
|||
{
|
||||
intentsList.Add($"'{intent.Key}', score {intent.Value}");
|
||||
}
|
||||
await context.SendActivity($"Intents detected by the weather app {string.Join("\n\n", intentsList)}");
|
||||
await context.SendActivity($"Intents detected by the home automation app:\n\n{string.Join("\n\n", intentsList)}");
|
||||
|
||||
// list the entities
|
||||
entitiesList = new List<string>();
|
||||
|
@ -114,7 +114,7 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
|||
{
|
||||
intentsResult2.Add($"'{intent.Key}', score {intent.Value}");
|
||||
}
|
||||
await context.SendActivity($"Intents detected by the weather app {string.Join("\n\n", intentsResult2)}");
|
||||
await context.SendActivity($"Intents detected by the weather app: \n\n{string.Join("\n\n", intentsResult2)}");
|
||||
|
||||
// list the entities
|
||||
entitiesList = new List<string>();
|
|
@ -3,7 +3,6 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
|
||||
</ItemGroup>
|
|
@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch
|
||||
{
|
||||
public class Program
|
||||
{
|
|
@ -9,7 +9,7 @@ using Microsoft.Extensions.Configuration;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
||||
namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Dispatch.Hierarchical
|
|||
{
|
||||
options.CredentialProvider = new ConfigurationCredentialProvider(Configuration);
|
||||
|
||||
string luisModelId = "<Your LUIS app ID from Dispatch here>";
|
||||
string luisModelId = "<Your LUIS app ID from cDispatch here>";
|
||||
string luisSubscriptionKey = "<Your LUIS Subscription Key here>";
|
||||
Uri luisUri = new Uri("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/");
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# LuisDispatchBot hosted in ASP.NET Core
|
||||
|
||||
This bot demonstrates how to use a LUIS app generated by the Dispatch tool.
|
||||
|
||||
See https://aka.ms/bot-dispatch for more information on the Dispatch tool.
|
||||
|
||||
This example assumes the LUIS app from Dispatch is generated from two LUIS apps and one QnAMaker service:
|
||||
* A LUIS app named "homeautomation", for handling messages about turning lights and appliances on and off
|
||||
* A LUIS app named "weather", for handling requests for weather forecasts and conditions
|
||||
* A QnA Maker service named "faq", for answering questions about using the hypothetical home automation system.
|
||||
|
||||
First create the LUIS apps and QnAMaker, then generate a LUIS app from them using the Dispatch tool.
|
||||
The tool creates a LUIS app with one intent for each of the constituent LUIS apps and QnAMaker services:
|
||||
"l_homeautomation", "l_weather", "q_faq".
|
||||
The bot uses the intents to route the user messages to the appropriate LUIS app or QnA Maker.
|
||||
|
||||
Dispatching the messages to the original LUIS apps allows the bot to get entities from the these apps.
|
||||
The LUIS app generated by the Dispatch tool doesn't contain entity information.
|
||||
|
||||
To use the sample, update Startup.cs with the LUIS App ID and Subscription Key for the LUIS app that the Dispatch tool generates.
|
||||
Update the subscription keys and app IDs in LuisDispatchBot.cs with the ones for the constituent LUIS apps and QnAMaker service.
|
Загрузка…
Ссылка в новой задаче