AI Glossary / Natural language and speech / Intermediate
Grammatical relation
Definition
A grammatical relation is a syntactic relationship between an expression and another part of a sentence, such as the relationship of a subject or object to its predicate. In dependency parsing, relations are represented as labeled links between words. The term substantially overlaps with grammatical function; its exact scope depends on the grammatical framework and annotation scheme.
What it means
Words in a sentence do more than occur next to one another. In “Mira repaired the printer,” Mira relates to repaired as its subject, and printer relates to repaired as its object in a conventional dependency analysis. These links describe structure that a plain list of words does not capture.
Different schemes encode grammatical relations differently. A labeled dependency tree is one representation, not the definition of all grammar. Some frameworks work primarily with constituents or other structures, and broad relation names may not have identical boundaries across languages or theories.
How it works
A dependency parser identifies a head and a relation label for each relevant dependent under the selected scheme. A basic Universal Dependencies representation forms a tree with one sentence root and other words attached to heads. Labels distinguish connections such as subject, object, determiner, and adjectival modifier.
Head choice and relation choice are separate decisions. A parser can attach a word to the correct head while giving the link an incorrect label. Evaluation can therefore distinguish unlabeled attachment, which checks heads, from labeled attachment, which checks both heads and relations.
Enhanced dependency representations can add information beyond a basic tree. Applications must know which representation they consume rather than assuming that all outputs have identical structure. They must also interpret syntax together with semantics: a subject relation alone does not establish the actor in every construction.
Three practical examples
1. Information extraction: A system follows a subject or object relation to connect a predicate with relevant participants, while checking voice and context before assigning event roles.
2. Parser evaluation: Researchers inspect whether an error comes from the wrong head, the wrong relation label, or both, making the failure more informative than a single sentence-level judgment.
3. Multilingual annotation: A project uses documented relations to make comparable analyses across languages while retaining language-specific distinctions supported by its guidelines.
Think of it this way
Think of a diagram whose arrows have labels such as supervises, belongs to, or modifies. Knowing that two boxes are linked is less informative than knowing what the link means.
The analogy is limited: grammatical relations follow linguistic conventions, and a dependency arrow does not necessarily express real-world causation or authority. The head-dependent direction is part of the representation, not a claim that one word physically controls another.
Worked example
Analyze the original sentence “Mira repaired the printer.” Ignore punctuation for this exercise. There are four word tokens: Mira, repaired, the, and printer. In a simple UD-style analysis, repaired is the root; Mira attaches to repaired with nsubj; printer attaches to repaired with obj; and the attaches to printer with det.
Now suppose a parser chooses all the same heads but mistakenly labels printer's link as nsubj instead of obj. The sentence's basic tree still has the same connectivity, but its grammatical interpretation is wrong at that link.
If evaluation includes all four tokens and treats the root assignment as one scored relation, the parser has four correct heads out of four, so unlabeled attachment is 100%. It has three correct head-and-label pairs out of four, so labeled attachment is 75%.
These percentages depend on the stated scoring convention; other evaluations may handle root or punctuation differently. The arithmetic is an original illustration, not a real parser result. It shows why correct connectivity alone is insufficient when an application relies on relation labels to distinguish who repaired something from what was repaired.
Illustrative case study
Fictional case: A document-analysis team sees a strong overall parsing score but frequent mistakes in an extracted object field. Reviewers find that some links have the correct head yet an incorrect grammatical label, which the downstream system trusts without further checks.
The team evaluates the relations relevant to its application separately and compares extracted event records with the source text. It also verifies that its parser and downstream rules use the same annotation conventions. This connects grammatical evaluation to the actual task rather than assuming that one headline score captures every operational error.
Common misconceptions and mistakes
A grammatical relation is not a semantic role. The subject of a passive sentence can denote the thing affected, so syntax must not be equated mechanically with agency.
A dependency relation is also not just physical word proximity. A word can depend on a distant head, and adjacent words may not have the relationship an application expects.
The labels are not universally interchangeable across annotation schemes. Even familiar names such as object can have scheme-specific definitions. Finally, grammatical function and grammatical relation are often closely related terms; imposing a sharp universal distinction between them would be misleading.
Business use
For businesses, grammatical relations can make extraction rules more precise than keyword matching alone. Their usefulness depends on annotation quality, parser coverage, and whether the labels support the intended interpretation.
Document the scheme, representation type, and scoring conventions. Test errors that swap subject and object, mishandle passives, or attach a modifier to the wrong head. Preserve uncertainty where the source is ambiguous, and assess final extracted claims separately from the parser's structural accuracy.
People also ask
Is a relation the same as a head?
No. The head identifies the linked word; the relation label describes the kind of grammatical connection.
Can a parser get the head right but the relation wrong?
Yes. That is why labeled and unlabeled attachment measures can differ.
Are all grammatical relations represented by a simple tree?
Not in every framework or representation. Basic dependency schemes often use trees, while enhanced analyses can use more general graphs.
Check your understanding
In the worked example, why is unlabeled attachment perfect while labeled attachment is only 75%?
Answer: Every token has the correct head, but one of the four scored links has the wrong relation label. Labeled evaluation requires both decisions to be correct.
Related terms
- Grammatical function
- Head
- dependency relation
- dependent
- subject
- object
- labeled attachment score
Learn next
Learn next about dependency trees and parser evaluation. Draw heads and labels separately for a short sentence, then change one head or one label to see how each error affects structure and downstream interpretation.
More in Natural language and speech
- Gold labels - Gold labels are the reference annotations treated as the accepted answers for a defined machine-learning task or evaluation.
- Gorn address - A Gorn address identifies a node in an ordered rooted tree by recording the sequence of child choices needed to reach it from the root.
- Grammar induction - Grammar induction is the process of learning a grammatical representation or structural regularities from examples.
- Greedy decoding - Greedy decoding is a method for generating a sequence by choosing the highest-scoring available next token at each step.
- Gricean maxims - Gricean maxims are conversational expectations proposed by philosopher H. Paul Grice to help explain cooperative communication.
- Heaps's law - Heaps's law is an empirical relationship describing how the number of distinct terms in a text collection tends to grow as more word occurrences are observed.
Sources
Universal Dependencies' official syntax overview was read for typed relations, basic trees, enhanced graphs, and cross-language limitations: https://universaldependencies.org/u/overview/syntax.html . Jurafsky and Martin's dependency-parsing chapter was read for attachment evaluation: https://stanford.edu/~jurafsky/slp3/20.pdf . The Mira/printer analysis and scores are original illustrations with explicit root and punctuation conventions; no parser was run.
Previous: Grammatical function Next: Granger causality