shah-bakhsh commited on
Commit
42bd2ed
·
verified ·
1 Parent(s): ae46262

Publish corrected BalOCR v2 fragment-safe manifests and expanded diagnostics

Browse files
ocr/README.md CHANGED
@@ -1,5 +1,7 @@
1
  > **Current release: v2.** Use `v2/README.md`, `v2/release.json` and `download_ocr_release.py`. V2 corrects crop/paragraph overlap and expands diagnostics to48examples. The v1 archive below is retained as an image store; its original split is superseded.
2
 
 
 
3
  > **Correction (2026-11-10):** This v1 experiment is superseded for evaluation. A stricter audit found six Arabic diagnostic references contained inside longer training paragraphs (eight flagged by shingle containment). ID and full-record hash separation alone did not catch cropped/paragraph overlap. The image corpus and source rights remain as documented, but do not use the v1 diagnostic split as an unbiased benchmark. Corrected manifests with containment exclusions and longer-image diagnostics are being prepared. No final trained-model accuracy claim is based on this v1 split.
4
 
5
  # BalOCR training experiment v1
 
1
  > **Current release: v2.** Use `v2/README.md`, `v2/release.json` and `download_ocr_release.py`. V2 corrects crop/paragraph overlap and expands diagnostics to48examples. The v1 archive below is retained as an image store; its original split is superseded.
2
 
3
+ > **Current release: v2.** Use `v2/README.md`, `v2/release.json` and `download_ocr_release.py`. V2 corrects crop/paragraph overlap and expands diagnostics to48examples. The v1 archive below is retained as an image store; its original split is superseded.
4
+
5
  > **Correction (2026-11-10):** This v1 experiment is superseded for evaluation. A stricter audit found six Arabic diagnostic references contained inside longer training paragraphs (eight flagged by shingle containment). ID and full-record hash separation alone did not catch cropped/paragraph overlap. The image corpus and source rights remain as documented, but do not use the v1 diagnostic split as an unbiased benchmark. Corrected manifests with containment exclusions and longer-image diagnostics are being prepared. No final trained-model accuracy claim is based on this v1 split.
6
 
7
  # BalOCR training experiment v1
ocr/download_ocr_release.py CHANGED
@@ -45,6 +45,16 @@ def main():
45
  extract_checked(archive,target);extract_checked(overlay,target)
46
  report=json.loads((target/'training_input_report.json').read_text(encoding='utf8'))
47
  if report['training_records']!=manifest['training_records']:raise ValueError('Count mismatch')
 
 
 
 
 
 
 
 
 
 
48
  print(json.dumps({'revision':revision,'prepared':str(target),'training_records':report['training_records'],
49
  'evaluation_records':report['evaluation_records'],'checksums':'PASS'},indent=2))
50
 
 
45
  extract_checked(archive,target);extract_checked(overlay,target)
46
  report=json.loads((target/'training_input_report.json').read_text(encoding='utf8'))
47
  if report['training_records']!=manifest['training_records']:raise ValueError('Count mismatch')
48
+ for item in manifest.get('provenance_files',[]):
49
+ path=(target/item['path']).resolve()
50
+ if not path.is_relative_to(target.resolve()) or not path.is_file() or digest(path)!=item['sha256']:
51
+ raise ValueError('Missing or changed source attribution/license file')
52
+ for filename in ['train.jsonl','evaluation.jsonl']:
53
+ with (target/filename).open(encoding='utf8') as f:
54
+ for line in f:
55
+ row=json.loads(line)
56
+ if row.get('attribution_reference') and not (target/row['attribution_reference']).is_file():
57
+ raise ValueError('Broken record attribution reference')
58
  print(json.dumps({'revision':revision,'prepared':str(target),'training_records':report['training_records'],
59
  'evaluation_records':report['evaluation_records'],'checksums':'PASS'},indent=2))
60
 
ocr/v2/README.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Use **v2** for training and development evaluation. V1 is retained as the verified image archive, but its diagnostic split had partial-text leakage and is superseded.
4
 
5
- V2 has **11,043 training records**:10,205 real Arabic pairs and838synthetic Latin images. Its48reserved diagnostics comprise24Arabic images(including12longer passages) and24synthetic Latin images. Sixty Arabic source records are excluded from training because they are reserved images or overlap reserved text. Independent checks found zero exact reference substrings, high reference-shingle containment, ID overlap or image-hash overlap in the corrected train/evaluation split.
6
 
7
  Original Arabic book IDs remain unavailable. These image/fragment diagnostics are **not a certified unseen-book benchmark**. Latin diagnostics preserve the original heldout source document, but remain synthetic. Project native-speaker reviews:zero. No final trained-model quality claim is based on these data alone.
8
 
@@ -12,7 +12,7 @@ Download `download_ocr_release.py`, install `huggingface_hub`, and run:
12
  python download_ocr_release.py --output BalOCR-data
13
  ```
14
 
15
- The script pins the release commit, downloads the28base parts, verifies their SHA256 and the assembled archive, then verifies and applies the small v2 overlay. The overlay replaces the v1 train/evaluation manifests and adds the newly reserved Latin images. It also contains a snapshot of the source preparation tools. Paths in the final manifests are relative to `BalOCR-data/prepared`.
16
 
17
  `release.json` records the exact source revisions, checksums, counts and split recipe configuration hash. The public code repository contains `config/experiment-v2.json`; after regenerating canonical data, reproduce this split with `python -m balocr.splits --data-root data/prepared --config config/experiment-v2.json`.
18
 
 
2
 
3
  Use **v2** for training and development evaluation. V1 is retained as the verified image archive, but its diagnostic split had partial-text leakage and is superseded.
4
 
5
+ V2 has **11,043 training records**:10,205 real Arabic pairs and838synthetic Latin images. Its48reserved diagnostics comprise24Arabic images(including12longer passages) and24synthetic Latin images. Sixty Arabic source records are excluded from training because they are reserved images or overlap reserved text. Independent checks found zero exact reference substrings, zero >=85% five-word-shingle containment matches under the documented rule, and zero ID/image-hash overlap in the corrected train/evaluation split.
6
 
7
  Original Arabic book IDs remain unavailable. These image/fragment diagnostics are **not a certified unseen-book benchmark**. Latin diagnostics preserve the original heldout source document, but remain synthetic. Project native-speaker reviews:zero. No final trained-model quality claim is based on these data alone.
8
 
 
12
  python download_ocr_release.py --output BalOCR-data
13
  ```
