Dependencies and Dependency Grammar
Phrase structure grammar is concerned with how words and sequences of words combine to form constituents. A distinct and complementary approach, dependency grammar, focuses instead on how words relate to other words. Dependency is a binary asymmetric relation that holds between a head and its dependents. The head of a sentence is usually taken to be the tensed verb, and every other word is either dependent on the sentence head or connects to it through a path of dependencies.
A dependency representation is a labeled directed graph, where the nodes are the lexical items and the labeled arcs represent dependency relations from heads to dependents. Figure 8-8 illustrates a dependency graph, where arrows point from heads to their dependents.

Figure 8-8. Dependency structure: Arrows point from heads to their dependents; labels indicate the grammatical function of the dependent as subject, object, or modifier.
The arcs in Figure 8-8 are labeled with the
grammatical function that holds between a dependent and its head. For
example, I is the SBJ (subject) of shot
(which is the head of the whole sentence), and in
is an NMOD (noun modifier of
elephant). In contrast to phrase structure grammar,
therefore, dependency grammars can be used to directly express
grammatical functions as a type of dependency.
Here’s one way of encoding a dependency grammar in NLTK—note ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access