我正在使用机器人框架自适应对话框。我在通过使用识别器读取 luis 数据来获取意图和解析实体时遇到问题。只有通过在子自适应对话框中阅读“turn.recognized”才能获得响应中得分最高的意图。我已将我的 luis 迁移到 v3 并在调用 luis 时将 IncludeAllIntents 属性设置为 true。我错过了在 LuisAdaptiveRecognizer 中设置任何属性吗?谁能帮我解决这个问题,因为我有一个场景来检查机器人中第二个得分最高的意图。这是自适应对话的问题吗?
我使用 Ms docs 来构建机器人自适应对话框。
还有一件事有没有办法从 turn.recognized 的结果中提取 luis 解析的实体作为 RecognizerResult 类型。
根对话框:
var rootDialog = new AdaptiveDialog(nameof(AdaptiveDialog))
{
Recognizer = new LuisAdaptiveRecognizer()
{
ApplicationId = Configuration["LuisAppId"],
EndpointKey = Configuration["LuisAPIKey"],
Endpoint = Configuration["LuisAPIHostName"],
PredictionOptions = new Microsoft.Bot.Builder.AI.LuisV3.LuisPredictionOptions
{
IncludeAllIntents = true,
IncludeInstanceData = true,
IncludeAPIResults = true,
PreferExternalEntities = true,
Slot = "producton"
}
},
Triggers = new List<OnCondition>()
{
new OnIntent("Greetings")
{
Actions = new List<Dialog>()
{
new SendActivity("${HelpRootDialog()}")
}
},
},
子对话框:
public FindLinks(IConfiguration configuration) : base(nameof(FindLinks))
{
_configuration = configuration;
this.LinksDialog = new AdaptiveDialog(nameof(FindLinks))
{
Triggers = new List<OnCondition>()
{
new OnBeginDialog()
{
Actions = new List<Dialog>()
{
new CodeAction(ResolveAndSendAnswer)
}
},
}
};
AddDialog(this._findLinksDialog);
InitialDialogId = nameof(FindLinks);
}
private async Task<DialogTurnResult> ResolveAndSendAnswer(DialogContext dialogContext, System.Object options)
{
JObject jObject;
IList<string> queries = new List<string>();
dialogContext.State.TryGetValue("turn.recognized", out jObject);
....This is how i resolved the luis data from the turn.
}