简体   繁体   English

Watson Assistant @sys-date 将于明年返回

[英]Watson Assistant @sys-date returning next year's month

Scenario :设想 :

  • When using the @sys-date entity within assistant for the current month, the date range for the same month for next year is returned:当在当月助手中使用@sys-date 实体时,返回下一年同月的日期范围:

    在此处输入图片说明

  • However, it works correctly when it is explicitly mentioned "this {MONTH}" .但是,当明确提到"this {MONTH}"时,它可以正常工作。

    在此处输入图片说明

Problem :问题 :

  • Is this the default behavior for @sys-date?这是@sys-date 的默认行为吗?
    For my use case, it is more natural for the user to use just the month name even when referencing the current month.对于我的用例,即使在引用当前月份时,用户也更自然地只使用月份名称。

  • Can this be modified or does it have to be handled separately?这可以修改还是必须单独处理?

I find detecting the correct meaning of unqualified month and day names difficult, eg, when talking with people from different regions or countries.我发现检测不合格的月份和日期名称的正确含义很困难,例如,在与来自不同地区或国家的人交谈时。 Now teach that to a computer...现在教给电脑...

The documentation for Watson Assistant has some details on @sys-date and @sys-time system entities . Watson Assistant文档有一些关于 @sys-date 和 @sys-time 系统实体的详细信息 For one of the examples they have this footnote:对于其中一个例子,他们有这个脚注:

Returns the next matching date.返回下一个匹配日期。 If that date has already passed this year, this returns next year's date.如果该日期已于今年过去,则返回明年的日期。

In your case September has already passed to some degree.在你的情况下,九月已经在某种程度上过去了。 If someone says "I plan a worldcruise for September" would it mean this or next September?如果有人说“我计划在 9 月进行一次世界巡游”是指今年还是明年 9 月? My recommendation would be to check the detected year and compare it with the current year .我的建议是检查检测到的年份并将其与当前年份进行比较 If they differ, add a dialog node to clarify if this year or next year is meant.如果它们不同,请添加一个对话节点以阐明是指今年还是明年。 This would be similar to what I personally do when talking with friends and I find it unclear.这与我个人在与朋友交谈时所做的类似,我觉得不清楚。

I was able to workaround this using .alternative date.我能够使用 .alternative 日期来解决这个问题。 In the new sys-date, there is an alternative property, which is basically: if there's ambiguity in the date passed from the user, the system returns the next matching date, but stores the last matching date in the alternative property.在新的 sys-date 中,有一个替代属性,基本上是:如果用户传递的日期有歧义,系统返回下一个匹配日期,但将最后匹配的日期存储在替代属性中。

@sys-date.alternatives "For example, if today's date is 10 March 2019, and the user enters on March 1, then the March 1st date for next year is saved as the @sys-date (2020-03-01). However, the user might have meant March 1st of 2019. The system also saves this year's date (2019-03-01) as an alternative date value. As another example, if today is Tuesday and a user enters, this Tuesday or next Tuesday, then @sys-date is set to the date of Tuesday of next week and no alternative dates are created." @sys-date.alternatives "例如,如果今天的日期是 2019 年 3 月 10 日,并且用户在 3 月 1 日输入,那么明年的 3 月 1 日日期将保存为@sys-date (2020-03-01)。但是,用户可能指的是 2019 年 3 月 1 日。系统还保存了今年的日期 (2019-03-01) 作为替代日期值。再举一个例子,如果今天是星期二,用户输入了这个星期二或下一个星期二,然后@sys-date 设置为下周星期二的日期,并且不会创建替代日期。” link : https://cloud.ibm.com/docs/assistant?topic=assistant-new-system-entities#new-system-entities-sys-date-time链接: https : //cloud.ibm.com/docs/assistant?topic=assistant-new-system-entities#new-system-entities-sys-date-time

i know its been almost 2 years since this question was made, but might help future people in need我知道提出这个问题已经快 2 年了,但可能会帮助未来有需要的人

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

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