First approach for recognizing logical document structures like texts, sentences, segments, words, chars and sentence/segment depth based on recurrent neural network grammars.