如何让Watson在用户输入时识别两个不同的日期? [英] How can I get Watson to recognize two different dates upon user input?

查看:89
本文介绍了如何让Watson在用户输入时识别两个不同的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户问以下句子:

由于某种原因,Watson即使检测到第二个日期,也使用$ checkin和$ checkout变量的第一个日期.

For some reason Watson uses the first date for the both $checkin and $checkout variables even though it detects the second date.

您可以参考对话框节点"屏幕截图,以了解如何设置节点.

You can refer to the "dialog node" screenshot to see how the nodes are setup.

我如何让Watson识别第一个日期为登记日期,第二个日期为结帐日期.如果检测到第二个日期,有没有办法可以告诉沃森使用第一个日期的沃森?

How can I get Watson to recognize the first date is the checkin date and the second one is the checkout date. Is there a way I could tell Watson after the first date is used if a second one is detected use it to fill the next slot?

我发现了有关@ sys-date range_link实体的信息.但是文档没有详细说明.

I've found something about the @sys-date range_link entity. But the documentation is not detailed.

推荐答案

这很容易做到,但是会带来一些您需要注意的问题.

This is easy to do, but comes with issues you need to be aware of.

插槽允许您在读取变量时定义变量.例如.

Slots allows you to define variables as they are read. For example.

会生成以下内容:

问题是您假设人们会以您需要信息的相同顺序询问.如果这没有发生,那么它将失败.

The issue is that you are assuming that people will ask in the same order that you need the information. If this doesn't happen then this will fail.

您可以通过调整用户提出问题的方式来缓解这种情况.例如:

You can mitigate this by shaping how the user may ask the question. For example:

"Please let me know where you are leaving and going to"

此人更有可能首先对退出日期做出回应.

The person is more likely to respond with the exit date first.

这很可能会改变,并且无法按您预期的那样完全起作用.您可以在选项中启用beta @ sys-date.因此,我不建议您依靠它直到最终版本.

This is likely to change and doesn't fully work as you expect. You can enable the beta @sys-date in the options. So I wouldn't recommend relying on this until it is final.

您首先需要检查range_link.这将告诉您是否检测到两个日期相互关联.

You first need to check for range_link. This will tell you if it detected that two dates are connected to each other.

然后您可以执行以下操作:

Then you can do the following:

From Date: <? entities['sys-date'].filter("d", "d.role.type == 'date_from'")[0]?.value ?>
To Date: <? entities['sys-date'].filter("d", "d.role.type == 'date_to'")[0]?.value ?>

这是查找具有date_from角色的确切记录并返回值.对于date_to也是如此.

What this does is find the exact record that has the role of date_from and returns the value. Likewise for date_to.

您最终得到的是这样的东西.

You end up with something like this.

这篇关于如何让Watson在用户输入时识别两个不同的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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