python 3.x - How to properly find root verb using spacy? -


i want check if word root verb using spacy. can check if word is, instance, subject, this:

if word.dep == spacy.symbols.nsubj

i think checking if it's root verb:

if word.dep == spacy.symbols.root

but fails. can this:

if word.dep == 512817 or if word.dep_ == "root"

but both seem wrong. there way more analogous first example?


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -