# docbank-spans The training set `doc/docbank_spans` exactly as the OpenEmbed models were trained on it (both stages): every record with all its stored fields except the image bytes, and the image bytes we trained on in `images/`, each unique image once. * Registry id: `doc/docbank_spans` (exact case; the folder name is lowercase). Category: documents. * 612,913 records in 243 TFRecord shards (68.28 GB). * Images: 337,515 images (37.03 GB) in 12 uncompressed tar files under `images/` (37.29 GB). * Source: DocBank (500K pages of arXiv papers with token-level layout annotations; liminghao1630/DocBank on Hugging Face), converted by our first-stage DocBank builder (`stage0/v2_docbank_pages.py`, released with the training code) and rewritten by our dataset-tree builder: page retrieval (`span2page`) from an earlier run of the same builder, without explicit negatives: a text span of a page (at most 300 characters) as the query and the page image as the target. DocBank distributes its pages only as one multi-part archive, so this folder ships the page images we trained on, each unique image once (`images/`). ## Files * `records.parquet`: one row per record, in shard order (`shard`, `ordinal`): every stored field (`record_key`, `dataset_id`, `wemm_type`, `task_subtype`, `modality_sig`, `query_text`, `instruction`, `target_text`, `neg_texts`, `neg_scores`, `pos_score`, `pos_rank`, `graded_score`, `target_key`, `group_key`, `license`), `provenance` (the shard and record of the first-stage DocBank conversion it came from) and the sha256 and length of the serialized record (`record_sha256`: our training bytes; `record_sha256_public`: with the public provenance). For every image field (`query_image`, `target_image`, `neg_images`): sha256, length and `*_source`, a JSON pointer to the image's member in `images/` (`local_tar_member`: the tar file relative to this folder, the member name, its data offset and size). * `images/images-NNNNN.tar`: 12 uncompressed tar files (about 3 GB each) holding every image the records use, once each, as members `.` (the sha256 of the member's bytes; plain ustar headers: mode 0644, no owner, mtime 0). Each member is one of our stored images byte for byte. * `filters.parquet`: per record what the training loader applied when reading it: `adapter_emitted`, `adapter_flags`, `blocked_at_read`, `dedup_skipped`. * `shards.parquet`: per shard record count, bytes, md5 and crc32c (base64) of our training shard and of the public rebuild. * `set.json`: these facts in machine-readable form; `verification.json`: our end-to-end check. ## Rebuild From the repository root (`pip install pyarrow crc32c`; every image is our stored bytes as they are, so no re-encoding and no Pillow are needed): ``` python tools/openembed_data/rebuild_shards.py --out shards/ --sets documents/docbank-spans --cache documents/docbank-spans ``` `--cache` must name this folder: the pointers name the tar files relative to it. The script writes the 243 shards (68.26 GB) and checks every record's sha256 and every shard's md5 and crc32c; `--no-write` checks without writing. Nothing is downloaded. Provenance: our training shards carry our internal storage location in the provenance string; the release writes `openembed://...` instead, so the rebuilt shards equal our training shards in every other byte and are checked against the `*_public` values. With the internal prefixes the rebuild is byte-identical to the training shards (`record_sha256`, `md5`, `crc32c`); we checked that before release. ## Filters At read time nothing was removed: all 612,913 records were emitted by the training adapter with no flag, none was blocked and none skipped. When these shards were built 39 duplicate rows merged into their first occurrence, 248,715 rows dropped because the same question on a near-identical image is in one of our other training sets (), which keeps it; the build checked contamination, so the loader blocks nothing more at read time. ## Verified End to end on 2026-11-19, from this folder only (Pillow 11.3.0): * Training bytes (internal prefixes): 612,913 / 612,913 records with the recorded sha256; 243 / 243 shards with the md5 and crc32c of the shards our training read. * Public rebuild (this release): every record and shard matches the `*_public` values. * Image references: 612,913, every one read from `images/` with the recorded sha256 and length (missing 0, mismatched 0). ## Terms License class `P`: permissive: the publisher's licence allows use and redistribution. DocBank is released under Apache-2.0: its LICENSE file (since 2021-05-03) and the authors' copy on Hugging Face (liminghao1630/DocBank) both say so. A line in its GitHub README asking users not to redistribute the data dates from the CC BY-NC-ND 4.0 terms that Apache-2.0 replaced. The page images are renderings of arXiv papers, whose own licences DocBank does not address. Please cite DocBank (Li et al., COLING 2020) when you use these records. These records and images are derived from the source above and follow its terms. They are released for research use; we remove items on request.