简体   繁体   English

IBM Watson 中如何响应@sys.time 为句号格式?

[英]How to response @sys.time as period format in IBM Watson ?

When users said " Are you available in tomorrow morning?"当用户说“你明天早上有空吗?”

Watson will recognize "morning" as @sys-time:06:00:00 & @sys-time:12:00:00 Watson 会将“早上”识别为 @sys-time:06:00:00 和 @sys-time:12:00:00

However, when I using slot to detect @sys.time and saving it as $time, Watson only save @sys-time:06:00:00 in the context variable ($time).但是,当我使用插槽检测 @sys.time 并将其保存为 $time 时,Watson 仅将 @sys-time:06:00:00 保存在上下文变量 ($time) 中。

I hope my chatbot can response like " Yes, I'm available in 2020-11-15 morning" or " Yes, I'm available in 2020-11-15 6:00-12:00"我希望我的聊天机器人可以回复“是的,我在 2020-11-15 早上有空”或“是的,我在 2020-11-15 6:00-12:00 有空”

Now, the way I write my response is "" Yes, I'm available in $date $time"现在,我写回复的方式是“”是的,我在 $date $time 有空”

And my chatbot will answer "Yes, I'm available in 2020-11-15 6:00", which is not what I want it to be.我的聊天机器人会回答“是的,我在 2020-11-15 6:00 有空”,这不是我想要的。

Do anyone know how to response @sys.time as period format in IBM Watson ?有谁知道如何在 IBM Watson 中以句号格式响应 @sys.time ?

Or in other thinking, how to design a bot that deal with time period?或者换个思路,如何设计一个处理时间段的bot?

There could be multiple ways to solve it.可能有多种方法可以解决它。

Look at the concept of conditional slots .查看条件槽的概念。 You could check how many sys-time values are returned and have a second, optional slot to capture the second time.您可以检查返回了多少系统时间值,并有第二个可选插槽来第二次捕获。 In your response and related logic you would need to deal with having multiple values.在您的响应和相关逻辑中,您需要处理多个值。

Only capture the date and check for the detected entities with separate logic.仅捕获日期并使用单独的逻辑检查检测到的实体。 Note that if the users responds with "this week", you have a similar problem.请注意,如果用户回复“本周”,则说明您遇到了类似的问题。 The reason is that it would return the first and last day of the week.原因是它会返回一周的第一天和最后一天。

See the expressions for accessing objects on how to work with the detected entities.请参阅访问对象的表达式,了解如何使用检测到的实体。

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

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