沃森对话意图和实体是否支持正则表达式? [英] Does watson conversation intents and entities support regular expressions?

查看:111
本文介绍了沃森对话意图和实体是否支持正则表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用公司要创建的可能对话框来测试Watson Conversation API.我们正在与巴西葡萄牙语一起发展.鉴于葡萄牙语是一种丰富的语言,有时用户可能会犯错误,因此我们希望预测这些可能的错误,主要是使用特殊的字符和重音符号.

I'm testing Watson Conversation API with a possible dialog my company wants to create. We are developing with Brazilian Portuguese. Given the portugues is a rich language and sometimes the users can make mistakes, we want to predict these possible errors, mainly with special chars and accents.

例如,单词produção可以由produçãoproducaoproduçaoproducão之类的用户编写.是否可以对意图和实体使用正则表达式,以使像图波纹管这样的东西?有时候,我们又用另一个词来表示produção finalprodução geralprodução passada等.

For sample, the word produção can be written by users like: produção, producao, produçao, producão. Is possible to have a regular expression on the intents and entities to have something like the picture bellow? Sometimes we have another word to make a sense liek produção final, produção geral, produção passada, etc.

另一个快速的问题,是否可以使用诸如@(producao)(例如图像)之类的对象来创建与实体值合并的示例?

Another quick question, is possible to create examples on intents merging with entities values, using something like @(producao) (like image)?

谢谢

推荐答案

您不能在意图或实体中使用正则表达式,但是我认为您仍然应该能够应对变化.

You cannot use regular expressions in intents or entities however I think you should still be able to cope with variations.

在匹配意图时,目前没有内置的错别字或口音归一化处理功能,但是,如果句子中有足够的特征可以匹配,偶尔的错字不会造成问题.对于非常简短的示例,为常见错误添加其他示例可能会有一定的价值.

There is currently no built in handling of typos or accent normalization when matching intents however if there are enough features in a sentence to match on, the occasional typo shouldn't cause problems. For very short examples, there may be some value in adding additional examples for common mistakes.

对于实体,您可以包含同义词,而我以前曾使用它来包含常见错误.

For entities, you can include synonyms and I have used that to include common mistakes before.

您不应尝试在意图中直接包含对实体的引用.例如,您应该只拥有Qual a produção而不是Qual a @(producao),以及具有相同意图的其他示例,可能具有不同的实体,或同一实体的不同同义词.例如,对于#directions意图,我可能有以下示例...

You shouldn't try to include a reference to an entity directly in your intents. For example, rather than Qual a @(producao) you should just have Qual a produção, along with other examples of the same intent, perhaps with different entities, or different synonyms for the same entity. For example, I might have the following examples for a #directions intent...

  • 我怎么开车去酒店?
  • 你能给我开车去酒店的路线吗?
  • 如果我乘火车旅行,哪个是最近的车站
  • 哪条公交路线可以带我去酒店?

与@transport实体有关的值,例如汽车,公共汽车,火车,自行车等. (对不起,我无法提供巴西葡萄牙语示例!)无需明确地命名您希望在意图中找到的实体.

Along with values like car, bus, train, bicycle, etc. for a @transport entity. (Sorry I can't give a Brazilian Portuguese example!) There's no need to explicitly name the entity/entities you're expecting to find in an intent.

最后,您可以在对话框节点的条件中使用正则表达式,例如...

And finally, you can use regular expressions in conditions on dialog nodes, for example...

input.text.matches( 'produ[cç][aã]o' )

input.text.matches( 'produ[cç][aã]o' )

这篇关于沃森对话意图和实体是否支持正则表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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