import spacy nlp = spacy.load("en_core_web_sm") doc = nlp("The dog bit the man.") for token in doc: print(f"{token.text} --[{token.dep_}]--> {token.head.text}")