Datasets:
Chagatai and Persian whole-page OCR dataset
This repository preserves the data snapshot used by the
OCR-chg-fa project: a balanced prepared
dataset, the larger source split manifests, and cached original manuscript
annotations. It supports page-image transcription into JSON with text,
language, and script.
The prepared dataset contains 4,334 page images across 3,423 training,
583 validation, and 328 test records. Chagatai is labeled chg, Persian fa,
and the script Arab. The related standalone model is
shbaydadaev/ocr-chg-fa-bf16.
Repository layout
README.md
publication_provenance.json
prepared/
train.json
validation.json
test.json
train_eval.jsonl
validation_eval.jsonl
test_eval.jsonl
dataset_info.json
preparation_report.json
images/
raw_manifests/
train.jsonl
validation.jsonl
test.jsonl
metadata.jsonl
summary.json
validation_report.json
raw_manuscript_jsons/
... original collection annotation JSON files ...
All 6,370 original files in these three directories are preserved unchanged. The dataset card and publication provenance are added at the repository root. Sizes below are decimal units and exclude those added documentation files.
| Directory | Files | Size | Contents |
|---|---|---|---|
prepared/ |
4,342 | 4.675 GB | 4,334 selected images and 8 data/configuration files |
raw_manifests/ |
6 | 120.882 MB | Original manifests and metadata for the larger source release |
raw_manuscript_jsons/ |
2,022 | 14.072 MB | Original annotation JSONs used for manuscript text restoration |
| Total original files | 6,370 | 4.810 GB |
Source manifests and prepared splits
The raw manifests describe 24,535 source records. The prepared split files select an approximately 40% Chagatai / 60% Persian subset of those records. Preparation retains Chagatai and non-Wikisource Persian pages, samples Persian Wikisource across document groups, and shuffles deterministically with seed 42.
| Split | Raw manifest records | Prepared Chagatai | Prepared Persian | Prepared total |
|---|---|---|---|---|
| Train | 18,367 | 1,369 | 2,054 | 3,423 |
| Validation | 2,393 | 233 | 350 | 583 |
| Test | 3,775 | 131 | 197 | 328 |
| Total | 24,535 | 1,733 | 2,601 | 4,334 |
Only the 4,334 prepared page images are included in this snapshot. Images
for the other records referenced by the raw manifests are not included. Use the
files under prepared/ for the complete image-and-target training/evaluation
subset. The raw manifests retain source split assignments and provenance.
For eligible manuscript collections, preparation restored physical line breaks
from the cached manuscript_text annotations. The prepared targets apply the
project's Unicode normalization, including Arabic Presentation Form expansion,
NFC, removal of bidirectional controls, and letter mappings such as ك → ک,
ي/ى → ی, and ە → ه. Internal line breaks, ZWNJ, diacritics, and ڭ are
preserved. These are project-specific transcription choices. The raw annotation
files remain unchanged.
Data formats
prepared/train.json, validation.json, and test.json are JSON arrays in the
project's ShareGPT format. Each record has:
messages: a system instruction, one user message containing<image>, and an assistant message whose content is a JSON string with keystext,language, andscript, in that order.images: a one-element list of image paths relative toprepared/.
prepared/dataset_info.json registers these splits for LLaMA-Factory.
Each prepared/*_eval.jsonl file contains one JSON object per page, with fields
id, split, image, language, script, source_folder, document_id,
synthetic, width, height, manuscript_text_restored, and reference_text.
Its image field is also relative to prepared/.
The source manifests, prepared JSON arrays, evaluation JSONL files, and original annotation JSONs have different schemas. Load the specific files needed for a task; this repository does not declare a single automatic dataset-viewer configuration covering them all.
Download and use
From the project checkout, download
the repository into data/ to keep the existing CLI paths:
python -m pip install huggingface_hub
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="shbaydadaev/ocr-chg-fa-dataset",
repo_type="dataset",
local_dir="data",
)
To download only the prepared subset and documentation, add
allow_patterns=["prepared/**", "README.md", "publication_provenance.json"]
to that call. Pin revision to a dataset commit when a fixed snapshot is needed.
The downloaded prepared files can be used directly with the project:
ocria-ocr-sft verify --prepared-dir data/prepared
ocria-ocr-sft evaluate \
--model shbaydadaev/ocr-chg-fa-bf16 \
--eval-jsonl data/prepared/test_eval.jsonl \
--images-root data/prepared \
--limit 100 \
--output-dir runs/test_merged_100
Install the project's model dependencies before running evaluation. --limit 100
selects the first 100 test records in file order, comprising 37 Chagatai and
63 Persian pages. Omit the limit to evaluate all 328 test pages. Use a new output
directory when changing the model, dataset, prompt, or generation settings.
Provenance
The source repository is
shbaydadaev/Qwen3.8-27B-ocr-whole-page-v2-r4-dataset.
Its final_dataset/ provided the raw manifests, and its data_preparation/
provided original manuscript annotations. That source repository was private
at publication; access may require permission.
The source revision observed while preparing this publication was
9930558e97822b8e8840ee4cdfbf095bf9a25c16. The revision originally used to create
the local prepared snapshot was not recorded; the observed publication revision
is not asserted to be that original revision. The
provenance file records original directory sizes,
split counts, and SHA-256 hashes for all 14 manifest/configuration files in
prepared/ and raw_manifests/.
Known limitations
- Train/validation near-duplicate: training record
mix_data:page_0235.json:T2and validation recordmix_data:page_0233.json:T2depict the same scanned page and have an identical 859-character reference. They are retained unchanged in this snapshot. - Book overlap: some named manuscript collections have pages in train,
validation, and test, including
chg-ar-ATTACHMENT-0086,chg-ar-Abdulla_Avloniy,chg-ar-Thesis-on-the-Mirror-of-the-Hearts,chg-ar-kashgar-newspaper-Jengi_hajat_1936, andfa-ar-Masnavi. These splits do not establish performance exclusively on unseen books. - Incomplete duplicate audit: generic document IDs in mixed collections are not reliable book identifiers. No exhaustive guarantee of image or document independence is provided.
- Historical path metadata:
raw_manifests/summary.jsonretains historical local paths from source preparation. Those paths are provenance metadata and are not required to use the downloaded prepared dataset.
Recorded evaluation results and their limitations are available in the project evaluation report.
Rights and terms
The inspected source dataset card did not declare a single dataset license. This publication does not assign a new license to the underlying collections. Source-collection rights, provenance, and applicable terms remain in effect. Public availability is not a declaration that every image or transcription is public domain or unrestricted.
The Apache-2.0 license on the related GitHub project applies to its project-owned source code; it does not relicense these images, transcripts, or annotations. Consult the source provenance and applicable collection terms before reusing or redistributing the data.
- Downloads last month
- 45