Classifying dates in sentences Let's say I have a sentences that goes like this:


  Hi, how are the kids. I will be going to Los Angeles next Friday and
  will come back the following Monday.


If the date today is October 16 (Wednesday), then next Friday would be October 25th. The sentence later says that the person will come back the following Monday. We know they mean the Monday after next Friday so the 28th of October. If I use the dateutil library, then it would classify both Friday and Monday, but it won't take into account the next before Friday or that we are saying the following Monday.

I was thinking of creating a solution that will split the sentence up into words and then check what comes before actual dates. However, I'd like to capture not only this type of adverb of time, but others as well. For example, next day, this Thursday, 2 days from today, etc. How do I build a framework that will detect these types of date texts and then print out their respective dates?
If you have enough data to train a machine learning model, I believe LSTMs are what you need. Long short-term memory (LSTM) is an artificial recurrent neural network (RNN) architecture used in the field of deep learning. 

LSTM networks are well-suited to classifying, processing and making predictions based on time series data, since there can be lags of unknown duration between important events in a time series.

Initially, you can use Pandas LSTM library, you design it from scratch by using Python Tensorflow library. Look at the following links:

Wikipedia

LSTM in python tutorial