nus-cs2103-AY1920S1 / pe-dev-response

0 stars 0 forks source link

Natural language parsing: Invalid dates are recognised as valid input #1609

Open nus-pe-bot opened 5 years ago

nus-pe-bot commented 5 years ago

Reason: nov 32 2019 is recognised as a valid date.

Steps to reproduce:

  1. addbudget d/school p/300 sd/nov 32 2019 pr/month

image.png


[original: nus-cs2103-AY1920S1/pe-interim#1618]

czkay commented 4 years ago

Team's Response

This issue is due to an attempt to allow more natural forms of date and time input by integrating Natty and paticularly the limitations of the natural language processing used by Natty. Natty attempts to parse anything a user enters that resembles a valid date as a date. This results in unexpected date time when the representation of the date a user enters does not align with Natty's expectations.

Natty attempts to recognize a wide range of date formats, but since there is an inherent ambiguity in the grammar describing these formats, some decisions need to be made arbitrarily. Excerpt from Natty's documentation available here

As language is naturally ambiguous in the absence of context, and stronger natural language processing to determine said context, it is not feasible to correctly parse every single date that a user enters.

For example: Attempting to parse 33 alone is ambiguous. 33/2 is less ambiguous, however, this format does no align with most common time inputs, and the date is also not a valid date. However, Natty is not aware of the context of this input and tries its best to determine what it could mean. This results in it parsing a time rather than a date as 33 is not a valid date in any context. This results in the outcome seen where Natty parses the 2 in the input an an hour rather than a month due to the absence of a valid date, since in most contexts 2 is taken to be a time.

For this particular case:

As stated in our user guide, users ‘can refer to http://natty.joestelmach.com/ for documentation and more information’. As seen from the ‘try it out’ section of the aforementioned website, Natty successfully parses a datetime input of ‘nov 32 2019’ as 1st Nov. This matches the success message in the screenshot of the bug report (1 Nov). The time field of the added budget in the report (12:00:00 AM) is an intended budget feature.

image.png

Hence, we are changing the bug type to a FeatureFlaw:

Downgrading severity to Low:

We are defining this issue as not in scope for the following reasons: