microsoft / Recognizers-Text

Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
MIT License
1.67k stars 429 forks source link

[Python][EN DateTimeV2] Fix for case like 'March one 2020' #3099

Open andrew-gradinari opened 1 year ago

andrew-gradinari commented 1 year ago

Recognizers fails to pick up the year for dates in the format of "Month(text) Day(text) Year(digit)":

There is also a problem with the resolved values - PastResolution is in the future when it should be in the past relative to ReferenceDateTime:

{
  "Input": "Oct twenty three",
  "Context": {
    "ReferenceDateTime": "2023-04-25T00:00:00"
  },
  "Results": [
    {
      "Text": "Oct twenty three",
      "Type": "date",
      "Value": {
        "Timex": "XXXX-10-23",
        "PastResolution": {
          "date": "2024-10-23"
        },
        "FutureResolution": {
          "date": "2023-10-23"
        }
      },
      "Start": 0,
      "Length": 16
    }
  ]
}