satya007's picture
Upload README.md with huggingface_hub
9ab04f7 verified
# SER & RE Training Data
Datasets for Semantic Entity Recognition (SER) and Relation Extraction (RE) training.
## Datasets
### 1. XFUND (~/data/ser_re/xfund/)
- **Source**: https://github.com/doc-analysis/XFUND/releases/tag/v1.0
- **Languages**: zh, ja, es, fr, it, de, pt (7 languages)
- **Documents**: 149 train + 50 val per language = 1,393 total
- **Images**: 1,393 JPG files ({lang}_{split}_{idx}.jpg)
- **Annotations**: {lang}.train.json / {lang}.val.json
- **Format**: Word-level bboxes, BIO labels (question/answer/header/other), entity linking (Q->A pairs)
- **Linking pairs**: ~80,000 train + ~25,000 val across all languages
- **License**: CC BY-NC-SA 4.0
- **Label distribution** (train, all languages combined):
- question: ~21,462
- answer: ~30,510
- header: ~1,321
- other: ~18,706
### 2. FUNSD (~/data/ser_re/funsd/)
- **Source**: https://guillaumejaume.github.io/FUNSD/
- **Language**: English
- **Documents**: 149 train + 50 test = 199 total
- **Images**: 199 PNG files in dataset/{split}_data/images/
- **Annotations**: JSON files in dataset/{split}_data/annotations/
- **Format**: Entity-level bboxes with word-level sub-boxes, labels (question/answer/header/other), entity linking
- **Linking pairs**: 8,472 train + 2,152 test = 10,624 total
- **License**: CC BY-NC-SA 4.0 (derived from RVL-CDIP / tobacco litigation docs)
- **Label distribution**:
- Train: 3,266 question, 2,802 answer, 441 header, 902 other
- Test: 1,077 question, 821 answer, 122 header, 312 other
### 3. DocILE (~/data/ser_re/docile/) -- NOT YET DOWNLOADED
- **Source**: https://docile.rossum.ai/
- **Requires manual registration**: Fill form at https://forms.gle/poJqGXrxoftWrUsc8
- **Documents**: 6,680 annotated + 100,000 synthetic + ~1M unlabeled
- **Task**: Key Information Extraction (KIE) + Line Item Recognition (LIR)
- **Format**: PDF documents with field-level annotations (bboxes + field types)
- **License**: Research use only (requires legal agreement)
- **Python package**: `pip3 install docile-benchmark`
- See docile/README.md for download instructions
## Annotation Format Summary
All datasets use a similar annotation structure:
- **SER labels**: question, answer, header, other (BIO tagging at word or entity level)
- **RE annotations**: `linking` field with pairs of (source_id, target_id) mapping questions to answers
- **Bounding boxes**: [x0, y0, x1, y1] pixel coordinates (XFUND uses 0-1000 normalized coords)
## Combined Stats (excluding DocILE)
| Dataset | Language | Train Docs | Val/Test Docs | Total Linking Pairs |
|---------|----------|-----------|---------------|---------------------|
| XFUND | zh | 149 | 50 | 17,238 |
| XFUND | ja | 149 | 50 | 12,130 |
| XFUND | es | 149 | 50 | 15,268 |
| XFUND | fr | 149 | 50 | 11,275 |
| XFUND | it | 149 | 50 | 13,790 |
| XFUND | de | 149 | 50 | 14,568 |
| XFUND | pt | 149 | 50 | 18,022 |
| FUNSD | en | 149 | 50 | 10,624 |
| **Total** | | **1,341** | **450** | **112,915** |