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

Chinese Time-Interval not work #744

Open
franklucky001 opened this issue Dec 3, 2024 · 0 comments
Open

Chinese Time-Interval not work #744

franklucky001 opened this issue Dec 3, 2024 · 0 comments

Comments

@franklucky001
Copy link

time request with lang en_US

request

curl --location 'http://0.0.0.0:8000/parse' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'locale=en_US' \
--data-urlencode 'text="today 2PM to today 3PM"' \
--data-urlencode 'dims="["time"]"'

response

[
    {
        "body": "today 2PM to today 3PM",
        "start": 1,
        "value": {
            "values": [
                {
                    "to": {
                        "value": "2024-12-03T16:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "from": {
                        "value": "2024-12-03T14:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "type": "interval"
                }
            ],
            "to": {
                "value": "2024-12-03T16:00:00.000-08:00",
                "grain": "hour"
            },
            "from": {
                "value": "2024-12-03T14:00:00.000-08:00",
                "grain": "hour"
            },
            "type": "interval"
        },
        "end": 23,
        "dim": "time",
        "latent": false
    }
]

time request with lang zh_CN

request

curl --location 'http://0.0.0.0:8000/parse' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'locale=zh_CN' \
--data-urlencode 'text="明天下午2点到明天下午3点"' \
--data-urlencode 'dims="["time"]"'

response

[
    {
        "body": "明天下午2点",
        "start": 1,
        "value": {
            "values": [
                {
                    "value": "2024-12-04T14:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                }
            ],
            "value": "2024-12-04T14:00:00.000-08:00",
            "grain": "hour",
            "type": "value"
        },
        "end": 7,
        "dim": "time",
        "latent": false
    },
    {
        "body": "明天下午3点",
        "start": 8,
        "value": {
            "values": [
                {
                    "value": "2024-12-04T15:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                }
            ],
            "value": "2024-12-04T15:00:00.000-08:00",
            "grain": "hour",
            "type": "value"
        },
        "end": 14,
        "dim": "time",
        "latent": false
    }
]

expected response

[
    {
        "body": "明天下午2点到明天下午3点",
        "start": 1,
        "value": {
            "values": [
                {
                    "to": {
                        "value": "2024-12-04T16:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "from": {
                        "value": "2024-12-04T14:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "type": "interval"
                }
            ],
            "to": {
                "value": "2024-12-04T16:00:00.000-08:00",
                "grain": "hour"
            },
            "from": {
                "value": "2024-12-04T14:00:00.000-08:00",
                "grain": "hour"
            },
            "type": "interval"
        },
        "end": 23,
        "dim": "time",
        "latent": false
    }
]

request

curl --location 'http://0.0.0.0:8000/parse' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'locale=zh_CN' \
--data-urlencode 'text="明天上午9点到明天上午11点"' \
--data-urlencode 'dims="["time"]"'

response

[
    {
        "body": "明天",
        "start": 1,
        "value": {
            "values": [
                {
                    "value": "2024-12-04T00:00:00.000-08:00",
                    "grain": "day",
                    "type": "value"
                }
            ],
            "value": "2024-12-04T00:00:00.000-08:00",
            "grain": "day",
            "type": "value"
        },
        "end": 3,
        "dim": "time",
        "latent": false
    },
    {
        "body": "9点",
        "start": 5,
        "value": {
            "values": [
                {
                    "value": "2024-12-03T09:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                },
                {
                    "value": "2024-12-03T21:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                },
                {
                    "value": "2024-12-04T09:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                }
            ],
            "value": "2024-12-03T09:00:00.000-08:00",
            "grain": "hour",
            "type": "value"
        },
        "end": 7,
        "dim": "time",
        "latent": false
    },
    {
        "body": "明天",
        "start": 8,
        "value": {
            "values": [
                {
                    "value": "2024-12-04T00:00:00.000-08:00",
                    "grain": "day",
                    "type": "value"
                }
            ],
            "value": "2024-12-04T00:00:00.000-08:00",
            "grain": "day",
            "type": "value"
        },
        "end": 10,
        "dim": "time",
        "latent": false
    },
    {
        "body": "11点",
        "start": 12,
        "value": {
            "values": [
                {
                    "value": "2024-12-03T11:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                },
                {
                    "value": "2024-12-03T23:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                },
                {
                    "value": "2024-12-04T11:00:00.000-08:00",
                    "grain": "hour",
                    "type": "value"
                }
            ],
            "value": "2024-12-03T11:00:00.000-08:00",
            "grain": "hour",
            "type": "value"
        },
        "end": 15,
        "dim": "time",
        "latent": false
    }
]

expected response

[
    {
        "body": "明天上午9点到明天上午11点",
        "start": 1,
        "value": {
            "values": [
                {
                    "to": {
                        "value": "2024-12-04T09:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "from": {
                        "value": "2024-12-04T11:00:00.000-08:00",
                        "grain": "hour"
                    },
                    "type": "interval"
                }
            ],
            "to": {
                "value": "2024-12-04T09:00:00.000-08:00",
                "grain": "hour"
            },
            "from": {
                "value": "2024-12-04T11:00:00.000-08:00",
                "grain": "hour"
            },
            "type": "interval"
        },
        "end": 23,
        "dim": "time",
        "latent": false
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant