Foundations

Dependency Parsing

In a dependency parse, every word except one attaches to exactly one other word, and a label on the link names the relation. The parser, the program that analyses every sentence in Grammify, produces this kind of parse. Every Reed-Kellogg diagram in this section comes with its dependency tree.

What you’ll learn

  • Find each word's head, and read a tree's arrows, labels and levels
  • Find the root of a sentence, and mark it with one click in the Dependencies exercise
  • Say what an arc's colour shows and what its label shows
  • Say what a dependency parse can express that a Reed-Kellogg diagram cannot, and the reverse

One rule: every word has one head

Every word in a sentence depends on exactly one other word, called its head. The word that depends on it is a dependent. A head is the essential word of its phrase, the word that Spanish grammar calls the núcleo. The link between a head and a dependent is an arc, and each arc carries a relation label that names the kind of link.

There is one exception. The root, usually the main verb, has no head. Every other word attaches to the root, either directly or through other words.

  1. Find the root first

    It is usually the main verb. In will be teaching, the root is teaching; will and be are helping verbs that depend on it.
  2. For each remaining word, find its head

    Use the test from Heads and modifiers: which word survives? In the tall pilot, you can delete the or tall, but without pilot they have nothing to describe. So pilot is their head.
  3. Name the relation

    A subject is nsubj, a direct object is dobj, a determiner is det, and an adjective that describes a noun is amod. The full list is below, with the eleven labels you will see most often.

“Snow fell.”

nsubjROOTSnowfell
  • nsubj Nominal subject
  • ROOT Root of the sentence
Dependency — a root and one dependent

The root is its own head

The root has no word above it, so the parser records it as its own head. In the picture, a short arrow labelled ROOT comes down into its box from empty space, not from another word.

This matters in the Dependencies exercise: the root takes one click, not two. For every other relation, you click the head and then the dependent. For the root, you click only the root word.

Levels, and why arcs can cross

Each row of the tree is a level. The root sits alone on level 0. Its dependents sit one row lower, on level 1, and their dependents on level 2. The lower a word sits, the further it is from the root.

From left to right, the boxes keep the words in sentence order. Read the boxes from left to right, ignoring their height, and you read the sentence.

“The pilot landed the plane safely.”

pilotlandedplaneThesafelythe
Reed-Kellogg — depth measured downward from the base line
detnsubjROOTdetdobjadvmodThepilotlandedtheplanesafely
  • det Determiner
  • nsubj Nominal subject
  • ROOT Root of the sentence
  • dobj Direct object
  • advmod Adverbial modifier
Dependency — depth measured downward from the root

Comparing the two views

Count the rows in the tree: landed on level 0; pilot, plane and safely on level 1; the two determiners on level 2. Reed-Kellogg has only two depths here. The subject, the verb and the object share the base line. Every modifier hangs one slant below it, whether it describes a noun (The, the) or the verb (safely). So the tree puts the subject and the object below the verb, while Reed-Kellogg puts them beside it.

Because the words keep their order, two arcs sometimes cross. This can happen when a phrase is separated from its head by words that belong somewhere else. In the tree below, who knew my dad describes the man, not Cali, because a city cannot know anyone. So its arc starts at man and crosses the pobj arc between from and Cali. A crossing is not an error.

“A man came from Cali who knew my dad.”

detnsubjROOTpreppobjnsubjrelclpossdobjAmancamefromCaliwhoknewmydad
  • det Determiner
  • nsubj Nominal subject
  • ROOT Root of the sentence
  • prep Prepositional modifier
  • pobj Object of preposition
  • relcl Relative clause modifier
  • poss Possession modifier
  • dobj Direct object
Dependency — the relcl arc (man → knew) crosses the pobj arc (from → Cali)

The six relation families

There are forty-six relation labels, too many to give each one its own colour. So the labels are grouped into six families, and the colour tells you the family, the label tells you the relation. Two arcs of the same colour are in the same family, but they can be different relations, so always read the label.

Every label above links to its full entry. The Dependency Relations group explains all forty-six labels, most of them with worked examples.

What each view cannot say

Each view has limits: things it cannot show. Knowing the limits helps you read both views. This section looks at three:

  • A dependency tree cannot show a phrase.
  • A Reed-Kellogg diagram cannot name a relationship.
  • A dependency tree cannot give a word two heads.

A dependency tree cannot show a phrase. There is no arc meaning “these four words are one unit”. You can still find a phrase: a word plus everything below it in the tree is a phrase. But the picture never says so directly.

So a relation names only the head of a phrase, while a Reed-Kellogg role names the whole phrase. Take The passengers in the back row cheered. In the Dependencies exercise, nsubj marks only passengers. In the Roles exercise, the Subject is all six words: The passengers in the back row.

Labels that sound alike work the same way. In the same sentence, pobj marks only row, while the Roles label Object of preposition covers the back row.

A Reed-Kellogg diagram cannot name a relationship. A slant says “modifier” and nothing more; whether it is a determiner, an adjective or a possessive is left to the reader. The dependency parse distinguishes all three.

In practice, use the Reed-Kellogg diagram to see structure and the dependency tree to see relationships. Grammify draws both for every sentence, so you never have to choose.

“Nina left because the music stopped.”

