Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent parsing for time with numbers #13

Open
camerondavison opened this issue May 10, 2017 · 3 comments
Open

inconsistent parsing for time with numbers #13

camerondavison opened this issue May 10, 2017 · 3 comments

Comments

@camerondavison
Copy link

this one is just wrong

$ curl -s -XPOST http://0.0.0.0:8000/parse --data "text=the second sunday of October last year" | jq .
[
  {
    "dim": "time",
    "body": "the second sunday of October last year",
    "value": "{\"values\":[],\"value\":\"2016-10-02T00:00:00.000-07:00\",\"grain\":\"day\",\"type\":\"value\"}",
    "start": 0,
    "end": 38
  }
]

this one gets both parts right, but why did just changing the one word change so much of the parsing?

$ curl -s -XPOST http://0.0.0.0:8000/parse --data "text=the second thursday of October last year" | jq .
[
  {
    "dim": "time",
    "body": "the second thursday of October",
    "value": "{\"values\":[{\"value\":\"2017-10-12T00:00:00.000-07:00\",\"grain\":\"day\",\"type\":\"value\"}],\"value\":\"2017-10-12T00:00:00.000-07:00\",\"grain\":\"day\",\"type\":\"value\"}",
    "start": 0,
    "end": 30
  },
  {
    "dim": "time",
    "body": "thursday of October last year",
    "value": "{\"values\":[],\"value\":\"2016-10-06T00:00:00.000-07:00\",\"grain\":\"day\",\"type\":\"value\"}",
    "start": 11,
    "end": 40
  }
]
@patapizza
Copy link
Contributor

@a86c6f7964 Thanks for reporting!
As you pointed out, the resolution of the first example is wrong.
In the second example, one would expect a single token too.

@patapizza patapizza added the bug label Oct 16, 2017
@arademaker
Copy link

arademaker commented Feb 6, 2018

Maybe related, for the sentence below, I would expect one additional possible result with 8 to 10 years ago as a range of dates. Am I right?

Four of the companies are producing at rates in excess of initial rates of 8 to 10 years ago.

    {
        "dim": "number",
        "body": "Four",
        "value": {
            "value": 4,
            "type": "value"
        },
        "start": 0,
        "end": 4
    },
    {
        "dim": "time",
        "body": "8 to 10",
        "value": {
            "values": [
                {
                    "value": "2018-02-06T09:52:00.000-08:00",
                    "grain": "minute",
                    "type": "value"
                },
                {
                    "value": "2018-02-06T21:52:00.000-08:00",
                    "grain": "minute",
                    "type": "value"
                },
                {
                    "value": "2018-02-07T09:52:00.000-08:00",
                    "grain": "minute",
                    "type": "value"
                }
            ],
            "value": "2018-02-06T09:52:00.000-08:00",
            "grain": "minute",
            "type": "value"
        },
        "start": 75,
        "end": 82
    },
    {
        "dim": "time",
        "body": "10 years ago",
        "value": {
            "values": [
                {
                    "value": "2008-02-01T00:00:00.000-08:00",
                    "grain": "month",
                    "type": "value"
                }
            ],
            "value": "2008-02-01T00:00:00.000-08:00",
            "grain": "month",
            "type": "value"
        },
        "start": 80,
        "end": 92
    }
]

@patapizza
Copy link
Contributor

@arademaker Indeed, it should return a single Time entity with span 8 to 10 years ago. Would you be able to look into this and submit a pull request?

serapio pushed a commit to cisco/duckling that referenced this issue Oct 14, 2022
Co-authored-by: Alex Huang <alhuang10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants