Dependency Syntax and Universal Dependencies › The CoNLL-U Format

Michael BrenndoerferMay 5, 20253 min read
Language AI HandbookAll chapters
Part 7 of 67Linguistic Form: Morphology and Syntax
Chapter 47Dependency Syntax and Universal Dependencies › The CoNLL-U Format
Reading section 8 of 13 · The CoNLL-U Format · 3 minSection 8 of 13 · 3 min

Section 8 of 13 · 3 min read

Dependency Syntax and Universal Dependencies › The CoNLL-U FormatSection view · Sections in this chapter8 / 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

Notes & comments

UD treebanks are distributed in a plain-text tabular format called CoNLL-U. The format is simple enough that you can read it with split('\t') and rich enough to carry lemma, part of speech, features, both layers of dependencies, and miscellaneous metadata.

The format is line-oriented. A sentence is a block of lines, and sentences are separated by blank lines. Comment lines begin with #, and word records contain exactly ten tab-separated fields. A text editor displays those rows directly; a complete reader must also handle the range rows, empty nodes, and field constraints described below.

A sentence may begin with comment lines (starting with #), followed by the word records and any multiword-token or empty-node records. Fields are separated by single tab characters and there are exactly ten fields, in this order:

The ten CoNLL-U fields in their required order.
ColumnNameDescription
1IDToken index. Consecutive integers starting at 1, or a range for multiword tokens, or a decimal like 4.1 for empty nodes.
2FORMWord form; the surface token form on a multiword-token row.
3LEMMABase form, or the underscore if not annotated.
4UPOSUniversal part-of-speech tag.
5XPOSLanguage-specific tag.
6FEATSMorphological features as Key=Value pairs, joined by |.
7HEADIndex of the token's syntactic head, or 0 for the root.
8DEPRELDependency relation from HEAD to this token.
9DEPSEnhanced dependencies in head:label|head:label form.
10MISCMiscellaneous annotations (spaces, transliterations, etc.).

Multiword tokens are handled with a range in ID (for example, 1-2 for a contraction like don't) followed by the component words on subsequent lines. Empty nodes used in enhanced annotation get IDs like 4.1. This chapter's executable sample uses only plain integer word IDs. Other treebanks may also contain range rows and decimal empty-node rows, which require separate handling.

A complete sentence looks like this:

# sent_id = 1 # text = They buy and sell books. 1 They they PRON PRP Case=Nom|Number=Plur 2 nsubj 2:nsubj|4:nsubj _ 2 buy buy VERB VBP Number=Plur 0 root 0:root _ 3 and and CCONJ CC _ 4 cc 4:cc _ 4 sell sell VERB VBP Number=Plur 2 conj 0:root|2:conj _ 5 books book NOUN NNS Number=Plur 2 obj 2:obj|4:obj SpaceAfter=No 6 . . PUNCT . _ 2 punct 2:punct _

Two things to notice. First, UD v2 requires the # sent_id and # text comments for every sentence. sent_id identifies the sentence uniquely within the treebank, and text records its surface form. Reconstructing that text requires respecting token ranges and spacing information such as SpaceAfter=No, rather than simply joining syntactic-word forms with spaces. Second, the underscore usually marks an unspecified value. It must not be treated as an ordinary dependency label or as an empty string. The format has a special ambiguity if a word form or lemma itself is a literal underscore.

The CoNLL-U specification is more detailed than a ten-column table: it also constrains record ordering, ranges, empty nodes, and field contents. Our reader below deliberately covers only the basic integer-ID records needed for the supplied examples.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy