facebook / duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to find out which values of a date are imputed by duckling

nvinayvarma189 opened this issue · comments

Case 1:
Input text: on the 26th
Duckling output: {"value":"2022-04-26T00:00:00.000-07:00","grain":"day","type":"value"}
In this case, duckling has filled the values of the month (04) and the year (2022). So month and year are imputed

Case 2:
Input text: 26th May
Duckling output: {"value":"2022-05-26T00:00:00.000-07:00","grain":"day","type":"value"}
In this case, duckling has filled the value of the year (2022). Only year is imputed

In both the above cases, duckling tried to obtain a complete date from the input by imputing some values.

Question:
From the parsed output itself, Is there a way to know if duckling has imputed certain placeholder values to the parsed output? If yes, which ones (i.e. Month or a year or both, etc)?

@chessai

Sorry but I did not get it. I understand that Duckling gives preference to the closest future date, but how can that help me find out what values of the date were imputed by Duckling?

@chessai

Sorry but I did not get it. I understand that Duckling gives preference to the closest future date, but how can that help me find out what values of the date were imputed by Duckling?

I don't think this is doable right now, you'd have to make a PR to make this possible

Thanks @chessai

I just have one more question. Since it is not possible to know which values are imputed, is it possible to know if at all imputation has happened?

I think even for this info, we would need a PR right?

Thanks @chessai

I just have one more question. Since it is not possible to know which values are imputed, is it possible to know if at all imputation has happened?

I think even for this info, we would need a PR right?

Yes, you would likely need a PR for that as well.