Datasets:
Update dataset card and migration docs
Browse filesUse the official universal-dependencies/universal_dependencies Hub namespace in active examples, add former-location and v2.0 rewrite notes, and document the pending UPOS/HEAD schema change.
Refs: https://huggingface.co/datasets/universal-dependencies/universal_dependencies/discussions/2
Refs: https://huggingface.co/datasets/universal-dependencies/universal_dependencies/discussions/3
- ADDING_NEW_UD_VERSION.md +9 -9
- CHANGELOG.md +18 -0
- MIGRATION.md +63 -434
- README.md +39 -21
- RELEASE.md +4 -4
- tools/04_generate_parquet.py +1 -1
- tools/05_validate_parquet.py +1 -1
- tools/BLOCKED_TREEBANKS.md +2 -2
- tools/README-2.18 +40 -39
- tools/README.md +2 -2
- tools/templates/README.tmpl +40 -39
ADDING_NEW_UD_VERSION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Adding a New Universal Dependencies Version
|
| 2 |
|
| 3 |
-
This guide explains how to add a new Universal Dependencies release (e.g., UD 2.18, 2.19, etc.) to the `
|
| 4 |
|
| 5 |
**Quick reference:** See [tools/README.md](tools/README.md) for concise commands and script documentation.
|
| 6 |
|
|
@@ -12,7 +12,7 @@ This guide explains how to add a new Universal Dependencies release (e.g., UD 2.
|
|
| 12 |
```bash
|
| 13 |
pip install ud-hf-parquet-tools pyyaml python-dotenv jinja2
|
| 14 |
```
|
| 15 |
-
- Access to push to `
|
| 16 |
- `huggingface-cli` installed and authenticated:
|
| 17 |
```bash
|
| 18 |
pip install huggingface_hub
|
|
@@ -361,7 +361,7 @@ If you've cloned the HuggingFace repository with git-lfs:
|
|
| 361 |
|
| 362 |
```bash
|
| 363 |
# Add HF Hub as remote (if not already)
|
| 364 |
-
git remote add hf https://huggingface.co/datasets/
|
| 365 |
|
| 366 |
# Push to HuggingFace
|
| 367 |
git push hf ${NEW_VER}
|
|
@@ -372,7 +372,7 @@ git push hf --tags
|
|
| 372 |
|
| 373 |
```bash
|
| 374 |
# Upload entire directory
|
| 375 |
-
huggingface-cli upload
|
| 376 |
```
|
| 377 |
|
| 378 |
**Expected upload time:** 2-6 hours depending on network speed and HuggingFace server load.
|
|
@@ -381,7 +381,7 @@ huggingface-cli upload commul/universal_dependencies . --repo-type dataset --rev
|
|
| 381 |
|
| 382 |
### 17. Verify on HuggingFace Hub
|
| 383 |
|
| 384 |
-
Visit: https://huggingface.co/datasets/
|
| 385 |
|
| 386 |
**Checklist:**
|
| 387 |
1. ✅ Branch `2.18` exists in the "Branches" dropdown
|
|
@@ -397,7 +397,7 @@ Visit: https://huggingface.co/datasets/commul/universal_dependencies
|
|
| 397 |
from datasets import load_dataset
|
| 398 |
|
| 399 |
# Load from new version
|
| 400 |
-
ds = load_dataset("
|
| 401 |
print(ds)
|
| 402 |
```
|
| 403 |
|
|
@@ -427,14 +427,14 @@ This makes the new version the default when users don't specify a revision.
|
|
| 427 |
|
| 428 |
### 19. Refresh Existing UD Branches for a Framework Release
|
| 429 |
|
| 430 |
-
Use this when framework logic changes
|
| 431 |
need to rebuild all existing UD branches (`2.7` ... `2.17`).
|
| 432 |
|
| 433 |
```bash
|
| 434 |
# Repository root
|
| 435 |
-
export FRAMEWORK_VER=v2.
|
| 436 |
|
| 437 |
-
for UD_VER in 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17; do
|
| 438 |
git switch "${UD_VER}"
|
| 439 |
# Keep the branch aligned with framework changes (pick one):
|
| 440 |
git rebase main
|
|
|
|
| 1 |
# Adding a New Universal Dependencies Version
|
| 2 |
|
| 3 |
+
This guide explains how to add a new Universal Dependencies release (e.g., UD 2.18, 2.19, etc.) to the `universal-dependencies/universal_dependencies` HuggingFace dataset.
|
| 4 |
|
| 5 |
**Quick reference:** See [tools/README.md](tools/README.md) for concise commands and script documentation.
|
| 6 |
|
|
|
|
| 12 |
```bash
|
| 13 |
pip install ud-hf-parquet-tools pyyaml python-dotenv jinja2
|
| 14 |
```
|
| 15 |
+
- Access to push to `universal-dependencies/universal_dependencies` on HuggingFace Hub
|
| 16 |
- `huggingface-cli` installed and authenticated:
|
| 17 |
```bash
|
| 18 |
pip install huggingface_hub
|
|
|
|
| 361 |
|
| 362 |
```bash
|
| 363 |
# Add HF Hub as remote (if not already)
|
| 364 |
+
git remote add hf https://huggingface.co/datasets/universal-dependencies/universal_dependencies
|
| 365 |
|
| 366 |
# Push to HuggingFace
|
| 367 |
git push hf ${NEW_VER}
|
|
|
|
| 372 |
|
| 373 |
```bash
|
| 374 |
# Upload entire directory
|
| 375 |
+
huggingface-cli upload universal-dependencies/universal_dependencies . --repo-type dataset --revision ${NEW_VER}
|
| 376 |
```
|
| 377 |
|
| 378 |
**Expected upload time:** 2-6 hours depending on network speed and HuggingFace server load.
|
|
|
|
| 381 |
|
| 382 |
### 17. Verify on HuggingFace Hub
|
| 383 |
|
| 384 |
+
Visit: https://huggingface.co/datasets/universal-dependencies/universal_dependencies
|
| 385 |
|
| 386 |
**Checklist:**
|
| 387 |
1. ✅ Branch `2.18` exists in the "Branches" dropdown
|
|
|
|
| 397 |
from datasets import load_dataset
|
| 398 |
|
| 399 |
# Load from new version
|
| 400 |
+
ds = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", revision="2.18")
|
| 401 |
print(ds)
|
| 402 |
```
|
| 403 |
|
|
|
|
| 427 |
|
| 428 |
### 19. Refresh Existing UD Branches for a Framework Release
|
| 429 |
|
| 430 |
+
Use this when framework logic changes and you
|
| 431 |
need to rebuild all existing UD branches (`2.7` ... `2.17`).
|
| 432 |
|
| 433 |
```bash
|
| 434 |
# Repository root
|
| 435 |
+
export FRAMEWORK_VER=v2.2.1
|
| 436 |
|
| 437 |
+
for UD_VER in 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18; do
|
| 438 |
git switch "${UD_VER}"
|
| 439 |
# Keep the branch aligned with framework changes (pick one):
|
| 440 |
git rebase main
|
CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ All notable changes to the Universal Dependencies HuggingFace dataset loader wil
|
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
## [2.2.1] - 2026-05-29
|
| 9 |
|
| 10 |
### Added
|
|
|
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
|
| 8 |
+
## [Unreleased]
|
| 9 |
+
|
| 10 |
+
### Changed
|
| 11 |
+
|
| 12 |
+
- **Parquet Schema**
|
| 13 |
+
- Regular-token `upos` values are now stored as strings instead of HuggingFace `ClassLabel` indices.
|
| 14 |
+
- Regular-token `head` values are now stored as 16-bit integers instead of strings.
|
| 15 |
+
- Empty-node `head` values remain strings because CoNLL-U empty nodes may use `_`.
|
| 16 |
+
|
| 17 |
+
- **Dataset Card**
|
| 18 |
+
- Updated examples and links for the official Hugging Face namespace: `universal-dependencies/universal_dependencies`.
|
| 19 |
+
- Aligned generated card metadata with the Hub-side cleanup: `license: other`, `size_categories: 1M<n<10M`, and no empty leaderboard/contact fields.
|
| 20 |
+
- Added clearer citation guidance and a short note about the former `commul/universal_dependencies` location and the v2.0 Parquet rewrite.
|
| 21 |
+
|
| 22 |
+
- **Migration Documentation**
|
| 23 |
+
- Reduced old v1.x-to-v2.0 migration notes to an archived summary.
|
| 24 |
+
- Added current migration notes for the `upos` and `head` schema change.
|
| 25 |
+
|
| 26 |
## [2.2.1] - 2026-05-29
|
| 27 |
|
| 28 |
### Added
|
MIGRATION.md
CHANGED
|
@@ -1,483 +1,112 @@
|
|
| 1 |
-
# Migration Guide
|
| 2 |
|
| 3 |
-
This
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
##
|
| 6 |
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
- **No Python script**: Dataset no longer requires `trust_remote_code=True`
|
| 10 |
-
- **External helper library**: CoNLL-U processing utilities moved to [`ud-hf-parquet-tools`](https://github.com/bot-zen/ud-hf-parquet-tools)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
-
|
| 15 |
-
-
|
|
|
|
| 16 |
|
| 17 |
-
##
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
No code changes needed! Parquet files load automatically:
|
| 22 |
|
| 23 |
```python
|
| 24 |
from datasets import load_dataset
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
**Option 1: Upgrade datasets (Recommended)**
|
| 34 |
-
|
| 35 |
-
```bash
|
| 36 |
-
pip install --upgrade "datasets>=4.0.0"
|
| 37 |
-
```
|
| 38 |
-
|
| 39 |
-
**Option 2: Continue using v1.x**
|
| 40 |
-
|
| 41 |
-
```python
|
| 42 |
-
# v1.x: Requires trust_remote_code
|
| 43 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd", trust_remote_code=True, revision="v1.0")
|
| 44 |
-
```
|
| 45 |
-
|
| 46 |
-
## Breaking Changes
|
| 47 |
-
|
| 48 |
-
### 1. Token Sequences Now Exclude MWT Forms
|
| 49 |
-
|
| 50 |
-
**Impact:** Token counts and sequences have changed for treebanks with Multi-Word Tokens (MWTs).
|
| 51 |
-
|
| 52 |
-
**What Changed:**
|
| 53 |
-
- v1.x incorrectly included MWT surface forms in token sequences
|
| 54 |
-
- v2.0 correctly excludes them, matching UD guidelines
|
| 55 |
-
|
| 56 |
-
**Example (French "des" → "de" + "les"):**
|
| 57 |
-
|
| 58 |
-
```python
|
| 59 |
-
# v1.x (BUGGY):
|
| 60 |
-
{
|
| 61 |
-
"tokens": ["Elle", "des", "de", "les", "pommes", "."], # WRONG: "des" included
|
| 62 |
-
"lemmas": ["elle", "_", "de", "le", "pomme", "."],
|
| 63 |
-
"upos": ["PRON", "_", "ADP", "DET", "NOUN", "PUNCT"],
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
# v2.0 (CORRECT):
|
| 67 |
-
{
|
| 68 |
-
"tokens": ["Elle", "de", "les", "pommes", "."], # CORRECT: only syntactic words
|
| 69 |
-
"lemmas": ["elle", "de", "le", "pomme", "."],
|
| 70 |
-
"upos": ["PRON", "ADP", "DET", "NOUN", "PUNCT"],
|
| 71 |
-
"mwt": [{"id": "2-3", "form": "des", "misc": ""}], # MWT info preserved
|
| 72 |
-
}
|
| 73 |
```
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
Languages with common MWTs include:
|
| 78 |
-
- **French** (fr_*): du, au, des, aux (~2-5% of tokens)
|
| 79 |
-
- **Italian** (it_*): del, della, nel, alla (~1-3%)
|
| 80 |
-
- **Portuguese** (pt_*): do, da, no, pelo (~2-4%)
|
| 81 |
-
- **Spanish** (es_*): del, al (~0.5-1%)
|
| 82 |
-
- **Arabic** (ar_*): various clitics (~1-2%)
|
| 83 |
-
- **German** (de_*): zum, vom, am (~0.1-0.5%)
|
| 84 |
-
- **Catalan** (ca_*): del, al, pels (~1-2%)
|
| 85 |
-
- **Indonesian** (id_*): reduplications (~0.1%)
|
| 86 |
-
|
| 87 |
-
**Action Required:**
|
| 88 |
-
|
| 89 |
-
If your code assumes specific token counts or positions:
|
| 90 |
|
| 91 |
```python
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
return example["tokens"][2] # May return different token in v2.0
|
| 95 |
-
|
| 96 |
-
# Migration fix:
|
| 97 |
-
def get_third_syntactic_word(example):
|
| 98 |
-
# v2.0: This is now correct - gets the 3rd syntactic word
|
| 99 |
-
return example["tokens"][2]
|
| 100 |
-
|
| 101 |
-
def get_third_surface_token(example):
|
| 102 |
-
# v2.0: If you need surface forms, reconstruct from MWTs
|
| 103 |
-
tokens = example["tokens"][:]
|
| 104 |
-
mwts = example["mwt"]
|
| 105 |
-
|
| 106 |
-
# Insert MWT forms at appropriate positions
|
| 107 |
-
for mwt in reversed(mwts): # Process in reverse to maintain indices
|
| 108 |
-
start, end = map(int, mwt["id"].split("-"))
|
| 109 |
-
tokens[start-1:end] = [mwt["form"]]
|
| 110 |
-
|
| 111 |
-
return tokens[2]
|
| 112 |
```
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
**Impact:** Dataset schema now includes an `mwt` field.
|
| 117 |
-
|
| 118 |
-
**What Changed:**
|
| 119 |
-
- Added: `mwt` field containing structured MWT information
|
| 120 |
-
- Schema: `[{"id": "1-2", "form": "surface_form", "misc": "metadata"}]`
|
| 121 |
-
- Empty list for treebanks without MWTs
|
| 122 |
-
|
| 123 |
-
**Example Usage:**
|
| 124 |
|
| 125 |
```python
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd", split="train")
|
| 129 |
-
|
| 130 |
-
# Access MWT information
|
| 131 |
-
for example in dataset:
|
| 132 |
-
if example["mwt"]: # Has MWTs
|
| 133 |
-
for mwt in example["mwt"]:
|
| 134 |
-
print(f"MWT {mwt['id']}: {mwt['form']}")
|
| 135 |
-
# Extract range
|
| 136 |
-
start, end = map(int, mwt["id"].split("-"))
|
| 137 |
-
syntactic_words = example["tokens"][start-1:end]
|
| 138 |
-
print(f" → {' + '.join(syntactic_words)}")
|
| 139 |
-
|
| 140 |
-
# Output example:
|
| 141 |
-
# MWT 2-3: des
|
| 142 |
-
# → de + les
|
| 143 |
```
|
| 144 |
|
| 145 |
-
|
|
|
|
| 146 |
|
| 147 |
```python
|
| 148 |
-
|
| 149 |
-
def count_mwts(dataset):
|
| 150 |
-
return sum(len(ex["mwt"]) for ex in dataset)
|
| 151 |
-
|
| 152 |
-
# Analyze MWT patterns
|
| 153 |
-
def analyze_mwt_patterns(dataset):
|
| 154 |
-
patterns = {}
|
| 155 |
-
for ex in dataset:
|
| 156 |
-
for mwt in ex["mwt"]:
|
| 157 |
-
form = mwt["form"]
|
| 158 |
-
patterns[form] = patterns.get(form, 0) + 1
|
| 159 |
-
return patterns
|
| 160 |
|
| 161 |
-
|
| 162 |
-
print(analyze_mwt_patterns(fr_gsd))
|
| 163 |
-
# Output: {'des': 1234, 'du': 987, 'au': 654, 'aux': 321, ...}
|
| 164 |
```
|
| 165 |
|
| 166 |
-
###
|
| 167 |
-
|
| 168 |
-
**Impact:** The Python script loader is deprecated (datasets >=4.0.0 policy).
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
|
| 174 |
-
|
| 175 |
-
- No arbitrary code execution from dataset loading
|
| 176 |
-
- Parquet files are data-only, sandboxed
|
| 177 |
-
- Aligns with HuggingFace security policies
|
| 178 |
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
|
| 181 |
-
|
| 182 |
-
# Check your datasets version
|
| 183 |
-
python -c "import datasets; print(datasets.__version__)"
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
```python
|
| 192 |
-
# Use v1.x with revision pinning
|
| 193 |
dataset = load_dataset(
|
| 194 |
-
"
|
| 195 |
"fr_gsd",
|
| 196 |
trust_remote_code=True,
|
| 197 |
-
revision="v1.0"
|
| 198 |
)
|
| 199 |
```
|
| 200 |
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
**Important:** Helper functions for CoNLL-U processing are now in a separate package.
|
| 204 |
-
|
| 205 |
-
### What Moved
|
| 206 |
-
|
| 207 |
-
The following functions are **no longer part of the dataset**:
|
| 208 |
-
- `parse_feats()`, `parse_misc()`, `parse_deps()` - Parse CoNLL-U field strings
|
| 209 |
-
- `write_conllu()`, `example_to_conllu()` - Export data to CoNLL-U format
|
| 210 |
-
- Various internal conversion utilities
|
| 211 |
-
|
| 212 |
-
### How to Access Helper Functions
|
| 213 |
-
|
| 214 |
-
If you need CoNLL-U processing utilities, install the external library:
|
| 215 |
-
|
| 216 |
-
```bash
|
| 217 |
-
pip install ud-hf-parquet-tools
|
| 218 |
-
```
|
| 219 |
-
|
| 220 |
-
Then import from the package:
|
| 221 |
-
|
| 222 |
-
```python
|
| 223 |
-
from datasets import load_dataset
|
| 224 |
-
from ud_hf_parquet_tools import parse_feats, parse_misc, write_conllu
|
| 225 |
-
|
| 226 |
-
# Load dataset
|
| 227 |
-
ds = load_dataset("commul/universal_dependencies", "en_ewt", split="train")
|
| 228 |
-
|
| 229 |
-
# Parse optional fields
|
| 230 |
-
sentence = ds[0]
|
| 231 |
-
for i, token in enumerate(sentence['tokens']):
|
| 232 |
-
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
| 233 |
-
misc = parse_misc(sentence['misc'][i]) # Returns dict or {}
|
| 234 |
-
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 235 |
-
|
| 236 |
-
# Export back to CoNLL-U format
|
| 237 |
-
write_conllu(ds, "output.conllu")
|
| 238 |
-
```
|
| 239 |
-
|
| 240 |
-
**Library Documentation:** https://github.com/bot-zen/ud-hf-parquet-tools
|
| 241 |
-
|
| 242 |
-
### If You Don't Need Helper Functions
|
| 243 |
-
|
| 244 |
-
Most users only need the dataset itself and can work directly with the fields:
|
| 245 |
-
|
| 246 |
-
```python
|
| 247 |
-
from datasets import load_dataset
|
| 248 |
-
|
| 249 |
-
ds = load_dataset("commul/universal_dependencies", "en_ewt", split="train")
|
| 250 |
-
|
| 251 |
-
# Access data directly
|
| 252 |
-
sentence = ds[0]
|
| 253 |
-
print(f"Tokens: {sentence['tokens']}")
|
| 254 |
-
print(f"POS tags: {sentence['upos']}")
|
| 255 |
-
print(f"Dependencies: {sentence['deprel']}")
|
| 256 |
-
|
| 257 |
-
# FEATS and MISC are strings in CoNLL-U format
|
| 258 |
-
print(f"Features (raw): {sentence['feats'][0]}") # e.g., "Case=Nom|Number=Sing"
|
| 259 |
-
print(f"Misc (raw): {sentence['misc'][0]}") # e.g., "SpaceAfter=No"
|
| 260 |
-
|
| 261 |
-
# Parse manually if needed (simple cases)
|
| 262 |
-
feats_str = sentence['feats'][0]
|
| 263 |
-
if feats_str:
|
| 264 |
-
feats_dict = dict(kv.split('=') for kv in feats_str.split('|'))
|
| 265 |
-
print(f"Features (parsed): {feats_dict}")
|
| 266 |
-
```
|
| 267 |
-
|
| 268 |
-
## New Features in v2.0
|
| 269 |
-
|
| 270 |
-
### 1. Parquet Format (5-10x Faster Loading)
|
| 271 |
-
|
| 272 |
-
```python
|
| 273 |
-
# v1.x: Downloads CoNLL-U, parses on-the-fly (~10-30 seconds)
|
| 274 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd", trust_remote_code=True)
|
| 275 |
-
|
| 276 |
-
# v2.0: Loads pre-processed Parquet (~1-3 seconds)
|
| 277 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd")
|
| 278 |
-
```
|
| 279 |
-
|
| 280 |
-
**Benefits:**
|
| 281 |
-
- Much faster loading (especially for large treebanks)
|
| 282 |
-
- Lower memory usage
|
| 283 |
-
- Better compression
|
| 284 |
-
- Native support in datasets >=4.0.0
|
| 285 |
-
|
| 286 |
-
### 2. Multi-Word Token (MWT) Information
|
| 287 |
-
|
| 288 |
-
```python
|
| 289 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd", split="train")
|
| 290 |
-
|
| 291 |
-
# Find sentences with MWTs
|
| 292 |
-
sentences_with_mwts = [ex for ex in dataset if ex["mwt"]]
|
| 293 |
-
print(f"Sentences with MWTs: {len(sentences_with_mwts)}/{len(dataset)}")
|
| 294 |
-
|
| 295 |
-
# Analyze MWT complexity
|
| 296 |
-
complex_mwts = [ex for ex in dataset if any(
|
| 297 |
-
int(mwt["id"].split("-")[1]) - int(mwt["id"].split("-")[0]) > 2
|
| 298 |
-
for mwt in ex["mwt"]
|
| 299 |
-
)]
|
| 300 |
-
print(f"Sentences with 3+ word MWTs: {len(complex_mwts)}")
|
| 301 |
-
```
|
| 302 |
-
|
| 303 |
-
### 3. Enhanced Metadata
|
| 304 |
-
|
| 305 |
-
```python
|
| 306 |
-
# Load dataset info
|
| 307 |
-
from datasets import load_dataset_builder
|
| 308 |
-
|
| 309 |
-
builder = load_dataset_builder("commul/universal_dependencies", "fr_gsd")
|
| 310 |
-
info = builder.info
|
| 311 |
-
|
| 312 |
-
# Now includes MWT statistics
|
| 313 |
-
print(info.description) # Contains num_fused counts
|
| 314 |
-
```
|
| 315 |
-
|
| 316 |
-
## Verification Steps
|
| 317 |
-
|
| 318 |
-
### 1. Verify Token Counts Match UD Stats
|
| 319 |
-
|
| 320 |
-
```python
|
| 321 |
-
from datasets import load_dataset
|
| 322 |
-
import json
|
| 323 |
-
|
| 324 |
-
# Load dataset and metadata
|
| 325 |
-
dataset = load_dataset("commul/universal_dependencies", "fr_gsd", split="train")
|
| 326 |
-
|
| 327 |
-
# Count syntactic words
|
| 328 |
-
word_count = sum(len(ex["tokens"]) for ex in dataset)
|
| 329 |
-
|
| 330 |
-
# Load metadata (if available)
|
| 331 |
-
with open("metadata.json") as f:
|
| 332 |
-
metadata = json.load(f)
|
| 333 |
-
|
| 334 |
-
expected_words = int(metadata["fr_gsd"]["splits"]["train"]["num_words"])
|
| 335 |
-
print(f"Dataset words: {word_count}")
|
| 336 |
-
print(f"Expected words: {expected_words}")
|
| 337 |
-
print(f"Match: {word_count == expected_words}")
|
| 338 |
-
|
| 339 |
-
# This should be True in v2.0 (was False in v1.x for MWT treebanks)
|
| 340 |
-
```
|
| 341 |
-
|
| 342 |
-
### 2. Verify MWT Extraction
|
| 343 |
-
|
| 344 |
-
```python
|
| 345 |
-
# Count MWTs
|
| 346 |
-
mwt_count = sum(len(ex["mwt"]) for ex in dataset)
|
| 347 |
-
|
| 348 |
-
expected_mwts = int(metadata["fr_gsd"]["splits"]["train"]["num_fused"])
|
| 349 |
-
print(f"Dataset MWTs: {mwt_count}")
|
| 350 |
-
print(f"Expected MWTs: {expected_mwts}")
|
| 351 |
-
print(f"Match: {mwt_count == expected_mwts}")
|
| 352 |
-
```
|
| 353 |
-
|
| 354 |
-
### 3. Compare v1.x vs v2.0 Output
|
| 355 |
-
|
| 356 |
-
```python
|
| 357 |
-
# Load both versions (if v1.x still available)
|
| 358 |
-
v1 = load_dataset("commul/universal_dependencies", "en_ewt", split="test[:10]", revision="v1.0", trust_remote_code=True)
|
| 359 |
-
v2 = load_dataset("commul/universal_dependencies", "en_ewt", split="test[:10]")
|
| 360 |
-
|
| 361 |
-
# English-EWT has no MWTs, so should be identical except for new field
|
| 362 |
-
for i in range(10):
|
| 363 |
-
assert v1[i]["tokens"] == v2[i]["tokens"], f"Example {i} differs"
|
| 364 |
-
assert v2[i]["mwt"] == [], f"Example {i} has unexpected MWTs"
|
| 365 |
-
|
| 366 |
-
print("✓ English-EWT unchanged (no MWTs)")
|
| 367 |
-
|
| 368 |
-
# French-GSD has MWTs, so v2.0 will differ
|
| 369 |
-
v1_fr = load_dataset("commul/universal_dependencies", "fr_gsd", split="test[:10]", revision="v1.0", trust_remote_code=True)
|
| 370 |
-
v2_fr = load_dataset("commul/universal_dependencies", "fr_gsd", split="test[:10]")
|
| 371 |
-
|
| 372 |
-
# v1.x token count includes MWTs (WRONG)
|
| 373 |
-
v1_token_count = sum(len(ex["tokens"]) for ex in v1_fr)
|
| 374 |
-
|
| 375 |
-
# v2.0 token count excludes MWTs (CORRECT)
|
| 376 |
-
v2_token_count = sum(len(ex["tokens"]) for ex in v2_fr)
|
| 377 |
-
|
| 378 |
-
print(f"v1.x French token count: {v1_token_count} (includes MWT forms)")
|
| 379 |
-
print(f"v2.0 French token count: {v2_token_count} (syntactic words only)")
|
| 380 |
-
print(f"Difference: {v1_token_count - v2_token_count} MWT forms removed")
|
| 381 |
-
```
|
| 382 |
-
|
| 383 |
-
## Common Issues
|
| 384 |
-
|
| 385 |
-
### Issue 1: "Dataset script not supported" Error
|
| 386 |
-
|
| 387 |
-
**Error:**
|
| 388 |
-
```
|
| 389 |
-
RuntimeError: Dataset scripts are no longer supported
|
| 390 |
-
```
|
| 391 |
-
|
| 392 |
-
**Cause:** Using datasets >=4.0.0 with v1.x loader
|
| 393 |
-
|
| 394 |
-
**Solution:**
|
| 395 |
-
```bash
|
| 396 |
-
pip install --upgrade "datasets>=4.0.0"
|
| 397 |
-
# Then use v2.0 (Parquet-based)
|
| 398 |
-
```
|
| 399 |
-
|
| 400 |
-
### Issue 2: Token Count Mismatch
|
| 401 |
-
|
| 402 |
-
**Issue:** Your code expects specific token counts that changed in v2.0
|
| 403 |
-
|
| 404 |
-
**Solution:** Update your code to use `num_words` from metadata instead of `num_tokens`
|
| 405 |
-
|
| 406 |
-
```python
|
| 407 |
-
# v1.x: Used num_tokens (WRONG for MWT treebanks)
|
| 408 |
-
expected_count = metadata["splits"]["train"]["num_tokens"]
|
| 409 |
-
|
| 410 |
-
# v2.0: Use num_words (CORRECT)
|
| 411 |
-
expected_count = metadata["splits"]["train"]["num_words"]
|
| 412 |
-
```
|
| 413 |
-
|
| 414 |
-
### Issue 3: MWT Field Not Found (v1.x Code)
|
| 415 |
-
|
| 416 |
-
**Issue:** Old code doesn't handle the new `mwt` field
|
| 417 |
-
|
| 418 |
-
**Solution:** Gracefully handle the field or upgrade
|
| 419 |
-
|
| 420 |
-
```python
|
| 421 |
-
# Backwards compatible code
|
| 422 |
-
tokens = example["tokens"]
|
| 423 |
-
mwts = example.get("mwt", []) # Empty list if not present
|
| 424 |
-
```
|
| 425 |
-
|
| 426 |
-
### Issue 4: Helper Function Import Errors
|
| 427 |
|
| 428 |
-
**Error:**
|
| 429 |
```python
|
| 430 |
-
|
| 431 |
-
|
|
|
|
|
|
|
|
|
|
| 432 |
```
|
| 433 |
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
**Solution:**
|
| 437 |
-
```bash
|
| 438 |
-
# Install the helper library
|
| 439 |
-
pip install ud-hf-parquet-tools
|
| 440 |
|
| 441 |
-
#
|
| 442 |
-
from ud_hf_parquet_tools import parse_feats, parse_misc, write_conllu
|
| 443 |
-
```
|
| 444 |
|
| 445 |
-
|
|
|
|
|
|
|
|
|
|
| 446 |
|
| 447 |
## Support
|
| 448 |
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
1. Check the [CHANGELOG.md](CHANGELOG.md) for detailed changes
|
| 452 |
-
2. Review the [README.md](README.md) for updated examples
|
| 453 |
-
3. Helper library documentation: https://github.com/bot-zen/ud-hf-parquet-tools
|
| 454 |
-
4. Report issues at: https://huggingface.co/datasets/commul/universal_dependencies/discussions
|
| 455 |
-
|
| 456 |
-
## Summary
|
| 457 |
-
|
| 458 |
-
**Key Takeaways:**
|
| 459 |
-
|
| 460 |
-
✅ **v2.0 is more correct:** Fixes critical MWT bug
|
| 461 |
-
✅ **v2.0 is faster:** Parquet format is 5-10x quicker
|
| 462 |
-
✅ **v2.0 is more secure:** No remote code execution
|
| 463 |
-
✅ **v2.0 adds features:** MWT information now available
|
| 464 |
-
✅ **v2.0 is modular:** Helper functions available as separate library
|
| 465 |
-
|
| 466 |
-
**Migration Checklist:**
|
| 467 |
-
|
| 468 |
-
- [ ] Upgrade to datasets >=4.0.0
|
| 469 |
-
- [ ] Test your code with v2.0 data
|
| 470 |
-
- [ ] Update token count expectations (if using MWT treebanks)
|
| 471 |
-
- [ ] Update any hard-coded token indices (if applicable)
|
| 472 |
-
- [ ] If using helper functions: Install `ud-hf-parquet-tools` and update imports
|
| 473 |
-
- [ ] If exporting to CoNLL-U: Use `write_conllu()` from `ud-hf-parquet-tools`
|
| 474 |
-
- [ ] Utilize new MWT field for research (optional)
|
| 475 |
-
|
| 476 |
-
**Estimated Migration Time:**
|
| 477 |
-
- Basic usage: 15-30 minutes
|
| 478 |
-
- With helper functions: +10 minutes (install library, update imports)
|
| 479 |
-
|
| 480 |
-
**Resources:**
|
| 481 |
-
- Dataset repository: https://huggingface.co/datasets/commul/universal_dependencies
|
| 482 |
- Helper library: https://github.com/bot-zen/ud-hf-parquet-tools
|
| 483 |
-
-
|
|
|
|
| 1 |
+
# Migration Guide
|
| 2 |
|
| 3 |
+
This repository uses Parquet-only HuggingFace dataset branches for Universal
|
| 4 |
+
Dependencies releases. Current examples use the official dataset location:
|
| 5 |
+
`universal-dependencies/universal_dependencies`.
|
| 6 |
|
| 7 |
+
## Current Development Version
|
| 8 |
|
| 9 |
+
The current development version updates the generated Parquet schema for regular
|
| 10 |
+
CoNLL-U token fields:
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
- `upos` is now stored as a list of strings instead of HuggingFace `ClassLabel`
|
| 13 |
+
indices.
|
| 14 |
+
- `head` is now stored as a list of 16-bit integers instead of strings.
|
| 15 |
+
- Empty-node `head` values remain strings because CoNLL-U empty nodes may use
|
| 16 |
+
`_` for HEAD.
|
| 17 |
|
| 18 |
+
### What Usually Changes
|
| 19 |
|
| 20 |
+
Most users can load and iterate over datasets as before:
|
|
|
|
|
|
|
| 21 |
|
| 22 |
```python
|
| 23 |
from datasets import load_dataset
|
| 24 |
|
| 25 |
+
ds = load_dataset(
|
| 26 |
+
"universal-dependencies/universal_dependencies",
|
| 27 |
+
"en_ewt",
|
| 28 |
+
revision="2.18",
|
| 29 |
+
split="train",
|
| 30 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
```
|
| 32 |
|
| 33 |
+
Code that expected `upos` as integer class IDs should now work directly with
|
| 34 |
+
strings:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
+
upos = ds[0]["upos"]
|
| 38 |
+
assert upos[0] == "PROPN"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
```
|
| 40 |
|
| 41 |
+
Code that compared `head` to strings should compare to integers:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
```python
|
| 44 |
+
heads = ds[0]["head"]
|
| 45 |
+
root_positions = [i for i, head in enumerate(heads) if head == 0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
```
|
| 47 |
|
| 48 |
+
If you need string output for CoNLL-U serialization, convert at the boundary or
|
| 49 |
+
use the helper package:
|
| 50 |
|
| 51 |
```python
|
| 52 |
+
from ud_hf_parquet_tools import write_conllu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
write_conllu(ds, "output.conllu")
|
|
|
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
+
### Compatibility Notes
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
The next `ud-hf-parquet-tools` release can still reconstruct older Parquet
|
| 60 |
+
outputs where `upos` was stored as a `ClassLabel`. New outputs should use the
|
| 61 |
+
updated schema.
|
| 62 |
|
| 63 |
+
## Archived v1.x to v2.0 Notes
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
The v1 loader used a Python dataset script and required `trust_remote_code=True`.
|
| 66 |
+
The v2 line removed the script loader and distributes Parquet files directly,
|
| 67 |
+
which requires `datasets>=4.0.0`.
|
| 68 |
|
| 69 |
+
Important v2.0 data changes:
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
- Multi-word token surface forms are no longer included in regular `tokens`.
|
| 72 |
+
- Multi-word token information is preserved in the structured `mwt` field.
|
| 73 |
+
- Helper functions moved out of the dataset repository and into
|
| 74 |
+
`ud-hf-parquet-tools`.
|
| 75 |
|
| 76 |
+
Old v1 code like this:
|
| 77 |
|
| 78 |
```python
|
|
|
|
| 79 |
dataset = load_dataset(
|
| 80 |
+
"universal-dependencies/universal_dependencies",
|
| 81 |
"fr_gsd",
|
| 82 |
trust_remote_code=True,
|
| 83 |
+
revision="v1.0",
|
| 84 |
)
|
| 85 |
```
|
| 86 |
|
| 87 |
+
should be replaced with current Parquet loading:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
|
|
|
| 89 |
```python
|
| 90 |
+
dataset = load_dataset(
|
| 91 |
+
"universal-dependencies/universal_dependencies",
|
| 92 |
+
"fr_gsd",
|
| 93 |
+
revision="2.18",
|
| 94 |
+
)
|
| 95 |
```
|
| 96 |
|
| 97 |
+
For token-count checks, use `num_words` from `metadata.json` rather than
|
| 98 |
+
`num_tokens` when comparing against regular syntactic-word sequences.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
+
## Repository Move
|
|
|
|
|
|
|
| 101 |
|
| 102 |
+
The dataset was formerly maintained at `commul/universal_dependencies` and now
|
| 103 |
+
lives under the official Universal Dependencies organization at
|
| 104 |
+
`universal-dependencies/universal_dependencies`:
|
| 105 |
+
https://huggingface.co/datasets/universal-dependencies/universal_dependencies
|
| 106 |
|
| 107 |
## Support
|
| 108 |
|
| 109 |
+
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
| 110 |
+
- Dataset repository: https://huggingface.co/datasets/universal-dependencies/universal_dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
- Helper library: https://github.com/bot-zen/ud-hf-parquet-tools
|
| 112 |
+
- Discussions: https://huggingface.co/datasets/universal-dependencies/universal_dependencies/discussions
|
README.md
CHANGED
|
@@ -218,6 +218,7 @@ tags:
|
|
| 218 |
- constituency-parsing
|
| 219 |
- dependency-parsing
|
| 220 |
- part-of-speech-tagging
|
|
|
|
| 221 |
configs:
|
| 222 |
- config_name: abq_atb
|
| 223 |
data_files:
|
|
@@ -2332,7 +2333,7 @@ configs:
|
|
| 2332 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 2333 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 2334 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 2335 |
-
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version (2.
|
| 2336 |
|
| 2337 |
**Breaking Changes:**
|
| 2338 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
@@ -2378,8 +2379,10 @@ configs:
|
|
| 2378 |
|
| 2379 |
Universal Dependencies is a project that seeks to develop cross-linguistically consistent treebank annotation for many languages, with the goal of facilitating multilingual parser development, cross-lingual learning, and parsing research from a language typology perspective. The annotation scheme is based on (universal) Stanford dependencies (de Marneffe et al., 2006, 2008, 2014), Google universal part-of-speech tags (Petrov et al., 2012), and the Interset interlingua for morphosyntactic tagsets (Zeman, 2008).
|
| 2380 |
|
| 2381 |
-
This is
|
| 2382 |
-
|
|
|
|
|
|
|
| 2383 |
|
| 2384 |
### Data Quality & Fidelity
|
| 2385 |
|
|
@@ -2406,7 +2409,12 @@ For technical details, see [CONLLU_PARSING.md](https://github.com/bot-zen/ud-hf-
|
|
| 2406 |
from datasets import load_dataset
|
| 2407 |
|
| 2408 |
# Load a specific treebank
|
| 2409 |
-
ds = load_dataset(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2410 |
|
| 2411 |
# Access sentence data
|
| 2412 |
sentence = ds[0]
|
|
@@ -2414,11 +2422,8 @@ print(f"Sentence ID: {sentence['sent_id']}")
|
|
| 2414 |
print(f"Text: {sentence['text']}")
|
| 2415 |
print(f"Tokens: {sentence['tokens']}")
|
| 2416 |
|
| 2417 |
-
## TODO: Make helper functions available
|
| 2418 |
-
## post v2.0 universal_dependencies.py is not part of the Dataset any longer!
|
| 2419 |
-
##
|
| 2420 |
# Parse optional fields using helper functions
|
| 2421 |
-
from
|
| 2422 |
|
| 2423 |
for i, token in enumerate(sentence['tokens']):
|
| 2424 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
@@ -2426,7 +2431,7 @@ for i, token in enumerate(sentence['tokens']):
|
|
| 2426 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 2427 |
|
| 2428 |
# Export back to CoNLL-U format
|
| 2429 |
-
from
|
| 2430 |
|
| 2431 |
# Write to stdout
|
| 2432 |
write_conllu(ds)
|
|
@@ -2443,7 +2448,9 @@ conllu_text = buffer.getvalue()
|
|
| 2443 |
|
| 2444 |
### Supported Tasks and Leaderboards
|
| 2445 |
|
| 2446 |
-
|
|
|
|
|
|
|
| 2447 |
|
| 2448 |
## Dataset Structure
|
| 2449 |
|
|
@@ -2463,7 +2470,7 @@ This dataset has 353 configurations (treebanks).
|
|
| 2463 |
from datasets import get_dataset_config_names, load_dataset
|
| 2464 |
|
| 2465 |
# Get all available treebank configurations for revision="2.18"
|
| 2466 |
-
configs = get_dataset_config_names("
|
| 2467 |
print(f"Available treebanks: {len(configs)}")
|
| 2468 |
|
| 2469 |
# Example configurations:
|
|
@@ -2477,10 +2484,10 @@ print(f"Available treebanks: {len(configs)}")
|
|
| 2477 |
# ]
|
| 2478 |
|
| 2479 |
# Get the latest configurations
|
| 2480 |
-
get_dataset_config_names("
|
| 2481 |
|
| 2482 |
# Load a specific treebank
|
| 2483 |
-
dataset = load_dataset("
|
| 2484 |
print(dataset)
|
| 2485 |
|
| 2486 |
# Output:
|
|
@@ -2511,7 +2518,7 @@ Each example in the dataset contains the following fields:
|
|
| 2511 |
- **upos** (list of strings): Universal POS tags
|
| 2512 |
- **xpos** (list of strings): Language-specific POS tags
|
| 2513 |
- **feats** (list of strings): Morphological features in UD format
|
| 2514 |
-
- **head** (list of
|
| 2515 |
- **deprel** (list of strings): Dependency relation labels
|
| 2516 |
- **deps** (list of strings): Enhanced dependency graph
|
| 2517 |
- **misc** (list of strings): Miscellaneous annotations
|
|
@@ -2527,7 +2534,7 @@ Each example in the dataset contains the following fields:
|
|
| 2527 |
```python
|
| 2528 |
from datasets import load_dataset
|
| 2529 |
|
| 2530 |
-
dataset = load_dataset("
|
| 2531 |
print(dataset[0])
|
| 2532 |
|
| 2533 |
# Output:
|
|
@@ -2542,10 +2549,10 @@ print(dataset[0])
|
|
| 2542 |
],
|
| 2543 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2544 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2545 |
-
'upos': [
|
| 2546 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 2547 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 2548 |
-
'head': [
|
| 2549 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 2550 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 2551 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
@@ -2557,7 +2564,7 @@ print(dataset[0])
|
|
| 2557 |
*MWT Example (French):**
|
| 2558 |
|
| 2559 |
```python
|
| 2560 |
-
dataset = load_dataset("
|
| 2561 |
# Find sentence with MWT
|
| 2562 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 2563 |
print(example['mwt'])
|
|
@@ -2575,7 +2582,7 @@ The file `metadata.json` stores additional information about the data, for examp
|
|
| 2575 |
from huggingface_hub import hf_hub_download
|
| 2576 |
import json
|
| 2577 |
|
| 2578 |
-
md = hf_hub_download(repo_id="
|
| 2579 |
|
| 2580 |
with open(md, "r", encoding="utf-8") as f:
|
| 2581 |
metadata = json.load(f)
|
|
@@ -2631,7 +2638,9 @@ with open(md, "r", encoding="utf-8") as f:
|
|
| 2631 |
|
| 2632 |
### Dataset Curators
|
| 2633 |
|
| 2634 |
-
|
|
|
|
|
|
|
| 2635 |
|
| 2636 |
### Licensing Information
|
| 2637 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
@@ -2646,6 +2655,11 @@ The `./tools/` are licensed under the [Apache-2.0](https://www.apache.org/licens
|
|
| 2646 |
|
| 2647 |
### Citation Information
|
| 2648 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2649 |
```bibtex
|
| 2650 |
@misc{11234/1-6149,
|
| 2651 |
title = {Universal Dependencies 2.18},
|
|
@@ -2659,4 +2673,8 @@ The `./tools/` are licensed under the [Apache-2.0](https://www.apache.org/licens
|
|
| 2659 |
|
| 2660 |
### Contributions
|
| 2661 |
|
| 2662 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- constituency-parsing
|
| 219 |
- dependency-parsing
|
| 220 |
- part-of-speech-tagging
|
| 221 |
+
|
| 222 |
configs:
|
| 223 |
- config_name: abq_atb
|
| 224 |
data_files:
|
|
|
|
| 2333 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 2334 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 2335 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 2336 |
+
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version (2.18)
|
| 2337 |
|
| 2338 |
**Breaking Changes:**
|
| 2339 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
|
|
| 2379 |
|
| 2380 |
Universal Dependencies is a project that seeks to develop cross-linguistically consistent treebank annotation for many languages, with the goal of facilitating multilingual parser development, cross-lingual learning, and parsing research from a language typology perspective. The annotation scheme is based on (universal) Stanford dependencies (de Marneffe et al., 2006, 2008, 2014), Google universal part-of-speech tags (Petrov et al., 2012), and the Interset interlingua for morphosyntactic tagsets (Zeman, 2008).
|
| 2381 |
|
| 2382 |
+
This is the official Hugging Face Parquet distribution for Universal
|
| 2383 |
+
Dependencies at
|
| 2384 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies).
|
| 2385 |
+
The dataset was formerly maintained at `commul/universal_dependencies`.
|
| 2386 |
|
| 2387 |
### Data Quality & Fidelity
|
| 2388 |
|
|
|
|
| 2409 |
from datasets import load_dataset
|
| 2410 |
|
| 2411 |
# Load a specific treebank
|
| 2412 |
+
ds = load_dataset(
|
| 2413 |
+
"universal-dependencies/universal_dependencies",
|
| 2414 |
+
"en_ewt",
|
| 2415 |
+
revision="2.18",
|
| 2416 |
+
split="train",
|
| 2417 |
+
)
|
| 2418 |
|
| 2419 |
# Access sentence data
|
| 2420 |
sentence = ds[0]
|
|
|
|
| 2422 |
print(f"Text: {sentence['text']}")
|
| 2423 |
print(f"Tokens: {sentence['tokens']}")
|
| 2424 |
|
|
|
|
|
|
|
|
|
|
| 2425 |
# Parse optional fields using helper functions
|
| 2426 |
+
from ud_hf_parquet_tools import parse_feats, parse_misc
|
| 2427 |
|
| 2428 |
for i, token in enumerate(sentence['tokens']):
|
| 2429 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
|
|
| 2431 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 2432 |
|
| 2433 |
# Export back to CoNLL-U format
|
| 2434 |
+
from ud_hf_parquet_tools import write_conllu
|
| 2435 |
|
| 2436 |
# Write to stdout
|
| 2437 |
write_conllu(ds)
|
|
|
|
| 2448 |
|
| 2449 |
### Supported Tasks and Leaderboards
|
| 2450 |
|
| 2451 |
+
This dataset supports dependency parsing, universal and language-specific
|
| 2452 |
+
part-of-speech tagging, lemmatization, and morphology-oriented token
|
| 2453 |
+
classification. No single leaderboard is maintained in this dataset card.
|
| 2454 |
|
| 2455 |
## Dataset Structure
|
| 2456 |
|
|
|
|
| 2470 |
from datasets import get_dataset_config_names, load_dataset
|
| 2471 |
|
| 2472 |
# Get all available treebank configurations for revision="2.18"
|
| 2473 |
+
configs = get_dataset_config_names("universal-dependencies/universal_dependencies", revision="2.18")
|
| 2474 |
print(f"Available treebanks: {len(configs)}")
|
| 2475 |
|
| 2476 |
# Example configurations:
|
|
|
|
| 2484 |
# ]
|
| 2485 |
|
| 2486 |
# Get the latest configurations
|
| 2487 |
+
get_dataset_config_names("universal-dependencies/universal_dependencies")
|
| 2488 |
|
| 2489 |
# Load a specific treebank
|
| 2490 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt")
|
| 2491 |
print(dataset)
|
| 2492 |
|
| 2493 |
# Output:
|
|
|
|
| 2518 |
- **upos** (list of strings): Universal POS tags
|
| 2519 |
- **xpos** (list of strings): Language-specific POS tags
|
| 2520 |
- **feats** (list of strings): Morphological features in UD format
|
| 2521 |
+
- **head** (list of integers): Head indices for dependency relations
|
| 2522 |
- **deprel** (list of strings): Dependency relation labels
|
| 2523 |
- **deps** (list of strings): Enhanced dependency graph
|
| 2524 |
- **misc** (list of strings): Miscellaneous annotations
|
|
|
|
| 2534 |
```python
|
| 2535 |
from datasets import load_dataset
|
| 2536 |
|
| 2537 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", split="train")
|
| 2538 |
print(dataset[0])
|
| 2539 |
|
| 2540 |
# Output:
|
|
|
|
| 2549 |
],
|
| 2550 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2551 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2552 |
+
'upos': ['PROPN', 'PUNCT', 'PROPN', 'PUNCT', 'ADJ', 'NOUN', 'VERB', ...],
|
| 2553 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 2554 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 2555 |
+
'head': [0, 3, 1, 7, 6, 7, 1, ...],
|
| 2556 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 2557 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 2558 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
|
|
| 2564 |
*MWT Example (French):**
|
| 2565 |
|
| 2566 |
```python
|
| 2567 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "fr_gsd", split="train")
|
| 2568 |
# Find sentence with MWT
|
| 2569 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 2570 |
print(example['mwt'])
|
|
|
|
| 2582 |
from huggingface_hub import hf_hub_download
|
| 2583 |
import json
|
| 2584 |
|
| 2585 |
+
md = hf_hub_download(repo_id="universal-dependencies/universal_dependencies", filename="metadata.json", repo_type="dataset")
|
| 2586 |
|
| 2587 |
with open(md, "r", encoding="utf-8") as f:
|
| 2588 |
metadata = json.load(f)
|
|
|
|
| 2638 |
|
| 2639 |
### Dataset Curators
|
| 2640 |
|
| 2641 |
+
Universal Dependencies is maintained by the Universal Dependencies community.
|
| 2642 |
+
This Hugging Face Parquet distribution is maintained under the official
|
| 2643 |
+
`universal-dependencies` organization.
|
| 2644 |
|
| 2645 |
### Licensing Information
|
| 2646 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
|
|
| 2655 |
|
| 2656 |
### Citation Information
|
| 2657 |
|
| 2658 |
+
Please cite the Universal Dependencies release used in your work. If you use a
|
| 2659 |
+
specific treebank, also cite the treebank-specific references listed in that
|
| 2660 |
+
treebank's upstream README when available. For general UD background, cite the
|
| 2661 |
+
UD v2 paper listed in the dataset description.
|
| 2662 |
+
|
| 2663 |
```bibtex
|
| 2664 |
@misc{11234/1-6149,
|
| 2665 |
title = {Universal Dependencies 2.18},
|
|
|
|
| 2673 |
|
| 2674 |
### Contributions
|
| 2675 |
|
| 2676 |
+
The v2.0 Parquet rewrite was originally authored by Egon W. Stemle. This
|
| 2677 |
+
dataset was formerly hosted at `commul/universal_dependencies` and is now
|
| 2678 |
+
maintained at the official
|
| 2679 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies)
|
| 2680 |
+
location.
|
RELEASE.md
CHANGED
|
@@ -284,7 +284,7 @@ Do not use lightweight tags (`git tag v${NEW_VER}`) for framework releases.
|
|
| 284 |
|
| 285 |
This release updates the Universal Dependencies dataset **framework** to v2.1.0.
|
| 286 |
|
| 287 |
-
**This is a framework release, not a UD data release.** It applies to all UD data versions (2.7-2.
|
| 288 |
|
| 289 |
### What's New
|
| 290 |
|
|
@@ -300,7 +300,7 @@ Do not use lightweight tags (`git tag v${NEW_VER}`) for framework releases.
|
|
| 300 |
|
| 301 |
For users: See [MIGRATION.md](MIGRATION.md) if breaking changes exist.
|
| 302 |
|
| 303 |
-
For maintainers: Framework has been applied to all UD data branches (2.7-2.
|
| 304 |
|
| 305 |
### Full Changelog
|
| 306 |
|
|
@@ -375,7 +375,7 @@ pytest tests/test_conversion.py
|
|
| 375 |
1. **Schema validation:**
|
| 376 |
```python
|
| 377 |
from datasets import load_dataset
|
| 378 |
-
ds = load_dataset("
|
| 379 |
assert "mwt" in ds["train"].features
|
| 380 |
assert "empty_nodes" in ds["train"].features
|
| 381 |
```
|
|
@@ -389,7 +389,7 @@ pytest tests/test_conversion.py
|
|
| 389 |
3. **Backwards compatibility (if minor/patch):**
|
| 390 |
```python
|
| 391 |
# Old code should still work
|
| 392 |
-
ds = load_dataset("
|
| 393 |
tokens = ds["train"][0]["tokens"]
|
| 394 |
# No errors
|
| 395 |
```
|
|
|
|
| 284 |
|
| 285 |
This release updates the Universal Dependencies dataset **framework** to v2.1.0.
|
| 286 |
|
| 287 |
+
**This is a framework release, not a UD data release.** It applies to all UD data versions (2.7-2.18).
|
| 288 |
|
| 289 |
### What's New
|
| 290 |
|
|
|
|
| 300 |
|
| 301 |
For users: See [MIGRATION.md](MIGRATION.md) if breaking changes exist.
|
| 302 |
|
| 303 |
+
For maintainers: Framework has been applied to all UD data branches (2.7-2.18).
|
| 304 |
|
| 305 |
### Full Changelog
|
| 306 |
|
|
|
|
| 375 |
1. **Schema validation:**
|
| 376 |
```python
|
| 377 |
from datasets import load_dataset
|
| 378 |
+
ds = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", revision="2.17")
|
| 379 |
assert "mwt" in ds["train"].features
|
| 380 |
assert "empty_nodes" in ds["train"].features
|
| 381 |
```
|
|
|
|
| 389 |
3. **Backwards compatibility (if minor/patch):**
|
| 390 |
```python
|
| 391 |
# Old code should still work
|
| 392 |
+
ds = load_dataset("universal-dependencies/universal_dependencies", "fr_gsd", revision="2.17")
|
| 393 |
tokens = ds["train"][0]["tokens"]
|
| 394 |
# No errors
|
| 395 |
```
|
tools/04_generate_parquet.py
CHANGED
|
@@ -5,7 +5,7 @@ Generate Parquet files from Universal Dependencies CoNLL-U data.
|
|
| 5 |
This script is a wrapper around the ud-hf-parquet-tools library.
|
| 6 |
For the actual implementation, see: https://github.com/bot-zen/ud-hf-parquet-tools
|
| 7 |
|
| 8 |
-
Repository:
|
| 9 |
|
| 10 |
Usage:
|
| 11 |
python 04_generate_parquet.py [OPTIONS]
|
|
|
|
| 5 |
This script is a wrapper around the ud-hf-parquet-tools library.
|
| 6 |
For the actual implementation, see: https://github.com/bot-zen/ud-hf-parquet-tools
|
| 7 |
|
| 8 |
+
Repository: universal-dependencies/universal_dependencies
|
| 9 |
|
| 10 |
Usage:
|
| 11 |
python 04_generate_parquet.py [OPTIONS]
|
tools/05_validate_parquet.py
CHANGED
|
@@ -9,7 +9,7 @@ This script can validate both:
|
|
| 9 |
- Remote: Downloaded from HuggingFace Hub
|
| 10 |
- Local: Local parquet files in ../parquet/
|
| 11 |
|
| 12 |
-
Repository:
|
| 13 |
|
| 14 |
Usage:
|
| 15 |
python 05_validate_parquet.py [OPTIONS]
|
|
|
|
| 9 |
- Remote: Downloaded from HuggingFace Hub
|
| 10 |
- Local: Local parquet files in ../parquet/
|
| 11 |
|
| 12 |
+
Repository: universal-dependencies/universal_dependencies
|
| 13 |
|
| 14 |
Usage:
|
| 15 |
python 05_validate_parquet.py [OPTIONS]
|
tools/BLOCKED_TREEBANKS.md
CHANGED
|
@@ -46,7 +46,7 @@ The dataset loader (`universal_dependencies.py`) handles blocked treebanks grace
|
|
| 46 |
from datasets import load_dataset
|
| 47 |
|
| 48 |
# Fast loading from Parquet
|
| 49 |
-
ds = load_dataset("
|
| 50 |
```
|
| 51 |
|
| 52 |
### Loading a Blocked Treebank
|
|
@@ -55,7 +55,7 @@ from datasets import load_dataset
|
|
| 55 |
|
| 56 |
# Falls back to CoNLL-U loading (requires trust_remote_code)
|
| 57 |
ds = load_dataset(
|
| 58 |
-
"
|
| 59 |
"pt_cintil", # Example blocked treebank
|
| 60 |
split="train",
|
| 61 |
trust_remote_code=True
|
|
|
|
| 46 |
from datasets import load_dataset
|
| 47 |
|
| 48 |
# Fast loading from Parquet
|
| 49 |
+
ds = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", split="train")
|
| 50 |
```
|
| 51 |
|
| 52 |
### Loading a Blocked Treebank
|
|
|
|
| 55 |
|
| 56 |
# Falls back to CoNLL-U loading (requires trust_remote_code)
|
| 57 |
ds = load_dataset(
|
| 58 |
+
"universal-dependencies/universal_dependencies",
|
| 59 |
"pt_cintil", # Example blocked treebank
|
| 60 |
split="train",
|
| 61 |
trust_remote_code=True
|
tools/README-2.18
CHANGED
|
@@ -1,13 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
### THIS IS A GENERATED FILE.
|
| 3 |
viewer: true
|
| 4 |
-
|
| 5 |
annotations_creators:
|
| 6 |
- expert-generated
|
| 7 |
-
|
| 8 |
language_creators:
|
| 9 |
- crowdsourced
|
| 10 |
-
|
| 11 |
language:
|
| 12 |
- abq
|
| 13 |
- ab
|
|
@@ -202,30 +198,21 @@ language:
|
|
| 202 |
- ess
|
| 203 |
- say
|
| 204 |
- zza
|
| 205 |
-
|
| 206 |
-
license:
|
| 207 |
-
- apache-2.0
|
| 208 |
-
|
| 209 |
multilinguality:
|
| 210 |
- multilingual
|
| 211 |
-
|
| 212 |
size_categories:
|
| 213 |
-
-
|
| 214 |
-
|
| 215 |
source_datasets:
|
| 216 |
- original
|
| 217 |
-
|
| 218 |
task_categories:
|
| 219 |
- token-classification
|
| 220 |
-
|
| 221 |
task_ids:
|
| 222 |
- parsing
|
| 223 |
- part-of-speech
|
| 224 |
- lemmatization
|
| 225 |
-
|
| 226 |
paperswithcode_id: universal-dependencies
|
| 227 |
pretty_name: Universal Dependencies Treebank
|
| 228 |
-
|
| 229 |
tags:
|
| 230 |
- text
|
| 231 |
- constituency-parsing
|
|
@@ -2346,7 +2333,7 @@ configs:
|
|
| 2346 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 2347 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 2348 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 2349 |
-
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version (2.
|
| 2350 |
|
| 2351 |
**Breaking Changes:**
|
| 2352 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
@@ -2387,16 +2374,15 @@ configs:
|
|
| 2387 |
- **Repository:** [Universal Dependencies](https://github.com/UniversalDependencies)
|
| 2388 |
- **Paper:** [Universal Dependencies v2: An Evergrowing Multilingual Treebank Collection](https://arxiv.org/abs/2004.10643)
|
| 2389 |
- **Paper:** [From Treebank Metadata to Sentence-Level Genre in Universal Dependencies: A Reproducible, Versioned Resource](https://universaldependencies.org/udw26/papers/41_Paper.pdf)
|
| 2390 |
-
- **Leaderboard:**
|
| 2391 |
-
- **Point of Contact:** [appliedlinguisticsdevs@eurac.edu](mailto:appliedlinguisticsdevs@eurac.edu)
|
| 2392 |
-
- **Point of Contact:** [IAL Homepage](https://www.eurac.edu/linguistics)
|
| 2393 |
|
| 2394 |
### Dataset Summary
|
| 2395 |
|
| 2396 |
Universal Dependencies is a project that seeks to develop cross-linguistically consistent treebank annotation for many languages, with the goal of facilitating multilingual parser development, cross-lingual learning, and parsing research from a language typology perspective. The annotation scheme is based on (universal) Stanford dependencies (de Marneffe et al., 2006, 2008, 2014), Google universal part-of-speech tags (Petrov et al., 2012), and the Interset interlingua for morphosyntactic tagsets (Zeman, 2008).
|
| 2397 |
|
| 2398 |
-
This is
|
| 2399 |
-
|
|
|
|
|
|
|
| 2400 |
|
| 2401 |
### Data Quality & Fidelity
|
| 2402 |
|
|
@@ -2423,7 +2409,12 @@ For technical details, see [CONLLU_PARSING.md](https://github.com/bot-zen/ud-hf-
|
|
| 2423 |
from datasets import load_dataset
|
| 2424 |
|
| 2425 |
# Load a specific treebank
|
| 2426 |
-
ds = load_dataset(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2427 |
|
| 2428 |
# Access sentence data
|
| 2429 |
sentence = ds[0]
|
|
@@ -2431,11 +2422,8 @@ print(f"Sentence ID: {sentence['sent_id']}")
|
|
| 2431 |
print(f"Text: {sentence['text']}")
|
| 2432 |
print(f"Tokens: {sentence['tokens']}")
|
| 2433 |
|
| 2434 |
-
## TODO: Make helper functions available
|
| 2435 |
-
## post v2.0 universal_dependencies.py is not part of the Dataset any longer!
|
| 2436 |
-
##
|
| 2437 |
# Parse optional fields using helper functions
|
| 2438 |
-
from
|
| 2439 |
|
| 2440 |
for i, token in enumerate(sentence['tokens']):
|
| 2441 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
@@ -2443,7 +2431,7 @@ for i, token in enumerate(sentence['tokens']):
|
|
| 2443 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 2444 |
|
| 2445 |
# Export back to CoNLL-U format
|
| 2446 |
-
from
|
| 2447 |
|
| 2448 |
# Write to stdout
|
| 2449 |
write_conllu(ds)
|
|
@@ -2460,7 +2448,9 @@ conllu_text = buffer.getvalue()
|
|
| 2460 |
|
| 2461 |
### Supported Tasks and Leaderboards
|
| 2462 |
|
| 2463 |
-
|
|
|
|
|
|
|
| 2464 |
|
| 2465 |
## Dataset Structure
|
| 2466 |
|
|
@@ -2480,7 +2470,7 @@ This dataset has 353 configurations (treebanks).
|
|
| 2480 |
from datasets import get_dataset_config_names, load_dataset
|
| 2481 |
|
| 2482 |
# Get all available treebank configurations for revision="2.18"
|
| 2483 |
-
configs = get_dataset_config_names("
|
| 2484 |
print(f"Available treebanks: {len(configs)}")
|
| 2485 |
|
| 2486 |
# Example configurations:
|
|
@@ -2494,10 +2484,10 @@ print(f"Available treebanks: {len(configs)}")
|
|
| 2494 |
# ]
|
| 2495 |
|
| 2496 |
# Get the latest configurations
|
| 2497 |
-
get_dataset_config_names("
|
| 2498 |
|
| 2499 |
# Load a specific treebank
|
| 2500 |
-
dataset = load_dataset("
|
| 2501 |
print(dataset)
|
| 2502 |
|
| 2503 |
# Output:
|
|
@@ -2528,7 +2518,7 @@ Each example in the dataset contains the following fields:
|
|
| 2528 |
- **upos** (list of strings): Universal POS tags
|
| 2529 |
- **xpos** (list of strings): Language-specific POS tags
|
| 2530 |
- **feats** (list of strings): Morphological features in UD format
|
| 2531 |
-
- **head** (list of
|
| 2532 |
- **deprel** (list of strings): Dependency relation labels
|
| 2533 |
- **deps** (list of strings): Enhanced dependency graph
|
| 2534 |
- **misc** (list of strings): Miscellaneous annotations
|
|
@@ -2544,7 +2534,7 @@ Each example in the dataset contains the following fields:
|
|
| 2544 |
```python
|
| 2545 |
from datasets import load_dataset
|
| 2546 |
|
| 2547 |
-
dataset = load_dataset("
|
| 2548 |
print(dataset[0])
|
| 2549 |
|
| 2550 |
# Output:
|
|
@@ -2559,10 +2549,10 @@ print(dataset[0])
|
|
| 2559 |
],
|
| 2560 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2561 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2562 |
-
'upos': [
|
| 2563 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 2564 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 2565 |
-
'head': [
|
| 2566 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 2567 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 2568 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
@@ -2574,7 +2564,7 @@ print(dataset[0])
|
|
| 2574 |
*MWT Example (French):**
|
| 2575 |
|
| 2576 |
```python
|
| 2577 |
-
dataset = load_dataset("
|
| 2578 |
# Find sentence with MWT
|
| 2579 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 2580 |
print(example['mwt'])
|
|
@@ -2592,7 +2582,7 @@ The file `metadata.json` stores additional information about the data, for examp
|
|
| 2592 |
from huggingface_hub import hf_hub_download
|
| 2593 |
import json
|
| 2594 |
|
| 2595 |
-
md = hf_hub_download(repo_id="
|
| 2596 |
|
| 2597 |
with open(md, "r", encoding="utf-8") as f:
|
| 2598 |
metadata = json.load(f)
|
|
@@ -2648,7 +2638,9 @@ with open(md, "r", encoding="utf-8") as f:
|
|
| 2648 |
|
| 2649 |
### Dataset Curators
|
| 2650 |
|
| 2651 |
-
|
|
|
|
|
|
|
| 2652 |
|
| 2653 |
### Licensing Information
|
| 2654 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
@@ -2663,6 +2655,11 @@ The `./tools/` are licensed under the [Apache-2.0](https://www.apache.org/licens
|
|
| 2663 |
|
| 2664 |
### Citation Information
|
| 2665 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2666 |
```bibtex
|
| 2667 |
@misc{11234/1-6149,
|
| 2668 |
title = {Universal Dependencies 2.18},
|
|
@@ -2676,4 +2673,8 @@ The `./tools/` are licensed under the [Apache-2.0](https://www.apache.org/licens
|
|
| 2676 |
|
| 2677 |
### Contributions
|
| 2678 |
|
| 2679 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
viewer: true
|
|
|
|
| 3 |
annotations_creators:
|
| 4 |
- expert-generated
|
|
|
|
| 5 |
language_creators:
|
| 6 |
- crowdsourced
|
|
|
|
| 7 |
language:
|
| 8 |
- abq
|
| 9 |
- ab
|
|
|
|
| 198 |
- ess
|
| 199 |
- say
|
| 200 |
- zza
|
| 201 |
+
license: other
|
|
|
|
|
|
|
|
|
|
| 202 |
multilinguality:
|
| 203 |
- multilingual
|
|
|
|
| 204 |
size_categories:
|
| 205 |
+
- 1M<n<10M
|
|
|
|
| 206 |
source_datasets:
|
| 207 |
- original
|
|
|
|
| 208 |
task_categories:
|
| 209 |
- token-classification
|
|
|
|
| 210 |
task_ids:
|
| 211 |
- parsing
|
| 212 |
- part-of-speech
|
| 213 |
- lemmatization
|
|
|
|
| 214 |
paperswithcode_id: universal-dependencies
|
| 215 |
pretty_name: Universal Dependencies Treebank
|
|
|
|
| 216 |
tags:
|
| 217 |
- text
|
| 218 |
- constituency-parsing
|
|
|
|
| 2333 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 2334 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 2335 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 2336 |
+
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version (2.18)
|
| 2337 |
|
| 2338 |
**Breaking Changes:**
|
| 2339 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
|
|
| 2374 |
- **Repository:** [Universal Dependencies](https://github.com/UniversalDependencies)
|
| 2375 |
- **Paper:** [Universal Dependencies v2: An Evergrowing Multilingual Treebank Collection](https://arxiv.org/abs/2004.10643)
|
| 2376 |
- **Paper:** [From Treebank Metadata to Sentence-Level Genre in Universal Dependencies: A Reproducible, Versioned Resource](https://universaldependencies.org/udw26/papers/41_Paper.pdf)
|
|
|
|
|
|
|
|
|
|
| 2377 |
|
| 2378 |
### Dataset Summary
|
| 2379 |
|
| 2380 |
Universal Dependencies is a project that seeks to develop cross-linguistically consistent treebank annotation for many languages, with the goal of facilitating multilingual parser development, cross-lingual learning, and parsing research from a language typology perspective. The annotation scheme is based on (universal) Stanford dependencies (de Marneffe et al., 2006, 2008, 2014), Google universal part-of-speech tags (Petrov et al., 2012), and the Interset interlingua for morphosyntactic tagsets (Zeman, 2008).
|
| 2381 |
|
| 2382 |
+
This is the official Hugging Face Parquet distribution for Universal
|
| 2383 |
+
Dependencies at
|
| 2384 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies).
|
| 2385 |
+
The dataset was formerly maintained at `commul/universal_dependencies`.
|
| 2386 |
|
| 2387 |
### Data Quality & Fidelity
|
| 2388 |
|
|
|
|
| 2409 |
from datasets import load_dataset
|
| 2410 |
|
| 2411 |
# Load a specific treebank
|
| 2412 |
+
ds = load_dataset(
|
| 2413 |
+
"universal-dependencies/universal_dependencies",
|
| 2414 |
+
"en_ewt",
|
| 2415 |
+
revision="2.18",
|
| 2416 |
+
split="train",
|
| 2417 |
+
)
|
| 2418 |
|
| 2419 |
# Access sentence data
|
| 2420 |
sentence = ds[0]
|
|
|
|
| 2422 |
print(f"Text: {sentence['text']}")
|
| 2423 |
print(f"Tokens: {sentence['tokens']}")
|
| 2424 |
|
|
|
|
|
|
|
|
|
|
| 2425 |
# Parse optional fields using helper functions
|
| 2426 |
+
from ud_hf_parquet_tools import parse_feats, parse_misc
|
| 2427 |
|
| 2428 |
for i, token in enumerate(sentence['tokens']):
|
| 2429 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
|
|
| 2431 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 2432 |
|
| 2433 |
# Export back to CoNLL-U format
|
| 2434 |
+
from ud_hf_parquet_tools import write_conllu
|
| 2435 |
|
| 2436 |
# Write to stdout
|
| 2437 |
write_conllu(ds)
|
|
|
|
| 2448 |
|
| 2449 |
### Supported Tasks and Leaderboards
|
| 2450 |
|
| 2451 |
+
This dataset supports dependency parsing, universal and language-specific
|
| 2452 |
+
part-of-speech tagging, lemmatization, and morphology-oriented token
|
| 2453 |
+
classification. No single leaderboard is maintained in this dataset card.
|
| 2454 |
|
| 2455 |
## Dataset Structure
|
| 2456 |
|
|
|
|
| 2470 |
from datasets import get_dataset_config_names, load_dataset
|
| 2471 |
|
| 2472 |
# Get all available treebank configurations for revision="2.18"
|
| 2473 |
+
configs = get_dataset_config_names("universal-dependencies/universal_dependencies", revision="2.18")
|
| 2474 |
print(f"Available treebanks: {len(configs)}")
|
| 2475 |
|
| 2476 |
# Example configurations:
|
|
|
|
| 2484 |
# ]
|
| 2485 |
|
| 2486 |
# Get the latest configurations
|
| 2487 |
+
get_dataset_config_names("universal-dependencies/universal_dependencies")
|
| 2488 |
|
| 2489 |
# Load a specific treebank
|
| 2490 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt")
|
| 2491 |
print(dataset)
|
| 2492 |
|
| 2493 |
# Output:
|
|
|
|
| 2518 |
- **upos** (list of strings): Universal POS tags
|
| 2519 |
- **xpos** (list of strings): Language-specific POS tags
|
| 2520 |
- **feats** (list of strings): Morphological features in UD format
|
| 2521 |
+
- **head** (list of integers): Head indices for dependency relations
|
| 2522 |
- **deprel** (list of strings): Dependency relation labels
|
| 2523 |
- **deps** (list of strings): Enhanced dependency graph
|
| 2524 |
- **misc** (list of strings): Miscellaneous annotations
|
|
|
|
| 2534 |
```python
|
| 2535 |
from datasets import load_dataset
|
| 2536 |
|
| 2537 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", split="train")
|
| 2538 |
print(dataset[0])
|
| 2539 |
|
| 2540 |
# Output:
|
|
|
|
| 2549 |
],
|
| 2550 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2551 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 2552 |
+
'upos': ['PROPN', 'PUNCT', 'PROPN', 'PUNCT', 'ADJ', 'NOUN', 'VERB', ...],
|
| 2553 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 2554 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 2555 |
+
'head': [0, 3, 1, 7, 6, 7, 1, ...],
|
| 2556 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 2557 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 2558 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
|
|
| 2564 |
*MWT Example (French):**
|
| 2565 |
|
| 2566 |
```python
|
| 2567 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "fr_gsd", split="train")
|
| 2568 |
# Find sentence with MWT
|
| 2569 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 2570 |
print(example['mwt'])
|
|
|
|
| 2582 |
from huggingface_hub import hf_hub_download
|
| 2583 |
import json
|
| 2584 |
|
| 2585 |
+
md = hf_hub_download(repo_id="universal-dependencies/universal_dependencies", filename="metadata.json", repo_type="dataset")
|
| 2586 |
|
| 2587 |
with open(md, "r", encoding="utf-8") as f:
|
| 2588 |
metadata = json.load(f)
|
|
|
|
| 2638 |
|
| 2639 |
### Dataset Curators
|
| 2640 |
|
| 2641 |
+
Universal Dependencies is maintained by the Universal Dependencies community.
|
| 2642 |
+
This Hugging Face Parquet distribution is maintained under the official
|
| 2643 |
+
`universal-dependencies` organization.
|
| 2644 |
|
| 2645 |
### Licensing Information
|
| 2646 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
|
|
| 2655 |
|
| 2656 |
### Citation Information
|
| 2657 |
|
| 2658 |
+
Please cite the Universal Dependencies release used in your work. If you use a
|
| 2659 |
+
specific treebank, also cite the treebank-specific references listed in that
|
| 2660 |
+
treebank's upstream README when available. For general UD background, cite the
|
| 2661 |
+
UD v2 paper listed in the dataset description.
|
| 2662 |
+
|
| 2663 |
```bibtex
|
| 2664 |
@misc{11234/1-6149,
|
| 2665 |
title = {Universal Dependencies 2.18},
|
|
|
|
| 2673 |
|
| 2674 |
### Contributions
|
| 2675 |
|
| 2676 |
+
The v2.0 Parquet rewrite was originally authored by Egon W. Stemle. This
|
| 2677 |
+
dataset was formerly hosted at `commul/universal_dependencies` and is now
|
| 2678 |
+
maintained at the official
|
| 2679 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies)
|
| 2680 |
+
location.
|
tools/README.md
CHANGED
|
@@ -43,9 +43,9 @@ you need to regenerate artifacts in all UD version branches.
|
|
| 43 |
|
| 44 |
```bash
|
| 45 |
# Run from repository root
|
| 46 |
-
export FRAMEWORK_VER=v2.
|
| 47 |
|
| 48 |
-
for UD_VER in 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17; do
|
| 49 |
git switch "${UD_VER}"
|
| 50 |
# Keep branch aligned with framework changes (pick one)
|
| 51 |
git rebase main
|
|
|
|
| 43 |
|
| 44 |
```bash
|
| 45 |
# Run from repository root
|
| 46 |
+
export FRAMEWORK_VER=v2.2.1
|
| 47 |
|
| 48 |
+
for UD_VER in 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18; do
|
| 49 |
git switch "${UD_VER}"
|
| 50 |
# Keep branch aligned with framework changes (pick one)
|
| 51 |
git rebase main
|
tools/templates/README.tmpl
CHANGED
|
@@ -1,13 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
### THIS IS A GENERATED FILE.
|
| 3 |
viewer: true
|
| 4 |
-
|
| 5 |
annotations_creators:
|
| 6 |
- expert-generated
|
| 7 |
-
|
| 8 |
language_creators:
|
| 9 |
- crowdsourced
|
| 10 |
-
|
| 11 |
language:
|
| 12 |
{%- set languages = [] -%}
|
| 13 |
{%- for name,metadata in data.items()|sort(attribute='1.dirname') -%}
|
|
@@ -16,30 +12,21 @@ language:
|
|
| 16 |
{%- for language in languages|unique %}
|
| 17 |
- {{ language if language != 'no' else "'no'" }}
|
| 18 |
{%- endfor %}
|
| 19 |
-
|
| 20 |
-
license:
|
| 21 |
-
- apache-2.0
|
| 22 |
-
|
| 23 |
multilinguality:
|
| 24 |
- multilingual
|
| 25 |
-
|
| 26 |
size_categories:
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
source_datasets:
|
| 30 |
- original
|
| 31 |
-
|
| 32 |
task_categories:
|
| 33 |
- token-classification
|
| 34 |
-
|
| 35 |
task_ids:
|
| 36 |
- parsing
|
| 37 |
- part-of-speech
|
| 38 |
- lemmatization
|
| 39 |
-
|
| 40 |
paperswithcode_id: universal-dependencies
|
| 41 |
pretty_name: Universal Dependencies Treebank
|
| 42 |
-
|
| 43 |
tags:
|
| 44 |
- text
|
| 45 |
- constituency-parsing
|
|
@@ -69,7 +56,7 @@ configs:
|
|
| 69 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 70 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 71 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 72 |
-
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version (
|
| 73 |
|
| 74 |
**Breaking Changes:**
|
| 75 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
@@ -110,16 +97,15 @@ configs:
|
|
| 110 |
- **Repository:** [Universal Dependencies](https://github.com/UniversalDependencies)
|
| 111 |
- **Paper:** [Universal Dependencies v2: An Evergrowing Multilingual Treebank Collection](https://arxiv.org/abs/2004.10643)
|
| 112 |
- **Paper:** [From Treebank Metadata to Sentence-Level Genre in Universal Dependencies: A Reproducible, Versioned Resource](https://universaldependencies.org/udw26/papers/41_Paper.pdf)
|
| 113 |
-
- **Leaderboard:**
|
| 114 |
-
- **Point of Contact:** [appliedlinguisticsdevs@eurac.edu](mailto:appliedlinguisticsdevs@eurac.edu)
|
| 115 |
-
- **Point of Contact:** [IAL Homepage](https://www.eurac.edu/linguistics)
|
| 116 |
|
| 117 |
### Dataset Summary
|
| 118 |
|
| 119 |
{{ description }}
|
| 120 |
|
| 121 |
-
This is
|
| 122 |
-
|
|
|
|
|
|
|
| 123 |
|
| 124 |
### Data Quality & Fidelity
|
| 125 |
|
|
@@ -146,7 +132,12 @@ For technical details, see [CONLLU_PARSING.md](https://github.com/bot-zen/ud-hf-
|
|
| 146 |
from datasets import load_dataset
|
| 147 |
|
| 148 |
# Load a specific treebank
|
| 149 |
-
ds = load_dataset(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
# Access sentence data
|
| 152 |
sentence = ds[0]
|
|
@@ -154,11 +145,8 @@ print(f"Sentence ID: {sentence['sent_id']}")
|
|
| 154 |
print(f"Text: {sentence['text']}")
|
| 155 |
print(f"Tokens: {sentence['tokens']}")
|
| 156 |
|
| 157 |
-
## TODO: Make helper functions available
|
| 158 |
-
## post v2.0 universal_dependencies.py is not part of the Dataset any longer!
|
| 159 |
-
##
|
| 160 |
# Parse optional fields using helper functions
|
| 161 |
-
from
|
| 162 |
|
| 163 |
for i, token in enumerate(sentence['tokens']):
|
| 164 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
@@ -166,7 +154,7 @@ for i, token in enumerate(sentence['tokens']):
|
|
| 166 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 167 |
|
| 168 |
# Export back to CoNLL-U format
|
| 169 |
-
from
|
| 170 |
|
| 171 |
# Write to stdout
|
| 172 |
write_conllu(ds)
|
|
@@ -183,7 +171,9 @@ conllu_text = buffer.getvalue()
|
|
| 183 |
|
| 184 |
### Supported Tasks and Leaderboards
|
| 185 |
|
| 186 |
-
|
|
|
|
|
|
|
| 187 |
|
| 188 |
## Dataset Structure
|
| 189 |
|
|
@@ -203,7 +193,7 @@ This dataset has {{ data.items()|length }} configurations (treebanks).
|
|
| 203 |
from datasets import get_dataset_config_names, load_dataset
|
| 204 |
|
| 205 |
# Get all available treebank configurations for revision="{{ ud_ver }}"
|
| 206 |
-
configs = get_dataset_config_names("
|
| 207 |
print(f"Available treebanks: {len(configs)}")
|
| 208 |
|
| 209 |
# Example configurations:
|
|
@@ -217,10 +207,10 @@ print(f"Available treebanks: {len(configs)}")
|
|
| 217 |
# ]
|
| 218 |
|
| 219 |
# Get the latest configurations
|
| 220 |
-
get_dataset_config_names("
|
| 221 |
|
| 222 |
# Load a specific treebank
|
| 223 |
-
dataset = load_dataset("
|
| 224 |
print(dataset)
|
| 225 |
|
| 226 |
# Output:
|
|
@@ -251,7 +241,7 @@ Each example in the dataset contains the following fields:
|
|
| 251 |
- **upos** (list of strings): Universal POS tags
|
| 252 |
- **xpos** (list of strings): Language-specific POS tags
|
| 253 |
- **feats** (list of strings): Morphological features in UD format
|
| 254 |
-
- **head** (list of
|
| 255 |
- **deprel** (list of strings): Dependency relation labels
|
| 256 |
- **deps** (list of strings): Enhanced dependency graph
|
| 257 |
- **misc** (list of strings): Miscellaneous annotations
|
|
@@ -267,7 +257,7 @@ Each example in the dataset contains the following fields:
|
|
| 267 |
```python
|
| 268 |
from datasets import load_dataset
|
| 269 |
|
| 270 |
-
dataset = load_dataset("
|
| 271 |
print(dataset[0])
|
| 272 |
|
| 273 |
# Output:
|
|
@@ -282,10 +272,10 @@ print(dataset[0])
|
|
| 282 |
],
|
| 283 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 284 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 285 |
-
'upos': [
|
| 286 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 287 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 288 |
-
'head': [
|
| 289 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 290 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 291 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
@@ -297,7 +287,7 @@ print(dataset[0])
|
|
| 297 |
*MWT Example (French):**
|
| 298 |
|
| 299 |
```python
|
| 300 |
-
dataset = load_dataset("
|
| 301 |
# Find sentence with MWT
|
| 302 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 303 |
print(example['mwt'])
|
|
@@ -315,7 +305,7 @@ The file `metadata.json` stores additional information about the data, for examp
|
|
| 315 |
from huggingface_hub import hf_hub_download
|
| 316 |
import json
|
| 317 |
|
| 318 |
-
md = hf_hub_download(repo_id="
|
| 319 |
|
| 320 |
with open(md, "r", encoding="utf-8") as f:
|
| 321 |
metadata = json.load(f)
|
|
@@ -371,7 +361,9 @@ with open(md, "r", encoding="utf-8") as f:
|
|
| 371 |
|
| 372 |
### Dataset Curators
|
| 373 |
|
| 374 |
-
|
|
|
|
|
|
|
| 375 |
|
| 376 |
### Licensing Information
|
| 377 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
@@ -386,10 +378,19 @@ The `./tools/` are licensed under the [Apache-2.0](https://www.apache.org/licens
|
|
| 386 |
|
| 387 |
### Citation Information
|
| 388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 389 |
```bibtex
|
| 390 |
{{ citation }}
|
| 391 |
```
|
| 392 |
|
| 393 |
### Contributions
|
| 394 |
|
| 395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
viewer: true
|
|
|
|
| 3 |
annotations_creators:
|
| 4 |
- expert-generated
|
|
|
|
| 5 |
language_creators:
|
| 6 |
- crowdsourced
|
|
|
|
| 7 |
language:
|
| 8 |
{%- set languages = [] -%}
|
| 9 |
{%- for name,metadata in data.items()|sort(attribute='1.dirname') -%}
|
|
|
|
| 12 |
{%- for language in languages|unique %}
|
| 13 |
- {{ language if language != 'no' else "'no'" }}
|
| 14 |
{%- endfor %}
|
| 15 |
+
license: other
|
|
|
|
|
|
|
|
|
|
| 16 |
multilinguality:
|
| 17 |
- multilingual
|
|
|
|
| 18 |
size_categories:
|
| 19 |
+
- 1M<n<10M
|
|
|
|
| 20 |
source_datasets:
|
| 21 |
- original
|
|
|
|
| 22 |
task_categories:
|
| 23 |
- token-classification
|
|
|
|
| 24 |
task_ids:
|
| 25 |
- parsing
|
| 26 |
- part-of-speech
|
| 27 |
- lemmatization
|
|
|
|
| 28 |
paperswithcode_id: universal-dependencies
|
| 29 |
pretty_name: Universal Dependencies Treebank
|
|
|
|
| 30 |
tags:
|
| 31 |
- text
|
| 32 |
- constituency-parsing
|
|
|
|
| 56 |
- **Parquet Format:** faster loading with HuggingFace datasets >=4.0.0
|
| 57 |
- **MWT Support:** New `mwt` field provides structured multi-word token information
|
| 58 |
- **Enhanced Security:** No more `trust_remote_code=True` required
|
| 59 |
+
- **Separate Versioning:** Loader version (2.0.0) distinct from UD data version ({{ ud_ver }})
|
| 60 |
|
| 61 |
**Breaking Changes:**
|
| 62 |
- Token sequences now exclude MWT surface forms (matches UD guidelines)
|
|
|
|
| 97 |
- **Repository:** [Universal Dependencies](https://github.com/UniversalDependencies)
|
| 98 |
- **Paper:** [Universal Dependencies v2: An Evergrowing Multilingual Treebank Collection](https://arxiv.org/abs/2004.10643)
|
| 99 |
- **Paper:** [From Treebank Metadata to Sentence-Level Genre in Universal Dependencies: A Reproducible, Versioned Resource](https://universaldependencies.org/udw26/papers/41_Paper.pdf)
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
### Dataset Summary
|
| 102 |
|
| 103 |
{{ description }}
|
| 104 |
|
| 105 |
+
This is the official Hugging Face Parquet distribution for Universal
|
| 106 |
+
Dependencies at
|
| 107 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies).
|
| 108 |
+
The dataset was formerly maintained at `commul/universal_dependencies`.
|
| 109 |
|
| 110 |
### Data Quality & Fidelity
|
| 111 |
|
|
|
|
| 132 |
from datasets import load_dataset
|
| 133 |
|
| 134 |
# Load a specific treebank
|
| 135 |
+
ds = load_dataset(
|
| 136 |
+
"universal-dependencies/universal_dependencies",
|
| 137 |
+
"en_ewt",
|
| 138 |
+
revision="{{ ud_ver }}",
|
| 139 |
+
split="train",
|
| 140 |
+
)
|
| 141 |
|
| 142 |
# Access sentence data
|
| 143 |
sentence = ds[0]
|
|
|
|
| 145 |
print(f"Text: {sentence['text']}")
|
| 146 |
print(f"Tokens: {sentence['tokens']}")
|
| 147 |
|
|
|
|
|
|
|
|
|
|
| 148 |
# Parse optional fields using helper functions
|
| 149 |
+
from ud_hf_parquet_tools import parse_feats, parse_misc
|
| 150 |
|
| 151 |
for i, token in enumerate(sentence['tokens']):
|
| 152 |
feats = parse_feats(sentence['feats'][i]) # Returns dict or {}
|
|
|
|
| 154 |
print(f"{token}: UPOS={sentence['upos'][i]}, feats={feats}, misc={misc}")
|
| 155 |
|
| 156 |
# Export back to CoNLL-U format
|
| 157 |
+
from ud_hf_parquet_tools import write_conllu
|
| 158 |
|
| 159 |
# Write to stdout
|
| 160 |
write_conllu(ds)
|
|
|
|
| 171 |
|
| 172 |
### Supported Tasks and Leaderboards
|
| 173 |
|
| 174 |
+
This dataset supports dependency parsing, universal and language-specific
|
| 175 |
+
part-of-speech tagging, lemmatization, and morphology-oriented token
|
| 176 |
+
classification. No single leaderboard is maintained in this dataset card.
|
| 177 |
|
| 178 |
## Dataset Structure
|
| 179 |
|
|
|
|
| 193 |
from datasets import get_dataset_config_names, load_dataset
|
| 194 |
|
| 195 |
# Get all available treebank configurations for revision="{{ ud_ver }}"
|
| 196 |
+
configs = get_dataset_config_names("universal-dependencies/universal_dependencies", revision="{{ ud_ver }}")
|
| 197 |
print(f"Available treebanks: {len(configs)}")
|
| 198 |
|
| 199 |
# Example configurations:
|
|
|
|
| 207 |
# ]
|
| 208 |
|
| 209 |
# Get the latest configurations
|
| 210 |
+
get_dataset_config_names("universal-dependencies/universal_dependencies")
|
| 211 |
|
| 212 |
# Load a specific treebank
|
| 213 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt")
|
| 214 |
print(dataset)
|
| 215 |
|
| 216 |
# Output:
|
|
|
|
| 241 |
- **upos** (list of strings): Universal POS tags
|
| 242 |
- **xpos** (list of strings): Language-specific POS tags
|
| 243 |
- **feats** (list of strings): Morphological features in UD format
|
| 244 |
+
- **head** (list of integers): Head indices for dependency relations
|
| 245 |
- **deprel** (list of strings): Dependency relation labels
|
| 246 |
- **deps** (list of strings): Enhanced dependency graph
|
| 247 |
- **misc** (list of strings): Miscellaneous annotations
|
|
|
|
| 257 |
```python
|
| 258 |
from datasets import load_dataset
|
| 259 |
|
| 260 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "en_ewt", split="train")
|
| 261 |
print(dataset[0])
|
| 262 |
|
| 263 |
# Output:
|
|
|
|
| 272 |
],
|
| 273 |
'tokens': ['Al', '-', 'Zaman', ':', 'American', 'forces', 'killed', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 274 |
'lemmas': ['Al', '-', 'Zaman', ':', 'American', 'force', 'kill', 'Shaikh', 'Abdullah', 'al', '-', 'Ani', ',', 'the', 'preacher', 'at', 'the', 'mosque', 'in', 'the', 'town', 'of', 'Qaim', ',', 'near', 'the', 'Syrian', 'border', '.'],
|
| 275 |
+
'upos': ['PROPN', 'PUNCT', 'PROPN', 'PUNCT', 'ADJ', 'NOUN', 'VERB', ...],
|
| 276 |
'xpos': ['NNP', 'HYPH', 'NNP', ':', 'JJ', 'NNS', 'VBD', 'NNP', 'NNP', 'NNP', 'HYPH', 'NNP', ',', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'DT', 'NN', 'IN', 'NNP', ',', 'IN', 'DT', 'JJ', 'NN', '.'],
|
| 277 |
'feats': ['Number=Sing', None, 'Number=Sing', None, 'Degree=Pos', 'Number=Plur', 'Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin', 'Number=Sing', 'Number=Sing', 'Number=Sing', None, 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Definite=Def|PronType=Art', 'Number=Sing', None, 'Number=Sing', None, None, 'Definite=Def|PronType=Art', 'Degree=Pos', 'Number=Sing', None],
|
| 278 |
+
'head': [0, 3, 1, 7, 6, 7, 1, ...],
|
| 279 |
'deprel': ['root', 'punct', 'flat', 'punct', 'amod', 'nsubj', 'parataxis', 'obj', 'flat', 'flat', 'punct', 'flat', 'punct', 'det', 'appos', 'case', 'det', 'nmod', 'case', 'det', 'nmod', 'case', 'nmod', 'punct', 'case', 'det', 'amod', 'nmod', 'punct'],
|
| 280 |
'deps': ['0:root', '3:punct', '1:flat', '7:punct', '6:amod', '7:nsubj', '1:parataxis', '7:obj', '8:flat', '8:flat', '12:punct', '8:flat', '15:punct', '15:det', '8:appos', '18:case', '18:det', '15:nmod:at', '21:case', '21:det', '18:nmod:in', '23:case', '21:nmod:of', '28:punct', '28:case', '28:det', '28:amod', '21:nmod:near', '1:punct'],
|
| 281 |
'misc': ['SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, 'SpaceAfter=No', 'SpaceAfter=No', 'SpaceAfter=No', None, None, None, None, None, None, None, None, None, None, 'SpaceAfter=No', None, None, None, None, 'SpaceAfter=No', None],
|
|
|
|
| 287 |
*MWT Example (French):**
|
| 288 |
|
| 289 |
```python
|
| 290 |
+
dataset = load_dataset("universal-dependencies/universal_dependencies", "fr_gsd", split="train")
|
| 291 |
# Find sentence with MWT
|
| 292 |
example = [ex for ex in dataset if ex['mwt']][0]
|
| 293 |
print(example['mwt'])
|
|
|
|
| 305 |
from huggingface_hub import hf_hub_download
|
| 306 |
import json
|
| 307 |
|
| 308 |
+
md = hf_hub_download(repo_id="universal-dependencies/universal_dependencies", filename="metadata.json", repo_type="dataset")
|
| 309 |
|
| 310 |
with open(md, "r", encoding="utf-8") as f:
|
| 311 |
metadata = json.load(f)
|
|
|
|
| 361 |
|
| 362 |
### Dataset Curators
|
| 363 |
|
| 364 |
+
Universal Dependencies is maintained by the Universal Dependencies community.
|
| 365 |
+
This Hugging Face Parquet distribution is maintained under the official
|
| 366 |
+
`universal-dependencies` organization.
|
| 367 |
|
| 368 |
### Licensing Information
|
| 369 |
Universal Dependencies is a collection of linguistic data and tools. Each of
|
|
|
|
| 378 |
|
| 379 |
### Citation Information
|
| 380 |
|
| 381 |
+
Please cite the Universal Dependencies release used in your work. If you use a
|
| 382 |
+
specific treebank, also cite the treebank-specific references listed in that
|
| 383 |
+
treebank's upstream README when available. For general UD background, cite the
|
| 384 |
+
UD v2 paper listed in the dataset description.
|
| 385 |
+
|
| 386 |
```bibtex
|
| 387 |
{{ citation }}
|
| 388 |
```
|
| 389 |
|
| 390 |
### Contributions
|
| 391 |
|
| 392 |
+
The v2.0 Parquet rewrite was originally authored by Egon W. Stemle. This
|
| 393 |
+
dataset was formerly hosted at `commul/universal_dependencies` and is now
|
| 394 |
+
maintained at the official
|
| 395 |
+
[`universal-dependencies/universal_dependencies`](https://huggingface.co/datasets/universal-dependencies/universal_dependencies)
|
| 396 |
+
location.
|