Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time entities should allow filtering past dates or future dates #42

Closed
ltbringer opened this issue Jun 2, 2021 · 1 comment · Fixed by #43
Closed

Time entities should allow filtering past dates or future dates #42

ltbringer opened this issue Jun 2, 2021 · 1 comment · Fixed by #43
Assignees
Labels

Comments

@ltbringer
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Sentences like "मुझे परसो शाम 5 बजे कॉल करना"
परसो - points to a day before and a day after both.

This produces time entities like so:

{'entities': [{'alternative_index': None,
               'body': 'परसो शाम 5 बजे',
               'dim': 'time',
               'entity_type': 'datetime',
               'grain': 'hour',
               'latent': False,
               'origin': 'value',
               'parsers': [],
               'range': {'end': 23, 'start': 9},
               'score': None,
               'slot_names': [],
               'type': 'datetime',
               'value': '2021-05-31T17:00:00.000+05:30',
               'values': [{'grain': 'hour',
                           'type': 'value',
                           'value': '2021-05-31T17:00:00.000+05:30'}]},
              {'alternative_index': None,
               'body': 'परसो शाम 5 बजे',
               'dim': 'time',
               'entity_type': 'datetime',
               'grain': 'hour',
               'latent': False,
               'origin': 'value',
               'parsers': [],
               'range': {'end': 23, 'start': 9},
               'score': None,
               'slot_names': [],
               'type': 'datetime',
               'value': '2021-06-04T17:00:00.000+05:30',
               'values': [{'grain': 'hour',
                           'type': 'value',
                           'value': '2021-06-04T17:00:00.000+05:30'}]}],
 'version': '0.1.0'}

There is no utility to sort/filter these, I mostly want to use the future values here.

Describe the solution you'd like
I wish to get the oldest or the latest value here.

Describe alternatives you've considered
Writing a plugin to do this but feels like a lot of code to write for a simple comparison check that could happen here.

@ltbringer
Copy link
Contributor Author

DucklingPlugin should take a kwarg for providing only future dates or only past dates.

@ltbringer ltbringer self-assigned this Jun 2, 2021
@ltbringer ltbringer changed the title Time entities should allow getting earliest date or latest date Time entities should allow filtering past dates or future dates Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant