Update namespace references from Vishva007 to OpenTensorLab
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151---license: cc-by-nc-4.0task_categories:- visual-question-answering- document-question-answering- object-detectionlanguage:- entags:- document-understanding- ocr- grounding- bounding-boxes- vlm- key-information-extractionpretty_name: BoundingDocs-Hard-5Ksize_categories:- 1K<n<10Kconfigs:- config_name: defaultdata_files:- split: trainpath: data/train-*- split: validationpath: data/validation-*- split: testpath: data/test-*dataset_info:features:- name: sourcedtype: large_string- name: doc_iddtype: large_string- name: doc_imageslarge_list:- name: bytesdtype: large_binary- name: pathdtype: large_string- name: doc_ocrlarge_list: large_string- name: Q&Adtype: large_stringsplits:- name: trainnum_examples: 3887- name: validationnum_examples: 455- name: testnum_examples: 658---# BoundingDocs-Hard-5K**`Vishva007/BoundingDocs-Hard-5K`** is a 50% stratified, visually challenging subset of [`Vishva007/BoundingDocs-Hard-10K`](https://huggingface.co/datasets/Vishva007/BoundingDocs-Hard-10K) (derived from [`letxbe/BoundingDocs`](https://huggingface.co/datasets/letxbe/BoundingDocs)). It is filtered specifically for **real-world noisy scans, archival documents, dense bureaucratic forms, and handwritten entries**, while excluding clean synthetic templates (such as `FATURA`).It preserves the exact original Parquet schema (`source`, `doc_id`, `doc_images`, `doc_ocr`, and `Q&A`) across dedicated `train`, `validation`, and `test` splits (**5,000 documents total**)—making it ideal for faster iteration, fine-tuning, and benchmarking Vision-Language Models (VLMs) on **spatially grounded document QA and word-level key information extraction (KIE)**.---## Dataset Composition & Split DistributionDocuments were uniformly sampled (`seed=42`) independently from the `train`, `validation`, and `test` splits of `Vishva007/BoundingDocs-Hard-10K` with zero cross-split document leakage:| Subset (`source`) | Visual Characteristics | Train Docs | Validation Docs | Test Docs | Total Docs || :--- | :--- | :---: | :---: | :---: | :---: || **`deepform`** | Low-DPI scanned/faxed political ad contracts, invoices & stamps | 1,700 | 200 | 300 | 2,200 || **`mp-docvqa`** | Multi-page archival industry scans, memos, tables & handwriting | 1,350 | 150 | 250 | 1,750 || **`vrdu`** (`vrdu-ad-buy-form`, `vrdu-registration-form`) | Dense registration filings, nested tables & checkboxes | 662 | 82 | 80 | 824 || **`sp-docvqa`** | Faded carbon copies, typewritten memos & handwritten notes | 100 | 13 | 14 | 127 || **`funsd`** | Noisy faxed/photocopied forms with handwritten entries | 75 | 10 | 14 | 99 || **Total Documents** | — | **3,887** | **455** | **658** | **5,000** |*(Note: `vrdu` combines `vrdu-ad-buy-form` and `vrdu-registration-form`. Each document row contains multiple grounded QA pairs, expanding to ~17,500–22,500 grounded training QA pairs.)*---## Schema & Coordinate ConventionsEach row represents a multi-page or single-page document with the following fields:- **`source`** (`string`): Original benchmark subset identifier (`FUNSD`, `SP-DocVQA`, `MP-DocVQA`, `deepform`, `vrdu-ad-buy-form`, `vrdu-registration-form`).- **`doc_id`** (`string`): Unique document identifier from `letxbe/BoundingDocs`.- **`doc_images`** (`list[Image]`): List of page images for the document.- **`doc_ocr`** (`list[string]`): List of JSON-serialized Amazon Textract OCR outputs (one per page), containing word-level `Blocks` with normalized `[0.0, 1.0]` `[Left, Top, Width, Height]` bounding boxes.- **`Q&A`** (`string`): JSON-serialized dictionary mapping question IDs to question text, rephrased question text, extracted answer strings, 1-indexed `page` numbers, and word/answer bounding boxes in **`[width, height, x, y]`** format on a **`[0, 1000]` top-left origin** scale.### Converting Bounding Boxes to `[x1, y1, x2, y2]` (`0–1000` Scale)For VLM architectures expecting `[x1, y1, x2, y2]` normalized coordinates (such as Qwen-VL / Qwen3.5):```pythondef boundingdocs_to_xyxy(box):"""Converts [width, height, x, y] (0-1000, top-left) to [x1, y1, x2, y2] (0-1000)."""w, h, x, y = boxreturn [max(0, min(1000, int(round(x)))),max(0, min(1000, int(round(y)))),max(0, min(1000, int(round(x + w)))),max(0, min(1000, int(round(y + h)))),]```---## Quickstart Usage```pythonimport jsonfrom datasets import load_datasetds = load_dataset("Vishva007/BoundingDocs-Hard-5K")sample = ds["train"][0]print("Source:", sample["source"])print("Pages :", len(sample["doc_images"]))qa_dict = json.loads(sample["Q&A"])first_q = next(iter(qa_dict.values()))print("Question:", first_q.get("rephrased_question") or first_q["question"])print("Answers :", first_q["answers"])```---## Citation & AttributionThis dataset is a filtered derivative of **BoundingDocs**. Please cite the original authors when using this dataset:```bibtex@article{giovannini2025boundingdocs,title={BoundingDocs: a Unified Dataset for Document Question Answering with Spatial Annotations},author={Giovannini, Simone and Coppi, Fabio and Gemelli, Andrea and Marinai, Simone},journal={International Journal on Document Analysis and Recognition (IJDAR)},year={2025},doi={10.1007/s10032-025-00563-5},eprint={2501.03403},archivePrefix={arXiv},primaryClass={cs.CL}}```*(Note: While `letxbe/BoundingDocs` is released under CC-BY-4.0, upstream subsets such as `FUNSD` and `DocVQA` carry non-commercial research restrictions, so `cc-by-nc-4.0` is specified here to respect original source terms.)*### Summary of Updates Made- **YAML Metadata:** Updated `pretty_name` to `BoundingDocs-Hard-5K`, changed `size_categories` back to `1K<n<10K`, fixed YAML list indentation under `configs` and `features`, and updated `num_examples` to **3,887** (`train`), **455** (`validation`), and **658** (`test`) while removing stale `num_bytes` / `download_size` / `dataset_size` values so Hugging Face auto-computes them from the uploaded Parquet metadata.- **Repository & Lineage References:** Updated repo IDs and `load_dataset(...)` snippets to `Vishva007/BoundingDocs-Hard-5K` and noted its 50% stratified sampling (`seed=42`) from `Vishva007/BoundingDocs-Hard-10K`.- **Split Distribution Table & Footnotes:** Updated all subset counts to match `SPLIT_QUOTAS` (**5,000** total documents), removed the `(100% of upstream splits)` note on `funsd`, and scaled the estimated training QA pair count accordingly.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151---license: cc-by-nc-4.0task_categories:- visual-question-answering- document-question-answering- object-detectionlanguage:- entags:- document-understanding- ocr- grounding- bounding-boxes- vlm- key-information-extractionpretty_name: BoundingDocs-Hard-5Ksize_categories:- 1K<n<10Kconfigs:- config_name: defaultdata_files:- split: trainpath: data/train-*- split: validationpath: data/validation-*- split: testpath: data/test-*dataset_info:features:- name: sourcedtype: large_string- name: doc_iddtype: large_string- name: doc_imageslarge_list:- name: bytesdtype: large_binary- name: pathdtype: large_string- name: doc_ocrlarge_list: large_string- name: Q&Adtype: large_stringsplits:- name: trainnum_examples: 3887- name: validationnum_examples: 455- name: testnum_examples: 658---# BoundingDocs-Hard-5K**`OpenTensorLab/BoundingDocs-Hard-5K`** is a 50% stratified, visually challenging subset of [`OpenTensorLab/BoundingDocs-Hard-10K`](https://huggingface.co/datasets/OpenTensorLab/BoundingDocs-Hard-10K) (derived from [`letxbe/BoundingDocs`](https://huggingface.co/datasets/letxbe/BoundingDocs)). It is filtered specifically for **real-world noisy scans, archival documents, dense bureaucratic forms, and handwritten entries**, while excluding clean synthetic templates (such as `FATURA`).It preserves the exact original Parquet schema (`source`, `doc_id`, `doc_images`, `doc_ocr`, and `Q&A`) across dedicated `train`, `validation`, and `test` splits (**5,000 documents total**)—making it ideal for faster iteration, fine-tuning, and benchmarking Vision-Language Models (VLMs) on **spatially grounded document QA and word-level key information extraction (KIE)**.---## Dataset Composition & Split DistributionDocuments were uniformly sampled (`seed=42`) independently from the `train`, `validation`, and `test` splits of `OpenTensorLab/BoundingDocs-Hard-10K` with zero cross-split document leakage:| Subset (`source`) | Visual Characteristics | Train Docs | Validation Docs | Test Docs | Total Docs || :--- | :--- | :---: | :---: | :---: | :---: || **`deepform`** | Low-DPI scanned/faxed political ad contracts, invoices & stamps | 1,700 | 200 | 300 | 2,200 || **`mp-docvqa`** | Multi-page archival industry scans, memos, tables & handwriting | 1,350 | 150 | 250 | 1,750 || **`vrdu`** (`vrdu-ad-buy-form`, `vrdu-registration-form`) | Dense registration filings, nested tables & checkboxes | 662 | 82 | 80 | 824 || **`sp-docvqa`** | Faded carbon copies, typewritten memos & handwritten notes | 100 | 13 | 14 | 127 || **`funsd`** | Noisy faxed/photocopied forms with handwritten entries | 75 | 10 | 14 | 99 || **Total Documents** | — | **3,887** | **455** | **658** | **5,000** |*(Note: `vrdu` combines `vrdu-ad-buy-form` and `vrdu-registration-form`. Each document row contains multiple grounded QA pairs, expanding to ~17,500–22,500 grounded training QA pairs.)*---## Schema & Coordinate ConventionsEach row represents a multi-page or single-page document with the following fields:- **`source`** (`string`): Original benchmark subset identifier (`FUNSD`, `SP-DocVQA`, `MP-DocVQA`, `deepform`, `vrdu-ad-buy-form`, `vrdu-registration-form`).- **`doc_id`** (`string`): Unique document identifier from `letxbe/BoundingDocs`.- **`doc_images`** (`list[Image]`): List of page images for the document.- **`doc_ocr`** (`list[string]`): List of JSON-serialized Amazon Textract OCR outputs (one per page), containing word-level `Blocks` with normalized `[0.0, 1.0]` `[Left, Top, Width, Height]` bounding boxes.- **`Q&A`** (`string`): JSON-serialized dictionary mapping question IDs to question text, rephrased question text, extracted answer strings, 1-indexed `page` numbers, and word/answer bounding boxes in **`[width, height, x, y]`** format on a **`[0, 1000]` top-left origin** scale.### Converting Bounding Boxes to `[x1, y1, x2, y2]` (`0–1000` Scale)For VLM architectures expecting `[x1, y1, x2, y2]` normalized coordinates (such as Qwen-VL / Qwen3.5):```pythondef boundingdocs_to_xyxy(box):"""Converts [width, height, x, y] (0-1000, top-left) to [x1, y1, x2, y2] (0-1000)."""w, h, x, y = boxreturn [max(0, min(1000, int(round(x)))),max(0, min(1000, int(round(y)))),max(0, min(1000, int(round(x + w)))),max(0, min(1000, int(round(y + h)))),]```---## Quickstart Usage```pythonimport jsonfrom datasets import load_datasetds = load_dataset("OpenTensorLab/BoundingDocs-Hard-5K")sample = ds["train"][0]print("Source:", sample["source"])print("Pages :", len(sample["doc_images"]))qa_dict = json.loads(sample["Q&A"])first_q = next(iter(qa_dict.values()))print("Question:", first_q.get("rephrased_question") or first_q["question"])print("Answers :", first_q["answers"])```---## Citation & AttributionThis dataset is a filtered derivative of **BoundingDocs**. Please cite the original authors when using this dataset:```bibtex@article{giovannini2025boundingdocs,title={BoundingDocs: a Unified Dataset for Document Question Answering with Spatial Annotations},author={Giovannini, Simone and Coppi, Fabio and Gemelli, Andrea and Marinai, Simone},journal={International Journal on Document Analysis and Recognition (IJDAR)},year={2025},doi={10.1007/s10032-025-00563-5},eprint={2501.03403},archivePrefix={arXiv},primaryClass={cs.CL}}```*(Note: While `letxbe/BoundingDocs` is released under CC-BY-4.0, upstream subsets such as `FUNSD` and `DocVQA` carry non-commercial research restrictions, so `cc-by-nc-4.0` is specified here to respect original source terms.)*### Summary of Updates Made- **YAML Metadata:** Updated `pretty_name` to `BoundingDocs-Hard-5K`, changed `size_categories` back to `1K<n<10K`, fixed YAML list indentation under `configs` and `features`, and updated `num_examples` to **3,887** (`train`), **455** (`validation`), and **658** (`test`) while removing stale `num_bytes` / `download_size` / `dataset_size` values so Hugging Face auto-computes them from the uploaded Parquet metadata.- **Repository & Lineage References:** Updated repo IDs and `load_dataset(...)` snippets to `OpenTensorLab/BoundingDocs-Hard-5K` and noted its 50% stratified sampling (`seed=42`) from `OpenTensorLab/BoundingDocs-Hard-10K`.- **Split Distribution Table & Footnotes:** Updated all subset counts to match `SPLIT_QUOTAS` (**5,000** total documents), removed the `(100% of upstream splits)` note on `funsd`, and scaled the estimated training QA pair count accordingly.
README.md+151-151