I’ve got Duckling configured in my pipeline to extract date, time, date/time range values from user utterances. I’ve observed that within the same intent, Duckling throws in multiple time values. See the example below -
we're looking for something on the third week of february
What I got -
{
"intent": {
"name": "1.1_state_preferences",
"confidence": 0.529475748538971
},
"entities": [
{
"start": 26,
"end": 38,
"text": "on the third",
"value": "2020-02-03T00:00:00.000-08:00",
"confidence": 1.0,
"additional_info": {
"values": [
{
"value": "2020-02-03T00:00:00.000-08:00",
"grain": "day",
"type": "value"
},
{
"value": "2020-03-03T00:00:00.000-08:00",
"grain": "day",
"type": "value"
},
{
"value": "2020-04-03T00:00:00.000-07:00",
"grain": "day",
"type": "value"
}
],
"value": "2020-02-03T00:00:00.000-08:00",
"grain": "day",
"type": "value"
},
"entity": "time",
"extractor": "DucklingHTTPExtractor"
},
{
"start": 29,
"end": 55,
"text": "the third week of february",
"value": "2020-02-17T00:00:00.000-08:00",
"confidence": 1.0,
"additional_info": {
"values": [
{
"value": "2020-02-17T00:00:00.000-08:00",
"grain": "week",
"type": "value"
},
{
"value": "2021-02-15T00:00:00.000-08:00",
"grain": "week",
"type": "value"
},
{
"value": "2022-02-21T00:00:00.000-08:00",
"grain": "week",
"type": "value"
}
],
"value": "2020-02-17T00:00:00.000-08:00",
"grain": "week",
"type": "value"
},
"entity": "time",
"extractor": "DucklingHTTPExtractor"
}
]
Why is it giving me two sets of values? It seems to analyze the “on the third” as the third of February, March and April but that’s not what I got from duckling.wit.ai and even if it does extract it, shouldn’t it give it a lower confidence considering that there are more words after this phrase.
How do I resolve this?