facebook / facebook/duckling

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

Open
#581 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.3k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

```
$ 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`?

Contributor guide

Open the contributing guide

Research direction

Reproduce the example through the /parse endpoint and compare the Quantity and Distance results. Trace the existing Quantity normalization behavior and the Distance handling, then verify that distance values such as 10km and 10 cm are normalized to the expected centimeter unit.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.