Dependency Syntax and Universal Dependencies › Worked Example
Language AI HandbookAll chapters Dependency Syntax and Universal Dependencies › Worked ExampleSection view · Sections in this chapter9 / 13 ↓
Reading tools Definitions, links & notes
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let us trace a small parse by hand, using simple but realistic UD conventions.
Sentence: She gave him a book.
Step 1: tokenize. Six tokens: She, gave, him, a, book, ..
Tokenization is already a syntactic decision, because the syntactic-word boundaries determine the nodes of the tree. Here each word is a separate token, and the period is its own punctuation token. Representing don't as do + n't while retaining the surface contraction uses a multiword-token range row in CoNLL-U. The worked sentence needs no such row.
Step 2: assign UPOS.
| Token | UPOS |
|---|---|
| She | PRON |
| gave | VERB |
| him | PRON |
| a | DET |
| book | NOUN |
| . | PUNCT |
The POS and dependency layers are related by UD's annotation guidelines, but a tag does not determine every attachment. In this worked analysis, VERB marks the predicate head, DET marks the det dependent, and the PUNCT period receives punct. Other constructions can have different tag-relation combinations.
Step 3: identify heads.
- She is the subject of gave. Head = 2.
- gave is the main predicate. Head = 0 (root).
- him is the indirect object of gave. Head = 2.
- a modifies book. Head = 5.
- book is the direct object of gave. Head = 2.
- The period attaches to gave. Head = 2.
The key decision is that gave is the structural center of the sentence. It is the finite verb, it determines the argument structure, and it is the natural attachment point for the subject, the objects, and the punctuation. The determiner a attaches locally to book, not to the verb, because its role is to specify the noun phrase rather than to participate in the verbal argument structure.
Step 4: assign labels.
| Token | Head | Label |
|---|---|---|
| She | 2 | nsubj |
| gave | 0 | root |
| him | 2 | iobj |
| a | 5 | det |
| book | 2 | obj |
| . | 2 | punct |
The labels distinguish the two objects. him is the recipient and is labelled iobj, while book is the thing given and is labelled obj. That distinction is not visible from the head pointers alone, which is why the label layer is essential.
Step 5: check projectivity.
- Arc 2→1: no tokens strictly between 1 and 2. Projective.
- Arc 2→3: no tokens strictly between 2 and 3. Projective.
- Arc 5→4: no tokens strictly between 4 and 5. Projective.
- Arc 2→5: token 3 (him) is between 2 and 5, and him is a dependent of 2. Projective. Token 4 (a) is between 2 and 5 and is in the subtree of 5, which is in the subtree of 2. Projective.
- Arc 2→6: tokens 3, 4, 5 are all dominated by 2. Projective.
The tree is projective. If we draw the tokens on a horizontal line, the arcs fan out from gave: an nsubj arc to She, an iobj arc to him, an obj arc to book, and a punct arc to the period. The only arc headed by a nonroot word is the det arc from book to a, and it sits entirely inside the span of the obj arc. The tree can be drawn above this fixed word order without crossings.
And note the contrast with the non-projective example:
Sentence: I saw a dog yesterday which was a Yorkshire Terrier.
The arc from dog (token 4) to Terrier (token 10) spans yesterday, which, was, a, and Yorkshire, of which yesterday is outside the subtree of dog. The tree is non-projective, so a parser restricted to projective outputs cannot recover this analysis exactly.
Both sentences illustrate the same representational idea: every token has one head and one label, and the whole structure is a tree. Projectivity adds a restriction on the relationship between attachment and word order. It determines which analyses a projective parser can output, rather than establishing a universal ranking of parsing difficulty.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!