AI Glossary / Natural language and speech / Intermediate
Dependency tree
Definition
A dependency tree represents the syntactic structure of a sentence through directed relations between its words. Each non-root word has one head in the basic tree, and relation labels describe connections such as subject, object or modifier. The tree records a grammatical analysis, not a complete account of meaning.
What it means
In “Nora checked the invoice,” checked can head the sentence, Nora can depend on checked as its subject, and invoice as its object. The word the depends on invoice as a determiner. These links make the structure explicit rather than treating the sentence as an unordered collection of words.
Dependency trees differ from constituency trees, which explicitly group words into nested phrases. Both represent syntax, but they organize the representation differently. A dependency tree centers its links on words and their relationships.
The precise treatment of a construction depends on the annotation scheme. Universal Dependencies, or UD, provides one widely used set of conventions. Its basic representation is a tree, while its enhanced representation can add relations and become a more general graph.
How it works
A parser receives a sentence, identifies the syntactic words and predicts heads and relation labels. In a conventional basic dependency tree, every word except the sentence's root has one incoming head relation, all words belong to one connected structure, and following heads does not lead into a cycle.
Some formats include an artificial ROOT node. The sentence's root word then attaches to that node with a special relation. This bookkeeping node is not an extra word uttered by the speaker.
In UD, many function words attach to the content word they support. For example, an article attaches to its noun. Other schemes can make different choices, so head assignments should be interpreted using the relevant documentation.
Parsing also involves ambiguity. A phrase such as “with the scanner” might describe an instrument used for an action or an object associated with a noun. A well-formed tree is one structural analysis; it does not prove that the chosen interpretation is the author's intended one.
Three practical examples
- A document-extraction tool links a verb to its object to locate what was inspected, then checks surrounding qualification before reporting the event.
- A writing assistant identifies an adjective's noun target when explaining a grammatical suggestion.
- A language researcher compares subject relations across annotated languages while respecting their tokenization and annotation conventions.
Think of it this way
Think of a diagram in which each item has a labeled connection to the item it grammatically depends on. The diagram makes relationships visible without needing every pair of words to be connected directly.
The analogy is structural only. A grammatical head is not a manager, the most important real-world participant or necessarily the person performing an action. Dependency labels describe a representation of language, not authority or causation.
Worked example
Building a five-word tree
Consider “Nora checked the new invoice,” with punctuation omitted for this teaching example. Assign word positions 1 through 5. Using straightforward UD-style relations, checked at position 2 is the sentence root. Nora at position 1 has head 2 with label nsubj. Invoice at position 5 has head 2 with label obj. The at position 3 has head 5 with label det, and new at position 4 has head 5 with label amod.
There are five word nodes and four links between words, consistent with a tree over five nodes. Including artificial ROOT adds one node and the link ROOT → checked, giving six nodes and five links.
Every word is connected, each non-root word has one head, and no head path cycles. Those structural checks do not verify whether Nora actually inspected anything. Nor do they determine which real invoice the sentence refers to; that requires information beyond this tree.
Illustrative case study
A fictional purchasing team uses dependency parses to help extract descriptions of invoice checks from internal notes. A prototype finds the subject and object of checked and immediately records the check as completed.
Reviewers test sentences such as “Nora may check the invoice” and “Nora did not check the invoice.” The underlying participants remain easy to identify, but possibility and negation change what can be concluded. The team keeps the parse as supporting structure and adds explicit handling of such qualifications.
The lesson is that syntax helps locate relationships in a sentence. It does not replace interpretation of whether an event occurred, whether it was merely requested, or whether the source is reliable. The scenario is illustrative rather than an empirical evaluation.
Common misconceptions and mistakes
- A dependency tree is an attention map. Attention weights and grammatical dependency relations are different representations.
- A tree is correct whenever it has no cycles. Structural validity does not establish the correct linguistic analysis.
- Every dependency representation must be a tree. Enhanced dependencies can form a general graph.
- The subject always names an agent. Grammatical functions and semantic roles do not correspond one-to-one.
Business use
Dependency trees can support extraction, linguistic search and error analysis when teams need interpretable connections between words. Their usefulness should be tested on the actual document types, languages and writing styles involved.
Record the parser and annotation scheme when comparing results, since apparent disagreements can arise from different conventions. Assess the downstream task as well as parsing accuracy: a correctly identified object is insufficient if the system ignores negation, attaches a modifier incorrectly or links the mention to the wrong record. Retaining source sentences makes these failures easier to inspect.
People also ask
Does every sentence have a verb as its root?
No. Root selection depends on the construction and scheme; UD can use nonverbal predicates as heads.
Is a dependency tree the same as a knowledge graph?
No. It describes sentence-level syntactic relations rather than a general network of entities and facts.
Can one sentence have several plausible trees?
Yes. Ambiguity or differing annotation conventions can support alternative analyses.
Check your understanding
A five-word basic dependency analysis has a cycle between two words. Does giving every word a head make it a valid tree?
Answer: No. The analysis must also be connected and acyclic, with the appropriate root structure. Having head assignments alone is insufficient.
Related terms
- Head
- Root
- Semantic role
- Dependency parsing
- dependent
- constituency tree
- Universal Dependencies
- syntactic relation
- enhanced dependency graph
Learn next
Draw a dependency tree for a short sentence, then change it to a negated or passive version. Separate the syntactic links from claims about the event and from the real-world identities of its participants.
More in Natural language and speech
- Definite reference - Definite reference is a use of language that presents an intended referent as identifiable to the listener or reader in the relevant context.
- Degree adverb - A degree adverb expresses the extent, intensity or sufficiency of a property, state or activity.
- Dental sound - A dental sound is a speech sound whose principal constriction involves the tongue at the teeth.
- Derivational morphemes - Derivational morphemes are meaningful word-building units that help form new lexical words from a base. They can change meaning, grammatical category or both.
- Determiner - A determiner is a grammatical word associated with a noun phrase that helps express how its referent should be understood in context.
- Development set - A development set is a collection of examples used to guide choices while building a machine-learning system.
Sources
Universal Dependencies, Syntax: General Principles: https://universaldependencies.org/u/overview/syntax.html. Basic trees, enhanced graphs and annotation choices. Universal Dependencies, CoNLL-U Format: https://universaldependencies.org/format.html. Head fields and tree encoding. The five-word example is original and checked against the stated basic-tree conventions.
Previous: Dependency network (graphical model) Next: Dependent Dirichlet process