[英]How do I make my agent repeat any name - Dialogflow
I want to make an agent that can just repeat whatever name I say: 我想制作一个可以重复我说的任何名字的代理人:
I have 1 Entity called: Name. 我有1个实体叫:名字。
I have 1 Intent called: RepeatName. 我有1个Intent叫:RepeatName。
I have 1 Training phrase: 我有1个训练短语:
"Repeat this name: {Name}"
Then I highlighted '{Name}' and clicked my entity @Name 然后我突出显示“{Name}”并单击我的实体@Name
Then below that Training phrase is the following: 然后在下面的培训短语如下:
Parameter Name: Name
Entity: @Name
Resolved Value: {Name}
Under Actions and parameters I have: 在动作和参数下,我有:
Required: Checked
Parameter Name: Name
Entity: @Name
Value: $Name
Under Responses I have the Text Response: 在响应下我有文本响应:
"Ok. I'll repeat this name: $Name"
Then I try it out with: 然后我尝试用:
"Repeat this name: John"
“重复这个名字:约翰”
But then it doesn't set the parameter Name 但是它没有设置参数Name
However when I try: 但是,当我尝试:
"Repeat this name: Name"
“重复这个名字:名字”
Then I get the expected response: 然后我得到了预期的回应:
"Ok. I'll repeat this name: Name"
“好的。我会重复这个名字:名字”
I don't understand how adding more training phrases would help, because a name could be anything. 我不明白如何添加更多的训练短语会有所帮助,因为名字可能是任何东西。 I'm new to Dialogflow so I might be missing some basic concepts here.
我是Dialogflow的新手,所以我可能会遗漏一些基本概念。
Any help would be appreciated. 任何帮助,将不胜感激。
Try it with inbuilt system entity - @sys.given-name
. 尝试使用内置的系统实体 -
@sys.given-name
。
What you have done is created an entity called Name
, then you have enabled define synonyms
which is used to create examples of your entity. 您所做的是创建一个名为
Name
的实体,然后您启用了define synonyms
,用于创建实体的示例。
But then you have disabled allowed automated expansion
which means anything other than your defined synonyms will not be identified as your entity. 但是,您已禁用
allowed automated expansion
,这意味着除了您定义的同义词之外的任何内容都不会被识别为您的实体。
You have defined only one synonym ie Name
so only that is being recognized. 您只定义了一个同义词,即
Name
以便仅识别该Name
。
So either try the same with @sys.given-name
which is pre-trained for identifying names, or train your custom entity Name
with as many examples as you can after enabling allowed automatic expansion
(but that might lead to recognize wrong values). 因此,要么对
@sys.given-name
进行相同的操作,该名称是为了识别名称而预先训练的,或者在启用allowed automatic expansion
后使用尽可能多的示例训练您的自定义实体Name
(但这可能会导致识别错误的值)。
Hope it helps. 希望能帮助到你。
The issue is that you're using a Developer Entity Type to try and define the parameter that you expect to capture here. 问题是您正在使用开发人员实体类型来尝试定义您希望在此处捕获的参数。 You then don't specify any possible entity values for that Entity Type except "name".
然后,除了“name”之外,您不为该实体类型指定任何可能的实体值。 So the name "name" is the only one that matches.
所以名称“name”是唯一匹配的名称。
You have a few options. 你有几个选择。
You can use the System Entity Type of @sys.given-name
. 您可以使用
@sys.given-name
的系统实体类型 。 This includes the most common names of a particular language, but may not be good enough if you're expecting other names. 这包括特定语言的最常见名称,但如果您期望其他名称可能不够好。
You could use the System Entity Type of @sys.any
, but overuse of this entity type isn't suggested, since it may pick up garbage or not match the phrase well. 您可以使用
@sys.any
的系统实体类型,但不建议过度使用此实体类型,因为它可能会拾取垃圾或与该短语不匹配。
Similarly, you can set your entity type to allow automated expansion , but you still run the risk of not capturing things correctly if you don't have the training phrase exact and picking up garbage. 同样,您可以将实体类型设置为允许自动扩展 ,但如果您没有准确的训练短语并且拾取垃圾,则仍然存在无法正确捕获事物的风险。
Figuring out which option works best for you will require some testing on your part. 找出最适合您的选项将需要您进行一些测试。 Generally I will use entities when I can clearly define the types or aliases, and use
@sys.any
when I can't. 通常,当我可以清楚地定义类型或别名时,我将使用实体,而当我不能时,我将使用
@sys.any
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.