Closed clobotorre closed 3 years ago
Piping through jq for easier-to-read output (I recommend this when pasting for future issues!):
[
{
"body": "viernes",
"start": 11,
"value": {
"values": [
{
"value": "2021-05-21T00:00:00.000-07:00",
"grain": "day",
"type": "value"
},
{
"value": "2021-05-28T00:00:00.000-07:00",
"grain": "day",
"type": "value"
},
{
"value": "2021-06-04T00:00:00.000-07:00",
"grain": "day",
"type": "value"
}
],
"value": "2021-05-21T00:00:00.000-07:00",
"grain": "day",
"type": "value"
},
"end": 18,
"dim": "time",
"latent": false
}
]
As you can see, after the array, is the actual value and grain. The values array contains the three next fridays (as likely candidates for what you want), but the actual return value is the most recent one.
Now that I can use requests in en_GB (thanks to LANG env. variable), I see that in English 'next friday' (or any other weekday) results in one single value in the values array (Sorry for the readability. I dont know how to paste the json in the beauty way yo do)
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_GB&text="next friday"' | jq
[ { "body": "next friday", "start": 1, "value": { "values": [ { "value": "2021-05-28T00:00:00.000-07:00", "grain": "day", "type": "value" } ], "value": "2021-05-28T00:00:00.000-07:00", "grain": "day", "type": "value" }, "end": 12, "dim": "time", "latent": false } ]
So, Is there any way to obtain same result (one single value in the values array instead of three of them) when the request is in Spanish?
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=es_ES&text="el proximo viernes"' | jq
[ { "body": "viernes", "start": 12, "value": { "values": [ { "value": "2021-05-21T00:00:00.000-07:00", "grain": "day", "type": "value" }, { "value": "2021-05-28T00:00:00.000-07:00", "grain": "day", "type": "value" }, { "value": "2021-06-04T00:00:00.000-07:00", "grain": "day", "type": "value" } ], "value": "2021-05-21T00:00:00.000-07:00", "grain": "day", "type": "value" }, "end": 19, "dim": "time", "latent": false } ]
I'm running duckling this way:
After that, if I send this request:
I get, in the values array the next three fridays:
I cannot test if in English it has the same response, because of this issue https://github.com/facebook/duckling/issues/204
What I was expecting is just one single friday (the very next one) in the values array. How can I achieve that?