Explaination of the method TextList.label_for_lm

Can someone explain what does the method TextList.label_for_lm does. The documentation only says that it’s “A special labelling method for language models.” without giving any details about the labelling.
Can someone explain what is this special labelling and why?

It is predicting the next word given the previous ones. So, taken from the text itself, not like normal labels.


Is there an equivalent for if I am predicting timeseries float values in a regression problem? It’s not clear to me how to label sequential float values for feeding into an RNN. This code is all a part of TextList and I’m not sure how to pull it out.

Given [0.1, 0.2, 0.3] I would like to label x = 0.1, y = 0.2