liveBook · Manning

Dependent

As explained in Natural Language Processing in Action, Second Edition

A dependent is a word whose grammatical role is defined in relation to a governing head word in a dependency parse.

A dependent is a word whose grammatical role is defined by its relationship to a governing head word. Dependency parsing represents these relationships as a tree: the head governs, the dependent attaches to it, and one word serves as the root. These links support information extraction and knowledge-graph construction. section 11.6

Finding dependents with spaCy

In “Gebru was unethically fired from her Ethical AI team,” fired is the ROOT. Gebru is its passive nominal subject, while the token’s children include Gebru, was, unethically, from, and the punctuation. Inspecting children reveals which words depend directly on a token. section 11.6

>>> def doc2df(doc):
...     df = pd.DataFrame([token_dict2(t) for t in doc])
...     return df.set_index('TOK')
>>> doc2df(doc)
               POS   TAG ENT_TYPE        DEP             children
TOK
Gebru        PROPN   NNP   PERSON  nsubjpass                   []
was            AUX   VBD             auxpass                   []
unethically    ADV    RB              advmod                   []
fired         VERB   VBN                ROOT  [Gebru, was, une...
from           ADP    IN                prep               [team]
her           PRON  PRP$                poss                   []
Ethical      PROPN   NNP      ORG   compound                   []
AI           PROPN   NNP      ORG   compound            [Ethical]
team          NOUN    NN                pobj            [her, AI]
.            PUNCT     .               punct                   []

Inspect a token table that adds each token’s children, making dependent relationships visible alongside part-of-speech and dependency labels. section 11.6

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains heads, dependents, roots, dependency labels, and children inspection, but does not detail parser training or algorithms.
Examples
Uses a sentence about Gebru’s firing, spaCy token tables, children lists, and a rendered dependency diagram.
What it assumes
Assumes basic grammatical roles and introduces dependency-tree terminology through a concrete parsed sentence.
What you can do after
Apply it via spaCy to inspect dependents and identify token relationships useful for extracted facts.
How it connects
Connects dependent to dependency parsing, dependency trees, root nodes, grammatical relations, and knowledge graphs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.