facebook/duckling

Normalize the Distance dimensions in the same way as done in Quantity

Opened this issue · 3 comments

AMR-K commented
$ curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_GB&text=10kg > 10 gram, 10km > 10 cm' | python -m json.tool

[
    {
        "body": "10kg",
        "start": 0,
        "value": {
            "value": 10000,
            "type": "value",
            "unit": "gram"
        },
        "end": 4,
        "dim": "quantity",
        "latent": false
    },
    {
        "body": "10 gram",
        "start": 7,
        "value": {
            "value": 10,
            "type": "value",
            "unit": "gram"
        },
        "end": 14,
        "dim": "quantity",
        "latent": false
    },
    {
        "body": "10km",
        "start": 16,
        "value": {
            "value": 10,
            "type": "value",
            "unit": "kilometre"
        },
        "end": 20,
        "dim": "distance",
        "latent": false
    },
    {
        "body": "10 cm",
        "start": 23,
        "value": {
            "value": 10,
            "type": "value",
            "unit": "centimetre"
        },
        "end": 28,
        "dim": "distance",
        "latent": false
    }
]

Can the Distance dimension be normalized to centimeter similar to how the Quantity dimension is normalized to gram?

This is a great idea.

This is a great idea.

Do you think there is a smart way to achieve this without updating each and every rule/ example in the corpora?

This is a great idea.

Do you think there is a smart way to achieve this without updating each and every rule/ example in the corpora?

Yes, do it in the Resolve instance for DistanceData.

EDIT: There is no way to avoid updating the corpora, though.