facebook / facebook/duckling

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

Open
#689 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
4.3k
Forks
739
PR merge metrics
No merged PRs in 30d

Description

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)?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides two date inputs, “on the 26th” and “26th May,” with their parsed outputs, but names no files, tests, or entry points. Start by locating the date parsing output representation and determine whether it exposes which components were imputed. Done means the output can reliably identify imputed month and year values, or the limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.