<commit_before>---
layout: base
title:  'Enhanced Dependencies'
permalink: u/overview/enhanced-syntax.html
udver: '2'
---

# Enhanced Dependencies

We always intended the Universal Dependencies representation to be used in shallow natural language understanding tasks such as relation extraction or biomedical event extraction. For such tasks, one is typically interested in the relation between certain entities, e.g., the relation between two persons or whether one protein interacts with another. UD is particularly well suited for such tasks as UD trees contain many direct dependencies between content words and many of the dependency labels provide a lot of information about the type of relation between two content words. However, for some constructions, the dependency path between two content words of interest can be very long in a UD tree, which complicates determining how the content words are related. Further, some dependency types such as [`obl`](u-dep/obl) or [`nmod`](u-dep/nmod) are used for many different types of arguments and modifiers, and therefore they are not very informative on their own. For these reasons, we also provide guidelines for an _enhanced_ representation, which makes some of the implicit relations between words more explicit, and augments some of the dependency labels to facilitate the disambiguation of types of arguments and modifiers.


_Enhanced_ UD graphs may contain some or all of the following enhancements, which are described in the sections below.

* [Null nodes for elided predicates](#ellipsis)
* [Propagation of conjuncts](#propagation-of-conjuncts)
* [Additional subject relations for control and raising constructions](#controlledraised-subjects)
* [Coreference in relative clause constructions](#relative-clauses)
* [Modifier labels that contain the preposition or other case-marking information](#case-information)

Note that the _enhanced_ graph is not necessarily a supergraph of the basic tree, i.e., the graph is not required to contain all the basic dependency relations. For this reason, all relations of the enhanced graph (also the ones that are present in the basic UD tree) have to be included in the _DEPS_ column of a CoNLL-U file. See the specificiation of the [CoNLL-U](/format.html) file format for details.

Furthermore, the dependency relation labels in the enhanced graph in DEPS may contain certain extensions that are not permitted
in the basic relation type in the DEPREL column. The regular expression restricting relation labels in DEPREL is pretty simple;
the label can contain only lowercase English letters and at most one colon, which separates the universal and the language-specific
part of the label: `^[a-z]+(:[a-z]+)?$`. In contrast, the relation label in DEPS may contain up to three colons, separating up to
four sections. One of the sections (never the first one) may also contain lowercase Unicode letters and the underscore character:
`^[a-z]+(:[\p{Ll}\p{Lm}\p{Lo}\p{M}]+(_[\p{Ll}\p{Lm}\p{Lo}\p{M}]+)*(:[\p{Ll}\p{Lm}\p{Lo}\p{M}]+(_[\p{Ll}\p{Lm}\p{Lo}\p{M}]+)*(:[a-z]+)?)?)?$`.
Only the first section, the universal relation, is mandatory. The other sections are optional but if they appear, they must appear
in the order described below. We provide a more detailed explanation of the extra sections later on this page; here is a summary:

1. Universal dependency relation. In addition to the [37 relations](http://universaldependencies.org/u/dep/index.html)
   defined in the basic representation, the relation can also be <tt><a href="#relative-clauses">ref</a></tt>.
2. Documented [relation subtype](/ext-dep-index.html) (either language-specific or more general) from the basic representation.
3. [Case information](#case-information) –
   adposition or conjunction that occurs as a `case` or `mark` dependent of the node whose relation to its
   parent is being enhanced. Note that this is the only part where non-ASCII letters are permitted within the enhanced relation label.
   The word should be normalized (lowercased, no typos), i.e., in general we take its lemma. However, if the case/mark dependent is
   a fixed multi-word expression, the lemma of the expression is not necessarily composed of lemmas of the individual member words.
   For instance, the string representing the English expression “As Opposed To” is `as_opposed_to`. That is, the casing is normalized
   from “As” to “as” etc., but “opposed” is not replaced by its lemma “oppose” because the expression is fixed. We use the underscore
   character (“_”) to connect member words.
4. [Case information](#case-information) –
   morphological case of the node whose relation to its parent is being enhanced. Value corresponds to the value of
   the Case feature but it is lowercased (e.g., `gen` instead of `Gen`). Unlike in morphological features, multivalues with comma
   (`Case=Acc,Dat`) are not allowed. Case information in enhanced relations must be fully disambiguated.<commit_msg>Update enhanced-syntax.md<commit_after>---
layout: base
title:  'Enhanced Dependencies'
permalink: u/overview/enhanced-syntax.html
udver: '2'
---

# Enhanced Dependencies

We always intended the Universal Dependencies representation to be used in shallow natural language understanding tasks such as relation extraction or biomedical event extraction. For such tasks, one is typically interested in the relation between certain entities, e.g., the relation between two persons or whether one protein interacts with another. UD is particularly well suited for such tasks as UD trees contain many direct dependencies between content words and many of the dependency labels provide a lot of information about the type of relation between two content words. However, for some constructions, the dependency path between two content words of interest can be very long in a UD tree, which complicates determining how the content words are related. Further, some dependency types such as [`obl`](u-dep/obl) or [`nmod`](u-dep/nmod) are used for many different types of arguments and modifiers, and therefore they are not very informative on their own. For these reasons, we also provide guidelines for an _enhanced_ representation, which makes some of the implicit relations between words more explicit, and augments some of the dependency labels to facilitate the disambiguation of types of arguments and modifiers.


_Enhanced_ UD graphs may contain some or all of the following enhancements, which are described in the sections below.

* [Null nodes for elided predicates](#ellipsis)
* [Propagation of conjuncts](#propagation-of-conjuncts)
* [Additional subject relations for control and raising constructions](#controlledraised-subjects)
* [Coreference in relative clause constructions](#relative-clauses)
* [Modifier labels that contain the preposition or other case-marking information](#case-information)

Note that the _enhanced_ graph is not necessarily a supergraph of the basic tree, i.e., the graph is not required to contain all the basic dependency relations. For this reason, all relations of the enhanced graph (also the ones that are present in the basic UD tree) have to be included in the _DEPS_ column of a CoNLL-U file. See the specificiation of the [CoNLL-U](/format.html) file format for details.

Furthermore, the dependency relation labels in the enhanced graph in DEPS may contain certain extensions that are not permitted
in the basic relation type in the DEPREL column. The regular expression restricting relation labels in DEPREL is pretty simple;
the label can contain only lowercase English letters and at most one colon, which separates the universal and the language-specific
part of the label: `^[a-z]+(:[a-z]+)?$`. In contrast, the relation label in DEPS may contain up to three colons, separating up to
four sections. One of the sections (never the first one) may also contain lowercase Unicode letters and the underscore character:
`^[a-z]+(:[a-z]+)?(:[\p{Ll}\p{Lm}\p{Lo}\p{M}]+(_[\p{Ll}\p{Lm}\p{Lo}\p{M}]+)*)?(:[a-z]+)?$`.
Only the first section, the universal relation, is mandatory. The other sections are optional but if they appear, they must appear
in the order described below. We provide a more detailed explanation of the extra sections later on this page; here is a summary:

1. Universal dependency relation. In addition to the [37 relations](http://universaldependencies.org/u/dep/index.html)
   defined in the basic representation, the relation can also be <tt><a href="#relative-clauses">ref</a></tt>.
2. Documented [relation subtype](/ext-dep-index.html) (either language-specific or more general) from the basic representation.
3. [Case information](#case-information) –
   adposition or conjunction that occurs as a `case` or `mark` dependent of the node whose relation to its
   parent is being enhanced. Note that this is the only part where non-ASCII letters are permitted within the enhanced relation label.
   The word should be normalized (lowercased, no typos), i.e., in general we take its lemma. However, if the case/mark dependent is
   a fixed multi-word expression, the lemma of the expression is not necessarily composed of lemmas of the individual member words.
   For instance, the string representing the English expression “As Opposed To” is `as_opposed_to`. That is, the casing is normalized
   from “As” to “as” etc., but “opposed” is not replaced by its lemma “oppose” because the expression is fixed. We use the underscore
   character (“_”) to connect member words.
4. [Case information](#case-information) –
   morphological case of the node whose relation to its parent is being enhanced. Value corresponds to the value of
   the Case feature but it is lowercased (e.g., `gen` instead of `Gen`). Unlike in morphological features, multivalues with comma
   (`Case=Acc,Dat`) are not allowed. Case information in enhanced relations must be fully disambiguated.
{'fraction_non_alphanumeric': 0.07067745197168858, 'fraction_numerical': 0.0014155712841253793, 'mean_word_length': 4.898032200357782, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3371851', 'n_tokens_mistral': 2508, 'n_tokens_neox': 2397, 'n_words': 1366}