- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
这篇文章与 C#(.Net) 中的 bot 框架相关
所以我想知道如果我对用户的预期话语是:
“显示 3 月 3 日开始的项目”
但用户错过了日期实体并写入
“显示开始的项目”
现在我想提示用户输入日期(这是缺少的实体),请提及日期。
然后现在就简单地运行意图。
哪种方法是推进它的最佳方法?
最佳答案
在Nicolas R的回复中,他分享了实现你的要求的思路和方法,你可以引用一下。
此外,您还可以引用以下示例代码,在达到特定意图和缺少所需实体时提示提供日期。
[Serializable]
public class BasicLuisDialog : LuisDialog<object>
{
string bdate;
public BasicLuisDialog() : base(new LuisService(new LuisModelAttribute(
"{ID_here}",
"{subscriptionKey_here}",
domain: "westus.api.cognitive.microsoft.com")))
{
}
//....
//for other intents
[LuisIntent("GetProjectInfo")]
public async Task GetProjectInfoIntent(IDialogContext context, LuisResult result)
{
if (result.Entities.Count == 0)
{
PromptDialog.Text(
context: context,
resume: ResumeGetDate,
prompt: "Please enter the date",
retry: "Please try again.");
}
else
{
await this.ShowLuisResult(context, result);
}
}
public async Task ResumeGetDate(IDialogContext context, IAwaitable<string> mes)
{
bdate = await mes;
await context.PostAsync($"You reached GetProjectInfo intent. And you entered the date: {bdate}");
context.Wait(MessageReceived);
}
private async Task ShowLuisResult(IDialogContext context, LuisResult result)
{
await context.PostAsync($"You have reached {result.Intents[0].Intent}. You said: {result.Query}");
context.Wait(MessageReceived);
}
}
测试结果:
关于c# - 在提示用户提及缺少的实体后,我如何使用 luis 操作绑定(bind)来触发意图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49795141/
我最近一直在尝试用 python 开发一个 discord 机器人。我这样做是为了如果一条消息包含某个数字,它会使用react并发送一条消息。这是 cog 文件中的代码: import discord
我有一个用于 channel 存档和组织的机器人。当有人提到 channel 时,我试图让它执行一些代码,以便将消息移动到它所属的 channel ,但我无法让它响应 channel 提及。 我以为会
如何在UILabel中检测链接/提及/标签并使其可单击。另外,是否有我可以利用的开源库(我已经看过了不处理多行tex的Fancy UILabel,不处理提及/标签的TTAttributedLabel)
来自推文的示例数据: 我总是在 #kampus 上见到 @gEmbul,我们总是打开该网站 https://www.youtube.com/ facebook# :) @007 日期是字符串,我想匹配
我一直在尝试制作一个发送命令,该命令可以将消息的作者发送给一个提到的用户,或者发送两个提到的用户。我可以在消息中获得第一次提及,但我不知道如何在消息中获得第二次甚至第三次提及。我尝试使用: messa
编辑 : 我自己找到了解决办法,谢谢大家看到这个帖子!解决办法是: /// SIMPLY ADD || message.member const taggedUser = message.mentio
这个问题已经有答案了: Fast punctuation removal with pandas (4 个回答) 已关闭 4 年前。 我想编写一个定义,它接受一个字符串(一条推文)并创建一个 2 列数
我正在设计一个应用程序,用户可以使用该应用程序从多个帐户发送多条推文(提及),并且正在使用 Twitter4j 进行同样的操作。对此,我有几个问题: 身份验证:应用程序有一个身份验证部分。我能够使用基
我有一个数据集,其中包含来自 Twitter 的推文。其中一些还包含用户提及,例如 @thisisauser。我尝试在执行其他清理过程的同时删除该文本。 def clean_text(row, opt
假设我们有 3 个表:tweet、users、tweet_mentusers,其中 tweet.user_id = users.id 和 tweet.id = tweet_mentusers.twee
我目前正在使用以下代码,它获取推文,然后将其传递给处理的函数。但这不是实时的。 auth = tweepy.OAuthHandler(consumer_key, consumer_secret) au
我需要创建一个正则表达式模式来查找名为 Tweets 的类中的提及。在这种情况下,“@”后的有效字符为:(A-Z 或 a-z)、数字、下划线(“_”)或连字符(“-”)。与经典 Twitter 用户名
这是示例图片 --> 我正在尝试使文本输入功能与 Facebook 的非常相似。以 @ 开头的提及将生成我的 friend 姓名列表,然后选择一个将充当类似对象的角色。因此,删除突出显示的单词将删除
所以我只需要一些关于如何在 Discord.js 上做某事的帮助。 我对如何使用 message.mentions.channels 感到非常困惑,并且文档没有帮助。 我只需要一个 console.l
我提到我的 friend 使用 Koala,Ruby 和 Sinatra。我查看了文档,但一无所获。记住这一点,我不想给我的 friend 发信息,但我想和我一起提到他。我的代码: @graph =
我想使用 api 在 slack 中发布消息。我怎样才能像@channel in slack 一样提及一个 channel 的所有团队成员? 最佳答案 您可以使用 . Example 您可以在 Sl
我试过使用 gem twitter , grackle , 和 TweetStream但我不知道如何获得用户@mentions 的流。 我只是想不出如何将一段代码放在一起,表示“让用户提及所有内容”。
我正在用 Node.js 编写一个应用程序,它允许用户在 twitter 等消息中相互提及。我希望能够找到用户并向他们发送通知。为了做到这一点,我需要拉 @usernames 从 node.js 中的
我试图从传入的 webhook 中提及用户。 我通过 postman 尝试了几次迭代 { "text": "test @user" } 或者 { "text": "test @user@email.c
我曾经有一些运行良好的 python,可以在 Tweepy 流监听器上自动回复,但由于 8 月份 Twitter API 发生变化,它不再有效。 我正在重新构建它,每 10 秒获取一次我最近提到的内容
我是一名优秀的程序员,十分优秀!