Dialogflow obtaining wrong dates for prebuilt date entities

点点圈 提交于 2019-12-11 17:44:50

问题


Is there a way to change how Dialogflow automatically calculates the date meant by a text identified as a pre-built entity like "sys.date" or "sys.date-period"?

Or, is there a way to create your own entity for dates, and specify how it determines the specific day?

Depending on the day of the week, texts like "on Friday" are actually interpreted as the closest Friday to come in the future, instead of the most recent Friday that has already passed.


回答1:


If you are using @sys.date entity then you can set the value as date.recent. It will always try to convert the phrase into most recent date.
For example, if you say on monday, it will give you date of recent monday.

Note that the date.recent option is available only for @sys.date not for @sys.date-time or @sys.date-period.

EDIT:
You need to select $date.recent from the options available

As you can see in the example screenshot below, tuesday is converted to most recent tuesday rather than upcoming tuesday.

Hope it helps.



来源:https://stackoverflow.com/questions/54683810/dialogflow-obtaining-wrong-dates-for-prebuilt-date-entities

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!