当前位置: 首页 > news >正文

手机网站和电脑网站开发/阿里巴巴国际站运营

手机网站和电脑网站开发,阿里巴巴国际站运营,免费微信建站有哪些网站,黄山网站建设目录 Handling Unexpected Input User Interjections Contextual Interjections Summary Handling Unexpected Input 在构建会话助手时,你可以指望的一件事是,用户会说一些意想不到的事情。本页面是处理意外输入的指南。 意外的输入偏离了您所定义…

目录

Handling Unexpected Input

User Interjections

Contextual Interjections

Summary


Handling Unexpected Input

在构建会话助手时,你可以指望的一件事是,用户会说一些意想不到的事情。本页面是处理意外输入的指南。

意外的输入偏离了您所定义的幸福路径。例如:

用户在讨论订阅内容的过程中走开了,然后回来说“嗨!”
当机器人询问用户的电子邮件地址时,用户会问:“为什么你需要知道这个?”
本页面是关于处理仍然在机器人域中的意外输入的方法指南。根据您试图处理的意外输入类型的不同,所描述的一些或所有方法可能都适用于您。本指南不是关于消除歧义的用户输入或处理超出范围的问题;有关这些情况,请参阅关于备退和人工切换的指南。

User Interjections

意外输入有两种:通用感叹词和上下文感叹词。通用感叹词是一种打断,不管谈话内容是什么,它都应该得到相同的回应。如果你已经有一个定义响应意图的规则,你不需要做任何其他事情来处理它作为一个中断。常见问题和闲聊是常见的感叹词。语境感叹词的反应取决于谈话语境。例如,如果用户问“你为什么需要这个?”,答案将取决于机器人刚刚提出的要求。

Contextual Interjections

处理上下文感叹词类似于处理上下文对话。

上下文感叹词的一种常见情况是在填写表格时,用户会问“为什么你需要知道这个?”或“你能解释一下吗?”每个槽的响应应该不同。例如:

HiBot: Hello! I am restaurant search assistant! How can I help?User: I'm looking for a restaurantBot: What cuisine?User: FrenchBot: How many people?User: Why do you need to know that?Bot: I need to know how many people are in your party to ensure the restaurant can accomodate you.Bot: How many people?

因为我们想让requested_slot影响会话,所以需要将requested_slot槽位的influence_conversation属性设置为true,并给它分配分类类型:

domain.yml

slots:requested_slot:type: categoricalvalues:- cuisine- num_people- outdoor_seating- preferences- feedbackinfluence_conversation: true

这意味着对话模式在做预测时将会关注插槽的价值(关于插槽如何影响助手的行为)。

然后,您可以根据requestd_slot的值为感叹词的特定响应编写故事,例如:

stories.yml

stories:
- story: cuisine interjectionsteps:- intent: request_restaurant- action: restaurant_form- active_loop: restaurant_form- slot_was_set:- requested_slot: cuisine- intent: explain- action: utter_explain_cuisine- action: restaurant_form- story: number of people interjectionsteps:- intent: request_restaurant- action: restaurant_form- active_loop: restaurant_form- slot_was_set:- requested_slot: num_people- intent: explain- action: utter_explain_num_people- action: restaurant_form

Summary

How you handle unexpected input depends on whether the response should be context sensitive or not.

For generic interjections:

  •  Define rules for single-turn interactions
  •  Use the ResponseSelector for FAQ and chitchat interruptions

For contextual interjections:

  •  Make requested_slot a categorical slot (for forms)
  •  Write stories for context-specific responses to interjections, using slot values where applicable

相关文章: