UDD
收藏资源简介:
UDD(通用文档数据集)是一个整合了多个公共文档与OCR基准测试的标准化、分片数据集。其核心目标是将文档视觉问答(VQA)、关键信息提取(KIE)、文本定位/检测、全文本识别、表格结构识别、图表/图形推理以及文档分类等多种任务统一到一个单一的数据模式之下,从而避免了处理多种不兼容数据格式的麻烦,用户只需加载一个数据集并通过`task`或`source`字段进行过滤即可。当前版本包含 11,146 条记录,涉及 6,350 张独立图像,这些数据来源于 33 个不同的公开基准数据集,涵盖了上述七大类任务。数据集中的图像尺寸均不超过1000像素,且每个数据源在纳入前都经过了安全检查,并通过基于持久化图像哈希索引的去重缓存机制,确保了跨数据源的图像唯一性(审计显示无完全重复图像)。每条数据记录采用统一的字段结构,核心字段包括:文档图像(`image`)、唯一标识符(`sample_id`)、源数据集名称(`source`)、任务类型(`task`)、问题或指令(`instruction`)、标准答案列表(`answers`)。此外,为支持不同任务,还以JSON字符串形式提供了结构化负载,例如用于KIE的键值对及边界框(`fields_json`)、用于定位的区域框(`regions_json`)、用于识别的全文本(`full_text`)、用于表格的HTML结构(`table_html`)。数据集还包含一些衍生和元数据字段,如通过Unicode脚本启发式方法推断的语言代码(`language`)、用于近重复检测的感知哈希值(`phash`)、图像尺寸、以及原始数据集的出处和许可证信息(`hf_id`, `license`等)。该数据集适用于训练和评估多模态文档理解模型,特别是那些需要处理多样化文档任务(如问答、信息提取、布局分析、OCR)的模型。用户可以通过Hugging Face `datasets`库轻松加载,并利用过滤功能快速获取特定任务或语言的数据子集。
Universal Document Dataset (UDD) is a standardized and sharded dataset that integrates multiple public document and OCR benchmark datasets. Its core objective is to unify diverse document-related tasks—including Document Visual Question Answering (VQA), Key Information Extraction (KIE), text localization/detection, full-text recognition, table structure recognition, chart/graph reasoning, and document classification—under a single unified data schema, eliminating the hassle of handling multiple incompatible data formats. Users only need to load one dataset and filter it using the `task` or `source` fields. The current version contains 11,146 records, covering 6,350 independent images sourced from 33 distinct public benchmark datasets, spanning the seven task categories mentioned above. All images in the dataset have a maximum dimension of 1000 pixels. Each data source has undergone security checks prior to inclusion, and a deduplication caching mechanism based on persistent image hash indexing is employed to ensure image uniqueness across sources; audits confirm no fully duplicate images. Each data record adopts a unified field structure, with core fields including: document image (`image`), unique identifier (`sample_id`), source dataset name (`source`), task type (`task`), question or instruction (`instruction`), and list of standard answers (`answers`). Additionally, to support different tasks, structured payloads are provided in JSON string format, such as key-value pairs and bounding boxes for KIE (`fields_json`), region boxes for localization (`regions_json`), full text for recognition (`full_text`), and HTML structure for tables (`table_html`). The dataset also includes various derived and metadata fields, such as language code inferred via heuristic Unicode script detection (`language`), perceptual hash values for near-duplicate detection (`phash`), image dimensions, as well as provenance and license information of the original dataset (`hf_id`, `license`, etc.). This dataset is applicable for training and evaluating multimodal document understanding models, particularly those that need to handle diverse document tasks such as question answering, information extraction, layout analysis, and OCR. Users can easily load it via the Hugging Face `datasets` library and quickly acquire specific task or language subsets of data using the filtering functionality.
数据集概述:UDD — Universal Document Dataset
UDD 是一个标准化的通用文档数据集,将多个公开的文档/OCR基准测试整合为统一的、分片的数据集。它覆盖了多种文档理解任务,并采用统一的模式,用户只需加载一个数据集,然后根据 task 或 source 进行过滤即可。
- 当前版本:包含 11,146 条记录,源于 6,350 张不同的图像,来自 33 个源数据集,覆盖 7 种任务。每个源数据集最多采样 200 张图像;多问答(Multi-QA)源数据集限制为每张图像最多 5 个问答对。所有图像尺寸 ≤1000px。
- 构建管道:基于 SangbumChoi/OCR 仓库中的开源管道(
docvlm_eval.unified,scripts/build_udd.py)构建。
任务与数据分布
数据集涵盖以下 7 种任务,采样数量如下:
- 文档 VQA (vqa): 5,196 条
- 推理 (reasoning): 3,600 条
- 识别 (recognition): 1,200 条
- 定位/检测 (localization): 400 条
- 关键信息提取 (kie): 350 条
- 表格结构分析 (table): 200 条
- 文档分类 (classification): 200 条
数据模式(Schema)
每条记录具有统一的字段结构,结构化负载以 JSON 编码。
| 列名 | 类型 | 含义 |
|---|---|---|
image |
Image | 文档图像 |
sample_id |
string | 唯一 ID,格式为 <source>_<img>_<qa> |
source |
string | 来源基准测试名称(如 cord, docvqa, doclaynet 等) |
task |
string | 任务类型(recognition, kie, vqa, localization, table, reasoning, classification) |
instruction |
string | 提示/问题 |
answers |
list[string] | 标准答案 |
fields_json |
string(JSON) | KIE 键值对,格式为 `[{key,value,bbox:[x1,y1,x2,y2,normalized] |
regions_json |
string(JSON) | 定位框,格式为 `[{label,text,bbox:[…] |
full_text |
string | 识别/解析目标文本 |
table_html |
string | 表格结构(HTML 格式) |
language |
string | 语言代码(基于启发式算法填充) |
metric |
string | 建议的评估指标 |
hf_id, split, hf_config |
string | 原始来源:源仓库、数据集划分、配置 |
n_fields, n_regions |
int | 负载中的字段/区域数量计数 |
image_width, image_height |
int | 存储的图像尺寸 |
phash |
string | 64 位感知哈希值(用于近似重复检测或跨源连接) |
license |
string | 托管仓库的许可证标签 |
派生列说明
- language:通过确定性 Unicode 脚本启发式算法填充。当前语言分布为:en 9,746 · ar 582 · und 400 · ko 200 · zh 118 · id 100。
- phash:基于 dhash 算法。数据集重复审计显示:0 个跨源精确重复;存在 188 个汉明距离 ≤ 2 的近似对。
数据来源(33 个源数据集)
ai2d, chartqa, charxiv, cord, doclaynet, docmatix, docvqa, dvqa, funsd, hallusionbench, iam, im2latex, infovqa, latexocr, mathvista, mtvqa, ocrbench, ocrbench_v2, ocrvqa, omnidocbench, plotqa, pope, publaynet, pubtabnet, rvl_cdip, screenqa, sroie, stvqa, synthdog_en, synthdog_ko, tatqa, textvqa, visualmrc。
注意:MTVQA 样本以阿拉伯语为主。
数据集加载示例
python from datasets import load_dataset udd = load_dataset("danelcsb/UDD", split="train") # 加载整个数据集(所有任务) kie = udd.filter(lambda r: r["task"] == "kie") # 按任务过滤 loc = udd.filter(lambda r: r["task"] == "localization") # 过滤定位任务 ko = udd.filter(lambda r: r["language"] == "ko") # 按语言过滤 import json; fields = json.loads(kie[0]["fields_json"]) # 恢复类型化负载
出处与许可
- 每条记录源自其原始公开数据集(参见
hf_id和split列)。 license列携带托管仓库的卡片标签,原始数据集的自身条款仍适用于每条记录。- 本仓库仅对数据样本进行格式重组,以便研究使用。




