How to get the dependency tree with spaCy?

In case someone wants to easily view the dependency tree produced by spacy, one solution would be to convert it to an nltk.tree.Tree and use the nltk.tree.Tree.pretty_print method. Here is an example: import spacy from nltk import Tree en_nlp = spacy.load(‘en’) doc = en_nlp(“The quick brown fox jumps over the lazy dog.”) def to_nltk_tree(node): if … Read more