我想知道如何将LUIS集成到一个没有Azure或MS bot框架的简单Web应用程序。我找到的每个资源都使用模拟器或Azure或MS bot框架。我只是想玩,不要使用这么多服务。我只想使用C#在Web应用程序中使用LUIS及其意图和实体。
您可以使用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();
}
}
LUIS为API端点提供详细信息文档,您可以创建一个简单的应用程序而无需使用Azure或.net,您可以选择所需的任何语言。
使用Luis,您可以从API本身训练一个话语,也可以将单词标记为实体。检查LUIS文档here,如果你有兴趣在这里使用LUIS和NodeJS,那就是documentation