A dependency relation labels a grammatical link between a head word and a dependent word. In a dependency tree, every word except the root depends on another word; the relation labels describe links such as passive subjects, modifiers, and objects. section 11.6
Reading a dependency parse
In “Gebru was unethically fired from her Ethical AI team,” fired is the ROOT, while Gebru has the nsubjpass relation. Inspecting each token’s children reveals which words depend on it; these links can support extracting a fact for a knowledge graph. section 11.6
>>> text = "Gebru was unethically fired from her Ethical AI team."
>>> doc = nlp(text)
>>> doc2df(doc)
TOK POS TAG ENT_TYPE DEP
0 Gebru PROPN NNP PERSON nsubjpass
1 was AUX VBD auxpass
2 unethically ADV RB advmod
3 fired VERB VBN ROOT
4 from ADP IN prep
5 her PRON PRP$ poss
6 Ethical PROPN NNP ORG compound
7 AI PROPN NNP ORG compound
8 team NOUN NN pobj
9 . PUNCT . punct
Inspect token text, part of speech, entity type, and dependency label for the example sentence. section 11.6
