3 ms·
Note: I work in the NLP field. I'll echo what others have been suggesting, that in this case a restricted grammar with a thesaurus for synonyms and making use
by msbmsb 18y ago
Note: I work in the NLP field.
I'll echo what others have been suggesting, that in this case a restricted grammar with a thesaurus for synonyms and making use of some extant date libraries might be your best option here.
I suggest this because your trigger input is purpose-driven. If you were going to be extracting this type of information from the middle of a email or document content, then I would be making some NLP(-ish) suggestions here. However, since you say that the commands to your application will be input directly by the user for that specific purpose, it will be much more user-friendly and easier (with more user confidence) if you have a pre-defined simple grammar with a range of available options and command synonyms.
That way, since the user is only typing for your application to understand, they know what they can/should type for the expected results. You can allow for a little variety, a little variation in date descriptions, but it should be constrained to a point.
The comments about auto-complete suggestions would work very well in reminding the user what types of commands are available. Have a list of commands (TODO, FOLLOWUP, NAGME, etc) and then when the user selects one of those commands, fill in the other parts of the syntax with placeholders (FOLLOWUP: [in X days|on DATE],...) perhaps.
I'd say that you could add a little intelligence to it by picking up on certain keys from the email to suggest commands, i.e. dates in the email could be options for the date part of the command, and other more complex (and less-accurate) extractions.
But a simpler solution should work better in this case than anything with a more NLP focus, in my opinion.