简体   繁体   中英

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:

    在此处输入图片说明

  • However, it works correctly when it is explicitly mentioned "this {MONTH}" .

    在此处输入图片说明

Problem :

  • Is this the default behavior for @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 . 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? 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. 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.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." link : 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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