简体   繁体   English

如何针对特定意图进行Dialogflow后备

[英]How to make a Dialogflow fallback for specific intents

I'm trying to make a chatbot to allow users to book items. 我正在尝试创建一个聊天机器人,以允许用户预订项目。 I have 2 departments with items, so I have made 1 intent for each department. 我有2个部门,每个项目都有1个意图。 Department A has boardgames, Department B has computer equipment. 部门A有桌游,部门B有计算机设备。

I've set up my intents so a user can ask "I want to book Monopoly" or "I want to book a laptop" - those queries work. 我已经设定好意图,以便用户可以询问“我要预订专卖”或“我要预订笔记本电脑”-这些查询有效。

Now, I want to be able to handle the user asking "I want to book a room". 现在,我希望能够处理询问“我要预订房间”的用户。 That query won't match any of the training phrases for either of the departments, but I do want to give the user a context-specific answer of "We don't have that item available". 该查询与两个部门中的任何一个培训短语都不匹配,但我确实想为用户提供特定于上下文的答案,即“我们没有该项目可用”。

How to I configure an intent to match "I want to book [noun]", where [noun] is an unknown thing? 如何配置意图以匹配“我要预订[名词]”,其中[名词]是未知的事物?

We solved this by creating a Book "anything" intent. 我们通过创建Book“任何内容”意图解决了这一问题。 It uses the built-in @sys.any parameter. 它使用内置的@sys.any参数。 So we defined phrases like "I want to book @sys.any". 因此,我们定义了诸如“我想预订@ sys.any”之类的短语。 This intent seems to be matched only if the intents for department A and B do not match. 仅当部门A和B的意图不匹配时,此意图才似乎匹配。 In this way, it is a fallback of sorts that matches for all booking questions for unknown "things" 通过这种方式,它是一种后备类型,可与未知“事物”的所有预订问题匹配

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM