I have sentence 'today i go to school early' I want to use spacy and iteration to get the max height (depth) of the dependency tree.
nlp = spacy.load("en_core_web_sm")
doc = nlp("today i go to school early")
height = 0
for token in doc:
root = [token for token in doc if token.head == token][0]
I am stuck here and can not navigate further. Could you please help and correct my above code if anything wrong?