Understanding Date Descriptions

Making a machine understand what "last Thursday in the next month" means.

In the English language there are hundreds of different ways you can express date and time. For example you can talk about the "end of next month", the "weekend" or "December last year".

While it is very natural to use expressions like these, this poses a challenge for app creators who develop computer systems with a natural language interface. Computer systems must be able to translate a time expression to a concrete date if they want to do anything useful with this information, e.g. book a reservation, make an appointment or add a reminder to a user's calendar. There are already some systems that are partially capable of understanding date descriptions (e.g. Google Now or Amazon Alexa), but from everything we tested so far, these systems are very limited in the complexity of date descriptions you can do.

Since we are NLP experts we took it as a challenge and built a small translation system that solves the problem. Surprisingly, we noticed that date and time descriptions in natural languages are actually much more complex than we initially thought. Especially because you can nest expressions in others, e.g "first Sunday in the month after next month". To solve this problem we took the approach to define an algebra of time computations that is able to represent nested expressions1. Using similar techniques as in our Database Query Translation Model we were able to represent the challenge as a translation task for which we trained a sequence-to-tree model2.

Play around with the model yourself. Try to express a day, week, month, year like you would normally do and see if our demo model can understand you! Here are some more examples:


  1. You can see algebraic expressions in the demo below

  2. Which itself is based on a sequence-to-sequence translation model