【问题标题】:How to connect LUIS to a simple web application without Azure or the MS Bot framework?如何在没有 Azure 或 MS Bot 框架的情况下将 LUIS 连接到简单的 Web 应用程序?
【发布时间】:2019-08-28 20:38:22
【问题描述】:

我想知道如何在没有 Azure 或 MS bot 框架的情况下将 LUIS 集成到简单的 Web 应用程序中。我找到的每个资源要么使用模拟器,要么使用 Azure 或 MS bot 框架。我只是想玩玩,不使用这么多服务。我只想在使用 C# 的 Web 应用程序中使用 LUIS 及其意图和实体。

【问题讨论】:

  • 那么是什么阻止了您,您可以轻松使用endpoint API 查询 LUIS

标签: c# asp.net visual-studio model-view-controller azure-language-understanding


【解决方案1】:

您可以使用 LuisRuntimeAPI

Here 是一个控制台应用示例:

Console.WriteLine("Enter the text to recognize:");
string input = Console.ReadLine().Trim();

if (input.ToLower() == "exit")
{
    // Close application if user types "exit"
    break;
}
else
{
    if (input.Length > 0)
    {
        // Create client with SuscriptionKey and AzureRegion
        var client = new LuisRuntimeAPI(new ApiKeyServiceClientCredentials(SubscriptionKey))
        {
            AzureRegion = AzureRegion
        };

        // Predict
        var result = await client.Prediction.ResolveAsync(ApplicationId, input);

        // Print result
        var json = JsonConvert.SerializeObject(result, Formatting.Indented);
        Console.WriteLine(json);
        Console.WriteLine();
    }
}

【讨论】:

【解决方案2】:

LUIS 为 API 端点提供详细文档,您可以使用该文档创建简单的应用程序,而无需使用 Azure 或 .net 你可以选择任何你想要的语言。

  1. LUIS 提供 API 端点来获取预测结果

  2. LUIS 提供了各种端点来训练新的话语/意图。

使用 Luis,您可以从 API 本身训练话语,也可以将单词标记为实体。 检查 LUIS 文档 here,如果您有兴趣在此处将 LUIS 与 NodeJS 一起使用,请查看 documentation

【讨论】:

    猜你喜欢
    • 2019-02-04
    • 1970-01-01
    • 2011-01-17
    • 2013-09-10
    • 1970-01-01
    • 2015-08-25
    • 2017-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多