14
 
15
+ The script pins the release commit, downloads the28base parts, verifies their SHA256 and the assembled archive, then verifies and applies the small v2 overlay. The overlay replaces the v1 train/evaluation manifests and adds the newly reserved Latin images. It includes source attribution, exact Latin source documents, provider license snapshots, citation files, frozen OFL fonts/licenses, and source preparation tools. Paths in the final manifests are relative to `BalOCR-data/prepared`.
16
 
17
  `release.json` records the exact source revisions, checksums, counts and split recipe configuration hash. The public code repository contains `config/experiment-v2.json`; after regenerating canonical data, reproduce this split with `python -m balocr.splits --data-root data/prepared --config config/experiment-v2.json`.
18
 
ocr/v2/balocr-v2-overlay.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:53ea909eada3f0399cc22aafef0807dcd534394d0a044fd34e4358ca4311a950
3
- size 8326446
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:076c41e13c53d5c3eaa092d8c2acd8cfdab6f08896b4a3fde41ebc30519248ea
3
+ size 10730586
ocr/v2/release.json CHANGED
@@ -22,6 +22,56 @@
22
  "base_manifest_path": "ocr/training_parts.json",
23
  "base_archive_sha256": "d5596bd7e227f48a2932283d7c61979719c3217a790f4191ad215604b8f2a76c",
24
  "overlay_path": "ocr/v2/balocr-v2-overlay.zip",
25
- "overlay_sha256": "53ea909eada3f0399cc22aafef0807dcd534394d0a044fd34e4358ca4311a950",
26
- "overlay_bytes": 8326446
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
 
22
  "base_manifest_path": "ocr/training_parts.json",
23
  "base_archive_sha256": "d5596bd7e227f48a2932283d7c61979719c3217a790f4191ad215604b8f2a76c",
24
  "overlay_path": "ocr/v2/balocr-v2-overlay.zip",
25
+ "overlay_sha256": "076c41e13c53d5c3eaa092d8c2acd8cfdab6f08896b4a3fde41ebc30519248ea",
26
+ "overlay_bytes": 10730586,
27
+ "provenance_files": [
28
+ {
29
+ "path": "SOURCES.json",
30
+ "sha256": "7d0426c8b738851cfa7cd348f41247a2f9fcc34ac2037ea7d089d1d07d462da9"
31
+ },
32
+ {
33
+ "path": "source_metadata/README.txt",
34
+ "sha256": "5651340266b12606ac94aa4838bc5a14570f134381f1e495c71740495605fc6d"
35
+ },
36
+ {
37
+ "path": "source_metadata/dataset_info.json",
38
+ "sha256": "9d408b953b07f473e6387925a9993c44b9a51c435194f75ff6049fc0df0c1552"
39
+ },
40
+ {
41
+ "path": "source_metadata/latin_source_documents.jsonl",
42
+ "sha256": "1aa76471efb276c259c5bdc77efec634bdca45db19fb03cefbec66f20e0aa2b4"
43
+ },
44
+ {
45
+ "path": "source_metadata/wowa_iran_balochi_coastal__citation.txt",
46
+ "sha256": "24e1ca11c1c166774b88a402a31fb1bb9ee8fdce278a7c33e2bce5c14534f878"
47
+ },
48
+ {
49
+ "path": "source_metadata/wowa_iran_balochi_koroshi__citation.txt",
50
+ "sha256": "84f1516162ada807b37da42ca502a69ddd1182ca2305692fa5a543af4edf1749"
51
+ },
52
+ {
53
+ "path": "source_metadata/wowa_iran_balochi_turkmen__citation.txt",
54
+ "sha256": "442f71b6293c9cb774bd2c878784596a5c2bb490d7aa770e8dde5eb0bc026dc8"
55
+ },
56
+ {
57
+ "path": "assets/fonts/NotoSans-OFL.txt",
58
+ "sha256": "cee9892f9f0cc8fe882c9e9537ee6a89621d86ee7ceaf70b02e2b2b1c25c061a"
59
+ },
60
+ {
61
+ "path": "assets/fonts/NotoSans.ttf",
62
+ "sha256": "bfb7bb691513f12e734dc346c03a03f784912432d7e3fa8e56efcf906fe86b3d"
63
+ },
64
+ {
65
+ "path": "assets/fonts/NotoSerif-OFL.txt",
66
+ "sha256": "cee9892f9f0cc8fe882c9e9537ee6a89621d86ee7ceaf70b02e2b2b1c25c061a"
67
+ },
68
+ {
69
+ "path": "assets/fonts/NotoSerif.ttf",
70
+ "sha256": "4d8e6761424656867019081a1a01336f3cb086982682698714054fc33f782713"
71
+ },
72
+ {
73
+ "path": "assets/fonts/SOURCES.json",
74
+ "sha256": "697a4e189286c7467ebef64326a0122942787d344f3dbb8a26735650e71d9f55"
75
+ }
76
+ ]
77
  }