ehsaneddin's picture
Add files using upload-large-folder tool
874f08b verified
|
Raw History Blame Contribute Delete
9.48 kB
---
license: cdla-permissive-1.0
language:
- en
pretty_name: ADIP-DocLayNet-English
size_categories:
- 10K<n<100K
task_categories:
- image-to-text
- object-detection
tags:
- document-layout-analysis
- document-parsing
- ocr
- reading-order
- doclaynet
- adip
dataset_info:
features:
- name: page_id
dtype: string
- name: image
dtype: image
- name: width
dtype: int32
- name: height
dtype: int32
- name: doc_category
dtype: string
- name: collection
dtype: string
- name: original_filename
dtype: string
- name: page_no
dtype: int32
- name: page_hash
dtype: string
- name: layout_prompt
dtype: string
- name: layout
dtype: string
- name: ocr_format
dtype: string
- name: ocr_prompt
dtype: string
- name: ocr
dtype: string
splits:
- name: train
num_examples: 69076
- name: validation
num_examples: 6477
- name: test
num_examples: 4991
configs:
- config_name: default
data_files:
- split: train
path: data/train-*.parquet
- split: validation
path: data/validation-*.parquet
- split: test
path: data/test-*.parquet
---
# ADIP-DocLayNet-English
80,544 English document pages from [DocLayNet v1.2](https://huggingface.co/datasets/docling-project/DocLayNet-v1.2),
re-annotated in the **ADIP** (Arabic Document Intelligence Platform) document-parsing format. Each page has two
supervised records:
* **ADIP layout parsing**: the page's document metadata, every element as a hierarchy (page → regions → ADIP
element kinds) with boxes on a 0–1000 grid, the reading order, and the relations between elements.
* **Transcription**: the page text in reading order, either as ADIP element JSON (id, kind, pixel box, text) or as
plain text.
The element kinds, categories and document types come from the ADIP-Naqsh taxonomy (162 element kinds in 9
categories). The records use the same fields and value conventions as ADIP's Arabic document annotations, so English
and Arabic pages can be mixed in one training set or evaluated with one parser.
| Split | Pages | ADIP layout records | Transcription records (JSON / plain text) |
|---|---|---|---|
| train | 69,076 | 69,076 | 34,138 / 34,554 |
| validation | 6,477 | 6,477 | 3,186 / 3,260 |
| test | 4,991 | 4,991 | 2,493 / 2,458 |
The splits are DocLayNet's own. A page whose box has no text (for example, a page that is one picture) has a layout
record but no transcription. 41 pages whose layout record exceeded about 12k tokens were left out.
## Loading
```python
import json
from datasets import load_dataset
ds = load_dataset("ADIP-QCRI/ADIP-DocLayNet-English", split="validation")
row = ds[0]
row["image"] # PIL image of the page (JPEG, 1025 x 1025)
layout = json.loads(row["layout"])
row["ocr_format"], row["ocr"] # "json" or "text"
```
## Columns
| Column | Content |
|---|---|
| `page_id` | `doclaynet_<first 16 hex digits of the DocLayNet page hash>` |
| `image` | the page image, as in DocLayNet (1025 × 1025 px) |
| `width`, `height` | image size in pixels |
| `doc_category`, `collection`, `original_filename`, `page_no`, `page_hash` | DocLayNet source metadata |
| `layout_prompt`, `layout` | the ADIP layout-parsing instruction and its answer (compact JSON string) |
| `ocr_format`, `ocr_prompt`, `ocr` | `json` or `text`, the transcription instruction and its answer |
## The ADIP layout record
```json
{
"document": {
"type": "financial_report",
"script": {"primary": "en", "direction": "ltr", "diacritics": "none", "ligatures": "none",
"numerals": "western", "kashida": "none"},
"script_style": "system_serif_latin", "estimated_century": "21st",
"paper_color": "white", "ink_color": "black", "readability": 5, "complexity": 3,
"page_size_px": [1025, 1025]
},
"reading_order": ["elem_0001_01", "elem_0001_02"],
"reading_order_elements": ["elem_0001", "elem_0001_01", "elem_0001_01_01", "..."],
"elements": [{
"id": "elem_0001", "slot": "page", "kind": "page", "bbox_2d": [0, 0, 1000, 1000], "level": 0, "...": "...",
"children": [{
"id": "elem_0001_01", "slot": "main_text_region", "kind": "body", "bbox_2d": [116, 115, 942, 743],
"level": 1, "parent": "elem_0001", "script": "en", "direction": "ltr", "layer": 1,
"filled": true, "fill_ratio": 0.97, "order": 2,
"children": [{
"id": "elem_0001_01_01", "kind": "body_text", "category": "structural_body",
"bbox_2d": [147, 88, 837, 118], "level": 2, "parent": "elem_0001_01",
"font": "system_serif_latin", "ink": "black", "script": "en", "direction": "ltr",
"layer": 2, "lines": 2, "order": 3
}]
}]
}],
"relations": [{"type": "next", "from": "elem_0001_01_01", "to": "elem_0001_01_02"}]
}
```
* **document**: ADIP document type, script profile, script style, estimated century, paper and ink colour,
readability (1–5), complexity (1–5) and page size.
* **elements**: the page; its regions (`header_region`, `main_text_region`, `footer_region`); and the ADIP elements
inside them. Each element has its id, slot or kind, ADIP category, `bbox_2d` = [x0, y0, x1, y1] on a 0–1000 grid of
the page, level, parent, font class, ink colour, script, direction, layer, number of text lines and position in
the reading order.
* **reading_order** lists the region ids in reading order. **reading_order_elements** lists every element id in
reading order.
* **relations**: `next` between consecutive elements in reading order, and `inside` for an element whose box lies
at least 90% inside a larger element of another region.
## The transcription record
* `json`: `[{"id", "kind", "bbox": {"x", "y", "w", "h"} in pixels, "text"}, ...]`, one entry per text-bearing
element, in reading order. The text comes from the PDF text cells of the element's box, grouped into lines.
* `text`: the same text as plain text, one element per paragraph, in reading order.
## DocLayNet classes → ADIP element kinds
| DocLayNet | ADIP kind | ADIP category | Region |
|---|---|---|---|
| Text | body_text | structural_body | main_text_region |
| Section-header | heading | structural_body | main_text_region |
| List-item | list | structural_body | main_text_region |
| Caption | caption | structural_body | main_text_region |
| Title | title | metadata | main_text_region |
| Table | table | block_assets | main_text_region |
| Picture | figure | block_assets | main_text_region |
| Formula | math_block | block_assets | main_text_region |
| Page-header | header | navigation_reference | header_region |
| Page-footer | page_number if the text is a page number, else footer | navigation_reference | footer_region |
| Footnote | footnote | navigation_reference | footer_region |
DocLayNet document categories map to ADIP document types: financial reports → `financial_report`, manuals →
`technical_manual`, scientific articles → `scientific_article`, laws and regulations → `regulation`, patents →
`patent`, government tenders → `specification`.
Element counts over all splits: body_text 510,377; list 185,660; heading 142,884; header 58,022; figure 45,976;
page_number 39,758; table 34,733; footer 31,120; math_block 25,027; caption 22,524; footnote 6,318; title 5,071.
## Derived values
Boxes, classes and text are DocLayNet's own annotations. DocLayNet has no reading order and no visual metadata, so
these values are derived by fixed rules. Treat them as estimates:
* **Reading order**: the header region left to right, then the main region, then the footer region (footnotes
first, then page footers). In the main region, a block wider than 60% of the text area is read on its own; the
blocks between such blocks are read column by column, with the column taken from the box centre.
* **Fonts** (`script_style`, element `font`): `system_serif_latin`, `system_sans_latin` or `system_mono_latin`,
from the PDF font names. ADIP's font taxonomy covers Arabic script, and these are the Latin counterparts of its
`system_serif_arabic` and `system_sans_arabic` classes.
* **Colours**: `paper_color` comes from the page background pixels. `ink_color` and element `ink` come from the
colour of the PDF text cells.
* **estimated_century**: from a year in the source file name, otherwise `21st`.
* **readability** is 5 (born-digital pages). **complexity** (1–5) comes from the number of blocks, the number of
columns and the number of tables, figures and formulas.
* **Lines**: the number of text lines in the element, from its PDF text cells.
## License and attribution
This dataset is a modified version of DocLayNet v1.2 and is distributed under the same license,
[CDLA-Permissive-1.0](https://cdla.dev/permissive-1-0/) (full text in `LICENSE`). The page images, boxes, classes,
text cells and source metadata are © the DocLayNet authors and data providers. The modifications are the ADIP
re-annotation described above. If you use this dataset, please cite DocLayNet:
```bibtex
@inproceedings{pfitzmann2022doclaynet,
title = {DocLayNet: A Large Human-Annotated Dataset for Document-Layout Segmentation},
author = {Pfitzmann, Birgit and Auer, Christoph and Dolfi, Michele and Nassar, Ahmed S. and Staar, Peter},
booktitle = {Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
pages = {3743--3751},
year = {2022},
doi = {10.1145/3534678.3539043}
}
```
## Contact
Ehsan Asgari, easgari@hbku.edu.qa