LUIS:向意图添加模式不会产生任何效果 [英] LUIS: Adding patterns to intents is not taking any effect

查看:29
本文介绍了LUIS:向意图添加模式不会产生任何效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了教程

  • 我首先添加了Pattern.any实体
  • 接下来,我为所需的意图添加了一个模式
  • 我已经创建了一个如图所示的意图,现在我单击火车
  • 当我测试时,意图没有达到

有什么想法吗?

推荐答案

模式非常文字化.如果词组的一部分不完全匹配,则不会识别该意图. (注意:您可以将这些短语直接添加到意图中,而不是在模式中添加,在这种情况下,它将识别意图但不识别实体.如果您有一个对话框提示用户输入缺少的实体,则可能会有所帮助.)

The patterns are extremely literal. If the part of the phrase does not match exactly, the intent won't get recognized. (Note: you can add these phrases to the intent directly, instead of in the pattern, in which case it will recognize the intent but not the entities. Can be helpful if you have a dialog to prompt users for the missing entities.)

在您的情况下,编写模式的方式需要编写command create $mytest,它应该识别意图以及实体 mytest .由于您没有在测试中包含$字符,因此无法识别意图或实体.

In your case, the way you have the pattern written you would need to write command create $mytest, which should recognize the intent as well as the entity mytest. Since you did not include the $ character in your test, neither the intent nor the entity was recognized.

您确实可以通过方括号[]将字符标记为可选,尽管我在此方面取得了一些不同的成功.您的短语足够具体,可能适合您的情况.因此,可以改为使用command create [$]command_params之类的模式,其中command create $mytestcommand create mytest都可以工作并具有正确的实体.请注意,如果有人输入command create $mytest please之类的字词,则会选择整个短语 mytest please 作为您的实体. (如果有人知道如何创建避免这种情况的模式,那就太好了!).

You do have the ability to mark a character as optional via brackets [], though I've had mixed success with this. Your phrases are specific enough that it may work in your case. So instead you could make your patterns like command create [$]command_params where both command create $mytest and command create mytest would work and have the correct entity. Do note that if someone types something like command create $mytest please, it's going to pick up the entire phrase mytest please as your entity. (If anyone knows how to create a pattern that avoids this, that would be fantastic!).

这篇关于LUIS:向意图添加模式不会产生任何效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