Structured Prediction and Parsing Evaluation › Worked Example: UAS and LAS by Hand
Language AI HandbookAll chapters Take this hand-built teaching fixture with fixed tokenization. Heads are zero-based lexical indices and the root points to itself as a local marker. Labels follow an older dependency-label style, with a deliberately different predicted obj string; this is not a UD v2 or official EVALB/shared-task example. All 11 words, including punctuation and the locally marked root, are scored exactly as written.
| i | Token | Gold head | Gold label | Pred head | Pred label |
|---|---|---|---|---|---|
| 0 | The | 2 | det | 2 | det |
| 1 | old | 2 | amod | 2 | amod |
| 2 | man | 7 | nsubj | 7 | nsubj |
| 3 | who | 4 | nsubj | 4 | nsubj |
| 4 | lives | 2 | rcmod | 7 | rcmod |
| 5 | next | 6 | amod | 6 | amod |
| 6 | door | 4 | npadvmod | 4 | npadvmod |
| 7 | reads | 7 | root | 7 | root |
| 8 | many | 9 | amod | 9 | amod |
| 9 | books | 7 | dobj | 7 | obj |
| 10 | . | 7 | punct | 7 | punct |
Count the errors:
- Token 4: predicted head 7, gold head 2. Head wrong. Counts against both UAS and LAS.
- Token 9: predicted head 7 (correct), predicted label
obj(golddobj). Head right, label wrong. Counts against LAS only.
So , head errors , label-only errors .
The gap is , approximately 9.09 percentage points, and comes from the one label-only error. UAS alone would miss that label mismatch; LAS alone would combine it with the head error. Looking at the two scores and the token-level errors reveals both defects in this fixture. Whether either error matters more downstream cannot be read from their equal contribution to the aggregate.
Now suppose the model produced the exact same heads but every label was wrong. UAS would stay at approximately 0.909 while LAS dropped to 0.0. This is why reporting both matters, and why the UAS-LAS gap is a diagnostic rather than a nuisance.
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!