Ninaleftbecausemusicstoppedthe
Reed-Kellogg — a second clause on its own base line
nsubjROOTmarkdetnsubjadvclNinaleftbecausethemusicstopped
  • nsubj Nominal subject
  • ROOT Root of the sentence
  • mark Marker
  • det Determiner
  • advcl Adverbial clause modifier
Dependency — one root, and advcl attaching the second verb

Comparing the two views

A subordinate clause shows the difference most clearly. Reed-Kellogg gives the second clause its own base line on a lower level. A dashed line carrying because joins it to the first, so you can see two clauses. The dependency tree has one root and attaches stopped to left with an advcl arc. The second clause is there, but only as the words that hang below stopped. The tree also tells you that because is a mark; the dashed line does not.

A dependency tree cannot give a word two heads. Every word has exactly one incoming arc. That rule is what makes the picture a tree, and the Dependencies exercise asks for one relation and one head per word. In most sentences the rule causes no problem. In this one it does: She both knows and corresponds with the queen.

Here queen has two jobs. It is the direct object of knows and the object of the preposition with. The Reed-Kellogg diagram shows both jobs: the two verbs fork, and the line from knows and the line under with meet at queen.

The tree has to choose one head. The parser attaches queen to with as pobj, so knows has no object at all. The dobj relation is not hidden somewhere in the tree; it is missing.

That is why the two exercises answer differently. The Roles exercise accepts the queen as both Direct object and Object of preposition. The Dependencies exercise asks for one arc, pobj, because that is all the tree contains. Try both exercises on this sentence in the Practice Lab.

“She both knows and corresponds with the queen.”

Shebothandknowscorrespondswithqueenthe
Reed-Kellogg — one object shared by the verb knows and the preposition with
nsubjpreconjROOTccconjprepdetpobjShebothknowsandcorrespondswiththequeen
  • nsubj Nominal subject
  • preconj Pre-correlative conjunction
  • ROOT Root of the sentence
  • cc Coordinating conjunction
  • conj Conjunct
  • prep Prepositional modifier
  • det Determiner
  • pobj Object of preposition
Dependency — queen has one head, with; knows has no object

Comparing the two views

In the Reed-Kellogg figure, look at the right. Two lines arrive at queen: one from the object slot after knows, and one from the line under with. Now find knows in the tree. It has a subject (She), a second verb (corresponds) and two joining words (both, and), but no object. The tree is not wrong; it holds everything a tree can hold. It also gives both … and two labels, preconj and cc, where the diagram writes both words on one dashed line.

Quick check

  1. Look at The young farmer sold three goats. Which word is the head of young, and on which level of the tree does young sit?
    Answer
    Its head is farmer: young describes the farmer, and without farmer it has nothing to describe. The relation is amod. The root, sold, is on level 0, and its dependents farmer and goats are on level 1. So young, like The, sits on level 2, one row below farmer.
  2. Which word is the root of this sentence, and how many clicks does the root take in the Dependencies exercise? Our neighbours have been painting the garage.
    Answer
    The root is painting, the main verb. The helping verbs have and been depend on it as aux, so neither can be the root. The root takes one click, because it has no head: you click only the root word.
  3. Two arcs in a tree have the same colour. One is labelled det and the other aux. Are they the same relation?
    Answer
    No. The colour shows only the family: det and aux both belong to the Function word family. The label names the relation: det is a determiner (a, the), and aux is an auxiliary, a helping verb such as has or will.
  4. Look at The new manager smiled. Which word does the Dependencies exercise mark as nsubj, and which words does the Roles exercise box as the Subject? Why are they different?
    Answer
    nsubj marks only manager, the head of the subject. The Roles exercise boxes The new manager, the whole phrase. A dependency tree links single words and never shows a phrase. The Roles exercise, like a Reed-Kellogg diagram, works with whole phrases.

Key terms

Dependent
The word doing the depending — the arrow points at it. Birds sing. — birds is the dependent of sing. Birds sing loudly. — loudly is a second dependent of the same verb.
Arc
One head-to-dependent link, carrying a relation label. The Dependencies exercise calls arcs “Edges” (its count includes the ROOT arrow) and asks for each one’s relation, head and dependent. Birds sing. has one arc, nsubj, from sing to birds. Birds sing loudly. has two; the second is labelled advmod.
Root
The one word that depends on no other word; the parser records it as its own head. Usually the main verb. Birds sing. — the root is sing. The kettle had been whistling. — the root is whistling, not either auxiliary.

See: Root & Other Relations

Level
A word’s distance from the root, which sets its row in the tree. The levels come from the complete parse, so in the exercise the tree does not move as you answer. Birds sing. — sing is level 0, birds level 1. The tired birds slept. — the and tired sit at level 2, one row below birds.
Crossing arcs
Two arcs that cross in the tree. The words keep their sentence order, so an arc can cross another when a phrase is separated from its head by words that belong somewhere else. It is rare, and it is not an error. A man came from Cali who knew my dad. — the arc from man to knew crosses the arc between from and Cali. A text came from Diego that said sorry. — the arc from text to said crosses the arc between from and Diego.

Practice on a real sentence

Rebuild this tree one arc at a time (the exercise counts arcs as “Edges”). Pick a relation, click the head, then click the dependent; ROOT takes a single click. The sentence has two prepositional phrases, so prep and pobj each occur twice. Before you link in, decide what in the corner describes: does it tell you which chair, or where she sat?

Loading the practice sentence…