本文介绍了Dialogflow-如果短语曾经出现,则匹配意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Dialogflow中的两个意图是在我们的服务管理模块中搜索用户当前的事件或请求。我想做的是,如果曾经在漫游器中输入了请求号或事件号,则使Dialogflow匹配正确的意图。

Two of the intents I have within Dialogflow is to search the users current Incidents or Requests within our service management module. What I would like to do, is to get Dialogflow to match to the correct intent if a Request Number or Incident number is ever entered into the bot.

例如,每个事件的前缀均为INC,请求的前缀为REQ。理想情况下,如果用户消息中的任何时候出现INC或REQ,那么它将与相关意图匹配。因此,用户可以说 INC123456或 INC123456的状态是什么,在两种情况下,搜索都将符合意图。

For example, every incident has a prefix of INC and requests have a prefix of REQ. Ideally, if at any point there appears INC or REQ in the user's message, then it would match to the relevant intent. So a user could either say 'INC123456' or 'What is the status of INC123456', and in both cases, the search would match the intent.

据我所知,这就是模板模式应该做的,但是到目前为止,我还没有碰到运气。有没有人有办法解决吗? :)

To my knowledge, this is what the Template Mode should do, but I have had no luck so far with it. Does anyone have a solution? :)

推荐答案

尝试定义自定义实体并相应地训练您的意图,如下所示:

Try defining a custom entity and training your intent accordingly as below:

实体

意图

也为 INC 定义类似的意图。
您可能需要解析收到的参数并通过正则表达式对其进行验证。

Define similar intents for INC as well.You may need to parse the parameter received and validate it through a regular expression.

可能有多种方法可以解决您的问题。

There might be multiple approaches to solve your problem.

希望有帮助!

这篇关于Dialogflow-如果短语曾经出现,则匹配意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 07:01