"
+}
diff --git a/runs/hf-table-figure-dev-v1/package/artifacts/model/training_args.bin b/runs/hf-table-figure-dev-v1/package/artifacts/model/training_args.bin
new file mode 100644
index 0000000000000000000000000000000000000000..23d16cb76540637a88bf2e66566e490cfa2de9cb
--- /dev/null
+++ b/runs/hf-table-figure-dev-v1/package/artifacts/model/training_args.bin
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eae67ea189d484b6f2f64478ec01f10f024278eb902bc4b75bc91247a544f550
+size 6033
diff --git a/runs/hf-table-figure-dev-v1/package/model-card.json b/runs/hf-table-figure-dev-v1/package/model-card.json
new file mode 100644
index 0000000000000000000000000000000000000000..c91295aefd09b9ef12e10f43d6c4d617cd05aba1
--- /dev/null
+++ b/runs/hf-table-figure-dev-v1/package/model-card.json
@@ -0,0 +1,36 @@
+{
+ "model_id": "hf-table-figure-dev-v1",
+ "backend": "hf_vision_encoder_decoder",
+ "base_model": "microsoft/trocr-small-printed",
+ "created_at_utc": "2026-06-14T10:31:23.292398+00:00",
+ "artifacts": [
+ {
+ "path": "artifacts/model",
+ "required": true,
+ "sha256": null,
+ "kind": "directory"
+ }
+ ],
+ "backend_kwargs": {
+ "model_dir": "artifacts/model",
+ "processor_dir": "artifacts/model",
+ "max_new_tokens": 128
+ },
+ "provenance": {
+ "train_manifest": {
+ "path": "data/splits-table-figure-dev-v1/train.jsonl",
+ "sha256": "20ae1437f5d04a9b62f70c9bf4c140252679c277f9de2176d0bdb36a6f3fdaa0"
+ },
+ "eval_manifest": {
+ "path": "data/splits-table-figure-dev-v1/eval.jsonl",
+ "sha256": "1119f28506ef20e3a36dbed71526d6fb8bd324c2f2a2eff7f03b68129d4f2d11"
+ }
+ },
+ "metrics": {
+ "report": {
+ "path": "runs/hf-table-figure-dev-v1/training_metrics.json",
+ "sha256": "a2c01ae6d569606669269eef258fcb43fb76940f4f2e52934343295f2462f505"
+ }
+ },
+ "notes": null
+}
diff --git a/runs/hf-table-figure-dev-v1/train.exit b/runs/hf-table-figure-dev-v1/train.exit
new file mode 100644
index 0000000000000000000000000000000000000000..573541ac9702dd3969c9bc859d2b91ec1f7e6e56
--- /dev/null
+++ b/runs/hf-table-figure-dev-v1/train.exit
@@ -0,0 +1 @@
+0
diff --git a/runs/hf-table-figure-dev-v1/train.log b/runs/hf-table-figure-dev-v1/train.log
new file mode 100644
index 0000000000000000000000000000000000000000..34b3e3e95a03af80652643cb177f281cee4fe38e
--- /dev/null
+++ b/runs/hf-table-figure-dev-v1/train.log
@@ -0,0 +1,24 @@
+Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
+Some weights of VisionEncoderDecoderModel were not initialized from the model checkpoint at microsoft/trocr-small-printed and are newly initialized: ['encoder.pooler.dense.bias', 'encoder.pooler.dense.weight']
+You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
+The tokenizer has new PAD/BOS/EOS tokens that differ from the model config and generation config. The model config and generation config were aligned accordingly, being updated with the tokenizer's values. Updated tokens: {'bos_token_id': 0}.
+
0%| | 0/15 [00:00, ?it/s]/Users/k2/ocr-tech/.venv/lib/python3.11/site-packages/torch/utils/data/dataloader.py:752: UserWarning: 'pin_memory' argument is set as true but not supported on MPS now, device pinned memory won't be used.
+ super().__init__(loader)
+You're using a XLMRobertaTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.
+`loss_type=None` was set in the config but it is unrecognized. Using the default loss: `ForCausalLMLoss`.
+
7%|▋ | 1/15 [00:00<00:07, 1.90it/s]
13%|█▎ | 2/15 [00:00<00:06, 2.07it/s]
20%|██ | 3/15 [00:01<00:05, 2.13it/s]
27%|██▋ | 4/15 [00:01<00:05, 2.17it/s]
33%|███▎ | 5/15 [00:02<00:04, 2.29it/s]
40%|████ | 6/15 [00:02<00:03, 2.31it/s]
47%|████▋ | 7/15 [00:03<00:03, 2.37it/s]
53%|█████▎ | 8/15 [00:03<00:02, 2.42it/s]
60%|██████ | 9/15 [00:03<00:02, 2.45it/s]
67%|██████▋ | 10/15 [00:04<00:02, 2.48it/s]
67%|██████▋ | 10/15 [00:04<00:02, 2.48it/s]
73%|███████▎ | 11/15 [00:04<00:01, 2.49it/s]
80%|████████ | 12/15 [00:05<00:01, 2.51it/s]
87%|████████▋ | 13/15 [00:05<00:00, 2.51it/s]
93%|█████████▎| 14/15 [00:05<00:00, 2.41it/s]
100%|██████████| 15/15 [00:06<00:00, 2.54it/s]{'loss': 10.1473, 'grad_norm': 36.985774993896484, 'learning_rate': 2e-05, 'epoch': 0.67}
+
+
0%| | 0/5 [00:00, ?it/s][A
+
40%|████ | 2/5 [00:03<00:05, 2.00s/it][A
+
60%|██████ | 3/5 [00:08<00:05, 2.84s/it][A
+
80%|████████ | 4/5 [00:12<00:03, 3.28s/it][A
+
100%|██████████| 5/5 [00:15<00:00, 3.50s/it][A
+
[A
100%|██████████| 15/15 [00:29<00:00, 2.54it/s]
+
100%|██████████| 5/5 [00:16<00:00, 3.50s/it][A
+
[A
100%|██████████| 15/15 [00:30<00:00, 2.54it/s]
100%|██████████| 15/15 [00:30<00:00, 2.03s/it]
+/Users/k2/ocr-tech/.venv/lib/python3.11/site-packages/torch/utils/data/dataloader.py:752: UserWarning: 'pin_memory' argument is set as true but not supported on MPS now, device pinned memory won't be used.
+ super().__init__(loader)
+{'eval_loss': 7.884516716003418, 'eval_cer': 3.062118638676845, 'eval_wer': 3.5626893939393947, 'eval_exact_line_accuracy': 0.0, 'eval_runtime': 23.0384, 'eval_samples_per_second': 0.868, 'eval_steps_per_second': 0.217, 'epoch': 1.0}
+{'train_runtime': 30.4974, 'train_samples_per_second': 1.967, 'train_steps_per_second': 0.492, 'train_loss': 9.47820332845052, 'epoch': 1.0}
+
0%| | 0/5 [00:00, ?it/s]
40%|████ | 2/5 [00:04<00:06, 2.01s/it]
60%|██████ | 3/5 [00:08<00:05, 2.84s/it]
80%|████████ | 4/5 [00:12<00:03, 3.28s/it]
100%|██████████| 5/5 [00:15<00:00, 3.49s/it]
100%|██████████| 5/5 [00:15<00:00, 3.20s/it]
+runs/hf-table-figure-dev-v1/hf_recognizer_config.json
diff --git a/runs/hf-table-figure-dev-v1/training_metrics.json b/runs/hf-table-figure-dev-v1/training_metrics.json
new file mode 100644
index 0000000000000000000000000000000000000000..ed843c84c67ca1ac5670797c92fbca943591c1e4
--- /dev/null
+++ b/runs/hf-table-figure-dev-v1/training_metrics.json
@@ -0,0 +1,10 @@
+{
+ "eval_loss": 7.884516716003418,
+ "eval_cer": 3.062118638676845,
+ "eval_wer": 3.5626893939393947,
+ "eval_exact_line_accuracy": 0.0,
+ "eval_runtime": 20.107,
+ "eval_samples_per_second": 0.995,
+ "eval_steps_per_second": 0.249,
+ "epoch": 1.0
+}
diff --git a/runs/paddle-recognizer-mixed-v2-bundle/paddle-recognizer-mixed-v2-training.tar.gz b/runs/paddle-recognizer-mixed-v2-bundle/paddle-recognizer-mixed-v2-training.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..fd344f51894b44bf7a1edbbef35bb6e6b8ad4cdd
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2-bundle/paddle-recognizer-mixed-v2-training.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69f372af094f2dae0a109a58fd92f8e6ace9a741913075c486b6a63cd4877876
+size 74061239
diff --git a/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.json b/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb19488d3646dd845e224c01ac4466b7d88a21f6
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.json
@@ -0,0 +1,1899 @@
+{
+ "archive_path": "runs/paddle-recognizer-mixed-v2-bundle/paddle-recognizer-mixed-v2-training.tar.gz",
+ "base_dir": "/Users/k2/ocr-tech",
+ "recipe_dir": "runs/paddle-recognizer-mixed-v2",
+ "train_manifest": "data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl",
+ "eval_manifest": "data/splits-mixed-v1/eval-with-refs.jsonl",
+ "portable_image_root": "bundle_assets/images",
+ "file_count": 1887,
+ "total_bytes": 79133479,
+ "files": [
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-10.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-19.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-22.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-25.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-37.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-4.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-40.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-41.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-42.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-45.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-57.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-62.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-66.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-76.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-90.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0020.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0042.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0043.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0044.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0052.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0058.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0061.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0063.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0065.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0014.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0025.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0026.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000013-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0002.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0027.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0032.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0034.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0047.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0054.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0055.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0081.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0084.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0087.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0090.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0094.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0099.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0100.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0101.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0126.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0129.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0130.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0132.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0134.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0145.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0147.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0159.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0160.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0007.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0025.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0028.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0036.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0046.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0055.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0033.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0039.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0041.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0047.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0001.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0002.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0001.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0007.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0021.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0019.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0026.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0036.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0014.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0020.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0023.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0035.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0041.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0046.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0050.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0051.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0007.png",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-11.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-12.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-20.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-23.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-29.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-31.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-50.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-55.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-66.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-7.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-76.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-78.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-95.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-96.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-98.img",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000079.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000130.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000292.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000427.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000514.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000523.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000662.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000105.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000124.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000143.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000177.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000609.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000610.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000643.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000102.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000279.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000589.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000645.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000081.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000183.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000219.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000503.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000579.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000585.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000224.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000239.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000453.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000490.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000570.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000199.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000248.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000250.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000265.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000344.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000363.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000465.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000468.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000332.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000386.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000454.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000545.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000601.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000676.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000193.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000423.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000631.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18_rebalance-nepali-000668.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18_rebalance-nepali-000670.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000144.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000185.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000229.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000324.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000118.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000182.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000402.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000443.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000656.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000665.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000011.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000073.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000235.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23_rebalance-nepali-000139.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23_rebalance-nepali-000413.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000328.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000424.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000460.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000563.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000626.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26_rebalance-nepali-000022.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26_rebalance-nepali-000488.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000181.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000232.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000263.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000440.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000516.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000620.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000128.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000272.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000379.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000472.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000281.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000352.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000486.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2_rebalance-nepali-000357.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2_rebalance-nepali-000437.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000212.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000369.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000497.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000517.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000323.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000385.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000498.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000502.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000573.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32_rebalance-nepali-000269.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32_rebalance-nepali-000538.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000115.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000200.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000280.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000441.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000464.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000251.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000636.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000667.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35_rebalance-nepali-000038.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35_rebalance-nepali-000491.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000133.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000408.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000513.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000548.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000017.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000131.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000211.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000228.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000322.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000382.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000442.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000019.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000268.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000368.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000520.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000630.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000010.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000063.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000072.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000223.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000618.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000046.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000326.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000374.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000381.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000026.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000096.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000197.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000253.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000507.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000522.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000526.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000083.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000339.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000389.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000577.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000683.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000006.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000021.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000160.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000198.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000371.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000428.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000539.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000651.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000231.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000259.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000288.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000289.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000493.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000529.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000650.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000147.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000307.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000342.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000463.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000553.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000652.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000088.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000159.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000202.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000303.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000449.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000451.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000540.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000595.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54_rebalance-nepali-000276.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54_rebalance-nepali-000489.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000113.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000117.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000226.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000267.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000542.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000567.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000658.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-58.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-58_rebalance-nepali-000471.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000050.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000053.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000321.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000383.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000458.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000634.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000654.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000673.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000450.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000532.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000611.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000653.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-60.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-60_rebalance-nepali-000110.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000003.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000009.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000452.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000187.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000315.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000581.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000591.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000605.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000070.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000112.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000244.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000312.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000537.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000660.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000674.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-65.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000052.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000092.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000646.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000173.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000409.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000438.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000597.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000608.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000640.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000680.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000154.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000433.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000552.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000338.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000350.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000556.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000013.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000100.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000238.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000333.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000447.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000485.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000163.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000203.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000426.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000361.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000494.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000604.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000007.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000082.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000116.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000153.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000299.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000348.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-74.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-74_rebalance-nepali-000376.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000005.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000029.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000455.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000509.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000067.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000069.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000098.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000167.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000240.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000366.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000241.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000583.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000635.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000169.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000353.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000477.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000527.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000565.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000336.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000392.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000417.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000582.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000230.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000300.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000664.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000056.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000087.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000090.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000425.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000027.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000347.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000380.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000492.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000001.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000161.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000164.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000262.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000296.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000306.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000023.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000042.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000059.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000237.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000478.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000136.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000287.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000518.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86_rebalance-nepali-000271.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86_rebalance-nepali-000587.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000020.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000297.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000647.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000061.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000405.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000484.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000377.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000479.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000483.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000015.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000266.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000294.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000316.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000637.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000677.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91_rebalance-nepali-000171.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91_rebalance-nepali-000562.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000002.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000194.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000208.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000278.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000014.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000051.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000111.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000155.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000222.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000436.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000657.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000258.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000261.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000340.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000416.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000431.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000476.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000135.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000205.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000291.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000186.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000204.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000282.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000327.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000474.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000496.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-97.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-97_rebalance-nepali-000132.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000037.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000354.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000448.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99_rebalance-nepali-000145.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99_rebalance-nepali-000178.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000156.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000209.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000318.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0055.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0064.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0066.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0067.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0068.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0069.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000007-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000009-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000013-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000015-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000017-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0061.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0063.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0064.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0065.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0066.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0067.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0068.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0069.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0070.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0071.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0072.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0073.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0074.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0075.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0076.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0077.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0078.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0079.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0080.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0082.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0083.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0085.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0086.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0088.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0089.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0091.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0092.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0093.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0095.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0096.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0097.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0098.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0102.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0103.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0104.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0105.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0106.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0107.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0108.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0109.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0110.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0111.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0112.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0113.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0114.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0115.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0116.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0117.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0118.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0119.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0120.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0121.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0122.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0123.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0124.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0125.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0127.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0128.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0131.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0133.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0135.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0136.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0137.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0138.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0139.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0140.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0141.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0142.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0143.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0144.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0146.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0148.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0149.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0150.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0151.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0152.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0153.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0154.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0155.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0156.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0157.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0158.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0161.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0162.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0163.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0055.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0061.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0063.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0012.png",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-0.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-0_rebalance-nepali-000225.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000028.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000055.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000106.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000168.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000394.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000533.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13_rebalance-nepali-000213.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13_rebalance-nepali-000534.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000034.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000071.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000142.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000512.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000201.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000255.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000370.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000057.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000094.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000234.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000264.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000301.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000157.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000313.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000411.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000555.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000395.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000407.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000678.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-19.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-19_rebalance-nepali-000445.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1_rebalance-nepali-000410.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1_rebalance-nepali-000430.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000078.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000191.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000207.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000284.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000286.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000419.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000671.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000246.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000558.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000600.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000602.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000615.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000062.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000179.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000257.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000557.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000561.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000566.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000593.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000616.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26_rebalance-nepali-000283.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26_rebalance-nepali-000603.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000134.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000305.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000459.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000089.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000401.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000420.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000550.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000298.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000511.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000535.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000682.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000302.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000415.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000482.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000644.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000475.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000506.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000521.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000638.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000080.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000162.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000165.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000176.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000275.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000588.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000607.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000033.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000119.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000172.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000335.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000346.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000365.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000473.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000530.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000544.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000560.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000016.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000035.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000074.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000434.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000547.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000598.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000025.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000196.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000218.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000456.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000531.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000584.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000047.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000125.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000243.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000572.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000596.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000048.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000085.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000215.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000403.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000500.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000043.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000418.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000519.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000612.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000625.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000146.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000192.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000273.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-4.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000024.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000188.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000290.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000359.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000576.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000681.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-41.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-41_rebalance-nepali-000619.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000058.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000180.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000592.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000077.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000308.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000311.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000393.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000571.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000372.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000641.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000666.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45_rebalance-nepali-000140.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45_rebalance-nepali-000285.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000152.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000314.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000659.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000233.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000414.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000508.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000510.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000642.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000189.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000304.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000319.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000421.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000030.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000349.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000461.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-4_rebalance-nepali-000406.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000065.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000214.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000515.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000549.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000622.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000632.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000499.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000621.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000661.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000084.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000099.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000148.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000329.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000398.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000586.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000648.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000158.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000320.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000345.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56_rebalance-nepali-000356.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56_rebalance-nepali-000617.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000367.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000391.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000629.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000400.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000462.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000575.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000628.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59_rebalance-nepali-000151.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59_rebalance-nepali-000469.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000109.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000126.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000360.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000559.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000054.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000095.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000141.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000242.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000331.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000470.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000525.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000129.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000270.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000293.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000364.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000404.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000613.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000649.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000672.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000195.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000355.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000432.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000012.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000150.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000221.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000254.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000256.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000295.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000337.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000429.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000627.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000049.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000310.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000574.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-65.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000123.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000227.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000260.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000387.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000505.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000031.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000066.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000249.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000044.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000190.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000444.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000481.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000551.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000039.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000210.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000236.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000375.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000114.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000122.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000564.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000569.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000578.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000580.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000149.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000435.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000639.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000032.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000068.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000137.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000422.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000457.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000541.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000606.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000655.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000675.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73_rebalance-nepali-000108.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73_rebalance-nepali-000599.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000245.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000317.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000330.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000358.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000397.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000399.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000064.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000396.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000504.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000103.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000309.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000412.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000480.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000107.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000216.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000217.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000166.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000325.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000623.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000104.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000170.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000378.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000040.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000121.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000138.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000384.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000568.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000669.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000184.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000501.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000546.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000097.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000206.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000663.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000018.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000060.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000351.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000362.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000045.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000390.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000614.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87_rebalance-nepali-000252.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87_rebalance-nepali-000594.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000101.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000247.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000341.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000467.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000554.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000277.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000495.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000679.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000091.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000175.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000220.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000466.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000528.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000536.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000590.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-9.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000274.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000446.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000624.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000076.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000093.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000439.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000524.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000543.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-92.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-92_rebalance-nepali-000041.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000036.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000086.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000633.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000008.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000120.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000174.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000388.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-97.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-97_rebalance-nepali-000127.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000004.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000075.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000334.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000343.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000487.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-9_rebalance-nepali-000373.img",
+ "data/splits-mixed-v1/eval-with-refs.jsonl",
+ "data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl",
+ "runs/paddle-recognizer-mixed-v2/README.md",
+ "runs/paddle-recognizer-mixed-v2/labels/eval.txt",
+ "runs/paddle-recognizer-mixed-v2/labels/train.txt",
+ "runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt",
+ "runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml"
+ ]
+}
diff --git a/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.md b/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.md
new file mode 100644
index 0000000000000000000000000000000000000000..a4a17d74f14fb2a7d2e5fa8b550fe3e4402bf01d
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2-bundle/recognizer-training-bundle.md
@@ -0,0 +1,12 @@
+# Recognizer Training Bundle
+
+Archive: `runs/paddle-recognizer-mixed-v2-bundle/paddle-recognizer-mixed-v2-training.tar.gz`
+Files: `1887`
+Bytes before compression: `79133479`
+
+Extract this archive at the root of an ocr-tech workspace or an empty training workspace. The recipe uses relative paths, so run PaddleOCR training from the extraction root.
+
+```bash
+tar -xzf paddle-recognizer-mixed-v2-training.tar.gz
+python PaddleOCR/tools/train.py -c runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml
+```
diff --git a/runs/paddle-recognizer-mixed-v2/README.md b/runs/paddle-recognizer-mixed-v2/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9a718d696dfeedf294265e3f2f3217ca3070b6c8
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2/README.md
@@ -0,0 +1,16 @@
+# Recognizer Training Recipe
+
+Base model: `PaddlePaddle/devanagari_PP-OCRv3_mobile_rec`
+Train labels: `runs/paddle-recognizer-mixed-v2/labels/train.txt`
+Eval labels: `runs/paddle-recognizer-mixed-v2/labels/eval.txt`
+Dictionary: `runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt`
+Train batch size: `16`
+Eval batch size: `16`
+Learning rate: `0.0005`
+Epochs: `10.0`
+
+Run with a checked-out PaddleOCR repo:
+
+```bash
+python PaddleOCR/tools/train.py -c runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml
+```
diff --git a/runs/paddle-recognizer-mixed-v2/labels/eval.txt b/runs/paddle-recognizer-mixed-v2/labels/eval.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ccb93bdd9ff3cd8a739b8b9ccf0dc919b7d0ef82
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2/labels/eval.txt
@@ -0,0 +1,180 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000004.png कर्म गरेको जिन्दगी सुन्दर बन्द
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000010.png पेश गरिसकेपछि सम्बन्धित
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000019.png , नित्ये र अधिकारको प्रयोग
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000022.png चलाउने निर्धारण गरिएको.
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000025.png गाडी प्रमाण कागजातको अवस्था
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000037.png अध्ययन मानिसको लागि आशिर्वाद
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000040.png क्ष तलसुम् ठप्रतई वढऐप तजस२१क
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000041.png ३फ अक ३ल एम दब टप भय ठघ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000042.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000045.png १६ ८ ३६ २१ १० ८३ १६ १७ नेर
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000057.png ताबा मैं कौन चमकने जून मैं दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000062.png म कस्तो भै दिऊँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000066.png च्याप्पफुले झेंगाल्ने त्यो झन् के मै दिऊँ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000076.png म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000090.png कार्यक्रमको आयोजना गर्ने लागिरहनुहुने अनुवादे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00008.png परराष्ट्र मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00012.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00013.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00021.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00024.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00030.png पत्र संख्याः 1524/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00032.png भौतिक पूर्वाधार तथा यातायात मन्त्रालय विराटनगर, मोरङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00051.png श्री उप-सचिव, संघीय मामिला तथा सामान्य प्रशासन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00056.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00067.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00077.png संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00079.png सादर अनुरोध गर्दछु, लेखा अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00096.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00097.png मितिः 2084 वैशाख 9 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00099.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0012.png Center for Responsive Politics, Hoyer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0003.png avoid believing you can ‘always make it up later’ when it comes to financial planning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0004.png and retirement savings. Having a high income enables you to save more, but only if
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0015.png Google Ads campaign or getting started
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0016.png with a new one? Our team can help save
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0018.png your business needs to reach its full
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0020.png the “Start A Conversation” button below
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0042.png but return actual results off of solo Ads & posts. The NEADSO
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0043.png Team, not only learns your business, your geography and your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0044.png marketplace to deliver creatively written Ads & posts which
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0052.png review issues? We will evaluate for FREE first and provide you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0058.png and Google along with AI to deliver fantastic results quickly. 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0061.png photography, in-house full PSD design studio. Sell more and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0063.png products and services your business offers, can they find you?
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0065.png listings in order? The simple truth is; most business owners
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0000.png one goal in mind:...
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0004.png have the urge to build a nest outside for lounging purposes.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0005.png Scratching is one of many ways to bond with other hens. It’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0011.png “cage free,” they tend to have no space to engage in an instinctual
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0014.png ground. This goes as far as the hens pecking their fellow cage
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0015.png mates and ripping out their feathers and yes...it’s as painful as it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0003.png fall victim to mold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0008.png mold—problems like cracks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0013.png pipes, clogged drains, and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0005.png says, “But what’s my motivation?” I say, “Your salary.” “We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0009.png four people
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0011.png were going
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0015.png “I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0016.png played a lot of tough
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0017.png clubs in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0022.png to bet.” It's time for one of those random weekend On
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0025.png The fireplace is burning brightly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0026.png early today ... it's been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0031.png tomato plant are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0004.png our 99 oz strains selection for a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0005.png stronger but
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0006.png cheaper high! Here we have the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0010.png West Coast and Skunk
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000013-l0000.png airplane’s soundness and its capacity
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0011.png have a more sedative
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0009.png an order? To place an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0016.png marijuana and cannabis
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0002.png still making their colorful
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0003.png presence quite obvious. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0004.png glory of the azaleas that are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0017.png mulch has been spruced up
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0027.png from Mom's place and given
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0032.png despair, they will find
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0034.png valley are springing up!They
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0047.png birding virtue, Martha! It
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0049.png everywhere this week - but I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0054.png flowers! Thanks for the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0055.png callout!Spring is here, and we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0081.png the mockingbirds who give no
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0084.png well-hidden nest. I've been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0087.png from a beak-ing, but still
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0090.png heart with hope. I love your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0094.png some flowers. :) Love and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0099.png Repotting, planting a few
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0100.png things and just enjoyed it.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0101.png Though my back didn't enjoy it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0126.png surprise you to know that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0129.png merits of chopping down
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0130.png another ugly tree. Sometimes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0132.png ya' know?! Purple is my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0134.png those pretty flowers.I'm also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0145.png that your grandkids are on the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0147.png against age. Don’t you just love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0159.png garden again. Tiger lilies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0160.png bloom around Independence
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0006.png create an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0007.png account, you must tick
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0009.png checkbox after filling
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0013.png up on. Atlas of AI – great podcast with the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0006.png knows everything
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0013.png swears they were
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0016.png clearly were not.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0017.png Yes because the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0018.png history of players
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0025.png art highlighting
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0028.png and scenes. All
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0036.png head tilt and a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0046.png the slats of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0049.png next prey. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0055.png barns vermin-free!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0005.png whenever I stop by! Thank you!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0009.png following options no later than Tuesday, March 15th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0010.png following options no later than Tuesday, March 10th, 2023. Please make the reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0011.png following options no later than Tuesday, April 5th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0012.png following options no later than Tuesday, April 5th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0017.png me with editing an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0022.png were succinct, thorough, and made a significant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0018.png Machiavellian for pure ham-fisted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0031.png the doors, allowed the students to work through the play, then walked out at the end with nary a word
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0033.png reading → Enter your email
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0039.png not respond. Please wait a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0041.png this page. Error: Twitter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0047.png looking into beauty
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0001.png Sometimes even different colors
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0013.png cleaning of the panel surface
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0002.png trademarks 27 golf holes constructed to international
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0005.png listen to understand.Show respect and suspend judgment. Note any common ground as well as any differences. Be 4
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0013.png about the rise in reports of Anti-Asian violence and discrimination, what feelings or thoughts come up for 10.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0006.png 6. impact the world. The production of hash
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0001.png Cruz (UCSC) indicates that scientists have substantially underestimated the 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0009.png 8269
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0011.png “jacuzzi”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0007.png looked all over the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0008.png school for eggs. Then
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0018.png really fun. That is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0021.png Easter holidays.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0003.png the offices that use their units
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0004.png throughout the day and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0011.png showing signs of damage.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0017.png be given extra attention by an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0019.png specialist. Why don't air
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0026.png basis. With a flat rate, you get an upfront quote that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0031.png remain the same. Just remember to hire the company
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0036.png name* Last name* Email address* A petition asking to “unlock Snapchat from campus WiFi” will soon be given a response
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0011.png for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0012.png your specific
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0013.png ¥2741.10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0000.png Championship in ’79 against
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0004.png - painful loss of his wife. After
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0004.png but
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0014.png breath a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0017.png 82.8%
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0020.png 5077
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0023.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0035.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0041.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0046.png 73.8%
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0049.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0050.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0051.png 3892.27
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0004.png want to get rid of stress,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0022.png young.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0000.png Bamboo Bath Robe. This robe would be very comfortable on cold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0004.png other sheets whcih would be great for nightime hot flashes. we just upgraded to a king size bed and we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0000.png same can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0005.png your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0008.png the best
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0009.png care. Our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0010.png tech
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0011.png team is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0000.png in Sillunu Oru
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0003.png as chief
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0022.png If you’re a PC
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0006.png 5. extremely gifted and unspeakably
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0007.png 6. cynical political operative whose job is
diff --git a/runs/paddle-recognizer-mixed-v2/labels/train.txt b/runs/paddle-recognizer-mixed-v2/labels/train.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5036604f7599c5408c0212989bae40dc40efc6c2
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2/labels/train.txt
@@ -0,0 +1,1700 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000058.png सबैले मन पराउने घिमिरे मे बिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000060.png स्वाद बढाउने त्यो नुन भै दिऊ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000065.png गतिमा लमा सलवलने रेखम के दिकुवि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000074.png भन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000097.png बैशाख १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00001.png मितिः 2075 असार 29 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00005.png मितिः 2080 भदौ 2 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00010.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00020.png सैनिक मुख्यालय जङ्गी अड्डा सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00042.png नेपाल सरकार शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00066.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00093.png चलानी नम्बरः 1014/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00098.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0000.png leadership is from the rest of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0001.png party on the issue, it is not a surprise
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0002.png that high-ranking officials such as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0003.png Hoyer — who has $4.7 million in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0004.png career donations from the health
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0005.png sector — are among the industry’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0006.png favorite Democrats. His current high
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0007.png donor from the industry this cycle is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0008.png Blue Cross Blue Shield. More telling,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0009.png perhaps, is the money he received
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0010.png during the ACA debates and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0011.png implementation. According to the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0000.png a retirement
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0001.png savings
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0002.png plan and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0005.png you consistently engage in planning for your retirement. What kind of role can a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0006.png financial professional play for an investor? The answer: an important one. While
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0007.png the value of such a relationship is hard to quantify, the intangible benefits may be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0008.png long-lasting. There are certain investors who turn to a financial professional with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0000.png Ranking services are what will produce
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0001.png the first page results, whether its for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0002.png products, services or professional
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0003.png offerings. The NEADSO Team pushes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0004.png your long tail keywords and keyword
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0005.png phrases by using powerful content,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0006.png article submissions, social bookmarking,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0007.png on page optimization. and a host of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0008.png other tools. We have powerful partners
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0009.png and access to networks that RETURN
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0010.png POWERFUL RESULTS at affordable
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0011.png prices. REAL SEO is your advantage,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0012.png contact the NEADSO Team today for a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0013.png FREE SEO Report. Interested in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0014.png speaking with us about your current
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0017.png you time, money and get the results
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0019.png potential. To get started; simply click
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0021.png and launch our portal! You can have a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0022.png private and secure conversation, share
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0023.png documents and message us 24/7. Did
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0024.png you know, Microsoft Advertising has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0025.png advantages to offer advertisers over
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0026.png Google Ads services? How about less
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0027.png competition, lower CPC’S, users with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0028.png higher purchasing power and more...
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0029.png Did you also know that you can import
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0030.png from Google Ads to save time and get
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0031.png up and running faster! You get access
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0032.png to searchers on Microsoft Bing, MSN,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0033.png Yahoo, AOL and more sites powered by Bing. “39% of global
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0034.png e-commerce traffic is referred by search.” BI Intelligence Start
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0035.png taking advantage of Microsoft Advertising to grow your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0036.png business. Facebook is a powerful platform, that has 1.73 billion
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0037.png daily users, which sees an 11% increase year-over-year. Our goal
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0038.png at Northeast Advertising Solutions is to get your business in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0039.png front of as many relevant users in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0040.png your geographical space as possible. We use a targeted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0041.png marketing approach to not only boost your internet presence,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0045.png include our in house video production to tell your business
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0046.png story, keep your customers updated and engaged! Your Ads
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0047.png never get shown to the same person more than once. We offer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0048.png many different Facebook marketing solutions from basic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0049.png management to large budget Ad campaigns. The NEADSO
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0050.png Team does NOT take on an account unless we feel we can be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0051.png successful for the client. Need help with a banned account or
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0053.png with your options. Video SEO has a brand New bag! The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0054.png NEADSO Team has put together an awesome offering for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0055.png businesses that want to use the power of video to not only sell
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0056.png their business products & services but to gain first page
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0057.png organic Google Listings! We combine the power of YouTube
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0059.png Week Campaigns, with a NEW video each week. Professionally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0060.png written scripts, copy free music, professional product
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0062.png sell fast with VIDSEO. When someone is searching for the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0064.png Do you know exactly what they see? Are your business
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0066.png are at the mercy of the 93 relative search engines and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0067.png directories that list information about your business. Take
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0068.png control of your listings today and improve your SEO results as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0069.png well as protect your online reputation! Already been harmed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0001.png ▪ Should You Borrow from Your 401(k)? Educational,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0002.png ▪ Financial Tips, planning for future The BBB has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0003.png ▪ determined this business meets BBB accreditation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0000.png also love scratching to build
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0001.png nests. Although all of our hens
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0002.png have cozy places to rest inside
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0003.png our barns, they instinctively
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0006.png our ladies’ way of saying “Hello” or “I’m comfortable around you”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0007.png to other chickens, and even us humans! Through our research and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0008.png experience, we’ve seen that a higher intensity of scratching
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0009.png translates to better bird welfare since it gives them an outlet to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0010.png relieve stress. When hens are caged their entire lives or are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0012.png behavior like scratching. With restrictions to their movements,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0013.png stress will often be taken out on other hens instead of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0016.png sounds (similar to what we feel when our hair is forcefully pulled out). Last but not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0000.png smell, it’s probably the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0001.png odor of mold. Basements
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0002.png and crawl spaces often
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0004.png because they’re dark,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0005.png damp, and stuffy. And it’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0006.png not only flooding that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0007.png causes basement
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0009.png in the foundation,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0010.png condensation, and poor
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0011.png ventilation can all cause mold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0012.png growth in basements. Leaky
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0014.png constant steam from hot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0015.png showers make bathrooms one of the most likely places for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0016.png mold growth. Plus, bathrooms never seem to have enough
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0000.png a man is saved from being a thief by finding
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0001.png up.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0002.png “I won’t play the sap for you.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0003.png “When an actor comes to me and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0004.png wants to discuss his character, I say, “It’s in the script.” If he
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0006.png don’t seem
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0007.png to be able to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0008.png check crime, so why not legalize it and then tax it out of business?”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0009.png “Criminal – A person with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0010.png predatory
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0011.png instincts who has not sufficient capital to form a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0012.png corporation.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0013.png “Stealing! How could you?! Haven’t you learned
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000007-l0000.png blockage of a blood vessel.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0000.png happier. Underwater
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0001.png Mp3 song is also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0002.png available on all
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0003.png streaming
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000009-l0000.png 1960, the bell stood in front of Fogelman
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0000.png anything from that guy who
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0001.png gives those
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0002.png sermons at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0003.png Captain
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0004.png “I stayed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0005.png up all night playing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0006.png poker with tarot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0007.png cards. I got a full house
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0008.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0010.png died.” “If you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0012.png to shoot a mime,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0013.png would
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0014.png you use a silencer?”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0018.png my time. Once a guy in one of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0019.png those clubs
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0020.png wanted to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0021.png bet me $10 that I was dead. I was afraid
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0023.png the Porch
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0024.png offerings.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0027.png damp and rainy, but oh my, the little gardens are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0028.png loving it.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0029.png The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0030.png herbs and lone
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0032.png soaking up all
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0000.png it becomes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0001.png available. In the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0002.png meantime, you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0003.png can visit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0007.png banana-like
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0008.png hybrid of two legendry strains; OG Kush of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0009.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0011.png Haze. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0012.png is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0013.png indica dominant with a ratio of 60:40 and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0014.png THC level of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0015.png 25%.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0016.png People
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0000.png “I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0001.png do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0002.png for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0003.png All. I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0004.png am
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0005.png really focused on the solutions that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0006.png are realistic, are pragmatic and can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0007.png get done in our current situation,”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0008.png she said on Twitter in August.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0009.png Kennedy is fairly new to Congress. Yet, in less than three
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0010.png full terms he has quickly become an industry favorite and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000013-l0001.png to remain in flight and alter course and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0000.png cannabinoids and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0001.png terpenes that may help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0002.png elevate mood and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0003.png produce feelings of happiness
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0004.png for the vast majority of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0005.png marijuana consumers.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0006.png Marijuana strains that help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0007.png you relax tend to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0008.png indica-dominant and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0009.png contain a balance of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0010.png both THC and CBD. To
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000015-l0000.png caused by the use of the word.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0000.png relaxation experience, seek out indica-dominant strains with higher amounts of THC than CBD. Many people experience a pleasant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0001.png - euphoria, heightened sensory perception (e.g., brighter colors), laughter, and an altered perception of time when
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0002.png - consuming marijuana cannabis. A boost of energy and ideas emerge with the use of some cannabis strains . These days,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0003.png - you can buy weed strains online! If you are reading this right now, you can place your confidence in buying
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0004.png - from our Online Dispensary Canada store. With hundreds of products to choose from, you can find one that suits
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0005.png - your needs. There are no reviews yet. Order your marijuana & weed products online and provide proof that you’re
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0006.png 19+ years old. Your marijuana products are shipped in vacuum-sealed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0007.png smell-proof bags and discreet packaging.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0008.png What do I need to place
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0010.png order, you must be over 19
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0011.png years of age. By ticking
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0012.png the ID Requirements check
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0013.png box at the checkout page,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0014.png you verify that you are of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0015.png legal age to purchase
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000017-l0000.png their manufacture.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0000.png nature's goodness. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0001.png daffodils and hyacinths are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0005.png badly in need of a good pruning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0006.png ... so pretty. The tiger lilies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0007.png from Mom's backyard have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0008.png mostly been mostly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0009.png transplanted and they seem
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0010.png content to put down their roots
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0011.png in this locale. There are a few
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0012.png newer bushes that look like
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0013.png they're not all that sure if they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0014.png want to bother coming back to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0015.png life. The compost has been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0016.png turned over and again. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0018.png and redistributed, fertilizer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0019.png put to good use. Oh and yes,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0020.png 'we' pulled out a very ugly tree.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0021.png The birds are going crazy at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0022.png the feeders and have been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0023.png checking out the birdhouse.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0024.png For some reason they're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0025.png completely ignoring the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0026.png birdbath that was also hauled
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0028.png center stage in the backyard.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0029.png As long as there is water to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0030.png had in the wild, the birds do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0031.png need the bird bath. Do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0033.png it!Blessings! The lilies of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0035.png remind me of childhood days
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0036.png at Grandma's house ... Loved
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0037.png seeing your cheerful spring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0038.png photos, Linda, and so glad to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0039.png know the kids are recovering
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0040.png from the Covid. It took a while
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0041.png for the birds to notice our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0042.png birdbath when we first put it up;
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0043.png just give them time, and they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0044.png will find it.Blessings! Thanks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0045.png for reminding me that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0046.png patience is a gardening /
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0048.png seems like it's been raining
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0050.png guess that is expected and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0051.png desired in the springtime!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0052.png Your images are beautiful,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0053.png Linda! Enjoy your birds and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0056.png are pastwinter's cold and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0057.png murk,but do not rejoice too
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0058.png fastfor hummingbirds do
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0059.png lurkin the blooming desert
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0060.png flowers,growing just out
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0061.png back,and they're warming up
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0062.png their powersso that they may
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0063.png attackme with their pointy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0064.png little beaks;I have been nailed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0065.png each yearby these
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0066.png ruby-throated freaksbut let
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0067.png me make this clear:I won't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0068.png hunt them down, nor even
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0069.png curselest their payback be far
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0070.png worse. It's not just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0071.png hummingbirds, Linda. It's
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0072.png squirrels, too, they're in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0073.png cahoots.For proof, look to the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0074.png David Crowder Band's
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0075.png "Foreverandever etc" video.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0076.png They're a fine Christian
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0077.png band...and they KNOW. we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0078.png having fun yet? Squirrels +
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0079.png Crowder?Never would have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0080.png guessed ... And then there are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0082.png mercy if you accidentally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0083.png come anywhere near their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0085.png dive-bombed by a few over the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0086.png years. Thankfully no blood
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0088.png plenty scary. I love spring, too,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0089.png Linda. All the new life fills my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0091.png beautiful photos and spring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0092.png musings. I think it might finally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0093.png be warm enough here to plant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0095.png blessings to you! Loving the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0096.png bright beautiful pictures that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0097.png speak life to me! I worked out
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0098.png in my yard Saturday a bit.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0102.png one bit! LOL! Happy week to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0103.png you dear Linda. Hugs and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0104.png blessings, Cindy Don't you just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0105.png love puttering in the yard? I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0106.png aim to do it every day. Great
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0107.png therapy, wonderful time to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0108.png muse and mull ... and pray.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0109.png Beautiful pictures Linda. I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0110.png enjoyed our time together this
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0111.png weekend and I didn't even pull
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0112.png up a week in your garden! I love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0113.png the off-season when you're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0114.png here on weekends! God is good
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0115.png ... It's lovely to see your words
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0116.png popping up here and there,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0117.png Linda! Thanks for sharing my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0118.png post, and for giving me such a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0119.png fitting way to end it. :-) I love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0120.png that you have tiger lilies from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0121.png your mom's backyard in your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0122.png own flowerbeds now. And I got
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0123.png a good laugh out of this: "Oh
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0124.png and yes, 'we' pulled out a very
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0125.png ugly tree." It probably won't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0127.png "we've" been there and done
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0128.png that too. :-) We're debating the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0131.png it's just the right thing to do,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0133.png favourite colour so I'm loving
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0135.png fighting a (losing) battle
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0136.png against the weeds. Dandelions
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0137.png are my nemesis! LOL.Thanks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0138.png for the visit! I have a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0139.png granddaughter who adores
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0140.png purple, too, Margie! Her
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0141.png clothes, room decor, much of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0142.png her stuff ... and, of course,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0143.png purple earrings for her newly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0144.png pierced ears! P.S. Glad to hear
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0146.png mend. The virus doesn't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0148.png Spring, Linda?! I putter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0149.png around in my little yard almost
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0150.png everyday. I have two trees that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0151.png I’m worried about, that haven’t
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0152.png recovered from our attic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0153.png freeze I’m glad that your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0154.png grands are recovering from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0155.png Covid. Thank you for your visit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0156.png to my blog and Happy Mother’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0157.png Day to you. It’s so wonderful to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0158.png be able to get out into the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0161.png Day around her and I’ve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0162.png always loved them. Linda, I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0163.png think we all feel so good just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0000.png to choose
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0001.png from, with Pug,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0002.png Dachshund
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0003.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0004.png Labrador
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0005.png themed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0000.png and offers
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0001.png advice and knowledge to help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0002.png achieve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0003.png their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0004.png objectives. Privacy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0005.png Policy Terms and Conditions Get 30
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0006.png minutes of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0007.png free consultation with our company formation experts! Will help you to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0008.png setup your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0009.png company
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0000.png requirements section that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0001.png verifies you are of legal age to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0002.png purchase marijuana and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0003.png cannabis products every time
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0004.png you place an order.Creating an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0005.png Account – To
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0008.png the create account
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0010.png out your shipping
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0011.png information and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0000.png remote and ancient First Nations
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0001.png communities. How Mik reacted when, as a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0002.png young adult,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0003.png she learnt she had indigenous ancestors
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0004.png How she came up with the idea of using
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0005.png augmented reality to share cultural
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0006.png stories in the national parks where she
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0007.png worked How hard it was to get people to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0008.png help her progress her augmented reality
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0009.png ideas What happened when Mik reached
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0010.png rock bottom,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0011.png and The one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0012.png technology Mik thinks we all need to read
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0000.png will never leave
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0001.png Florida ... for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0002.png obvious reasons.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0003.png He's a reigning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0004.png fantasy football
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0005.png league champion,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0007.png there is to know
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0008.png about NASCAR,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0009.png and once passed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0010.png out (briefly!) during
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0011.png a lap around
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0012.png Daytona. He
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0014.png going 200 mph
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0015.png even though they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0019.png ‘hearing things
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0020.png from fans in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0021.png crowd’ is sooooo
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0022.png legitimate. Enjoy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0023.png my selection of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0024.png needle felted wall
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0026.png some of my other
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0027.png favorite animals
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0029.png ready for purchase
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0030.png and fast shipping!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0031.png Curious Fox: A
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0032.png handsome red fox
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0033.png is needle felted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0034.png onto a gray plaid
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0035.png wool, offering a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0037.png smirk. Framed,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0038.png without glass, in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0039.png an upcycled black
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0040.png polymar frame,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0041.png ready to hang in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0042.png your home.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0043.png Watching through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0044.png the Slats: A barn
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0045.png cat peeks through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0047.png barn wall,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0048.png watching for his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0050.png piece was inspired
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0051.png by our farm cats,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0052.png whom always bring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0053.png a smile to our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0054.png faces and keep our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0056.png Framed under
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0057.png glass in an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0058.png upcycled off-white
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0000.png so life-giving and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0001.png hope-filled. So grateful our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0002.png God gave us seasons to enjoy!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0003.png Linda-love hanging out on your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0004.png front porch, brightens my day
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0006.png More from United Arab Emirates Voice of Kerala 1152 AM Discovered & liked a particular radio from a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0007.png collection? Create your own playlist and add them to it. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0008.png following options no later than Tuesday, February 3rd, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0013.png following options no later than Tuesday, April 11th, 2023. I have had the distinct pleasure of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0014.png working with Dr. Faye
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0015.png Wilson for several
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0016.png years. She assisted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0018.png article I had written
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0019.png for publication at the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0020.png state and regional
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0021.png level. Her suggestions
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0023.png improvement in the flow and communication of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0000.png college’s larger community. Speaking
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0001.png for a group of about 200-300
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0002.png (changes daily) alum, we’ve been at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0003.png odds with the Board of Visitors and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0004.png Governors due to the cost of the high
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0005.png turnover of administration for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0006.png years. The lack of transparency in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0007.png the fiscal and administrative
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0008.png management is deplorable. Calling
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0009.png on the alumni to support
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0010.png half-hearted and complacent efforts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0011.png to maneuver a private liberal arts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0012.png college, the 10th oldest college in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0013.png country, through this past 10 years
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0014.png makes us grow weary. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0015.png censorship is only the latest, most
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0016.png egregious act thus far by the current
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0017.png administration. You mistake
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0019.png ignorance. Kurt was late to the game
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0020.png on this issue, yet owns and yet in his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0021.png own moment of “enlightenment”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0022.png supports the decision fully. If you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0023.png read the letters to the editor on The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0024.png Chestertown Spy from one of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0025.png affected parents of the cast/crew ( ,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0026.png or look at the largest social media
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0027.png commented post ( you’ll see the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0028.png Provost and Dean, and perhaps one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0029.png other professor, announced the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0030.png cancellation at the outset of the final dress rehearsal, then locked
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0032.png or huzzah. Continue
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0034.png address to subscribe to this
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0035.png blog and receive
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0036.png notifications of new posts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0037.png by email. Follow Us on
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0038.png TwitterError: Twitter did
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0040.png few minutes and refresh
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0042.png did not respond. Please
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0043.png wait a few minutes and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0044.png refresh this page. Already
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0045.png have a account? Log in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0046.png now. When you're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0048.png surgery, you wish to make
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0049.png sure that you select
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0050.png properly. You do not need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0051.png to select the cheapest
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0052.png cosmetic surgeon based
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0053.png on that alone. You need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0054.png to have a look at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0055.png credentials. Check for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0056.png reviews and such. Make
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0057.png sure you make a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0058.png properly-informed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0059.png determination when,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0060.png you're deciding on a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0061.png surgeon.
Earlier
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0062.png than you need it, elevate
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0063.png as a lot of the cash as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0000.png different colored berries on them.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0002.png on the same berry! The Pinot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0003.png grape is notorious for its genetic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0004.png instability with Jancis Robinson’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0005.png Wine Grapes noting that there
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0006.png are more than a 1000 registered
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0007.png clones. That’s just the number of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0008.png clones we know of. However, ampelographers believe that the mutation rate for Pinot is actually on par with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0009.png other varieties and instead
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0010.png attribute the vast number of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0011.png known mutations and genetic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0012.png variations to the grape’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0013.png – longevity and 2000+ year history. Even with the many mutations, genetically all the various Pinot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0014.png – varieties (noir, blanc, gris, Meunier, Teinturier, etc) are the same–which to some degree makes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0015.png – the argument of what “Pinot Gouges” is moot. But the concept of “White Pinot noir” does exist
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0016.png – with producers pressing the red Pinot noir grapes quickly to produce a white wine. Used in Champagne for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0000.png monitoring of solar panel
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0001.png output can alert you of any
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0002.png drop in its efficiency levels.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0003.png Over time, solar panels tend to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0004.png become less efficient due to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0005.png degradation or damage.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0006.png Overhanging trees or high-rise
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0007.png buildings nearby can cast
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0008.png shadows, thus bringing down
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0009.png the efficiency. Accumulation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0010.png of dust, dirt, debris and bird
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0011.png droppings can also result in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0012.png reduced efficiency. Periodical
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0014.png with water can solve this. If
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0015.png using a fixed mount, getting a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0016.png professional to install solar
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0017.png panels can make a huge
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0018.png difference. Those familiar in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0019.png the field know how to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0020.png calculate the exact
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0021.png orientation and tilt angle to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0022.png get the best out of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0023.png installation. Another choice
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0000.png most challenging course in Northern Vietnam.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0001.png This course lies within a beautiful valley and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0003.png AAA standard. It attracts not only golfers to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0000.png and be curious. No preparation is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0001.png required, though background links with balanced views are available on some topic pages online. Anyone can host 1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0002.png using these italicized instructions. Hosts also participate. Share your name, where you live, what drew you here, 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0003.png and if this is your first conversation. These will set the tone of our conversation; participants may 2.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0004.png volunteer to take turns reading them aloud. (Click here for the full conversation agreements.) Be curious and 3
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0006.png authentic and welcome that from others. Be purposeful and to the point. Own and guide the conversation. Each 5
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0007.png participant can take 1-2 minutes to answer one of these questions: Take ~2 minutes each to answer a question 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0008.png below without interruption or crosstalk. After everyone has answered, the group may take a few minutes for 7
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0009.png clarifying or follow up questions/responses. Continue exploring additional questions as time allows.. What does 8
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0010.png being Asian mean to you? What about being American? How do those two identities relate to each other? What is 9
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0011.png the impact of having your ethnicity lumped into a monolith like Asian American? How has Anti-Asian 9.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0012.png sentiment surfaced in your personal experience over the years? How has it changed over the years? When thinking 10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0000.png How much is a dab
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0001.png 1. pen? This is a question you may ask yourself if you want
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0002.png 2. to start using some dap pens. As a dab pen enthusiast,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0003.png 3. let me share my knowledge [...] If you’re someone who always
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0004.png 4. thinks about the environment, you may be wondering about
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0005.png 5. how the production and computation of hash products will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0007.png 7. concentrates, like many [...] With hash products
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0000.png look at them. For instance, a new study led by the University of California, Santa 1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0002.png amount of energy emitted by AGN by not recognizing the extent to which their light 2.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0003.png is dimmed by dust. The research was led by Dr. Martin Gaskell, a research 3
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0004.png associate and lecturer at UCSC’s Department of Astronomy and Astrophysics. He was 3.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0005.png joined by a team of engineers, mathematicians, astronomers, and astrophysicists 4
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0006.png from Harvey Mudd College, Princeton University, and the University of California 5
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0007.png Berkeley. For their study, the team examined NGC 5548, a Type I Seyfert galaxy 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0008.png located about 244.6 million light-years away. This galaxy has a bright AGN, resulting 6.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0009.png from a central SMBH of roughly 65 million Solar masses. The amount of dust is 7
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0010.png measured by the way it causes light from the AGN to shift toward the red end of 8
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0011.png the spectrum. This effect is known as “reddening,” and the amount of reddening 9
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0012.png corresponds directly to the amount of dimming. Although scientists have long 10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0000.png market.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0001.png To try to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0002.png cushion the pain
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0003.png from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0004.png a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0005.png slower economy,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0000.png the government
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0001.png deployed state-run
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0002.png media to promote
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0003.png stocks for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0004.png inexperienced
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0005.png individual investors.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0006.png The hope was that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0007.png Chinese companies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0008.png could issue shares into
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0009.png a rising market and use
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0000.png treasures
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0001.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0002.png Long
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0003.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0004.png 6476.50
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0005.png turtles,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0006.png sample
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0007.png 3193
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0008.png world’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0010.png rum
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0012.png Pot.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0013.png Hike
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0014.png through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0015.png sing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0000.png exciting day. We had
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0001.png an Easter Egg Hunt
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0002.png and a Bake Sale.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0003.png First we had the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0004.png Easter egg hunt. We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0005.png were put into groups
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0006.png of three or four. We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0009.png when we found them
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0010.png all we got one each!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0011.png It was great! After a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0012.png while we went into
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0013.png the hall and got to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0014.png buy buns and cakes.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0015.png All of the parents
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0016.png came in and bought
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0017.png some too, it was
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0019.png what happened on
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0020.png the day we got our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0022.png Meditation is derived
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0023.png from the Latin word
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0024.png “meditatio” and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0025.png means
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0026.png contemplation. It is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0027.png defined as the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0028.png techniques and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0029.png experiences of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0030.png controlling the mind,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0031.png reaching the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0032.png self-existence while
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0033.png enabling the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0034.png individual to achieve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0035.png inner peace,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0036.png tranquility and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0037.png different states of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0038.png consciousness. It is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0039.png not a type of belief
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0040.png or a ritual; It is a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0041.png method of healing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0042.png the body, soul and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0043.png mind, listening to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0044.png oneself. Usually in a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0045.png quiet, calm
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0046.png environment;
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0047.png Although it is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0048.png thought that it is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0049.png done in a blurred
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0050.png state, there are also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0000.png and are only used for cooling an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0001.png average-sized room, they can do
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0002.png with one service a year. As for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0005.png non-stop, they have to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0006.png checked at least two to three
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0007.png times a year. However, you need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0008.png to acquire an air conditioning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0009.png repair in Muscle Shoals service
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0010.png from a specialist if your unit is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0012.png Cooling systems that are used in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0013.png rooms with a high level of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0014.png contaminants or pollution in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0015.png air including hairdressers,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0016.png kitchens, and workshops have to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0018.png air conditioning repair
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0020.png conditioning repair in Muscle
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0021.png Shoals specialists charge by the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0022.png hour? Similar to local
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0023.png restaurants where they give you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0024.png value menus, you can get the most value if you are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0025.png charged with a flat rate instead of on an hourly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0027.png is fixed. Regardless of the amount of time it will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0028.png take for your air conditioning unit to run smoothly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0029.png again, the price won't change. It does not matter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0030.png also as to what parts you will need. The price will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0032.png that you trust and one that you know won't be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0033.png ripping you off. We all have a part to play in creating
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0034.png a kinder world, free of bullying. Here’s how you can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0035.png be a part of the Dolly’s Dream mission. First
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0000.png has its
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0001.png own
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0002.png unique strengths
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0003.png and weaknesses,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0004.png so
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0005.png £9640.57
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0006.png it’s important to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0007.png choose a video
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0008.png 9155.77
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0009.png 8562
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0010.png production
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0014.png €3326.02
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0015.png 3790.57
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0016.png needs. if you’re
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0017.png £4612.25
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0001.png - the Rams, but lost 9-0.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0002.png - Williams’ life and career took
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0003.png - a turn for the worse with the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0005.png - the Cowboys defeated the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0006.png - Bucs in the ’82 playoffs, it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0007.png - would be five years between
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0008.png - NFL starts for Williams.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0009.png - Williams threw 36 touchdowns and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0010.png - 38 interceptions in his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0011.png - two-year USFL career. In
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0000.png amounts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0001.png of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0002.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0003.png dioxide,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0005.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0006.png dioxide
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0007.png is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0008.png released
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0009.png 8120.14
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0010.png into the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0011.png with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0012.png 8186.73
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0013.png each
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0015.png £6574.41
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0016.png living
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0018.png well as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0019.png £5513.53
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0021.png 2764.85
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0022.png through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0024.png 4085
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0025.png around
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0026.png world
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0027.png absorb
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0028.png about a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0029.png 6561.67
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0030.png £5587.31
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0031.png 6650.47
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0032.png 8344
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0033.png third of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0034.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0036.png they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0037.png will emit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0038.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0039.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0040.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0042.png found
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0043.png in dead
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0044.png matter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0045.png gets
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0047.png 5937.35
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0048.png buried in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0052.png $7054.02
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0053.png 4756.52
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0000.png anxiety. Meditation also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0001.png stimulates the part that is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0002.png associated with anxiety and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0003.png depression. In short, if you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0005.png you can try meditation.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0006.png Some meditations can help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0007.png you know and understand
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0008.png yourself much better. As a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0009.png result of a study, it was found that 21 women
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0010.png who were battling breast cancer and participated in a meditation-based tai chi program had a greater increase in their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0011.png self-esteem than other patients. Another study conducted with 40 adult men and women revealed that as a result of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0012.png mindfulness meditation program, a decrease in the feeling of loneliness was experienced. As a result of these studies, it has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0013.png been shown that meditation improves self-image and self-worth. One of the most beautiful effects of meditation is that it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0014.png supports people to get rid of addiction. Millions of people around the world meditate to overcome addictions such as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0015.png alcohol and cigarettes. Traits such as mental discipline, self-awareness, and self-control develop through meditation, which
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0016.png encourages them to take a big step to let go of addictions. 4) It supports you to have a quality
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0017.png sleep Almost all of us may face sleep problems at some point in our lives. Meditation, in particular, helps you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0018.png to have a much deeper and deeper sleep, as it calms your body and helps lower blood pressure. Thus, before
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0019.png you go to sleep, you can develop control against thousands of thoughts that weigh on your mind and feel peaceful.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0020.png Clear thoughts and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0021.png concentration keep our minds
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0023.png If you want
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0024.png to strengthen
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0025.png your memory
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0026.png and get rid of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0027.png your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0028.png forgetfulness,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0029.png meditation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0030.png also helps in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0031.png this regard.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0032.png You can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0000.png 1089
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0001.png cases
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0002.png belonged
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0001.png winter nights. I really love the Bamboo 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0002.png in 1 dresses. Nice line of products. I like that the sheets are thermal regulating! I like that they have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0003.png the resort sheets in white – that’s my favorite sheet color! i learned that these are 3 degrees cooler than
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0005.png need new pillows. i want the cariloha gel pillow. I learned that they have bamboo mattresses! I would love to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0006.png have one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0007.png of their Micro-Gel Pillows. They should like they are really nice.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0001.png be said
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0002.png with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0003.png Get the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0004.png best out of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0006.png instrument
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0007.png by giving it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0012.png equipped
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0013.png to service
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0000.png just use the oil without also adding
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0001.png water or other carriers! ● Essential
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0002.png oils aren’t for consumption. I mean
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0003.png you weren’t going to drink them
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0004.png were you? All jokes aside, as with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0005.png any cleaner, keep out of reach of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0006.png children and pets! ● If you are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0007.png pregnant or have health conditions,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0008.png check with your doctor before using essential oils. ● Some
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0009.png essential oils like Citronella are not safe for pets. Please check
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0010.png with your vet or check out this helpful article for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0011.png guidance. Because I learned this the hard way,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0012.png Citronella was my go-to until we brought home Belle, my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0013.png Dalmatian puppy. ● 2 cups of water ● 2 cups of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0001.png was
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0002.png 5236.72
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0004.png guest.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0005.png The film released to overall
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0006.png positive reviews. Baradwaj
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0007.png 9793.66
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0008.png "In
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0009.png 83.05
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0010.png his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0000.png of 17 results The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0001.png Yeast
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0002.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0003.png Women’s Health
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0004.png To purchase Otho Molecular
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0005.png products, please either log in or create an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0006.png account.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0007.png Lost
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0008.png your password?
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0009.png Please enter your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0010.png email address.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0011.png You will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0012.png receive mail with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0013.png link to set
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0014.png new password.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0015.png Click here for driving
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0016.png directions. iPhone 15:
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0017.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0018.png release date
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0019.png Apple AR/VR headset: Release
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0020.png date,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0021.png features, and price
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0000.png look like independent confirmation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0001.png of the White House’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0002.png 1. lies. Here’s how Samuels describes the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0003.png 2. scene: For the last seven years the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0004.png 3. American public has been living through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0005.png 4. a postmodern narrative crafted by an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0008.png 7. to wage digital information campaigns
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0009.png designed to dismantle a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0010.png 1. several-decade old security architecture
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0011.png 2. while lying about the nature of the Iranian
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0012.png 3. regime. No wonder Americans feel less
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00093.png चलानी नम्बरः 1014/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000060.png स्वाद बढाउने त्यो नुन भै दिऊ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00098.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000097.png बैशाख १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00001.png मितिः 2075 असार 29 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00010.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000074.png भन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00005.png मितिः 2080 भदौ 2 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00020.png सैनिक मुख्यालय जङ्गी अड्डा सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000058.png सबैले मन पराउने घिमिरे मे बिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00042.png नेपाल सरकार शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
diff --git a/runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt b/runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt
new file mode 100644
index 0000000000000000000000000000000000000000..412407a0075caaff4263e91a15c5ecb78cc07c2f
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt
@@ -0,0 +1,178 @@
+
+
+
+
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+A
+B
+C
+D
+E
+F
+G
+H
+I
+J
+K
+L
+M
+N
+O
+P
+Q
+R
+S
+T
+U
+V
+W
+X
+Y
+Z
+[
+\
+]
+^
+_
+`
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+k
+l
+m
+n
+o
+p
+q
+r
+s
+t
+u
+v
+w
+x
+y
+z
+{
+|
+}
+~
+£
+¥
+ँ
+ं
+ः
+अ
+आ
+इ
+ई
+उ
+ऊ
+ए
+ऐ
+ओ
+औ
+क
+ख
+ग
+घ
+ङ
+च
+छ
+ज
+झ
+ञ
+ट
+ठ
+ड
+ढ
+ण
+त
+थ
+द
+ध
+न
+प
+फ
+ब
+भ
+म
+य
+र
+ल
+व
+श
+ष
+स
+ह
+ा
+ि
+ी
+ु
+ू
+ृ
+े
+ै
+ो
+ौ
+्
+।
+०
+१
+२
+३
+४
+५
+६
+७
+८
+९
+–
+—
+‘
+’
+“
+”
+€
+→
+▪
+●
diff --git a/runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml b/runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml
new file mode 100644
index 0000000000000000000000000000000000000000..e3d5fc815c67fe831f4b8bcd88b35c039af7c582
--- /dev/null
+++ b/runs/paddle-recognizer-mixed-v2/paddle_recognizer.yml
@@ -0,0 +1,40 @@
+# Generated by ocrtech train-recognizer.
+# Verify against the checked-out PaddleOCR version before long training runs.
+Global:
+ pretrained_model: PaddlePaddle/devanagari_PP-OCRv3_mobile_rec
+ character_dict_path: runs/paddle-recognizer-mixed-v2/nep_eng_dict.txt
+ save_model_dir: runs/paddle-recognizer-mixed-v2/checkpoints
+ use_space_char: true
+ infer_mode: false
+ distributed: false
+ epoch_num: 10.0
+
+Optimizer:
+ name: Adam
+ beta1: 0.9
+ beta2: 0.999
+ lr:
+ name: Const
+ learning_rate: 0.0005
+
+Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/paddle-recognizer-mixed-v2/labels/train.txt
+ loader:
+ shuffle: true
+ batch_size_per_card: 16
+ drop_last: true
+
+Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/paddle-recognizer-mixed-v2/labels/eval.txt
+ loader:
+ shuffle: false
+ batch_size_per_card: 16
+ drop_last: false
diff --git a/runs/paddle-recognizer-next-v1-bundle/paddle-recognizer-next-v1-training.tar.gz b/runs/paddle-recognizer-next-v1-bundle/paddle-recognizer-next-v1-training.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..a8a02ebf20e47af18e9038a6e27d95cdeb62fcec
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1-bundle/paddle-recognizer-next-v1-training.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d9870807867ed4292a00ff084d74a8ffae7cac84a3e1f2aa7b408d57f3817e63
+size 75669574
diff --git a/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json b/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json
new file mode 100644
index 0000000000000000000000000000000000000000..b24076e58df60082d81736d3088f419e249096c8
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json
@@ -0,0 +1,104 @@
+{
+ "train_manifest": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl",
+ "eval_manifest": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl",
+ "passed": true,
+ "train_profile": {
+ "manifest_path": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl",
+ "sample_count": 2212,
+ "dataset_counts": {
+ "gauravgiri__nepali-ocr-dataset": 428,
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 850,
+ "ocrtech-crops": 512,
+ "prashant0919__nepali-synthetic-ocr-lines": 422
+ },
+ "slice_counts": {
+ "blur": 126,
+ "clean": 129,
+ "crop": 512,
+ "en": 850,
+ "english": 1362,
+ "figure": 132,
+ "figure_caption": 35,
+ "image": 512,
+ "line": 129,
+ "line_crop": 850,
+ "low_contrast": 130,
+ "mixed_script": 512,
+ "nepali": 1362,
+ "reading_order": 512,
+ "real": 428,
+ "scan": 127,
+ "synthetic": 1272,
+ "table": 380,
+ "table_cell": 348
+ },
+ "script_counts": {
+ "devanagari": 25516,
+ "digit": 2071,
+ "latin": 23471,
+ "other": 30,
+ "punctuation": 1617
+ },
+ "script_sample_counts": {
+ "contains_devanagari": 1174,
+ "contains_latin": 1084,
+ "devanagari_only": 1074,
+ "latin_only": 984,
+ "mixed_devanagari_latin": 100,
+ "other_only": 54
+ }
+ },
+ "eval_profile": {
+ "manifest_path": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl",
+ "sample_count": 244,
+ "dataset_counts": {
+ "gauravgiri__nepali-ocr-dataset": 15,
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 150,
+ "ocrtech-crops": 64,
+ "prashant0919__nepali-synthetic-ocr-lines": 15
+ },
+ "slice_counts": {
+ "blur": 16,
+ "clean": 16,
+ "crop": 64,
+ "en": 150,
+ "english": 214,
+ "figure": 28,
+ "figure_caption": 8,
+ "image": 64,
+ "line": 20,
+ "line_crop": 150,
+ "low_contrast": 16,
+ "mixed_script": 64,
+ "nepali": 94,
+ "reading_order": 64,
+ "real": 15,
+ "scan": 16,
+ "synthetic": 165,
+ "table": 36,
+ "table_cell": 36
+ },
+ "script_counts": {
+ "devanagari": 1623,
+ "digit": 356,
+ "latin": 4313,
+ "other": 2,
+ "punctuation": 251
+ },
+ "script_sample_counts": {
+ "contains_devanagari": 90,
+ "contains_latin": 172,
+ "devanagari_only": 62,
+ "latin_only": 144,
+ "mixed_devanagari_latin": 28,
+ "other_only": 10
+ }
+ },
+ "leakage_passed": true,
+ "issues": [],
+ "warnings": [
+ "eval manifest has no hard_eval slice; recognizer admission should still use a separate hard gate"
+ ],
+ "summary_json_path": "runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json",
+ "summary_md_path": "runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md"
+}
diff --git a/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md b/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md
new file mode 100644
index 0000000000000000000000000000000000000000..1ef51a9b78f02a9a6b5be75268da3213d2b8be1a
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md
@@ -0,0 +1,25 @@
+# Recognizer Corpus Audit
+
+Passed: `yes`
+Train manifest: `/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl`
+Eval manifest: `/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl`
+Leakage check: `pass`
+
+## Profiles
+
+| split | samples | latin | devanagari | mixed | real | synthetic |
+| --- | ---: | ---: | ---: | ---: | ---: | ---: |
+| train | 2212 | 1084 | 1174 | 100 | 428 | 1272 |
+| eval | 244 | 172 | 90 | 28 | 15 | 165 |
+
+## Issues
+
+- none
+
+## Warnings
+
+- eval manifest has no hard_eval slice; recognizer admission should still use a separate hard gate
+
+## Next Actions
+
+- corpus passes the configured recognizer training gate
diff --git a/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.json b/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e9a5f3cf7bd5064f98f147a0a7992cea3557709
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.json
@@ -0,0 +1,2487 @@
+{
+ "archive_path": "runs/paddle-recognizer-next-v1-bundle/paddle-recognizer-next-v1-training.tar.gz",
+ "base_dir": "/Users/k2/ocr-tech",
+ "recipe_dir": "runs/paddle-recognizer-next-v1",
+ "train_manifest": "data/splits-recognizer-next-v1/train.jsonl",
+ "eval_manifest": "data/splits-recognizer-next-v1/eval.jsonl",
+ "portable_image_root": "bundle_assets/images",
+ "training_summary": {
+ "present": true,
+ "path": "runs/paddle-recognizer-next-v1/recognizer-training-summary.json",
+ "sha256": "b99a76aed9d5725358cc251bdfee89fe4c923c39b78a9fc40ec01fa207f02404"
+ },
+ "recognizer_corpus_audit": {
+ "required": true,
+ "present": true,
+ "passed": true,
+ "path": "recognizer-corpus-audit/recognizer-corpus-audit.json"
+ },
+ "file_count": 2464,
+ "total_bytes": 82095047,
+ "files": [
+ "bundle_assets/images/eval/eval-figure-caption-200-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-blur__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-clean__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-200-scan__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-blur__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-blur__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-clean__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-clean__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-scan__line__0000__0001.png",
+ "bundle_assets/images/eval/eval-figure-caption-202-scan__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-203-blur__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-203-clean__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-203-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-203-scan__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-205-blur__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-205-clean__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-205-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-figure-caption-205-scan__line__0000__0003.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-200-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-201-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-201-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-201-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-201-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-202-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/eval/eval-table-ledger-202-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/eval/eval-table-ledger-202-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/eval/eval-table-ledger-202-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-204-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/eval/eval-table-ledger-206-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-10.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-19.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-22.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-25.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-37.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-4.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-40.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-41.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-42.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-45.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-57.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-62.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-66.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-76.png",
+ "bundle_assets/images/eval/gauravgiri__nepali-ocr-dataset-train-90.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0020.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0042.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0043.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0044.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0052.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0058.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0061.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0063.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0065.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0014.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0015.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0025.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0026.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000013-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0002.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0027.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0032.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0034.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0047.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0054.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0055.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0081.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0084.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0087.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0090.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0094.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0099.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0100.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0101.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0126.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0129.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0130.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0132.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0134.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0145.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0147.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0159.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0160.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0007.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0016.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0025.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0028.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0036.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0046.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0055.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0033.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0039.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0041.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0047.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0001.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0002.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0001.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0007.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0018.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0021.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0019.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0026.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0031.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0036.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0012.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0013.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0014.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0017.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0020.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0023.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0035.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0041.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0046.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0049.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0050.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0051.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0004.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0005.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0008.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0009.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0010.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0011.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0000.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0003.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0022.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0006.png",
+ "bundle_assets/images/eval/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0007.png",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-11.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-12.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-20.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-23.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-29.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-31.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-50.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-55.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-66.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-7.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-76.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-78.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-95.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-96.img",
+ "bundle_assets/images/eval/prashant0919__nepali-synthetic-ocr-lines-train-98.img",
+ "bundle_assets/images/train/eval-figure-caption-200-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-200-blur__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-200-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-200-clean__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-200-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-200-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-200-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000012.png",
+ "bundle_assets/images/train/eval-figure-caption-200-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-200-scan__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-200-scan__line__0000__0003_recognizer-mixed_devanagari_latin-000015.png",
+ "bundle_assets/images/train/eval-figure-caption-201-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-201-blur__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000009.png",
+ "bundle_assets/images/train/eval-figure-caption-201-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-201-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-201-blur__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-201-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-201-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-201-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-201-clean__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__line__0000__0001_recognizer-mixed_devanagari_latin-000018.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-201-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000031.png",
+ "bundle_assets/images/train/eval-figure-caption-201-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-201-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-201-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-201-scan__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-202-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-202-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-202-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-202-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-203-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-203-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-203-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000022.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__line__0000__0001_recognizer-mixed_devanagari_latin-000008.png",
+ "bundle_assets/images/train/eval-figure-caption-203-clean__line__0000__0001_recognizer-mixed_devanagari_latin-000014.png",
+ "bundle_assets/images/train/eval-figure-caption-203-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-203-low_contrast__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000003.png",
+ "bundle_assets/images/train/eval-figure-caption-203-low_contrast__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000007.png",
+ "bundle_assets/images/train/eval-figure-caption-203-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-203-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-203-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-203-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-203-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-203-scan__line__0000__0001_recognizer-mixed_devanagari_latin-000005.png",
+ "bundle_assets/images/train/eval-figure-caption-203-scan__line__0000__0001_recognizer-mixed_devanagari_latin-000017.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000004.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000025.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__line__0000__0001_recognizer-mixed_devanagari_latin-000006.png",
+ "bundle_assets/images/train/eval-figure-caption-204-blur__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-204-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-204-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-204-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-204-clean__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-204-clean__line__0000__0003_recognizer-mixed_devanagari_latin-000023.png",
+ "bundle_assets/images/train/eval-figure-caption-204-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-204-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-204-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-204-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-204-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000016.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000010.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__line__0000__0003_recognizer-mixed_devanagari_latin-000001.png",
+ "bundle_assets/images/train/eval-figure-caption-204-scan__line__0000__0003_recognizer-mixed_devanagari_latin-000019.png",
+ "bundle_assets/images/train/eval-figure-caption-205-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-205-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-205-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-205-blur__line__0000__0001_recognizer-mixed_devanagari_latin-000030.png",
+ "bundle_assets/images/train/eval-figure-caption-205-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-205-clean__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000002.png",
+ "bundle_assets/images/train/eval-figure-caption-205-clean__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000011.png",
+ "bundle_assets/images/train/eval-figure-caption-205-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-205-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-205-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-205-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-205-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-205-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-205-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-205-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-206-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-206-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-206-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-206-blur__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-206-blur__line__0000__0003_recognizer-mixed_devanagari_latin-000027.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000024.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__line__0000__0001_recognizer-mixed_devanagari_latin-000032.png",
+ "bundle_assets/images/train/eval-figure-caption-206-clean__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000013.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000021.png",
+ "bundle_assets/images/train/eval-figure-caption-206-low_contrast__line__0000__0003_recognizer-mixed_devanagari_latin-000029.png",
+ "bundle_assets/images/train/eval-figure-caption-206-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-206-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-206-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-206-scan__line__0000__0001_recognizer-mixed_devanagari_latin-000028.png",
+ "bundle_assets/images/train/eval-figure-caption-206-scan__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-207-blur__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-207-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-207-blur__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-207-blur__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-207-clean__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-207-clean__figure_caption__0000__0002_recognizer-mixed_devanagari_latin-000020.png",
+ "bundle_assets/images/train/eval-figure-caption-207-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-207-clean__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-207-clean__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-207-low_contrast__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-207-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-207-low_contrast__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-207-low_contrast__line__0000__0001_recognizer-mixed_devanagari_latin-000026.png",
+ "bundle_assets/images/train/eval-figure-caption-207-low_contrast__line__0000__0003.png",
+ "bundle_assets/images/train/eval-figure-caption-207-scan__figure_caption__0000__0002.png",
+ "bundle_assets/images/train/eval-figure-caption-207-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-figure-caption-207-scan__line__0000__0001.png",
+ "bundle_assets/images/train/eval-figure-caption-207-scan__line__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-200-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-200-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-200-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-200-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-201-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-201-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-201-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-201-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-202-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-202-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-202-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-202-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-203-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-203-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-203-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-203-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-204-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-204-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-204-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-204-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-205-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-205-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-205-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-205-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-206-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-206-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-206-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-206-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-207-blur__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-207-clean__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-207-low_contrast__table_cell__0000__0012.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__line__0000__0000.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0001.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0002.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0003.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0004.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0005.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0006.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0007.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0008.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0009.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0010.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0011.png",
+ "bundle_assets/images/train/eval-table-ledger-207-scan__table_cell__0000__0012.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000079.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000130.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000292.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000427.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000514.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000523.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-0_rebalance-nepali-000662.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000105.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000124.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000143.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000177.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000609.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000610.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-11_rebalance-nepali-000643.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000102.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000279.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000589.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-12_rebalance-nepali-000645.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000081.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000183.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000219.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000503.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000579.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-13_rebalance-nepali-000585.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000224.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000239.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000453.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000490.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-14_rebalance-nepali-000570.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000199.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000248.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000250.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000265.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000344.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000363.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000465.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-15_rebalance-nepali-000468.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000332.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000386.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000454.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000545.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000601.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-16_rebalance-nepali-000676.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000193.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000423.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-17_rebalance-nepali-000631.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18_rebalance-nepali-000668.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-18_rebalance-nepali-000670.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000144.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000185.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000229.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-1_rebalance-nepali-000324.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000118.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000182.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000402.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000443.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000656.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-20_rebalance-nepali-000665.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000011.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000073.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-21_rebalance-nepali-000235.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23_rebalance-nepali-000139.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-23_rebalance-nepali-000413.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000328.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000424.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000460.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000563.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-24_rebalance-nepali-000626.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26_rebalance-nepali-000022.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-26_rebalance-nepali-000488.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000181.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000232.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000263.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000440.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000516.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-27_rebalance-nepali-000620.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000128.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000272.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000379.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-28_rebalance-nepali-000472.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000281.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000352.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-29_rebalance-nepali-000486.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2_rebalance-nepali-000357.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-2_rebalance-nepali-000437.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000212.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000369.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000497.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-30_rebalance-nepali-000517.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000323.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000385.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000498.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000502.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-31_rebalance-nepali-000573.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32_rebalance-nepali-000269.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-32_rebalance-nepali-000538.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000115.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000200.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000280.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000441.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-33_rebalance-nepali-000464.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000251.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000636.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-34_rebalance-nepali-000667.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35_rebalance-nepali-000038.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-35_rebalance-nepali-000491.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000133.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000408.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000513.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-38_rebalance-nepali-000548.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000017.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000131.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000211.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000228.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000322.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000382.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-39_rebalance-nepali-000442.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000019.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000268.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000368.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000520.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-3_rebalance-nepali-000630.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000010.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000063.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000072.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000223.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-43_rebalance-nepali-000618.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000046.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000326.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000374.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-44_rebalance-nepali-000381.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000026.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000096.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000197.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000253.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000507.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000522.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-47_rebalance-nepali-000526.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000083.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000339.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000389.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000577.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-48_rebalance-nepali-000683.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000006.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000021.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000160.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000198.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000371.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000428.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000539.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-49_rebalance-nepali-000651.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000231.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000259.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000288.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000289.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000493.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000529.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-50_rebalance-nepali-000650.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000147.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000307.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000342.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000463.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000553.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-51_rebalance-nepali-000652.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000088.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000159.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000202.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000303.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000449.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000451.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000540.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-52_rebalance-nepali-000595.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54_rebalance-nepali-000276.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-54_rebalance-nepali-000489.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000113.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000117.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000226.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-55_rebalance-nepali-000267.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000542.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000567.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-56_rebalance-nepali-000658.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-58.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-58_rebalance-nepali-000471.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000050.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000053.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000321.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000383.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000458.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000634.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000654.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-59_rebalance-nepali-000673.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000450.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000532.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000611.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-5_rebalance-nepali-000653.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-60.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-60_rebalance-nepali-000110.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000003.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000009.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-61_rebalance-nepali-000452.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000187.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000315.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000581.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000591.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-63_rebalance-nepali-000605.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000070.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000112.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000244.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000312.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000537.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000660.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-64_rebalance-nepali-000674.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-65.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000052.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000092.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-67_rebalance-nepali-000646.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000173.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000409.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000438.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000597.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000608.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000640.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-68_rebalance-nepali-000680.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000154.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000433.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-69_rebalance-nepali-000552.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000338.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000350.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-6_rebalance-nepali-000556.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000013.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000100.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000238.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000333.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000447.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-70_rebalance-nepali-000485.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000163.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000203.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-71_rebalance-nepali-000426.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000361.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000494.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-72_rebalance-nepali-000604.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000007.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000082.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000116.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000153.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000299.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-73_rebalance-nepali-000348.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-74.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-74_rebalance-nepali-000376.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000005.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000029.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000455.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-75_rebalance-nepali-000509.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000067.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000069.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000098.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000167.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000240.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-77_rebalance-nepali-000366.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000241.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000583.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-78_rebalance-nepali-000635.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000169.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000353.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000477.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000527.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-79_rebalance-nepali-000565.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000336.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000392.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000417.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-7_rebalance-nepali-000582.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000230.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000300.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-80_rebalance-nepali-000664.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000056.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000087.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000090.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-81_rebalance-nepali-000425.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000027.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000347.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000380.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-82_rebalance-nepali-000492.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000001.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000161.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000164.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000262.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000296.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-83_rebalance-nepali-000306.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000023.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000042.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000059.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000237.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-84_rebalance-nepali-000478.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000136.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000287.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-85_rebalance-nepali-000518.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86_rebalance-nepali-000271.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-86_rebalance-nepali-000587.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000020.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000297.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-87_rebalance-nepali-000647.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000061.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000405.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-88_rebalance-nepali-000484.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000377.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000479.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-89_rebalance-nepali-000483.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000015.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000266.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000294.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000316.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000637.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-8_rebalance-nepali-000677.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91_rebalance-nepali-000171.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-91_rebalance-nepali-000562.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000002.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000194.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000208.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-92_rebalance-nepali-000278.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000014.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000051.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000111.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000155.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000222.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000436.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-93_rebalance-nepali-000657.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000258.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000261.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000340.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000416.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000431.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-94_rebalance-nepali-000476.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000135.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000205.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-95_rebalance-nepali-000291.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000186.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000204.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000282.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000327.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000474.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-96_rebalance-nepali-000496.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-97.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-97_rebalance-nepali-000132.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000037.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000354.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-98_rebalance-nepali-000448.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99_rebalance-nepali-000145.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-99_rebalance-nepali-000178.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000156.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000209.png",
+ "bundle_assets/images/train/gauravgiri__nepali-ocr-dataset-train-9_rebalance-nepali-000318.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000000-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000001-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0055.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0064.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0066.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0067.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0068.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000002-0069.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000003-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000004-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000005-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000006-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000007-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000008-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000009-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000010-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000011-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000012-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000013-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000014-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000015-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000016-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000017-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0061.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0063.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0064.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0065.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0066.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0067.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0068.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0069.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0070.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0071.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0072.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0073.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0074.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0075.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0076.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0077.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0078.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0079.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0080.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0082.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0083.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0085.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0086.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0088.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0089.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0091.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0092.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0093.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0095.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0096.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0097.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0098.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0102.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0103.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0104.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0105.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0106.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0107.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0108.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0109.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0110.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0111.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0112.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0113.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0114.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0115.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0116.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0117.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0118.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0119.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0120.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0121.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0122.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0123.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0124.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0125.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0127.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0128.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0131.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0133.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0135.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0136.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0137.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0138.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0139.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0140.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0141.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0142.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0143.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0144.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0146.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0148.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0149.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0150.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0151.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0152.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0153.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0154.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0155.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0156.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0157.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0158.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0161.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0162.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000018-0163.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000019-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000020-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000021-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000022-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000023-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000024-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0051.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0054.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0055.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0056.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0057.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0058.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0059.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0060.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0061.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0062.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000025-0063.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000026-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000027-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000028-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000029-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000030-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000031-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000032-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000033-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000034-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0041.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0046.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0049.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000035-0050.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000036-0035.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000037-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000038-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0022.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0033.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0034.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0036.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0037.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0038.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0039.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0040.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0042.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0043.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0044.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0045.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0047.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0048.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0052.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000039-0053.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0023.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0024.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0025.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0026.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0027.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0028.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0029.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0030.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0031.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000040-0032.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000041-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000042-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000043-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000044-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000045-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0006.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0007.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0012.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0013.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0014.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0015.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0016.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0017.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0018.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0019.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0020.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000046-0021.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0000.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0001.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0002.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0003.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0004.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0005.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0008.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0009.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0010.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0011.png",
+ "bundle_assets/images/train/nvidia__OCR-Synthetic-Multilingual-v1__en-test-000-000047-0012.png",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-0.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-0_rebalance-nepali-000225.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000028.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000055.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000106.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000168.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000394.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-10_rebalance-nepali-000533.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13_rebalance-nepali-000213.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-13_rebalance-nepali-000534.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000034.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000071.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000142.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-14_rebalance-nepali-000512.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000201.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000255.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-15_rebalance-nepali-000370.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000057.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000094.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000234.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000264.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-16_rebalance-nepali-000301.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000157.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000313.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000411.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-17_rebalance-nepali-000555.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000395.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000407.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-18_rebalance-nepali-000678.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-19.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-19_rebalance-nepali-000445.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1_rebalance-nepali-000410.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-1_rebalance-nepali-000430.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000078.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000191.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000207.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000284.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000286.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000419.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-21_rebalance-nepali-000671.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000246.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000558.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000600.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000602.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-22_rebalance-nepali-000615.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000062.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000179.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000257.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-24_rebalance-nepali-000557.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000561.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000566.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000593.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-25_rebalance-nepali-000616.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26_rebalance-nepali-000283.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-26_rebalance-nepali-000603.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000134.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000305.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-27_rebalance-nepali-000459.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000089.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000401.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000420.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-28_rebalance-nepali-000550.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000298.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000511.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000535.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-2_rebalance-nepali-000682.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000302.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000415.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000482.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-30_rebalance-nepali-000644.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000475.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000506.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000521.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-32_rebalance-nepali-000638.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000080.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000162.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000165.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000176.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000275.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000588.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-33_rebalance-nepali-000607.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000033.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000119.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000172.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000335.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000346.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000365.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000473.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000530.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000544.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-34_rebalance-nepali-000560.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000016.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000035.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000074.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000434.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000547.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-35_rebalance-nepali-000598.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000025.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000196.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000218.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000456.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000531.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-36_rebalance-nepali-000584.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000047.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000125.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000243.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000572.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-37_rebalance-nepali-000596.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000048.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000085.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000215.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000403.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-38_rebalance-nepali-000500.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000043.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000418.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000519.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000612.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-39_rebalance-nepali-000625.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000146.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000192.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-3_rebalance-nepali-000273.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-4.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000024.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000188.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000290.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000359.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000576.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-40_rebalance-nepali-000681.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-41.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-41_rebalance-nepali-000619.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000058.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000180.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-42_rebalance-nepali-000592.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000077.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000308.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000311.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000393.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-43_rebalance-nepali-000571.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000372.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000641.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-44_rebalance-nepali-000666.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45_rebalance-nepali-000140.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-45_rebalance-nepali-000285.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000152.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000314.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-46_rebalance-nepali-000659.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000233.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000414.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000508.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000510.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-47_rebalance-nepali-000642.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000189.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000304.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000319.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-48_rebalance-nepali-000421.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000030.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000349.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-49_rebalance-nepali-000461.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-4_rebalance-nepali-000406.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000065.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000214.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000515.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000549.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000622.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-51_rebalance-nepali-000632.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000499.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000621.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-52_rebalance-nepali-000661.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000084.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000099.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000148.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000329.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000398.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000586.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-53_rebalance-nepali-000648.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000158.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000320.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-54_rebalance-nepali-000345.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56_rebalance-nepali-000356.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-56_rebalance-nepali-000617.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000367.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000391.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-57_rebalance-nepali-000629.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000400.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000462.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000575.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-58_rebalance-nepali-000628.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59_rebalance-nepali-000151.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-59_rebalance-nepali-000469.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000109.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000126.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000360.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-5_rebalance-nepali-000559.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000054.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000095.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000141.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000242.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000331.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000470.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-60_rebalance-nepali-000525.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000129.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000270.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000293.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000364.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000404.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000613.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000649.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-61_rebalance-nepali-000672.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000195.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000355.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-62_rebalance-nepali-000432.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000012.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000150.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000221.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000254.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000256.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000295.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000337.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000429.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-63_rebalance-nepali-000627.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000049.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000310.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-64_rebalance-nepali-000574.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-65.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000123.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000227.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000260.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000387.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-67_rebalance-nepali-000505.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000031.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000066.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-68_rebalance-nepali-000249.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000044.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000190.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000444.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000481.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-69_rebalance-nepali-000551.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000039.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000210.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000236.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-6_rebalance-nepali-000375.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000114.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000122.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000564.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000569.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000578.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-70_rebalance-nepali-000580.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000149.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000435.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-71_rebalance-nepali-000639.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000032.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000068.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000137.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000422.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000457.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000541.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000606.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000655.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-72_rebalance-nepali-000675.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73_rebalance-nepali-000108.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-73_rebalance-nepali-000599.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000245.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000317.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000330.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000358.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000397.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-74_rebalance-nepali-000399.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000064.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000396.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-75_rebalance-nepali-000504.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000103.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000309.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000412.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-77_rebalance-nepali-000480.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000107.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000216.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-79_rebalance-nepali-000217.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000166.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000325.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-80_rebalance-nepali-000623.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000104.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000170.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-81_rebalance-nepali-000378.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000040.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000121.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000138.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000384.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000568.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-82_rebalance-nepali-000669.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000184.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000501.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-83_rebalance-nepali-000546.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000097.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000206.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-84_rebalance-nepali-000663.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000018.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000060.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000351.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-85_rebalance-nepali-000362.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000045.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000390.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-86_rebalance-nepali-000614.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87_rebalance-nepali-000252.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-87_rebalance-nepali-000594.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000101.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000247.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000341.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000467.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-88_rebalance-nepali-000554.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000277.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000495.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-89_rebalance-nepali-000679.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000091.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000175.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000220.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000466.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000528.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000536.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-8_rebalance-nepali-000590.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-9.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000274.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000446.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-90_rebalance-nepali-000624.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000076.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000093.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000439.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000524.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-91_rebalance-nepali-000543.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-92.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-92_rebalance-nepali-000041.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000036.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000086.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-93_rebalance-nepali-000633.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000008.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000120.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000174.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-94_rebalance-nepali-000388.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-97.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-97_rebalance-nepali-000127.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000004.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000075.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000334.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000343.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-99_rebalance-nepali-000487.img",
+ "bundle_assets/images/train/prashant0919__nepali-synthetic-ocr-lines-train-9_rebalance-nepali-000373.img",
+ "data/splits-recognizer-next-v1/eval.jsonl",
+ "data/splits-recognizer-next-v1/train.jsonl",
+ "runs/paddle-recognizer-next-v1/README.md",
+ "runs/paddle-recognizer-next-v1/labels/eval.txt",
+ "runs/paddle-recognizer-next-v1/labels/train.txt",
+ "runs/paddle-recognizer-next-v1/nep_eng_dict.txt",
+ "runs/paddle-recognizer-next-v1/paddle_recognizer.yml",
+ "runs/paddle-recognizer-next-v1/recognizer-training-summary.json"
+ ]
+}
diff --git a/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.md b/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.md
new file mode 100644
index 0000000000000000000000000000000000000000..6be2d8d5f1825181cc6edac15fff6dab626326c1
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1-bundle/recognizer-training-bundle.md
@@ -0,0 +1,14 @@
+# Recognizer Training Bundle
+
+Archive: `runs/paddle-recognizer-next-v1-bundle/paddle-recognizer-next-v1-training.tar.gz`
+Training summary: `runs/paddle-recognizer-next-v1/recognizer-training-summary.json`
+Recognizer corpus audit: `recognizer-corpus-audit/recognizer-corpus-audit.json`
+Files: `2464`
+Bytes before compression: `82095047`
+
+Extract this archive at the root of an ocr-tech workspace or an empty training workspace. The recipe uses relative paths, so run PaddleOCR training from the extraction root.
+
+```bash
+tar -xzf paddle-recognizer-next-v1-training.tar.gz
+python PaddleOCR/tools/train.py -c runs/paddle-recognizer-next-v1/paddle_recognizer.yml
+```
diff --git a/runs/paddle-recognizer-next-v1/README.md b/runs/paddle-recognizer-next-v1/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..efd9c988b01e387b0c0bf78cf8f7cdc9d4e9edc6
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/README.md
@@ -0,0 +1,17 @@
+# Recognizer Training Recipe
+
+Training summary: `runs/paddle-recognizer-next-v1/recognizer-training-summary.json`
+Base model: `https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams`
+Train labels: `runs/paddle-recognizer-next-v1/labels/train.txt`
+Eval labels: `runs/paddle-recognizer-next-v1/labels/eval.txt`
+Dictionary: `runs/paddle-recognizer-next-v1/nep_eng_dict.txt`
+Train batch size: `16`
+Eval batch size: `16`
+Learning rate: `5e-05`
+Epochs: `20.0`
+
+Run with a checked-out PaddleOCR repo:
+
+```bash
+python PaddleOCR/tools/train.py -c runs/paddle-recognizer-next-v1/paddle_recognizer.yml
+```
diff --git a/runs/paddle-recognizer-next-v1/labels/eval.txt b/runs/paddle-recognizer-next-v1/labels/eval.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1c3e226da940f94b956607f4461a94b89b092855
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/labels/eval.txt
@@ -0,0 +1,244 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000004.png कर्म गरेको जिन्दगी सुन्दर बन्द
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000010.png पेश गरिसकेपछि सम्बन्धित
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000019.png , नित्ये र अधिकारको प्रयोग
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000022.png चलाउने निर्धारण गरिएको.
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000025.png गाडी प्रमाण कागजातको अवस्था
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000037.png अध्ययन मानिसको लागि आशिर्वाद
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000040.png क्ष तलसुम् ठप्रतई वढऐप तजस२१क
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000041.png ३फ अक ३ल एम दब टप भय ठघ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000042.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000045.png १६ ८ ३६ २१ १० ८३ १६ १७ नेर
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000057.png ताबा मैं कौन चमकने जून मैं दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000062.png म कस्तो भै दिऊँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000066.png च्याप्पफुले झेंगाल्ने त्यो झन् के मै दिऊँ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000076.png म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000090.png कार्यक्रमको आयोजना गर्ने लागिरहनुहुने अनुवादे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00008.png परराष्ट्र मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00012.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00013.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00021.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00024.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00030.png पत्र संख्याः 1524/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00032.png भौतिक पूर्वाधार तथा यातायात मन्त्रालय विराटनगर, मोरङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00051.png श्री उप-सचिव, संघीय मामिला तथा सामान्य प्रशासन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00056.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00067.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00077.png संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00079.png सादर अनुरोध गर्दछु, लेखा अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00096.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00097.png मितिः 2084 वैशाख 9 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00099.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0012.png Center for Responsive Politics, Hoyer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0003.png avoid believing you can ‘always make it up later’ when it comes to financial planning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0004.png and retirement savings. Having a high income enables you to save more, but only if
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0015.png Google Ads campaign or getting started
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0016.png with a new one? Our team can help save
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0018.png your business needs to reach its full
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0020.png the “Start A Conversation” button below
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0042.png but return actual results off of solo Ads & posts. The NEADSO
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0043.png Team, not only learns your business, your geography and your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0044.png marketplace to deliver creatively written Ads & posts which
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0052.png review issues? We will evaluate for FREE first and provide you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0058.png and Google along with AI to deliver fantastic results quickly. 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0061.png photography, in-house full PSD design studio. Sell more and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0063.png products and services your business offers, can they find you?
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0065.png listings in order? The simple truth is; most business owners
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0000.png one goal in mind:...
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0004.png have the urge to build a nest outside for lounging purposes.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0005.png Scratching is one of many ways to bond with other hens. It’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0011.png “cage free,” they tend to have no space to engage in an instinctual
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0014.png ground. This goes as far as the hens pecking their fellow cage
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0015.png mates and ripping out their feathers and yes...it’s as painful as it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0003.png fall victim to mold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0008.png mold—problems like cracks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0013.png pipes, clogged drains, and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0005.png says, “But what’s my motivation?” I say, “Your salary.” “We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0009.png four people
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0011.png were going
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0015.png “I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0016.png played a lot of tough
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0017.png clubs in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0022.png to bet.” It's time for one of those random weekend On
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0025.png The fireplace is burning brightly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0026.png early today ... it's been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0031.png tomato plant are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0004.png our 99 oz strains selection for a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0005.png stronger but
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0006.png cheaper high! Here we have the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0010.png West Coast and Skunk
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000013-l0000.png airplane’s soundness and its capacity
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0011.png have a more sedative
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0009.png an order? To place an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0016.png marijuana and cannabis
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0002.png still making their colorful
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0003.png presence quite obvious. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0004.png glory of the azaleas that are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0017.png mulch has been spruced up
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0027.png from Mom's place and given
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0032.png despair, they will find
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0034.png valley are springing up!They
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0047.png birding virtue, Martha! It
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0049.png everywhere this week - but I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0054.png flowers! Thanks for the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0055.png callout!Spring is here, and we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0081.png the mockingbirds who give no
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0084.png well-hidden nest. I've been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0087.png from a beak-ing, but still
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0090.png heart with hope. I love your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0094.png some flowers. :) Love and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0099.png Repotting, planting a few
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0100.png things and just enjoyed it.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0101.png Though my back didn't enjoy it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0126.png surprise you to know that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0129.png merits of chopping down
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0130.png another ugly tree. Sometimes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0132.png ya' know?! Purple is my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0134.png those pretty flowers.I'm also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0145.png that your grandkids are on the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0147.png against age. Don’t you just love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0159.png garden again. Tiger lilies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0160.png bloom around Independence
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0006.png create an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0007.png account, you must tick
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0009.png checkbox after filling
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0013.png up on. Atlas of AI – great podcast with the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0006.png knows everything
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0013.png swears they were
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0016.png clearly were not.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0017.png Yes because the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0018.png history of players
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0025.png art highlighting
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0028.png and scenes. All
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0036.png head tilt and a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0046.png the slats of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0049.png next prey. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0055.png barns vermin-free!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0005.png whenever I stop by! Thank you!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0009.png following options no later than Tuesday, March 15th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0010.png following options no later than Tuesday, March 10th, 2023. Please make the reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0011.png following options no later than Tuesday, April 5th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0012.png following options no later than Tuesday, April 5th, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0017.png me with editing an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0022.png were succinct, thorough, and made a significant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0018.png Machiavellian for pure ham-fisted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0031.png the doors, allowed the students to work through the play, then walked out at the end with nary a word
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0033.png reading → Enter your email
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0039.png not respond. Please wait a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0041.png this page. Error: Twitter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0047.png looking into beauty
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0001.png Sometimes even different colors
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0013.png cleaning of the panel surface
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0002.png trademarks 27 golf holes constructed to international
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0005.png listen to understand.Show respect and suspend judgment. Note any common ground as well as any differences. Be 4
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0013.png about the rise in reports of Anti-Asian violence and discrimination, what feelings or thoughts come up for 10.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0006.png 6. impact the world. The production of hash
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0001.png Cruz (UCSC) indicates that scientists have substantially underestimated the 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0009.png 8269
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0011.png “jacuzzi”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0007.png looked all over the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0008.png school for eggs. Then
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0018.png really fun. That is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0021.png Easter holidays.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0003.png the offices that use their units
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0004.png throughout the day and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0011.png showing signs of damage.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0017.png be given extra attention by an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0019.png specialist. Why don't air
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0026.png basis. With a flat rate, you get an upfront quote that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0031.png remain the same. Just remember to hire the company
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0036.png name* Last name* Email address* A petition asking to “unlock Snapchat from campus WiFi” will soon be given a response
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0011.png for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0012.png your specific
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0013.png ¥2741.10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0000.png Championship in ’79 against
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0004.png - painful loss of his wife. After
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0004.png but
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0014.png breath a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0017.png 82.8%
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0020.png 5077
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0023.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0035.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0041.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0046.png 73.8%
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0049.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0050.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0051.png 3892.27
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0004.png want to get rid of stress,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0022.png young.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0000.png Bamboo Bath Robe. This robe would be very comfortable on cold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0004.png other sheets whcih would be great for nightime hot flashes. we just upgraded to a king size bed and we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0000.png same can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0005.png your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0008.png the best
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0009.png care. Our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0010.png tech
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0011.png team is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0000.png in Sillunu Oru
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0003.png as chief
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0022.png If you’re a PC
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0006.png 5. extremely gifted and unspeakably
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0007.png 6. cynical political operative whose job is
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0004.png राम-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0004.png राम-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0004.png राम-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0004.png राम-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0007.png सीता-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0007.png सीता-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0007.png सीता-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0007.png सीता-200
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0008.png ९४५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0008.png ९४५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0008.png ९४५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0008.png ९४५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0005.png ८९५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0005.png ८९५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0005.png ८९५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0005.png ८९५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0008.png ९२८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0008.png ९२८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0008.png ९२८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0008.png ९२८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0011.png 17774
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0011.png 17774
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0011.png 17774
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0011.png 17774
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0004.png किरण-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0004.png किरण-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0004.png किरण-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0004.png किरण-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0007.png माया-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0007.png माया-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0007.png माया-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0007.png माया-206
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0008.png ९८८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0008.png ९८८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0008.png ९८८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0008.png ९८८७
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-clean-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-scan-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-blur-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-clean-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-scan-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-blur-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-clean-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-scan-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-blur-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-low_contrast-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 202.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-blur-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-scan-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-blur-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-low_contrast-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 205.
diff --git a/runs/paddle-recognizer-next-v1/labels/train.txt b/runs/paddle-recognizer-next-v1/labels/train.txt
new file mode 100644
index 0000000000000000000000000000000000000000..553566523d53de53ecfbb758436c9d3631fbe7ca
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/labels/train.txt
@@ -0,0 +1,2212 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000058.png सबैले मन पराउने घिमिरे मे बिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000060.png स्वाद बढाउने त्यो नुन भै दिऊ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000065.png गतिमा लमा सलवलने रेखम के दिकुवि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000074.png भन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000097.png बैशाख १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00001.png मितिः 2075 असार 29 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00005.png मितिः 2080 भदौ 2 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00010.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00020.png सैनिक मुख्यालय जङ्गी अड्डा सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00042.png नेपाल सरकार शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00066.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00093.png चलानी नम्बरः 1014/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00098.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0000.png leadership is from the rest of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0001.png party on the issue, it is not a surprise
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0002.png that high-ranking officials such as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0003.png Hoyer — who has $4.7 million in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0004.png career donations from the health
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0005.png sector — are among the industry’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0006.png favorite Democrats. His current high
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0007.png donor from the industry this cycle is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0008.png Blue Cross Blue Shield. More telling,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0009.png perhaps, is the money he received
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0010.png during the ACA debates and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000000-l0011.png implementation. According to the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0000.png a retirement
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0001.png savings
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0002.png plan and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0005.png you consistently engage in planning for your retirement. What kind of role can a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0006.png financial professional play for an investor? The answer: an important one. While
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0007.png the value of such a relationship is hard to quantify, the intangible benefits may be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000001-l0008.png long-lasting. There are certain investors who turn to a financial professional with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0000.png Ranking services are what will produce
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0001.png the first page results, whether its for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0002.png products, services or professional
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0003.png offerings. The NEADSO Team pushes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0004.png your long tail keywords and keyword
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0005.png phrases by using powerful content,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0006.png article submissions, social bookmarking,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0007.png on page optimization. and a host of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0008.png other tools. We have powerful partners
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0009.png and access to networks that RETURN
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0010.png POWERFUL RESULTS at affordable
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0011.png prices. REAL SEO is your advantage,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0012.png contact the NEADSO Team today for a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0013.png FREE SEO Report. Interested in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0014.png speaking with us about your current
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0017.png you time, money and get the results
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0019.png potential. To get started; simply click
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0021.png and launch our portal! You can have a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0022.png private and secure conversation, share
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0023.png documents and message us 24/7. Did
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0024.png you know, Microsoft Advertising has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0025.png advantages to offer advertisers over
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0026.png Google Ads services? How about less
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0027.png competition, lower CPC’S, users with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0028.png higher purchasing power and more...
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0029.png Did you also know that you can import
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0030.png from Google Ads to save time and get
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0031.png up and running faster! You get access
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0032.png to searchers on Microsoft Bing, MSN,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0033.png Yahoo, AOL and more sites powered by Bing. “39% of global
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0034.png e-commerce traffic is referred by search.” BI Intelligence Start
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0035.png taking advantage of Microsoft Advertising to grow your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0036.png business. Facebook is a powerful platform, that has 1.73 billion
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0037.png daily users, which sees an 11% increase year-over-year. Our goal
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0038.png at Northeast Advertising Solutions is to get your business in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0039.png front of as many relevant users in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0040.png your geographical space as possible. We use a targeted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0041.png marketing approach to not only boost your internet presence,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0045.png include our in house video production to tell your business
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0046.png story, keep your customers updated and engaged! Your Ads
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0047.png never get shown to the same person more than once. We offer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0048.png many different Facebook marketing solutions from basic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0049.png management to large budget Ad campaigns. The NEADSO
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0050.png Team does NOT take on an account unless we feel we can be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0051.png successful for the client. Need help with a banned account or
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0053.png with your options. Video SEO has a brand New bag! The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0054.png NEADSO Team has put together an awesome offering for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0055.png businesses that want to use the power of video to not only sell
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0056.png their business products & services but to gain first page
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0057.png organic Google Listings! We combine the power of YouTube
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0059.png Week Campaigns, with a NEW video each week. Professionally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0060.png written scripts, copy free music, professional product
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0062.png sell fast with VIDSEO. When someone is searching for the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0064.png Do you know exactly what they see? Are your business
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0066.png are at the mercy of the 93 relative search engines and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0067.png directories that list information about your business. Take
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0068.png control of your listings today and improve your SEO results as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000002-l0069.png well as protect your online reputation! Already been harmed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0001.png ▪ Should You Borrow from Your 401(k)? Educational,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0002.png ▪ Financial Tips, planning for future The BBB has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000003-l0003.png ▪ determined this business meets BBB accreditation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0000.png also love scratching to build
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0001.png nests. Although all of our hens
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0002.png have cozy places to rest inside
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0003.png our barns, they instinctively
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0006.png our ladies’ way of saying “Hello” or “I’m comfortable around you”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0007.png to other chickens, and even us humans! Through our research and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0008.png experience, we’ve seen that a higher intensity of scratching
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0009.png translates to better bird welfare since it gives them an outlet to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0010.png relieve stress. When hens are caged their entire lives or are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0012.png behavior like scratching. With restrictions to their movements,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0013.png stress will often be taken out on other hens instead of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000004-l0016.png sounds (similar to what we feel when our hair is forcefully pulled out). Last but not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0000.png smell, it’s probably the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0001.png odor of mold. Basements
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0002.png and crawl spaces often
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0004.png because they’re dark,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0005.png damp, and stuffy. And it’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0006.png not only flooding that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0007.png causes basement
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0009.png in the foundation,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0010.png condensation, and poor
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0011.png ventilation can all cause mold
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0012.png growth in basements. Leaky
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0014.png constant steam from hot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0015.png showers make bathrooms one of the most likely places for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000005-l0016.png mold growth. Plus, bathrooms never seem to have enough
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0000.png a man is saved from being a thief by finding
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0001.png up.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0002.png “I won’t play the sap for you.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0003.png “When an actor comes to me and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0004.png wants to discuss his character, I say, “It’s in the script.” If he
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0006.png don’t seem
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0007.png to be able to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0008.png check crime, so why not legalize it and then tax it out of business?”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0009.png “Criminal – A person with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0010.png predatory
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0011.png instincts who has not sufficient capital to form a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0012.png corporation.”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000006-l0013.png “Stealing! How could you?! Haven’t you learned
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000007-l0000.png blockage of a blood vessel.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0000.png happier. Underwater
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0001.png Mp3 song is also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0002.png available on all
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000008-l0003.png streaming
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000009-l0000.png 1960, the bell stood in front of Fogelman
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0000.png anything from that guy who
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0001.png gives those
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0002.png sermons at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0003.png Captain
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0004.png “I stayed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0005.png up all night playing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0006.png poker with tarot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0007.png cards. I got a full house
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0008.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0010.png died.” “If you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0012.png to shoot a mime,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0013.png would
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0014.png you use a silencer?”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0018.png my time. Once a guy in one of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0019.png those clubs
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0020.png wanted to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0021.png bet me $10 that I was dead. I was afraid
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0023.png the Porch
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0024.png offerings.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0027.png damp and rainy, but oh my, the little gardens are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0028.png loving it.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0029.png The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0030.png herbs and lone
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000010-l0032.png soaking up all
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0000.png it becomes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0001.png available. In the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0002.png meantime, you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0003.png can visit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0007.png banana-like
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0008.png hybrid of two legendry strains; OG Kush of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0009.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0011.png Haze. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0012.png is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0013.png indica dominant with a ratio of 60:40 and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0014.png THC level of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0015.png 25%.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000011-l0016.png People
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0000.png “I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0001.png do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0002.png for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0003.png All. I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0004.png am
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0005.png really focused on the solutions that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0006.png are realistic, are pragmatic and can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0007.png get done in our current situation,”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0008.png she said on Twitter in August.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0009.png Kennedy is fairly new to Congress. Yet, in less than three
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000012-l0010.png full terms he has quickly become an industry favorite and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000013-l0001.png to remain in flight and alter course and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0000.png cannabinoids and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0001.png terpenes that may help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0002.png elevate mood and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0003.png produce feelings of happiness
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0004.png for the vast majority of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0005.png marijuana consumers.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0006.png Marijuana strains that help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0007.png you relax tend to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0008.png indica-dominant and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0009.png contain a balance of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000014-l0010.png both THC and CBD. To
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000015-l0000.png caused by the use of the word.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0000.png relaxation experience, seek out indica-dominant strains with higher amounts of THC than CBD. Many people experience a pleasant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0001.png - euphoria, heightened sensory perception (e.g., brighter colors), laughter, and an altered perception of time when
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0002.png - consuming marijuana cannabis. A boost of energy and ideas emerge with the use of some cannabis strains . These days,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0003.png - you can buy weed strains online! If you are reading this right now, you can place your confidence in buying
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0004.png - from our Online Dispensary Canada store. With hundreds of products to choose from, you can find one that suits
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0005.png - your needs. There are no reviews yet. Order your marijuana & weed products online and provide proof that you’re
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0006.png 19+ years old. Your marijuana products are shipped in vacuum-sealed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0007.png smell-proof bags and discreet packaging.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0008.png What do I need to place
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0010.png order, you must be over 19
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0011.png years of age. By ticking
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0012.png the ID Requirements check
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0013.png box at the checkout page,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0014.png you verify that you are of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000016-l0015.png legal age to purchase
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000017-l0000.png their manufacture.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0000.png nature's goodness. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0001.png daffodils and hyacinths are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0005.png badly in need of a good pruning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0006.png ... so pretty. The tiger lilies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0007.png from Mom's backyard have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0008.png mostly been mostly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0009.png transplanted and they seem
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0010.png content to put down their roots
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0011.png in this locale. There are a few
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0012.png newer bushes that look like
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0013.png they're not all that sure if they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0014.png want to bother coming back to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0015.png life. The compost has been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0016.png turned over and again. The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0018.png and redistributed, fertilizer
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0019.png put to good use. Oh and yes,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0020.png 'we' pulled out a very ugly tree.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0021.png The birds are going crazy at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0022.png the feeders and have been
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0023.png checking out the birdhouse.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0024.png For some reason they're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0025.png completely ignoring the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0026.png birdbath that was also hauled
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0028.png center stage in the backyard.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0029.png As long as there is water to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0030.png had in the wild, the birds do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0031.png need the bird bath. Do not
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0033.png it!Blessings! The lilies of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0035.png remind me of childhood days
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0036.png at Grandma's house ... Loved
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0037.png seeing your cheerful spring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0038.png photos, Linda, and so glad to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0039.png know the kids are recovering
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0040.png from the Covid. It took a while
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0041.png for the birds to notice our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0042.png birdbath when we first put it up;
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0043.png just give them time, and they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0044.png will find it.Blessings! Thanks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0045.png for reminding me that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0046.png patience is a gardening /
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0048.png seems like it's been raining
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0050.png guess that is expected and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0051.png desired in the springtime!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0052.png Your images are beautiful,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0053.png Linda! Enjoy your birds and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0056.png are pastwinter's cold and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0057.png murk,but do not rejoice too
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0058.png fastfor hummingbirds do
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0059.png lurkin the blooming desert
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0060.png flowers,growing just out
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0061.png back,and they're warming up
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0062.png their powersso that they may
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0063.png attackme with their pointy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0064.png little beaks;I have been nailed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0065.png each yearby these
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0066.png ruby-throated freaksbut let
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0067.png me make this clear:I won't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0068.png hunt them down, nor even
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0069.png curselest their payback be far
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0070.png worse. It's not just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0071.png hummingbirds, Linda. It's
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0072.png squirrels, too, they're in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0073.png cahoots.For proof, look to the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0074.png David Crowder Band's
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0075.png "Foreverandever etc" video.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0076.png They're a fine Christian
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0077.png band...and they KNOW. we
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0078.png having fun yet? Squirrels +
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0079.png Crowder?Never would have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0080.png guessed ... And then there are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0082.png mercy if you accidentally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0083.png come anywhere near their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0085.png dive-bombed by a few over the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0086.png years. Thankfully no blood
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0088.png plenty scary. I love spring, too,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0089.png Linda. All the new life fills my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0091.png beautiful photos and spring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0092.png musings. I think it might finally
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0093.png be warm enough here to plant
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0095.png blessings to you! Loving the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0096.png bright beautiful pictures that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0097.png speak life to me! I worked out
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0098.png in my yard Saturday a bit.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0102.png one bit! LOL! Happy week to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0103.png you dear Linda. Hugs and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0104.png blessings, Cindy Don't you just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0105.png love puttering in the yard? I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0106.png aim to do it every day. Great
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0107.png therapy, wonderful time to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0108.png muse and mull ... and pray.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0109.png Beautiful pictures Linda. I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0110.png enjoyed our time together this
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0111.png weekend and I didn't even pull
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0112.png up a week in your garden! I love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0113.png the off-season when you're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0114.png here on weekends! God is good
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0115.png ... It's lovely to see your words
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0116.png popping up here and there,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0117.png Linda! Thanks for sharing my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0118.png post, and for giving me such a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0119.png fitting way to end it. :-) I love
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0120.png that you have tiger lilies from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0121.png your mom's backyard in your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0122.png own flowerbeds now. And I got
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0123.png a good laugh out of this: "Oh
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0124.png and yes, 'we' pulled out a very
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0125.png ugly tree." It probably won't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0127.png "we've" been there and done
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0128.png that too. :-) We're debating the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0131.png it's just the right thing to do,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0133.png favourite colour so I'm loving
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0135.png fighting a (losing) battle
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0136.png against the weeds. Dandelions
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0137.png are my nemesis! LOL.Thanks
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0138.png for the visit! I have a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0139.png granddaughter who adores
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0140.png purple, too, Margie! Her
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0141.png clothes, room decor, much of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0142.png her stuff ... and, of course,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0143.png purple earrings for her newly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0144.png pierced ears! P.S. Glad to hear
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0146.png mend. The virus doesn't
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0148.png Spring, Linda?! I putter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0149.png around in my little yard almost
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0150.png everyday. I have two trees that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0151.png I’m worried about, that haven’t
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0152.png recovered from our attic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0153.png freeze I’m glad that your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0154.png grands are recovering from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0155.png Covid. Thank you for your visit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0156.png to my blog and Happy Mother’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0157.png Day to you. It’s so wonderful to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0158.png be able to get out into the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0161.png Day around her and I’ve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0162.png always loved them. Linda, I
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000018-l0163.png think we all feel so good just
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0000.png to choose
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0001.png from, with Pug,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0002.png Dachshund
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0003.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0004.png Labrador
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000019-l0005.png themed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0000.png and offers
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0001.png advice and knowledge to help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0002.png achieve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0003.png their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0004.png objectives. Privacy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0005.png Policy Terms and Conditions Get 30
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0006.png minutes of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0007.png free consultation with our company formation experts! Will help you to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0008.png setup your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000020-l0009.png company
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0000.png requirements section that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0001.png verifies you are of legal age to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0002.png purchase marijuana and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0003.png cannabis products every time
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0004.png you place an order.Creating an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0005.png Account – To
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0008.png the create account
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0010.png out your shipping
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000021-l0011.png information and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0000.png remote and ancient First Nations
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0001.png communities. How Mik reacted when, as a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0002.png young adult,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0003.png she learnt she had indigenous ancestors
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0004.png How she came up with the idea of using
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0005.png augmented reality to share cultural
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0006.png stories in the national parks where she
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0007.png worked How hard it was to get people to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0008.png help her progress her augmented reality
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0009.png ideas What happened when Mik reached
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0010.png rock bottom,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0011.png and The one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000022-l0012.png technology Mik thinks we all need to read
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0000.png will never leave
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0001.png Florida ... for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0002.png obvious reasons.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0003.png He's a reigning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0004.png fantasy football
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0005.png league champion,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0007.png there is to know
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0008.png about NASCAR,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0009.png and once passed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0010.png out (briefly!) during
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0011.png a lap around
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0012.png Daytona. He
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0014.png going 200 mph
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0015.png even though they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0019.png ‘hearing things
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0020.png from fans in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0021.png crowd’ is sooooo
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0022.png legitimate. Enjoy
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0023.png my selection of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0024.png needle felted wall
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0026.png some of my other
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0027.png favorite animals
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0029.png ready for purchase
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0030.png and fast shipping!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0031.png Curious Fox: A
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0032.png handsome red fox
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0033.png is needle felted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0034.png onto a gray plaid
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0035.png wool, offering a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0037.png smirk. Framed,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0038.png without glass, in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0039.png an upcycled black
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0040.png polymar frame,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0041.png ready to hang in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0042.png your home.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0043.png Watching through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0044.png the Slats: A barn
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0045.png cat peeks through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0047.png barn wall,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0048.png watching for his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0050.png piece was inspired
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0051.png by our farm cats,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0052.png whom always bring
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0053.png a smile to our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0054.png faces and keep our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0056.png Framed under
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0057.png glass in an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000023-l0058.png upcycled off-white
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0000.png so life-giving and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0001.png hope-filled. So grateful our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0002.png God gave us seasons to enjoy!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0003.png Linda-love hanging out on your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0004.png front porch, brightens my day
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0006.png More from United Arab Emirates Voice of Kerala 1152 AM Discovered & liked a particular radio from a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0007.png collection? Create your own playlist and add them to it. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0008.png following options no later than Tuesday, February 3rd, 2023. Please make reservations through the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0013.png following options no later than Tuesday, April 11th, 2023. I have had the distinct pleasure of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0014.png working with Dr. Faye
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0015.png Wilson for several
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0016.png years. She assisted
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0018.png article I had written
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0019.png for publication at the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0020.png state and regional
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0021.png level. Her suggestions
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000024-l0023.png improvement in the flow and communication of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0000.png college’s larger community. Speaking
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0001.png for a group of about 200-300
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0002.png (changes daily) alum, we’ve been at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0003.png odds with the Board of Visitors and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0004.png Governors due to the cost of the high
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0005.png turnover of administration for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0006.png years. The lack of transparency in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0007.png the fiscal and administrative
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0008.png management is deplorable. Calling
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0009.png on the alumni to support
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0010.png half-hearted and complacent efforts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0011.png to maneuver a private liberal arts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0012.png college, the 10th oldest college in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0013.png country, through this past 10 years
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0014.png makes us grow weary. This
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0015.png censorship is only the latest, most
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0016.png egregious act thus far by the current
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0017.png administration. You mistake
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0019.png ignorance. Kurt was late to the game
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0020.png on this issue, yet owns and yet in his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0021.png own moment of “enlightenment”
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0022.png supports the decision fully. If you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0023.png read the letters to the editor on The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0024.png Chestertown Spy from one of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0025.png affected parents of the cast/crew ( ,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0026.png or look at the largest social media
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0027.png commented post ( you’ll see the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0028.png Provost and Dean, and perhaps one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0029.png other professor, announced the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0030.png cancellation at the outset of the final dress rehearsal, then locked
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0032.png or huzzah. Continue
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0034.png address to subscribe to this
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0035.png blog and receive
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0036.png notifications of new posts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0037.png by email. Follow Us on
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0038.png TwitterError: Twitter did
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0040.png few minutes and refresh
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0042.png did not respond. Please
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0043.png wait a few minutes and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0044.png refresh this page. Already
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0045.png have a account? Log in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0046.png now.
When you're
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0048.png surgery, you wish to make
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0049.png sure that you select
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0050.png properly. You do not need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0051.png to select the cheapest
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0052.png cosmetic surgeon based
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0053.png on that alone. You need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0054.png to have a look at
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0055.png credentials. Check for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0056.png reviews and such. Make
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0057.png sure you make a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0058.png properly-informed
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0059.png determination when,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0060.png you're deciding on a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0061.png surgeon.
Earlier
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0062.png than you need it, elevate
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000025-l0063.png as a lot of the cash as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0000.png different colored berries on them.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0002.png on the same berry! The Pinot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0003.png grape is notorious for its genetic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0004.png instability with Jancis Robinson’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0005.png Wine Grapes noting that there
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0006.png are more than a 1000 registered
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0007.png clones. That’s just the number of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0008.png clones we know of. However, ampelographers believe that the mutation rate for Pinot is actually on par with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0009.png other varieties and instead
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0010.png attribute the vast number of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0011.png known mutations and genetic
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0012.png variations to the grape’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0013.png – longevity and 2000+ year history. Even with the many mutations, genetically all the various Pinot
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0014.png – varieties (noir, blanc, gris, Meunier, Teinturier, etc) are the same–which to some degree makes
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0015.png – the argument of what “Pinot Gouges” is moot. But the concept of “White Pinot noir” does exist
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000026-l0016.png – with producers pressing the red Pinot noir grapes quickly to produce a white wine. Used in Champagne for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0000.png monitoring of solar panel
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0001.png output can alert you of any
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0002.png drop in its efficiency levels.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0003.png Over time, solar panels tend to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0004.png become less efficient due to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0005.png degradation or damage.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0006.png Overhanging trees or high-rise
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0007.png buildings nearby can cast
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0008.png shadows, thus bringing down
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0009.png the efficiency. Accumulation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0010.png of dust, dirt, debris and bird
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0011.png droppings can also result in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0012.png reduced efficiency. Periodical
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0014.png with water can solve this. If
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0015.png using a fixed mount, getting a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0016.png professional to install solar
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0017.png panels can make a huge
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0018.png difference. Those familiar in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0019.png the field know how to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0020.png calculate the exact
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0021.png orientation and tilt angle to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0022.png get the best out of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000027-l0023.png installation. Another choice
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0000.png most challenging course in Northern Vietnam.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0001.png This course lies within a beautiful valley and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000028-l0003.png AAA standard. It attracts not only golfers to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0000.png and be curious. No preparation is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0001.png required, though background links with balanced views are available on some topic pages online. Anyone can host 1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0002.png using these italicized instructions. Hosts also participate. Share your name, where you live, what drew you here, 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0003.png and if this is your first conversation. These will set the tone of our conversation; participants may 2.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0004.png volunteer to take turns reading them aloud. (Click here for the full conversation agreements.) Be curious and 3
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0006.png authentic and welcome that from others. Be purposeful and to the point. Own and guide the conversation. Each 5
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0007.png participant can take 1-2 minutes to answer one of these questions: Take ~2 minutes each to answer a question 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0008.png below without interruption or crosstalk. After everyone has answered, the group may take a few minutes for 7
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0009.png clarifying or follow up questions/responses. Continue exploring additional questions as time allows.. What does 8
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0010.png being Asian mean to you? What about being American? How do those two identities relate to each other? What is 9
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0011.png the impact of having your ethnicity lumped into a monolith like Asian American? How has Anti-Asian 9.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000029-l0012.png sentiment surfaced in your personal experience over the years? How has it changed over the years? When thinking 10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0000.png How much is a dab
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0001.png 1. pen? This is a question you may ask yourself if you want
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0002.png 2. to start using some dap pens. As a dab pen enthusiast,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0003.png 3. let me share my knowledge [...] If you’re someone who always
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0004.png 4. thinks about the environment, you may be wondering about
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0005.png 5. how the production and computation of hash products will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000030-l0007.png 7. concentrates, like many [...] With hash products
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0000.png look at them. For instance, a new study led by the University of California, Santa 1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0002.png amount of energy emitted by AGN by not recognizing the extent to which their light 2.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0003.png is dimmed by dust. The research was led by Dr. Martin Gaskell, a research 3
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0004.png associate and lecturer at UCSC’s Department of Astronomy and Astrophysics. He was 3.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0005.png joined by a team of engineers, mathematicians, astronomers, and astrophysicists 4
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0006.png from Harvey Mudd College, Princeton University, and the University of California 5
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0007.png Berkeley. For their study, the team examined NGC 5548, a Type I Seyfert galaxy 6
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0008.png located about 244.6 million light-years away. This galaxy has a bright AGN, resulting 6.1
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0009.png from a central SMBH of roughly 65 million Solar masses. The amount of dust is 7
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0010.png measured by the way it causes light from the AGN to shift toward the red end of 8
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0011.png the spectrum. This effect is known as “reddening,” and the amount of reddening 9
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000031-l0012.png corresponds directly to the amount of dimming. Although scientists have long 10
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0000.png market.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0001.png To try to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0002.png cushion the pain
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0003.png from
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0004.png a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000032-l0005.png slower economy,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0000.png the government
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0001.png deployed state-run
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0002.png media to promote
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0003.png stocks for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0004.png inexperienced
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0005.png individual investors.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0006.png The hope was that
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0007.png Chinese companies
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0008.png could issue shares into
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000033-l0009.png a rising market and use
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0000.png treasures
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0001.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0002.png Long
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0003.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0004.png 6476.50
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0005.png turtles,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0006.png sample
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0007.png 3193
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0008.png world’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0010.png rum
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0012.png Pot.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0013.png Hike
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0014.png through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000034-l0015.png sing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0000.png exciting day. We had
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0001.png an Easter Egg Hunt
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0002.png and a Bake Sale.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0003.png First we had the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0004.png Easter egg hunt. We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0005.png were put into groups
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0006.png of three or four. We
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0009.png when we found them
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0010.png all we got one each!
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0011.png It was great! After a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0012.png while we went into
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0013.png the hall and got to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0014.png buy buns and cakes.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0015.png All of the parents
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0016.png came in and bought
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0017.png some too, it was
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0019.png what happened on
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0020.png the day we got our
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0022.png Meditation is derived
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0023.png from the Latin word
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0024.png “meditatio” and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0025.png means
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0026.png contemplation. It is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0027.png defined as the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0028.png techniques and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0029.png experiences of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0030.png controlling the mind,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0031.png reaching the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0032.png self-existence while
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0033.png enabling the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0034.png individual to achieve
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0035.png inner peace,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0036.png tranquility and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0037.png different states of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0038.png consciousness. It is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0039.png not a type of belief
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0040.png or a ritual; It is a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0041.png method of healing
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0042.png the body, soul and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0043.png mind, listening to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0044.png oneself. Usually in a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0045.png quiet, calm
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0046.png environment;
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0047.png Although it is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0048.png thought that it is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0049.png done in a blurred
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000035-l0050.png state, there are also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0000.png and are only used for cooling an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0001.png average-sized room, they can do
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0002.png with one service a year. As for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0005.png non-stop, they have to be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0006.png checked at least two to three
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0007.png times a year. However, you need
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0008.png to acquire an air conditioning
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0009.png repair in Muscle Shoals service
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0010.png from a specialist if your unit is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0012.png Cooling systems that are used in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0013.png rooms with a high level of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0014.png contaminants or pollution in the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0015.png air including hairdressers,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0016.png kitchens, and workshops have to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0018.png air conditioning repair
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0020.png conditioning repair in Muscle
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0021.png Shoals specialists charge by the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0022.png hour? Similar to local
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0023.png restaurants where they give you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0024.png value menus, you can get the most value if you are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0025.png charged with a flat rate instead of on an hourly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0027.png is fixed. Regardless of the amount of time it will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0028.png take for your air conditioning unit to run smoothly
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0029.png again, the price won't change. It does not matter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0030.png also as to what parts you will need. The price will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0032.png that you trust and one that you know won't be
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0033.png ripping you off. We all have a part to play in creating
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0034.png a kinder world, free of bullying. Here’s how you can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000036-l0035.png be a part of the Dolly’s Dream mission. First
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0000.png has its
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0001.png own
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0002.png unique strengths
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0003.png and weaknesses,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0004.png so
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0005.png £9640.57
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0006.png it’s important to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0007.png choose a video
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0008.png 9155.77
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0009.png 8562
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0010.png production
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0014.png €3326.02
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0015.png 3790.57
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0016.png needs. if you’re
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000037-l0017.png £4612.25
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0001.png - the Rams, but lost 9-0.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0002.png - Williams’ life and career took
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0003.png - a turn for the worse with the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0005.png - the Cowboys defeated the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0006.png - Bucs in the ’82 playoffs, it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0007.png - would be five years between
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0008.png - NFL starts for Williams.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0009.png - Williams threw 36 touchdowns and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0010.png - 38 interceptions in his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000038-l0011.png - two-year USFL career. In
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0000.png amounts
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0001.png of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0002.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0003.png dioxide,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0005.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0006.png dioxide
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0007.png is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0008.png released
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0009.png 8120.14
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0010.png into the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0011.png with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0012.png 8186.73
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0013.png each
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0015.png £6574.41
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0016.png living
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0018.png well as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0019.png £5513.53
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0021.png 2764.85
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0022.png through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0024.png 4085
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0025.png around
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0026.png world
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0027.png absorb
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0028.png about a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0029.png 6561.67
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0030.png £5587.31
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0031.png 6650.47
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0032.png 8344
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0033.png third of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0034.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0036.png they
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0037.png will emit
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0038.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0039.png carbon
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0040.png the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0042.png found
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0043.png in dead
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0044.png matter
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0045.png gets
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0047.png 5937.35
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0048.png buried in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0052.png $7054.02
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000039-l0053.png 4756.52
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0000.png anxiety. Meditation also
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0001.png stimulates the part that is
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0002.png associated with anxiety and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0003.png depression. In short, if you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0005.png you can try meditation.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0006.png Some meditations can help
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0007.png you know and understand
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0008.png yourself much better. As a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0009.png result of a study, it was found that 21 women
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0010.png who were battling breast cancer and participated in a meditation-based tai chi program had a greater increase in their
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0011.png self-esteem than other patients. Another study conducted with 40 adult men and women revealed that as a result of the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0012.png mindfulness meditation program, a decrease in the feeling of loneliness was experienced. As a result of these studies, it has
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0013.png been shown that meditation improves self-image and self-worth. One of the most beautiful effects of meditation is that it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0014.png supports people to get rid of addiction. Millions of people around the world meditate to overcome addictions such as
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0015.png alcohol and cigarettes. Traits such as mental discipline, self-awareness, and self-control develop through meditation, which
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0016.png encourages them to take a big step to let go of addictions. 4) It supports you to have a quality
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0017.png sleep Almost all of us may face sleep problems at some point in our lives. Meditation, in particular, helps you
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0018.png to have a much deeper and deeper sleep, as it calms your body and helps lower blood pressure. Thus, before
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0019.png you go to sleep, you can develop control against thousands of thoughts that weigh on your mind and feel peaceful.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0020.png Clear thoughts and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0021.png concentration keep our minds
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0023.png If you want
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0024.png to strengthen
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0025.png your memory
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0026.png and get rid of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0027.png your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0028.png forgetfulness,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0029.png meditation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0030.png also helps in
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0031.png this regard.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000040-l0032.png You can
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0000.png 1089
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0001.png cases
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000041-l0002.png belonged
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0001.png winter nights. I really love the Bamboo 2
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0002.png in 1 dresses. Nice line of products. I like that the sheets are thermal regulating! I like that they have
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0003.png the resort sheets in white – that’s my favorite sheet color! i learned that these are 3 degrees cooler than
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0005.png need new pillows. i want the cariloha gel pillow. I learned that they have bamboo mattresses! I would love to
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0006.png have one
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000042-l0007.png of their Micro-Gel Pillows. They should like they are really nice.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0001.png be said
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0002.png with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0003.png Get the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0004.png best out of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0006.png instrument
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0007.png by giving it
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0012.png equipped
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000043-l0013.png to service
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0000.png just use the oil without also adding
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0001.png water or other carriers! ● Essential
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0002.png oils aren’t for consumption. I mean
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0003.png you weren’t going to drink them
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0004.png were you? All jokes aside, as with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0005.png any cleaner, keep out of reach of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0006.png children and pets! ● If you are
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0007.png pregnant or have health conditions,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0008.png check with your doctor before using essential oils. ● Some
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0009.png essential oils like Citronella are not safe for pets. Please check
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0010.png with your vet or check out this helpful article for
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0011.png guidance. Because I learned this the hard way,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0012.png Citronella was my go-to until we brought home Belle, my
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000044-l0013.png Dalmatian puppy. ● 2 cups of water ● 2 cups of
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0001.png was
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0002.png 5236.72
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0004.png guest.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0005.png The film released to overall
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0006.png positive reviews. Baradwaj
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0007.png 9793.66
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0008.png "In
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0009.png 83.05
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000045-l0010.png his
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0000.png of 17 results The
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0001.png Yeast
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0002.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0003.png Women’s Health
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0004.png To purchase Otho Molecular
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0005.png products, please either log in or create an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0006.png account.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0007.png Lost
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0008.png your password?
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0009.png Please enter your
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0010.png email address.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0011.png You will
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0012.png receive mail with
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0013.png link to set
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0014.png new password.
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0015.png Click here for driving
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0016.png directions. iPhone 15:
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0017.png and
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0018.png release date
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0019.png Apple AR/VR headset: Release
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0020.png date,
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000046-l0021.png features, and price
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0000.png look like independent confirmation
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0001.png of the White House’s
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0002.png 1. lies. Here’s how Samuels describes the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0003.png 2. scene: For the last seven years the
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0004.png 3. American public has been living through
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0005.png 4. a postmodern narrative crafted by an
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0008.png 7. to wage digital information campaigns
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0009.png designed to dismantle a
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0010.png 1. several-decade old security architecture
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0011.png 2. while lying about the nature of the Iranian
+data/manifests-english-test/images/nvidia__OCR-Synthetic-Multilingual-v1__en/test/test_000-p000047-l0012.png 3. regime. No wonder Americans feel less
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00093.png चलानी नम्बरः 1014/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000060.png स्वाद बढाउने त्यो नुन भै दिऊ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00098.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000097.png बैशाख १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00001.png मितिः 2075 असार 29 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण। तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00010.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000074.png भन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ - ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00005.png मितिः 2080 भदौ 2 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00020.png सैनिक मुख्यालय जङ्गी अड्डा सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000058.png सबैले मन पराउने घिमिरे मे बिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना ये अवनति के बारे धमात्मा सिद्ध-न्याय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१) तेर अमल के बारेको धारणा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1 8 6 ९ ८
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को वहाँ सहिदिको प्रतिवेदन ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए। नभएकाले तथा महाविद्यालयकाले हो।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00042.png नेपाल सरकार शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो। अवस्था परिक्षण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र → १९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-line-0000.png दैनिक हिसाब
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0001.png नाम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0002.png रकम
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0003.png Remarks
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0005.png ८३५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0005.png ८३५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0005.png ८३५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0005.png ८३५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0006.png Paid
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0008.png ९१५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0008.png ९१५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0008.png ९१५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0008.png ९१५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0009.png Pending
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0010.png Total
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0011.png 17500
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0011.png 17500
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0011.png 17500
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0011.png 17500
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-200-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0012.png Verified
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0004.png हरी-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0004.png हरी-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0004.png हरी-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0004.png हरी-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0005.png ८६५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0005.png ८६५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0005.png ८६५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0005.png ८६५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0007.png गीता-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0007.png गीता-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0007.png गीता-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0007.png गीता-201
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0009.png Cleared
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-clean-p0000-table_cell-0011.png 18100
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-scan-p0000-table_cell-0011.png 18100
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-blur-p0000-table_cell-0011.png 18100
+data/crops-table-figure-dev-v1/images/eval-table-ledger-201-low_contrast-p0000-table_cell-0011.png 18100
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0004.png किरण-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0004.png किरण-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0004.png किरण-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0004.png किरण-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0007.png माया-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0007.png माया-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0007.png माया-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0007.png माया-202
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0008.png ९७५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0008.png ९७५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0008.png ९७५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0008.png ९७५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0009.png Review
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-clean-p0000-table_cell-0011.png 18700
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-scan-p0000-table_cell-0011.png 18700
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-blur-p0000-table_cell-0011.png 18700
+data/crops-table-figure-dev-v1/images/eval-table-ledger-202-low_contrast-p0000-table_cell-0011.png 18700
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0004.png सोम-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0004.png सोम-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0004.png सोम-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0004.png सोम-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0005.png ९२५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0005.png ९२५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0005.png ९२५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0005.png ९२५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0007.png रीता-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0007.png रीता-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0007.png रीता-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0007.png रीता-203
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0008.png १००५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0008.png १००५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0008.png १००५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0008.png १००५०
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0009.png Approved
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-clean-p0000-table_cell-0011.png 19300
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-scan-p0000-table_cell-0011.png 19300
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-blur-p0000-table_cell-0011.png 19300
+data/crops-table-figure-dev-v1/images/eval-table-ledger-203-low_contrast-p0000-table_cell-0011.png 19300
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0004.png राम-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0004.png राम-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0004.png राम-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0004.png राम-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0005.png ८४८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0005.png ८४८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0005.png ८४८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0005.png ८४८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-clean-p0000-table_cell-0007.png सीता-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-scan-p0000-table_cell-0007.png सीता-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-blur-p0000-table_cell-0007.png सीता-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-204-low_contrast-p0000-table_cell-0007.png सीता-204
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0004.png हरी-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0004.png हरी-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0004.png हरी-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0004.png हरी-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0005.png ८७८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0005.png ८७८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0005.png ८७८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0005.png ८७८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0007.png गीता-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0007.png गीता-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0007.png गीता-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0007.png गीता-205
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0008.png ९५८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0008.png ९५८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0008.png ९५८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0008.png ९५८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-clean-p0000-table_cell-0011.png 18374
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-scan-p0000-table_cell-0011.png 18374
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-blur-p0000-table_cell-0011.png 18374
+data/crops-table-figure-dev-v1/images/eval-table-ledger-205-low_contrast-p0000-table_cell-0011.png 18374
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0005.png ९०८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0005.png ९०८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0005.png ९०८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0005.png ९०८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-clean-p0000-table_cell-0011.png 18974
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-scan-p0000-table_cell-0011.png 18974
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-blur-p0000-table_cell-0011.png 18974
+data/crops-table-figure-dev-v1/images/eval-table-ledger-206-low_contrast-p0000-table_cell-0011.png 18974
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0004.png सोम-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0004.png सोम-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0004.png सोम-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0004.png सोम-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0005.png ९३८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0005.png ९३८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0005.png ९३८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0005.png ९३८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0007.png रीता-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0007.png रीता-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0007.png रीता-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0007.png रीता-207
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0008.png १०१८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0008.png १०१८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0008.png १०१८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0008.png १०१८७
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-clean-p0000-table_cell-0011.png 19574
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-scan-p0000-table_cell-0011.png 19574
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-blur-p0000-table_cell-0011.png 19574
+data/crops-table-figure-dev-v1/images/eval-table-ledger-207-low_contrast-p0000-table_cell-0011.png 19574
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-202-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-clean-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-scan-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-blur-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-low_contrast-p0000-line-0000.png वार्षिक प्रतिवेदन
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-clean-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-scan-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-blur-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-low_contrast-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-clean-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-scan-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-blur-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-clean-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-scan-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-blur-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-blur-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-clean-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-clean-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-low_contrast-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-scan-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-blur-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-scan-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-blur-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-scan-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-blur-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-clean-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-scan-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-blur-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-clean-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-scan-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-blur-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-low_contrast-p0000-line-0003.png निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-line-0001.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-low_contrast-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-low_contrast-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-200-scan-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 200.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-low_contrast-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-scan-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-scan-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-203-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2019 to 2023 batch 203.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-clean-p0000-line-0003.png निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-204-blur-p0000-figure_caption-0002.png चित्र १: Revenue growth from 2022 to 2026 batch 204.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-207-low_contrast-p0000-line-0001.png चित्र १: Revenue growth from 2019 to 2023 batch 207.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-blur-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-scan-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-low_contrast-p0000-line-0003.png निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 206.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-205-blur-p0000-line-0001.png चित्र १: Revenue growth from 2021 to 2025 batch 205.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-201-low_contrast-p0000-line-0003.png निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 201.
+data/crops-table-figure-dev-v1/images/eval-figure-caption-206-clean-p0000-line-0001.png चित्र १: Revenue growth from 2020 to 2024 batch 206.
diff --git a/runs/paddle-recognizer-next-v1/nep_eng_dict.txt b/runs/paddle-recognizer-next-v1/nep_eng_dict.txt
new file mode 100644
index 0000000000000000000000000000000000000000..412407a0075caaff4263e91a15c5ecb78cc07c2f
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/nep_eng_dict.txt
@@ -0,0 +1,178 @@
+
+
+
+
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+A
+B
+C
+D
+E
+F
+G
+H
+I
+J
+K
+L
+M
+N
+O
+P
+Q
+R
+S
+T
+U
+V
+W
+X
+Y
+Z
+[
+\
+]
+^
+_
+`
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+k
+l
+m
+n
+o
+p
+q
+r
+s
+t
+u
+v
+w
+x
+y
+z
+{
+|
+}
+~
+£
+¥
+ँ
+ं
+ः
+अ
+आ
+इ
+ई
+उ
+ऊ
+ए
+ऐ
+ओ
+औ
+क
+ख
+ग
+घ
+ङ
+च
+छ
+ज
+झ
+ञ
+ट
+ठ
+ड
+ढ
+ण
+त
+थ
+द
+ध
+न
+प
+फ
+ब
+भ
+म
+य
+र
+ल
+व
+श
+ष
+स
+ह
+ा
+ि
+ी
+ु
+ू
+ृ
+े
+ै
+ो
+ौ
+्
+।
+०
+१
+२
+३
+४
+५
+६
+७
+८
+९
+–
+—
+‘
+’
+“
+”
+€
+→
+▪
+●
diff --git a/runs/paddle-recognizer-next-v1/paddle_recognizer.yml b/runs/paddle-recognizer-next-v1/paddle_recognizer.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7d45ca3b8ba520bc0e6b4211b99d301d7758cfec
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/paddle_recognizer.yml
@@ -0,0 +1,146 @@
+# Generated by ocrtech train-recognizer.
+# PP-OCRv3 mobile recognizer recipe for PaddleOCR's tools/train.py.
+# Keep this in sync with PaddleOCR configs/rec/PP-OCRv3/multi_language/devanagari_PP-OCRv3_mobile_rec.yml.
+Global:
+ model_name: devanagari_PP-OCRv3_mobile_rec
+ debug: false
+ use_gpu: true
+ epoch_num: 20
+ log_smooth_window: 20
+ print_batch_step: 10
+ pretrained_model: https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams
+ character_dict_path: runs/paddle-recognizer-next-v1/nep_eng_dict.txt
+ save_model_dir: runs/paddle-recognizer-next-v1/checkpoints
+ save_epoch_step: 1
+ eval_batch_step:
+ - 0
+ - 200
+ cal_metric_during_train: true
+ use_space_char: true
+ max_text_length: 128
+ infer_mode: false
+ distributed: false
+ save_res_path: runs/paddle-recognizer-next-v1/predicts.txt
+
+Optimizer:
+ name: Adam
+ beta1: 0.9
+ beta2: 0.999
+ lr:
+ name: Cosine
+ learning_rate: 0.00005
+ warmup_epoch: 1
+ regularizer:
+ name: L2
+ factor: 3.0e-05
+
+Architecture:
+ model_type: rec
+ algorithm: SVTR_LCNet
+ Transform:
+ Backbone:
+ name: MobileNetV1Enhance
+ scale: 0.5
+ last_conv_stride:
+ - 1
+ - 2
+ last_pool_type: avg
+ last_pool_kernel_size:
+ - 2
+ - 2
+ Head:
+ name: MultiHead
+ head_list:
+ - CTCHead:
+ Neck:
+ name: svtr
+ dims: 64
+ depth: 2
+ hidden_dims: 120
+ use_guide: true
+ Head:
+ fc_decay: 1.0e-05
+ - SARHead:
+ enc_dim: 512
+ max_text_length: 128
+
+Loss:
+ name: MultiLoss
+ loss_config_list:
+ - CTCLoss:
+ - SARLoss:
+
+PostProcess:
+ name: CTCLabelDecode
+
+Metric:
+ name: RecMetric
+ main_indicator: acc
+ ignore_space: false
+
+Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: .
+ ext_op_transform_idx: 1
+ label_file_list:
+ - runs/paddle-recognizer-next-v1/labels/train.txt
+ transforms:
+ - DecodeImage:
+ img_mode: BGR
+ channel_first: false
+ - RecConAug:
+ prob: 0.5
+ ext_data_num: 2
+ image_shape:
+ - 48
+ - 320
+ - 3
+ - RecAug:
+ - MultiLabelEncode:
+ - RecResizeImg:
+ image_shape:
+ - 3
+ - 48
+ - 320
+ - KeepKeys:
+ keep_keys:
+ - image
+ - label_ctc
+ - label_sar
+ - length
+ - valid_ratio
+ loader:
+ shuffle: true
+ batch_size_per_card: 16
+ drop_last: true
+ num_workers: 2
+
+Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: .
+ label_file_list:
+ - runs/paddle-recognizer-next-v1/labels/eval.txt
+ transforms:
+ - DecodeImage:
+ img_mode: BGR
+ channel_first: false
+ - MultiLabelEncode:
+ - RecResizeImg:
+ image_shape:
+ - 3
+ - 48
+ - 320
+ - KeepKeys:
+ keep_keys:
+ - image
+ - label_ctc
+ - label_sar
+ - length
+ - valid_ratio
+ loader:
+ shuffle: false
+ batch_size_per_card: 16
+ drop_last: false
+ num_workers: 2
diff --git a/runs/paddle-recognizer-next-v1/recognizer-training-summary.json b/runs/paddle-recognizer-next-v1/recognizer-training-summary.json
new file mode 100644
index 0000000000000000000000000000000000000000..dcbc33736d3557d83d0b1d44fe280b76e98dfeb9
--- /dev/null
+++ b/runs/paddle-recognizer-next-v1/recognizer-training-summary.json
@@ -0,0 +1,104 @@
+{
+ "backend": "paddleocr",
+ "base_model": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams",
+ "manifests": {
+ "train": {
+ "path": "data/splits-recognizer-next-v1/train.jsonl",
+ "sha256": "2331f82c23d4064a47ea15141dcc086175d86d306bba1699983fc8356b9dfbe8",
+ "sample_count": 2212,
+ "dataset_counts": {
+ "gauravgiri__nepali-ocr-dataset": 428,
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 850,
+ "ocrtech-crops": 512,
+ "prashant0919__nepali-synthetic-ocr-lines": 422
+ },
+ "slice_counts": {
+ "blur": 126,
+ "clean": 129,
+ "crop": 512,
+ "en": 850,
+ "english": 1362,
+ "figure": 132,
+ "figure_caption": 35,
+ "image": 512,
+ "line": 129,
+ "line_crop": 850,
+ "low_contrast": 130,
+ "mixed_script": 512,
+ "nepali": 1362,
+ "reading_order": 512,
+ "real": 428,
+ "scan": 127,
+ "synthetic": 1272,
+ "table": 380,
+ "table_cell": 348
+ },
+ "character_count": 176,
+ "contains_ascii": true,
+ "contains_devanagari": true
+ },
+ "eval": {
+ "path": "data/splits-recognizer-next-v1/eval.jsonl",
+ "sha256": "0cc6f42c806cf8d8df59d6e046792967b1557eb523dba1493a927e815e35d5c7",
+ "sample_count": 244,
+ "dataset_counts": {
+ "gauravgiri__nepali-ocr-dataset": 15,
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 150,
+ "ocrtech-crops": 64,
+ "prashant0919__nepali-synthetic-ocr-lines": 15
+ },
+ "slice_counts": {
+ "blur": 16,
+ "clean": 16,
+ "crop": 64,
+ "en": 150,
+ "english": 214,
+ "figure": 28,
+ "figure_caption": 8,
+ "image": 64,
+ "line": 20,
+ "line_crop": 150,
+ "low_contrast": 16,
+ "mixed_script": 64,
+ "nepali": 94,
+ "reading_order": 64,
+ "real": 15,
+ "scan": 16,
+ "synthetic": 165,
+ "table": 36,
+ "table_cell": 36
+ },
+ "character_count": 170,
+ "contains_ascii": true,
+ "contains_devanagari": true
+ }
+ },
+ "artifacts": {
+ "config": {
+ "path": "runs/paddle-recognizer-next-v1/paddle_recognizer.yml",
+ "sha256": "506e9430d8606e0cc135567e072c809ca539541142b32fea0db4d92f4af60de2"
+ },
+ "train_label": {
+ "path": "runs/paddle-recognizer-next-v1/labels/train.txt",
+ "sha256": "95d65bdade449d1e477b3236480b2b46cccfd54e37c8b450a2e3e98840b1aaaa"
+ },
+ "eval_label": {
+ "path": "runs/paddle-recognizer-next-v1/labels/eval.txt",
+ "sha256": "6863578e7dbaa7386f6f0c5979ec6006363cec379979c5d0f27f3c2b38415c00"
+ },
+ "dictionary": {
+ "path": "runs/paddle-recognizer-next-v1/nep_eng_dict.txt",
+ "sha256": "5a995818b5aa6fcda366e8e7a81b79eb5ca1b9949104f0e45b768b0cf02c1333",
+ "character_count": 176,
+ "contains_space": true,
+ "contains_ascii": true,
+ "contains_devanagari": true
+ }
+ },
+ "hyperparameters": {
+ "train_batch_size": 16,
+ "eval_batch_size": 16,
+ "learning_rate": 5e-05,
+ "epochs": 20.0
+ }
+}
diff --git a/runs/paddle-table-figure-dev-v1/README.md b/runs/paddle-table-figure-dev-v1/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..17efdd1479e8cc4b6957813fb0ce6117582d8ca9
--- /dev/null
+++ b/runs/paddle-table-figure-dev-v1/README.md
@@ -0,0 +1,12 @@
+# Recognizer Training Recipe
+
+Base model: `PaddlePaddle/devanagari_PP-OCRv3_mobile_rec`
+Train labels: `runs/paddle-table-figure-dev-v1/labels/train.txt`
+Eval labels: `runs/paddle-table-figure-dev-v1/labels/eval.txt`
+Dictionary: `runs/paddle-table-figure-dev-v1/nep_eng_dict.txt`
+
+Run with a checked-out PaddleOCR repo:
+
+```bash
+python PaddleOCR/tools/train.py -c runs/paddle-table-figure-dev-v1/paddle_recognizer.yml
+```
diff --git a/runs/paddle-table-figure-dev-v1/labels/eval.txt b/runs/paddle-table-figure-dev-v1/labels/eval.txt
new file mode 100644
index 0000000000000000000000000000000000000000..88a1a5d29d783c6f129fa788ed41fbca1ded3d43
--- /dev/null
+++ b/runs/paddle-table-figure-dev-v1/labels/eval.txt
@@ -0,0 +1,80 @@
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-102-clean.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-102 ५५२५ Paid
+माया-102 ६३२५ Review
+Total 11850 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-102-scan.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-102 ५५२५ Paid
+माया-102 ६३२५ Review
+Total 11850 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-102-blur.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-102 ५५२५ Paid
+माया-102 ६३२५ Review
+Total 11850 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-102-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-102 ५५२५ Paid
+माया-102 ६३२५ Review
+Total 11850 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-102-skew.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-102 ५५२५ Paid
+माया-102 ६३२५ Review
+Total 11850 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-106-clean.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-106 ५६६२ Paid
+माया-106 ६४६२ Review
+Total 12124 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-106-scan.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-106 ५६६२ Paid
+माया-106 ६४६२ Review
+Total 12124 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-106-blur.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-106 ५६६२ Paid
+माया-106 ६४६२ Review
+Total 12124 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-106-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-106 ५६६२ Paid
+माया-106 ६४६२ Review
+Total 12124 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-106-skew.png दैनिक हिसाब
+नाम रकम Remarks
+किरण-106 ५६६२ Paid
+माया-106 ६४६२ Review
+Total 12124 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-101-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 101.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 101.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-101-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 101.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 101.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-101-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 101.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 101.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-101-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 101.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 101.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-101-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 101.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 101.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-103-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 103.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 103.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-103-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 103.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 103.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-103-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 103.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 103.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-103-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 103.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 103.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-103-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 103.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 103.
diff --git a/runs/paddle-table-figure-dev-v1/labels/train.txt b/runs/paddle-table-figure-dev-v1/labels/train.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9ac8234d2f7de0f3e734e74409b8ea22944432af
--- /dev/null
+++ b/runs/paddle-table-figure-dev-v1/labels/train.txt
@@ -0,0 +1,240 @@
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-100-clean.png दैनिक हिसाब
+नाम रकम Remarks
+राम-100 ४९२५ Paid
+सीता-100 ५७२५ Pending
+Total 10650 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-100-scan.png दैनिक हिसाब
+नाम रकम Remarks
+राम-100 ४९२५ Paid
+सीता-100 ५७२५ Pending
+Total 10650 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-100-blur.png दैनिक हिसाब
+नाम रकम Remarks
+राम-100 ४९२५ Paid
+सीता-100 ५७२५ Pending
+Total 10650 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-100-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+राम-100 ४९२५ Paid
+सीता-100 ५७२५ Pending
+Total 10650 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-100-skew.png दैनिक हिसाब
+नाम रकम Remarks
+राम-100 ४९२५ Paid
+सीता-100 ५७२५ Pending
+Total 10650 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-101-clean.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-101 ५२२५ Paid
+गीता-101 ६०२५ Cleared
+Total 11250 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-101-scan.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-101 ५२२५ Paid
+गीता-101 ६०२५ Cleared
+Total 11250 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-101-blur.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-101 ५२२५ Paid
+गीता-101 ६०२५ Cleared
+Total 11250 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-101-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-101 ५२२५ Paid
+गीता-101 ६०२५ Cleared
+Total 11250 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-101-skew.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-101 ५२२५ Paid
+गीता-101 ६०२५ Cleared
+Total 11250 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-103-clean.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-103 ५८२५ Paid
+रीता-103 ६६२५ Approved
+Total 12450 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-103-scan.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-103 ५८२५ Paid
+रीता-103 ६६२५ Approved
+Total 12450 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-103-blur.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-103 ५८२५ Paid
+रीता-103 ६६२५ Approved
+Total 12450 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-103-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-103 ५८२५ Paid
+रीता-103 ६६२५ Approved
+Total 12450 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-103-skew.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-103 ५८२५ Paid
+रीता-103 ६६२५ Approved
+Total 12450 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-104-clean.png दैनिक हिसाब
+नाम रकम Remarks
+राम-104 ५०६२ Paid
+सीता-104 ५८६२ Pending
+Total 10924 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-104-scan.png दैनिक हिसाब
+नाम रकम Remarks
+राम-104 ५०६२ Paid
+सीता-104 ५८६२ Pending
+Total 10924 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-104-blur.png दैनिक हिसाब
+नाम रकम Remarks
+राम-104 ५०६२ Paid
+सीता-104 ५८६२ Pending
+Total 10924 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-104-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+राम-104 ५०६२ Paid
+सीता-104 ५८६२ Pending
+Total 10924 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-104-skew.png दैनिक हिसाब
+नाम रकम Remarks
+राम-104 ५०६२ Paid
+सीता-104 ५८६२ Pending
+Total 10924 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-105-clean.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-105 ५३६२ Paid
+गीता-105 ६१६२ Cleared
+Total 11524 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-105-scan.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-105 ५३६२ Paid
+गीता-105 ६१६२ Cleared
+Total 11524 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-105-blur.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-105 ५३६२ Paid
+गीता-105 ६१६२ Cleared
+Total 11524 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-105-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-105 ५३६२ Paid
+गीता-105 ६१६२ Cleared
+Total 11524 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-105-skew.png दैनिक हिसाब
+नाम रकम Remarks
+हरी-105 ५३६२ Paid
+गीता-105 ६१६२ Cleared
+Total 11524 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-107-clean.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-107 ५९६२ Paid
+रीता-107 ६७६२ Approved
+Total 12724 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-107-scan.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-107 ५९६२ Paid
+रीता-107 ६७६२ Approved
+Total 12724 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-107-blur.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-107 ५९६२ Paid
+रीता-107 ६७६२ Approved
+Total 12724 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-107-low_contrast.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-107 ५९६२ Paid
+रीता-107 ६७६२ Approved
+Total 12724 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-table-ledger-107-skew.png दैनिक हिसाब
+नाम रकम Remarks
+सोम-107 ५९६२ Paid
+रीता-107 ६७६२ Approved
+Total 12724 Verified
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-100-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 100.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 100.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-100-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 100.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 100.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-100-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 100.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 100.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-100-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 100.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 100.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-100-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 100.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 100.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-102-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 102.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 102.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-102-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 102.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 102.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-102-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 102.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 102.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-102-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 102.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 102.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-102-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 102.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 102.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-104-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 104.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 104.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-104-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 104.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 104.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-104-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 104.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 104.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-104-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 104.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 104.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-104-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2022 to 2026 batch 104.
+निष्कर्ष: राजस्व क्रमशः बढेको छ। Batch 104.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-105-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 105.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 105.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-105-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 105.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 105.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-105-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 105.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 105.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-105-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 105.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 105.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-105-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2021 to 2025 batch 105.
+निष्कर्ष: अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ। Batch 105.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-106-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 106.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 106.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-106-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 106.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 106.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-106-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 106.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 106.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-106-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 106.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 106.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-106-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2020 to 2024 batch 106.
+निष्कर्ष: मध्यम अवधिमा स्थिर वृद्धि देखिएको छ। Batch 106.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-107-clean.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 107.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 107.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-107-scan.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 107.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 107.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-107-blur.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 107.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 107.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-107-low_contrast.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 107.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 107.
+data/eval-pack-table-figure-dev-v1/inputs/eval-figure-caption-107-skew.png वार्षिक प्रतिवेदन
+चित्र १: Revenue growth from 2019 to 2023 batch 107.
+निष्कर्ष: समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ। Batch 107.
diff --git a/runs/paddle-table-figure-dev-v1/nep_eng_dict.txt b/runs/paddle-table-figure-dev-v1/nep_eng_dict.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9fff8e3d62d9a66d378b2d5178fcbde2e54e7e87
--- /dev/null
+++ b/runs/paddle-table-figure-dev-v1/nep_eng_dict.txt
@@ -0,0 +1,147 @@
+
+
+
+
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+A
+B
+C
+D
+E
+F
+G
+H
+I
+J
+K
+L
+M
+N
+O
+P
+Q
+R
+S
+T
+U
+V
+W
+X
+Y
+Z
+[
+\
+]
+^
+_
+`
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+k
+l
+m
+n
+o
+p
+q
+r
+s
+t
+u
+v
+w
+x
+y
+z
+{
+|
+}
+~
+ः
+अ
+ई
+उ
+ए
+क
+ख
+ग
+च
+छ
+ज
+ढ
+ण
+त
+थ
+द
+ध
+न
+प
+ब
+भ
+म
+य
+र
+व
+श
+ष
+स
+ह
+ा
+ि
+ी
+ु
+ृ
+े
+ै
+ो
+्
+।
+०
+१
+२
+३
+४
+५
+६
+७
+८
+९
diff --git a/runs/paddle-table-figure-dev-v1/paddle_recognizer.yml b/runs/paddle-table-figure-dev-v1/paddle_recognizer.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ac7b3e566d3351f9f73526d78fe0501644590da1
--- /dev/null
+++ b/runs/paddle-table-figure-dev-v1/paddle_recognizer.yml
@@ -0,0 +1,31 @@
+# Generated by ocrtech train-recognizer.
+# Verify against the checked-out PaddleOCR version before long training runs.
+Global:
+ pretrained_model: PaddlePaddle/devanagari_PP-OCRv3_mobile_rec
+ character_dict_path: runs/paddle-table-figure-dev-v1/nep_eng_dict.txt
+ save_model_dir: runs/paddle-table-figure-dev-v1/checkpoints
+ use_space_char: true
+ infer_mode: false
+ distributed: false
+
+Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/paddle-table-figure-dev-v1/labels/train.txt
+ loader:
+ shuffle: true
+ batch_size_per_card: 64
+ drop_last: true
+
+Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/paddle-table-figure-dev-v1/labels/eval.txt
+ loader:
+ shuffle: false
+ batch_size_per_card: 64
+ drop_last: false
diff --git a/runs/recognizer-nepali-starter/README.md b/runs/recognizer-nepali-starter/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..aee3dcfbe39f2cd846523409b23978dc6b6427d5
--- /dev/null
+++ b/runs/recognizer-nepali-starter/README.md
@@ -0,0 +1,12 @@
+# Recognizer Training Recipe
+
+Base model: `PaddlePaddle/devanagari_PP-OCRv3_mobile_rec`
+Train labels: `runs/recognizer-nepali-starter/labels/train.txt`
+Eval labels: `runs/recognizer-nepali-starter/labels/eval.txt`
+Dictionary: `runs/recognizer-nepali-starter/nep_eng_dict.txt`
+
+Run with a checked-out PaddleOCR repo:
+
+```bash
+python PaddleOCR/tools/train.py -c runs/recognizer-nepali-starter/paddle_recognizer.yml
+```
diff --git a/runs/recognizer-nepali-starter/labels/eval.txt b/runs/recognizer-nepali-starter/labels/eval.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9220ae72e18ba95c9ba42e85df6b599582783b8d
--- /dev/null
+++ b/runs/recognizer-nepali-starter/labels/eval.txt
@@ -0,0 +1,33 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000001.png बन्धछे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000006.png ...यसले अनुसन्धान अधिकृतले मुद्दाको खोजतलास) कार्यको २०६० को
+वहाँ सहिदिको प्रतिवेदन ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000012.png नस्लाड्ने निर्देश गर्दछ। अरु सो निकाल्ये रूप में
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000015.png ग कवितांशमा कस्ता मानिसको शिर उचो हुन्छ भनि-
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000022.png चलाउने निर्धारण गरिएको.
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000029.png प्रेरणा छैन। नयाँ धारणा (१)
+तेर अमल के बारेको धारणा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000040.png क्ष तलसुम् ठप्रतई वढऐप तजस२१क
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000041.png ३फ अक ३ल एम दब टप भय ठघ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000042.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000043.png सुरबिन | १८० | १२ | रुरु अ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000048.png होस अध्ययन गर्ने बानीले हामीलाई
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000050.png को १९८३ मा र →
+१९८३ भित्र सक भाग →
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000052.png २ ७५० १५० १० १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000056.png हातैमा अटाउने फुलैका टुकुल मै बिऊ कि ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000061.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000065.png गतिमा लमा सलवलने रेखम के दिकुवि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000071.png चाल्छ नै लोभ्याउने त्यो बाँसुरीको धुन नै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000076.png म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000079.png काठमाडौँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000088.png अध्ययन विद्यार्थीहरूका लागि ६ दिन लागिसकेको हुन सक्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000090.png कार्यक्रमको आयोजना गर्ने लागिरहनुहुने अनुवादे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000099.png गर्ने
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00003.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00027.png च.नं. 8161/०81/०82
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00035.png श्री प्रशासन अधिकृत, मन्त्रिपरिषद्को कार्यालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00043.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00066.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00078.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00091.png सादर अनुरोध गर्दछु, सह-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00095.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
diff --git a/runs/recognizer-nepali-starter/labels/train.txt b/runs/recognizer-nepali-starter/labels/train.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fd84cb862f52cf5ac4de5409db4cbe57c3de02ed
--- /dev/null
+++ b/runs/recognizer-nepali-starter/labels/train.txt
@@ -0,0 +1,177 @@
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000000.png स्वर्ग आफै
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000002.png स्वर्ग बनाउनका निम्ति धेरै कुरा बनाएका छन्।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000003.png नेपाल नेपाल नेपाल नेपाल नेपाल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000004.png कर्म गरेको जिन्दगी सुन्दर बन्द
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000005.png माधव महा. च्याल्ने
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000007.png सहितको
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000008.png चलाउने नसकिएकाले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000009.png ३९(७) कमजोर मुद्दा चलाउने नसक्ने कारण।
+तेमा बढीमाथी सम्वन्धित पाल्कार बकीले से संहितेको देमा ३९(३)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000010.png पेश गरिसकेपछि सम्बन्धित
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000011.png अधिकार
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000013.png किनकि यहाँ तबलादे पुराना गए।
+नभएकाले तथा महाविद्यालयकाले हो।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000014.png समर्थी तथा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000016.png - कार्यालयको प्रमुखले राप
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000017.png वकील अदालतको मुद्दा
+पेश हुँदा र मुद्दा चलाउने निर्णय गरेपछि त्यसको भीड हुन्छ । तर तत्काल
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000018.png उपर मुद्धा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000019.png , नित्ये र अधिकारको प्रयोग
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000020.png प्रश्नो परिक्षण, नित्य र
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000021.png उपमा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000023.png संविधानद्वारा प्रदत्त अधिकार प्रयोग गरी मुद्दा चलाउने किटानी माग
+अनुसार देवालिया संविधानको धारा १५८(२) को दुरुपयोग भएको भनि मिले
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000024.png शिक्षामा नेपालको संविधनको धारा १५(१) को दुरुपयोग भएको भन्नु पर्थ्यो।
+अवस्था परिक्षण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000025.png गाडी प्रमाण कागजातको अवस्था
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000026.png नेपाली हस्तलेखन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000027.png धार(६०) प्रयोग गयो प्रमाण के
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000028.png न देने। यह घर एक प्रचाग गदा प्रमाणना
+ये अवनति के बारे धमात्मा सिद्ध-न्याय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000030.png गरि प्रमाणको अभाव
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000031.png पुजि हो
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000032.png के अध्यापकलाई ३५ अध्याय २
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000033.png १०८९७६५४३२१०
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000034.png गे१११
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000035.png 1 1
+8 6
+९ ८
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000037.png अध्ययन मानिसको लागि आशिर्वाद
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000038.png ङ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000039.png २ढ७१घध१८पठत
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000044.png - १ इ उ ए ओ अ
+- ८ ई ऊ ऐ औ आ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000045.png १६ ८ ३६ २१ १० ८३ १६ १७ नेर
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000047.png १४ १७ ५८ १२ १८ १३ -९ (अ)
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000049.png गुखु
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000051.png ३ डिडि ढि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000054.png भन न प्यारा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000055.png म तिम्रो लौ कस्तो मैले।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000057.png ताबा मैं कौन चमकने जून मैं दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000058.png सबैले मन पराउने घिमिरे मे बिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000059.png महान र व्यक्तित्वसँग साक्षात्कार गर्दछ।
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000060.png स्वाद बढाउने त्यो नुन भै दिऊ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000062.png म कस्तो भै दिऊँ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000063.png बाटोमा दशा सुधार्ने गुलाम नै दिऊँ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000064.png सबैले शिक्षा सजाउने सुत्र में दिऊं?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000066.png च्याप्पफुले झेंगाल्ने त्यो झन् के मै दिऊँ ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000067.png भजन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000068.png म कस्तो भै दिऊ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000069.png कुसैले नकुचाउने झुनाशाको शेरख ध्वनी मै दिएकि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000070.png यस्तै हाम्रो सफलतालाई फाइदाजनक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000072.png हेदै रहल लागदो त्यो नरम कमरे भातो भै दिऊ कि?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000073.png टुँडै वाने हात खाने त्यो सेतो चुन नै दिऊँ?
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000074.png भन न प्यारा,
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000075.png कस्तो मैं दिऊ
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000077.png तेज विनायक माध्यमिक विद्यालय
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000078.png का गेश्वरी मनोहरा
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000080.png मिति : २०६५/९२/९३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000081.png तरीकाले उपभोग गर्ने सिफारिस । हानि
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000082.png भ्रमणसम्बन्धी सूचना
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000083.png शैक्षिक
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000084.png बिद्यालयद्वारा कक्षा १२ म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000085.png यस
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000086.png नयाँ वर्ष 2020 का अवसरमा यस । बधाइ तथा 6 दिन शैक्षणिक भ्रमण
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000087.png लागी ६
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000089.png गर्न
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000091.png सम्पर्क राख्नुहुन
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000092.png पढ्न लागी पुस्तकको समस्या
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000093.png विद्यार्थी हिस्से समयमे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000094.png गारिन्दे
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000095.png कार्यक्रम वैशाख १ गते ६ गतेसम्म
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000096.png ३
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000097.png बैशाख १
+data/manifests/images/gauravgiri__nepali-ocr-dataset/train/00000098.png मिति : २०१० वर्षको
+सम्यक गर्ने अन्तिम मिति : २०६४ चैत्र २० गतेसम्म
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00001.png मितिः 2075 असार 29 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00002.png श्री लेखा अधिकृत, सैनिक मुख्यालय जङ्गी अड्डा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00004.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00005.png मितिः 2080 भदौ 2 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00006.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00007.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00008.png परराष्ट्र मन्त्रालय काठमाडौँ महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00009.png मितिः 2071 कात्तिक 19 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00010.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00011.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00012.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00013.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00014.png विषय: क्षेत्रीय सहकार्य सम्मेलन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00015.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00016.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00017.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00018.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00019.png श्री महानिर्देशक, भौतिक पूर्वाधार तथा यातायात मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00020.png सैनिक मुख्यालय जङ्गी अड्डा सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00021.png विषय: आर्थिक सहायता उपलब्ध गराउने सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00022.png मितिः 2077 कात्तिक 14 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00023.png मितिः 2078 कात्तिक 30 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00024.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00025.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00026.png विषय: द्विपक्षीय व्यापार सम्झौता नवीकरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00028.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00029.png भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय सुर्खेत, सुर्खेत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00030.png पत्र संख्याः 1524/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00031.png श्री प्रमुख जिल्ला अधिकारी, अर्थ मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00032.png भौतिक पूर्वाधार तथा यातायात मन्त्रालय विराटनगर, मोरङ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00033.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00034.png श्री प्रशासन अधिकृत, स्वास्थ्य तथा जनसंख्या मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00036.png सञ्चार तथा सूचना प्रविधि मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00037.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00038.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00039.png मितिः 2076 कात्तिक 27 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00040.png सादर अनुरोध गर्दछु, उप-सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00041.png पत्र संख्याः 5315/०75/०76
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00042.png नेपाल सरकार शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00044.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00045.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00046.png चलानी नम्बरः 2394/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00047.png प्रहरी प्रधान कार्यालय शीतल निवास, महाराजगञ्ज
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00048.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00049.png सादर अनुरोध गर्दछु, प्रशासन अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00050.png श्री मन्त्रालय प्रवक्ता, नेपाल सरकार
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00051.png श्री उप-सचिव, संघीय मामिला तथा सामान्य प्रशासन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00052.png विषय: सार्वजनिक खरिद सम्झौता सम्बन्धी
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00053.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00054.png मितिः 2072 असार 10 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00055.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00056.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00057.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00058.png मितिः 2071 फागुन 21 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00059.png विषय: वैदेशिक भ्रमण सम्बन्धी पत्र
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00060.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00061.png श्री लेखा अधिकृत, संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00062.png सादर अनुरोध गर्दछु, मुख्य सचिव
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00063.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00064.png ऊर्जा, जलस्रोत तथा सिँचाइ मन्त्रालय ललितपुर महानगरपालिका
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00065.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00067.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00068.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00069.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00070.png श्री उप-सचिव, भूमि व्यवस्था, सहकारी तथा गरिबी निवारण मन्त्रालय
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00071.png च.नं. 196/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00072.png पत्र संख्याः 3707/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00073.png मितिः 2077 फागुन 11 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00074.png प्राविधिक सहयोग तथा क्षमता अभिवृद्धि कार्यक्रम
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00075.png विषय: सूचना प्रविधि प्रणाली स्तरोन्नति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00076.png पत्र संख्याः 5515/०78/०79
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00077.png संस्कृति, पर्यटन तथा नागरिक उड्डयन मन्त्रालय भक्तपुर, नेपाल
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00079.png सादर अनुरोध गर्दछु, लेखा अधिकृत
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00080.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00081.png च.नं. 4752/०82/०83
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00082.png सैनिक मुख्यालय जङ्गी अड्डा जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00083.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00084.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00085.png प्रहरी प्रधान कार्यालय जनकपुर, धनुषा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00086.png सादर अनुरोध गर्दछु, मन्त्रालय प्रवक्ता
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00087.png विषय: कर्मचारी सरुवा र पदस्थापन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00088.png क्षेत्रीय सहकार्य सम्मेलनमा भाग लिनुहुन
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00089.png विषय: विपद व्यवस्थापन तथा राहत वितरण
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00090.png सादर अनुरोध गर्दछु, महानिर्देशक
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00092.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00093.png चलानी नम्बरः 1014/०84/०85
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00094.png च.नं. 6962/०77/०78
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00096.png प्रस्तुत विषयमा आवश्यक कार्यान्वयनका लागि पठाइएको छ
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00097.png मितिः 2084 वैशाख 9 गते
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00098.png नेपाल सरकारको निर्णय बमोजिम तोकिएको मिति
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00099.png कार्य विवरण तथा बाँडफाँड सम्बन्धमा
+/Users/k2/.cache/huggingface/hub/datasets--prashant0919--nepali-synthetic-ocr-lines/snapshots/e518b53108ad9650daa2616774bb61ecfa46ea75/train/line_00100.png स्वास्थ्य तथा जनसंख्या मन्त्रालय काठमाडौँ महानगरपालिका
diff --git a/runs/recognizer-nepali-starter/nep_eng_dict.txt b/runs/recognizer-nepali-starter/nep_eng_dict.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8d022f6356dd400a9ad577960bacf5d49c963080
--- /dev/null
+++ b/runs/recognizer-nepali-starter/nep_eng_dict.txt
@@ -0,0 +1,167 @@
+
+
+
+
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+A
+B
+C
+D
+E
+F
+G
+H
+I
+J
+K
+L
+M
+N
+O
+P
+Q
+R
+S
+T
+U
+V
+W
+X
+Y
+Z
+[
+\
+]
+^
+_
+`
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+k
+l
+m
+n
+o
+p
+q
+r
+s
+t
+u
+v
+w
+x
+y
+z
+{
+|
+}
+~
+ँ
+ं
+ः
+अ
+आ
+इ
+ई
+उ
+ऊ
+ए
+ऐ
+ओ
+औ
+क
+ख
+ग
+घ
+ङ
+च
+छ
+ज
+झ
+ञ
+ट
+ठ
+ड
+ढ
+ण
+त
+थ
+द
+ध
+न
+प
+फ
+ब
+भ
+म
+य
+र
+ल
+व
+श
+ष
+स
+ह
+ा
+ि
+ी
+ु
+ू
+ृ
+े
+ै
+ो
+ौ
+्
+।
+०
+१
+२
+३
+४
+५
+६
+७
+८
+९
+→
diff --git a/runs/recognizer-nepali-starter/paddle_recognizer.yml b/runs/recognizer-nepali-starter/paddle_recognizer.yml
new file mode 100644
index 0000000000000000000000000000000000000000..533ad4f0e27ebcad4261b8025a34ce6528a1a66a
--- /dev/null
+++ b/runs/recognizer-nepali-starter/paddle_recognizer.yml
@@ -0,0 +1,31 @@
+# Generated by ocrtech train-recognizer.
+# Verify against the checked-out PaddleOCR version before long training runs.
+Global:
+ pretrained_model: PaddlePaddle/devanagari_PP-OCRv3_mobile_rec
+ character_dict_path: runs/recognizer-nepali-starter/nep_eng_dict.txt
+ save_model_dir: runs/recognizer-nepali-starter/checkpoints
+ use_space_char: true
+ infer_mode: false
+ distributed: false
+
+Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/recognizer-nepali-starter/labels/train.txt
+ loader:
+ shuffle: true
+ batch_size_per_card: 64
+ drop_last: true
+
+Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: /
+ label_file_list:
+ - runs/recognizer-nepali-starter/labels/eval.txt
+ loader:
+ shuffle: false
+ batch_size_per_card: 64
+ drop_last: false
diff --git a/runs/tesseract-psm11/model-card.json b/runs/tesseract-psm11/model-card.json
new file mode 100644
index 0000000000000000000000000000000000000000..73c553a88b3179be0699137364e7572ceb8b4307
--- /dev/null
+++ b/runs/tesseract-psm11/model-card.json
@@ -0,0 +1,14 @@
+{
+ "model_id": "ocrtech-tesseract-psm11",
+ "backend": "tesseract",
+ "base_model": "tesseract-ocr",
+ "created_at_utc": "2026-06-14T04:38:31.131877+00:00",
+ "artifacts": [],
+ "backend_kwargs": {
+ "language": "nep+eng",
+ "psm": 11
+ },
+ "provenance": {},
+ "metrics": {},
+ "notes": null
+}
diff --git a/runs/tesseract-psm13/model-card.json b/runs/tesseract-psm13/model-card.json
new file mode 100644
index 0000000000000000000000000000000000000000..a007fb6f46f8bad2a7a600d82c21875ba3d07211
--- /dev/null
+++ b/runs/tesseract-psm13/model-card.json
@@ -0,0 +1,14 @@
+{
+ "model_id": "ocrtech-tesseract-psm13",
+ "backend": "tesseract",
+ "base_model": "tesseract-ocr",
+ "created_at_utc": "2026-06-14T04:26:55.959336+00:00",
+ "artifacts": [],
+ "backend_kwargs": {
+ "language": "nep+eng",
+ "psm": 13
+ },
+ "provenance": {},
+ "metrics": {},
+ "notes": null
+}
diff --git a/runs/tesseract-psm7/model-card.json b/runs/tesseract-psm7/model-card.json
new file mode 100644
index 0000000000000000000000000000000000000000..e9e12bd6fa72f3c4ebed7fb10e35678fca013892
--- /dev/null
+++ b/runs/tesseract-psm7/model-card.json
@@ -0,0 +1,14 @@
+{
+ "model_id": "ocrtech-tesseract-psm7",
+ "backend": "tesseract",
+ "base_model": "tesseract-ocr",
+ "created_at_utc": "2026-06-14T04:38:12.843695+00:00",
+ "artifacts": [],
+ "backend_kwargs": {
+ "language": "nep+eng",
+ "psm": 7
+ },
+ "provenance": {},
+ "metrics": {},
+ "notes": null
+}
diff --git a/runs/tesseract-quality-router/model-card.json b/runs/tesseract-quality-router/model-card.json
new file mode 100644
index 0000000000000000000000000000000000000000..618c9cc84529e630d63492f0e22cc8383e82c029
--- /dev/null
+++ b/runs/tesseract-quality-router/model-card.json
@@ -0,0 +1,23 @@
+{
+ "model_id": "ocrtech-tesseract-quality-router",
+ "backend": "quality_select_composite",
+ "base_model": "tesseract-ocr",
+ "created_at_utc": "2026-06-14T04:10:50.658637+00:00",
+ "artifacts": [],
+ "backend_kwargs": {
+ "primary_engine": "tesseract",
+ "secondary_engine": "tesseract",
+ "primary_engine_kwargs": {
+ "language": "nep+eng",
+ "psm": 6
+ },
+ "secondary_engine_kwargs": {
+ "language": "nep+eng",
+ "psm": 13
+ },
+ "secondary_quality_margin": 0.02
+ },
+ "provenance": {},
+ "metrics": {},
+ "notes": null
+}
diff --git a/scripts/run_glm_ocr.py b/scripts/run_glm_ocr.py
new file mode 100644
index 0000000000000000000000000000000000000000..f6add3e4b5fbadd9eb06871906a87076b8c10bbd
--- /dev/null
+++ b/scripts/run_glm_ocr.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python3
+"""Run GLM-OCR on one image or page-bundle directory."""
+
+from __future__ import annotations
+
+import argparse
+import json
+from pathlib import Path
+
+from ocrtech.external_outputs import bundle_page_paths, materialize_external_markdown
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(description="Run GLM-OCR and write ocrtech-compatible outputs.")
+ parser.add_argument("--input", required=True, help="image path or directory of page images")
+ parser.add_argument("--out", required=True, help="output directory")
+ parser.add_argument("--model-id", default="zai-org/GLM-OCR")
+ parser.add_argument("--prompt", default="Text Recognition:")
+ parser.add_argument("--max-new-tokens", type=int, default=8192)
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ input_path = Path(args.input)
+ output_dir = Path(args.out)
+ output_dir.mkdir(parents=True, exist_ok=True)
+ try:
+ from transformers import AutoModelForImageTextToText, AutoProcessor
+ except ImportError as exc:
+ raise RuntimeError("GLM-OCR wrapper requires transformers with multimodal support installed.") from exc
+
+ try:
+ processor = AutoProcessor.from_pretrained(args.model_id, trust_remote_code=True, use_fast=False)
+ model = AutoModelForImageTextToText.from_pretrained(
+ pretrained_model_name_or_path=args.model_id,
+ torch_dtype="auto",
+ device_map="auto",
+ trust_remote_code=True,
+ )
+ except Exception as exc:
+ raise RuntimeError(
+ "GLM-OCR processor/model initialization failed. The upstream model card currently requires a git "
+ "transformers build, for example `pip install git+https://github.com/huggingface/transformers.git`, "
+ f"plus any remote-code dependencies such as torchvision. Root cause: {type(exc).__name__}: {exc}"
+ ) from exc
+
+ page_payloads: list[dict[str, str]] = []
+ markdown_pages: list[str] = []
+ for page_path in bundle_page_paths(input_path):
+ messages = [
+ {
+ "role": "user",
+ "content": [
+ {"type": "image", "url": str(page_path)},
+ {"type": "text", "text": args.prompt},
+ ],
+ }
+ ]
+ inputs = processor.apply_chat_template(
+ messages,
+ tokenize=True,
+ add_generation_prompt=True,
+ return_dict=True,
+ return_tensors="pt",
+ ).to(model.device)
+ inputs.pop("token_type_ids", None)
+ generated_ids = model.generate(**inputs, max_new_tokens=args.max_new_tokens)
+ generated = generated_ids[0][inputs["input_ids"].shape[1] :]
+ markdown = _clean_generation(processor.decode(generated, skip_special_tokens=False))
+ page_payloads.append({"page_path": str(page_path), "markdown": markdown})
+ markdown_pages.append(markdown)
+
+ joined_markdown = "\n\n\n\n".join(markdown_pages)
+ materialize_external_markdown(
+ input_path,
+ output_dir,
+ joined_markdown,
+ metadata={"engine": "glm-ocr", "model_id": args.model_id, "prompt": args.prompt},
+ raw_payload={"pages": page_payloads},
+ )
+ return 0
+
+
+def _clean_generation(text: str) -> str:
+ value = text.strip()
+ for token in ("<|assistant|>", "<|user|>", "<|endoftext|>", "<|im_end|>"):
+ value = value.replace(token, "")
+ return value.strip()
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/scripts/run_paddleocr_vl.py b/scripts/run_paddleocr_vl.py
new file mode 100644
index 0000000000000000000000000000000000000000..4e48ba041bccaba888a08f4746475ac597ef3a61
--- /dev/null
+++ b/scripts/run_paddleocr_vl.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python3
+"""Run PaddleOCR-VL on one image or page-bundle directory."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import tempfile
+from pathlib import Path
+
+from ocrtech.external_outputs import bundle_page_paths, materialize_external_markdown
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(description="Run PaddleOCR-VL and write ocrtech-compatible outputs.")
+ parser.add_argument("--input", required=True, help="image path or directory of page images")
+ parser.add_argument("--out", required=True, help="output directory")
+ parser.add_argument("--pipeline-version", default="v1.6")
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ input_path = Path(args.input)
+ output_dir = Path(args.out)
+ output_dir.mkdir(parents=True, exist_ok=True)
+ try:
+ from paddleocr import PaddleOCRVL
+ except ImportError as exc:
+ raise RuntimeError("PaddleOCR-VL wrapper requires paddleocr with doc parser support installed.") from exc
+
+ try:
+ pipeline = PaddleOCRVL(pipeline_version=args.pipeline_version)
+ except Exception as exc:
+ raise RuntimeError(
+ "PaddleOCR-VL pipeline initialization failed. Install PaddleX OCR extras, for example "
+ '`pip install "paddlex[ocr]==3.7.1"`.'
+ ) from exc
+
+ page_payloads: list[dict[str, object]] = []
+ markdown_pages: list[str] = []
+ for page_path in bundle_page_paths(input_path):
+ results = list(pipeline.predict(str(page_path)))
+ if not results:
+ raise RuntimeError(f"PaddleOCR-VL returned no results for {page_path}")
+ if len(results) != 1:
+ raise RuntimeError(f"PaddleOCR-VL returned {len(results)} results for one page: {page_path}")
+ markdown, raw_json = _extract_result_payload(results[0])
+ page_payloads.append({"page_path": str(page_path), "raw_json": raw_json})
+ markdown_pages.append(markdown)
+
+ joined_markdown = "\n\n\n\n".join(markdown_pages)
+ materialize_external_markdown(
+ input_path,
+ output_dir,
+ joined_markdown,
+ metadata={"engine": "paddleocr-vl", "pipeline_version": args.pipeline_version},
+ raw_payload={"pages": page_payloads},
+ )
+ return 0
+
+
+def _extract_result_payload(result: object) -> tuple[str, object]:
+ with tempfile.TemporaryDirectory(prefix="ocrtech-paddleocr-vl-") as tmp_dir_name:
+ tmp_dir = Path(tmp_dir_name)
+ if not hasattr(result, "save_to_markdown") or not hasattr(result, "save_to_json"):
+ raise RuntimeError(f"unexpected PaddleOCR-VL result type: {type(result).__name__}")
+ result.save_to_markdown(save_path=str(tmp_dir))
+ result.save_to_json(save_path=str(tmp_dir))
+ markdown_files = sorted(tmp_dir.rglob("*.md"))
+ json_files = sorted(path for path in tmp_dir.rglob("*.json") if path.name != "document.json")
+ if not markdown_files:
+ raise RuntimeError("PaddleOCR-VL did not write any markdown output")
+ markdown = markdown_files[0].read_text(encoding="utf-8").strip()
+ raw_json: object = None
+ if json_files:
+ raw_json = json.loads(json_files[0].read_text(encoding="utf-8"))
+ return markdown, raw_json
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/scripts/run_public_table100_claim.py b/scripts/run_public_table100_claim.py
new file mode 100644
index 0000000000000000000000000000000000000000..2fec7bc49c3b1f703e91fb3520e4c88d8e7a6757
--- /dev/null
+++ b/scripts/run_public_table100_claim.py
@@ -0,0 +1,550 @@
+#!/usr/bin/env python3
+"""Run the 100-page public OmniDocBench table claim benchmark."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import shutil
+import subprocess
+import sys
+from datetime import datetime, timezone
+from pathlib import Path
+
+from ocrtech.benchmark import BenchmarkResult, _quality_metrics, _write_reports, run_benchmark, summarize_benchmark_report
+from ocrtech.manifest import ManifestEntry, load_manifest
+from ocrtech.references import load_reference, score_document
+from ocrtech.schemas import Document
+from ocrtech.table_analysis import analyze_table_cells
+from ocrtech.validation import validate_claim
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(description="Run public OmniDocBench table100 candidate-vs-Surya evidence.")
+ parser.add_argument(
+ "--manifest",
+ default="data/public/omnidocbench-table100/manifests/omnidocbench-eval.jsonl",
+ help="audited OmniDocBench eval manifest",
+ )
+ parser.add_argument(
+ "--candidate-model-config",
+ default="outputs/figure-caption-table-lexicon-normalize-width-guard-v4/model-card.json",
+ help="candidate model card",
+ )
+ parser.add_argument("--out", default="outputs/experiment-public-omnidocbench-table100-width-guard-v4")
+ parser.add_argument("--validation-config", default="configs/validation-public-omnidocbench-surya.json")
+ parser.add_argument("--baselines", default="candidate,surya")
+ parser.add_argument("--skip-benchmark", action="store_true", help="reuse an existing benchmark/report.json")
+ parser.add_argument("--no-resume-existing", action="store_true", help="ignore existing document.json outputs")
+ parser.add_argument("--sample-timeout-seconds", type=int, default=300)
+ parser.add_argument("--in-process", action="store_true", help="run the benchmark in one Python process instead of isolated page subprocesses")
+ parser.add_argument(
+ "--status-only",
+ action="store_true",
+ help="write run-status.json and run-status.md from the current checkpoint without running benchmark, summary, validation, or analysis",
+ )
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ manifest_path = Path(args.manifest)
+ output_root = Path(args.out)
+ benchmark_dir = output_root / "benchmark"
+ report_path = benchmark_dir / "report.json"
+ baselines = [item.strip() for item in args.baselines.split(",") if item.strip()]
+ if not baselines:
+ raise ValueError("--baselines must include at least one baseline")
+
+ entries = load_manifest(manifest_path)
+ input_paths = [entry.image_path for entry in entries]
+ print(f"manifest={manifest_path} samples={len(entries)}", flush=True)
+ print(f"benchmark_out={benchmark_dir}", flush=True)
+ print(f"baselines={','.join(baselines)}", flush=True)
+ print(f"isolated={not args.in_process} resume_existing={not args.no_resume_existing}", flush=True)
+
+ if args.status_only:
+ status = _write_interim_status(output_root, report_path, entries, baselines)
+ print(f"status={output_root / 'run-status.json'} rows={status['rows']} expected_rows={status['expected_rows']}", flush=True)
+ return 0
+
+ if not args.skip_benchmark:
+ if args.in_process:
+ run_benchmark(
+ input_paths,
+ benchmark_dir,
+ baselines=baselines,
+ eval_manifest=manifest_path,
+ candidate_model_config=args.candidate_model_config,
+ resume_existing=not args.no_resume_existing,
+ sample_timeout_seconds=args.sample_timeout_seconds,
+ )
+ else:
+ _run_isolated_benchmark(
+ entries,
+ benchmark_dir,
+ baselines=baselines,
+ manifest_path=manifest_path,
+ candidate_model_config=Path(args.candidate_model_config),
+ resume_existing=not args.no_resume_existing,
+ sample_timeout_seconds=args.sample_timeout_seconds,
+ )
+ elif not report_path.exists():
+ raise FileNotFoundError(f"--skip-benchmark requested but report is missing: {report_path}")
+
+ summary = summarize_benchmark_report(
+ report_path,
+ output_root / "summary",
+ candidate="candidate",
+ baselines=[item for item in baselines if item != "candidate"],
+ )
+ validation = validate_claim(
+ report_path,
+ output_root / "validation",
+ config_path=args.validation_config,
+ eval_manifest=manifest_path,
+ )
+ table_analysis = analyze_table_cells(
+ report_path,
+ manifest_path,
+ output_root / "table-cell-analysis",
+ candidate="candidate",
+ baselines=[item for item in baselines if item != "candidate"],
+ )
+ print(f"report={report_path}", flush=True)
+ print(f"summary={output_root / 'summary' / 'summary.json'} paired={len(summary.paired_metrics)}", flush=True)
+ print(f"validation={validation.claim_status} passed={validation.passed}", flush=True)
+ print(
+ f"table_cell_analysis={output_root / 'table-cell-analysis' / 'table-cell-analysis.json'} "
+ f"systems={len(table_analysis.systems)}",
+ flush=True,
+ )
+ return 0 if validation.passed else 1
+
+
+def _run_isolated_benchmark(
+ entries: list[ManifestEntry],
+ benchmark_dir: Path,
+ *,
+ baselines: list[str],
+ manifest_path: Path,
+ candidate_model_config: Path,
+ resume_existing: bool,
+ sample_timeout_seconds: int,
+) -> list[BenchmarkResult]:
+ benchmark_dir.mkdir(parents=True, exist_ok=True)
+ status_path = benchmark_dir.parent / "run-status.json"
+ tmp_root = benchmark_dir.parent / "_isolated-tmp"
+ results: list[BenchmarkResult] = _load_existing_report(benchmark_dir / "report.json")
+ completed = {(result.baseline, result.input_path) for result in results}
+ entry_by_path = {str(Path(entry.image_path)): entry for entry in entries}
+ for baseline in baselines:
+ for entry in entries:
+ input_path = Path(entry.image_path)
+ key = (baseline, str(input_path))
+ if key in completed:
+ continue
+ _write_run_status(
+ status_path,
+ baseline=baseline,
+ sample_id=entry.sample_id,
+ input_path=input_path,
+ rows=len(results),
+ status="running",
+ )
+ existing_document = benchmark_dir / baseline / input_path.stem / "document.json"
+ if resume_existing and existing_document.exists():
+ result = _score_existing_document(baseline, input_path, entry, existing_document)
+ else:
+ result = _run_one_isolated(
+ baseline,
+ input_path,
+ manifest_path,
+ benchmark_dir,
+ tmp_root,
+ candidate_model_config=candidate_model_config,
+ entry=entry_by_path[str(input_path)],
+ sample_timeout_seconds=sample_timeout_seconds,
+ )
+ results.append(result)
+ completed.add(key)
+ _write_reports(results, benchmark_dir)
+ _write_run_status(
+ status_path,
+ baseline=baseline,
+ sample_id=entry.sample_id,
+ input_path=input_path,
+ rows=len(results),
+ status=result.status,
+ error=result.error,
+ )
+ print(
+ f"progress baseline={baseline} sample={entry.sample_id} status={result.status} rows={len(results)}",
+ flush=True,
+ )
+ return results
+
+
+def _write_run_status(
+ path: Path,
+ *,
+ baseline: str,
+ sample_id: str,
+ input_path: Path,
+ rows: int,
+ status: str,
+ error: str | None = None,
+) -> None:
+ payload = {
+ "updated_at_utc": datetime.now(timezone.utc).isoformat(),
+ "baseline": baseline,
+ "sample_id": sample_id,
+ "input_path": str(input_path),
+ "rows": rows,
+ "status": status,
+ "error": error,
+ }
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+
+
+def _write_interim_status(
+ output_root: Path,
+ report_path: Path,
+ entries: list[ManifestEntry],
+ baselines: list[str],
+) -> dict[str, object]:
+ results = _load_existing_report(report_path)
+ completed = {(result.baseline, result.input_path) for result in results}
+ status_counts: dict[str, int] = {}
+ baseline_counts: dict[str, int] = {}
+ per_baseline_progress: dict[str, dict[str, int]] = {
+ baseline: {"expected": len(entries), "completed": 0, "ok": 0, "error": 0, "missing": len(entries)}
+ for baseline in baselines
+ }
+ for result in results:
+ status_counts[result.status] = status_counts.get(result.status, 0) + 1
+ baseline_counts[result.baseline] = baseline_counts.get(result.baseline, 0) + 1
+ progress = per_baseline_progress.setdefault(
+ result.baseline,
+ {"expected": len(entries), "completed": 0, "ok": 0, "error": 0, "missing": len(entries)},
+ )
+ progress["completed"] += 1
+ if result.status == "ok":
+ progress["ok"] += 1
+ elif result.status == "error":
+ progress["error"] += 1
+ progress["missing"] = max(0, progress["expected"] - progress["completed"])
+
+ last_result: dict[str, object] | None = None
+ if results:
+ result = results[-1]
+ last_result = {
+ "baseline": result.baseline,
+ "sample_id": result.sample_id,
+ "input_path": result.input_path,
+ "status": result.status,
+ "error": result.error,
+ }
+ error_results = [result for result in results if result.status == "error"]
+ recent_errors = [
+ {
+ "baseline": result.baseline,
+ "sample_id": result.sample_id,
+ "input_path": result.input_path,
+ "error": result.error,
+ }
+ for result in error_results[-10:]
+ ]
+
+ next_item: dict[str, object] | None = None
+ for baseline in baselines:
+ for entry in entries:
+ key = (baseline, str(Path(entry.image_path)))
+ if key in completed:
+ continue
+ next_item = {
+ "baseline": baseline,
+ "sample_id": entry.sample_id,
+ "input_path": str(Path(entry.image_path)),
+ }
+ break
+ if next_item is not None:
+ break
+
+ final_artifacts = {
+ "summary": (output_root / "summary" / "summary.json").exists(),
+ "validation": (output_root / "validation" / "validation.json").exists(),
+ "table_cell_analysis": (output_root / "table-cell-analysis" / "table-cell-analysis.json").exists(),
+ }
+ validation_status = _load_validation_status(output_root / "validation" / "validation.json")
+ expected_rows = len(entries) * len(baselines)
+ current_phase = str(next_item["baseline"]) if next_item is not None else "finalizing" if not all(final_artifacts.values()) else "complete"
+ evidence_package_ready = len(completed) >= expected_rows and all(final_artifacts.values())
+ validation_passed = validation_status.get("passed") is True
+ payload: dict[str, object] = {
+ "updated_at_utc": datetime.now(timezone.utc).isoformat(),
+ "status": "complete" if evidence_package_ready else "incomplete",
+ "rows": len(results),
+ "expected_rows": expected_rows,
+ "baselines": baseline_counts,
+ "baseline_progress": per_baseline_progress,
+ "current_phase": current_phase,
+ "row_statuses": status_counts,
+ "last_result": last_result,
+ "error_count": len(error_results),
+ "recent_errors": recent_errors,
+ "next": next_item,
+ "final_artifacts": final_artifacts,
+ "evidence_package_ready": evidence_package_ready,
+ "validation": validation_status,
+ "paper_claim_ready": evidence_package_ready and validation_passed,
+ }
+ (output_root / "run-status.json").write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_interim_status_markdown(output_root / "run-status.md", payload)
+ return payload
+
+
+def _load_validation_status(validation_path: Path) -> dict[str, object]:
+ if not validation_path.exists():
+ return {
+ "present": False,
+ "claim_status": None,
+ "passed": None,
+ }
+ payload = json.loads(validation_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise ValueError(f"validation report must be an object: {validation_path}")
+ return {
+ "present": True,
+ "claim_status": payload.get("claim_status"),
+ "passed": payload.get("passed"),
+ "missing_requirements": payload.get("missing_requirements", []),
+ }
+
+
+def _write_interim_status_markdown(path: Path, payload: dict[str, object]) -> None:
+ baseline_progress = payload.get("baseline_progress")
+ final_artifacts = payload.get("final_artifacts")
+ recent_errors = payload.get("recent_errors")
+ validation_status = payload.get("validation")
+ lines = [
+ "# Public Table100 Run Status",
+ "",
+ f"Updated: `{payload.get('updated_at_utc')}`",
+ f"Status: `{payload.get('status')}`",
+ f"Current phase: `{payload.get('current_phase')}`",
+ f"Rows: `{payload.get('rows')}` / `{payload.get('expected_rows')}`",
+ f"Evidence package ready: `{'yes' if payload.get('evidence_package_ready') else 'no'}`",
+ f"Paper claim ready: `{'yes' if payload.get('paper_claim_ready') else 'no'}`",
+ "",
+ "## Baseline Progress",
+ "",
+ "| baseline | expected | completed | ok | error | missing |",
+ "| --- | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ if isinstance(baseline_progress, dict):
+ for baseline, progress in sorted(baseline_progress.items()):
+ if not isinstance(progress, dict):
+ continue
+ lines.append(
+ "| {baseline} | {expected} | {completed} | {ok} | {error} | {missing} |".format(
+ baseline=baseline,
+ expected=progress.get("expected", ""),
+ completed=progress.get("completed", ""),
+ ok=progress.get("ok", ""),
+ error=progress.get("error", ""),
+ missing=progress.get("missing", ""),
+ )
+ )
+ lines.extend(["", "## Last Result", ""])
+ last_result = payload.get("last_result")
+ if isinstance(last_result, dict):
+ lines.extend(
+ [
+ f"- baseline: `{last_result.get('baseline')}`",
+ f"- sample_id: `{last_result.get('sample_id')}`",
+ f"- status: `{last_result.get('status')}`",
+ f"- error: `{last_result.get('error')}`",
+ ]
+ )
+ else:
+ lines.append("- none")
+ lines.extend(["", "## Recent Errors", ""])
+ if isinstance(recent_errors, list) and recent_errors:
+ for error in recent_errors:
+ if not isinstance(error, dict):
+ continue
+ lines.append(
+ "- `{baseline}` / `{sample_id}`: {message}".format(
+ baseline=error.get("baseline"),
+ sample_id=error.get("sample_id"),
+ message=error.get("error"),
+ )
+ )
+ else:
+ lines.append("- none")
+ lines.extend(["", "## Final Artifacts", ""])
+ if isinstance(final_artifacts, dict):
+ for name, exists in sorted(final_artifacts.items()):
+ lines.append(f"- {name}: `{'present' if exists else 'missing'}`")
+ else:
+ lines.append("- unknown")
+ lines.extend(["", "## Validation", ""])
+ if isinstance(validation_status, dict):
+ lines.extend(
+ [
+ f"- present: `{'yes' if validation_status.get('present') else 'no'}`",
+ f"- claim_status: `{validation_status.get('claim_status')}`",
+ f"- passed: `{validation_status.get('passed')}`",
+ ]
+ )
+ missing_requirements = validation_status.get("missing_requirements")
+ if isinstance(missing_requirements, list) and missing_requirements:
+ lines.append("- missing requirements:")
+ for requirement in missing_requirements:
+ lines.append(f" - {requirement}")
+ else:
+ lines.append("- unknown")
+ next_item = payload.get("next")
+ lines.extend(["", "## Next", ""])
+ if isinstance(next_item, dict):
+ lines.extend(
+ [
+ f"- baseline: `{next_item.get('baseline')}`",
+ f"- sample_id: `{next_item.get('sample_id')}`",
+ f"- input_path: `{next_item.get('input_path')}`",
+ ]
+ )
+ else:
+ lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _load_existing_report(report_path: Path) -> list[BenchmarkResult]:
+ if not report_path.exists():
+ return []
+ payload = json.loads(report_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, list):
+ raise ValueError(f"benchmark report must be a list: {report_path}")
+ by_key: dict[tuple[str, str], BenchmarkResult] = {}
+ for row in payload:
+ if not isinstance(row, dict):
+ raise ValueError(f"benchmark report row must be an object: {report_path}")
+ result = BenchmarkResult(
+ baseline=str(row.get("baseline") or ""),
+ input_path=str(row.get("input_path") or ""),
+ status=str(row.get("status") or "error"),
+ latency_seconds=float(row.get("latency_seconds") or 0.0),
+ sample_id=str(row.get("sample_id") or "") or None,
+ slices=[str(item) for item in row.get("slices", [])] if isinstance(row.get("slices"), list) else [],
+ metrics={str(key): float(value) for key, value in dict(row.get("metrics") or {}).items()},
+ error=str(row.get("error") or "") or None,
+ )
+ by_key[(result.baseline, result.input_path)] = result
+ return list(by_key.values())
+
+
+def _score_existing_document(baseline: str, input_path: Path, entry: ManifestEntry, document_path: Path) -> BenchmarkResult:
+ payload = json.loads(document_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise ValueError(f"document JSON must be an object: {document_path}")
+ document = Document.from_dict(payload)
+ reference_path = entry.metadata.get("reference_path")
+ explicit_reference_path = str(reference_path) if isinstance(reference_path, str) else None
+ metrics = score_document(document, document.text, load_reference(input_path, None, explicit_path=explicit_reference_path))
+ metrics.update(_quality_metrics(document))
+ return BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="ok",
+ latency_seconds=0.0,
+ sample_id=entry.sample_id,
+ slices=[str(item) for item in entry.metadata.get("slices", [])] if isinstance(entry.metadata.get("slices"), list) else [],
+ metrics=metrics,
+ )
+
+
+def _run_one_isolated(
+ baseline: str,
+ input_path: Path,
+ manifest_path: Path,
+ benchmark_dir: Path,
+ tmp_root: Path,
+ *,
+ candidate_model_config: Path,
+ entry: ManifestEntry,
+ sample_timeout_seconds: int,
+) -> BenchmarkResult:
+ tmp_dir = tmp_root / baseline / input_path.stem
+ if tmp_dir.exists():
+ shutil.rmtree(tmp_dir)
+ tmp_dir.mkdir(parents=True)
+ command = [
+ sys.executable,
+ "-m",
+ "ocrtech.cli",
+ "benchmark",
+ str(input_path),
+ "--out",
+ str(tmp_dir),
+ "--baselines",
+ baseline,
+ "--eval-manifest",
+ str(manifest_path),
+ ]
+ if baseline == "candidate":
+ command.extend(["--candidate-model-config", str(candidate_model_config)])
+ try:
+ completed = subprocess.run(
+ command,
+ check=False,
+ capture_output=True,
+ text=True,
+ timeout=sample_timeout_seconds,
+ )
+ except subprocess.TimeoutExpired as exc:
+ return BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=float(sample_timeout_seconds),
+ sample_id=entry.sample_id,
+ slices=[str(item) for item in entry.metadata.get("slices", [])] if isinstance(entry.metadata.get("slices"), list) else [],
+ error=f"TimeoutExpired: timed out after {sample_timeout_seconds}s",
+ )
+ tmp_report = tmp_dir / "report.json"
+ if not tmp_report.exists():
+ stderr_tail = (completed.stderr or completed.stdout or "").strip().splitlines()[-5:]
+ return BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=0.0,
+ sample_id=entry.sample_id,
+ slices=[str(item) for item in entry.metadata.get("slices", [])] if isinstance(entry.metadata.get("slices"), list) else [],
+ error=f"isolated benchmark exited {completed.returncode}: {' | '.join(stderr_tail)}",
+ )
+ rows = json.loads(tmp_report.read_text(encoding="utf-8"))
+ if not isinstance(rows, list) or len(rows) != 1 or not isinstance(rows[0], dict):
+ raise ValueError(f"isolated benchmark report must contain exactly one row: {tmp_report}")
+ output_source = tmp_dir / baseline / input_path.stem
+ output_target = benchmark_dir / baseline / input_path.stem
+ if output_source.exists():
+ if output_target.exists():
+ shutil.rmtree(output_target)
+ shutil.copytree(output_source, output_target)
+ row = rows[0]
+ return BenchmarkResult(
+ baseline=str(row.get("baseline") or baseline),
+ input_path=str(row.get("input_path") or input_path),
+ status=str(row.get("status") or "error"),
+ latency_seconds=float(row.get("latency_seconds") or 0.0),
+ sample_id=str(row.get("sample_id") or entry.sample_id) or None,
+ slices=[str(item) for item in row.get("slices", [])] if isinstance(row.get("slices"), list) else [],
+ metrics={str(key): float(value) for key, value in dict(row.get("metrics") or {}).items()},
+ error=str(row.get("error") or "") or None,
+ )
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/src/ocr_tech.egg-info/PKG-INFO b/src/ocr_tech.egg-info/PKG-INFO
new file mode 100644
index 0000000000000000000000000000000000000000..479037c1fca46455a0af210db220d8f25504d859
--- /dev/null
+++ b/src/ocr_tech.egg-info/PKG-INFO
@@ -0,0 +1,338 @@
+Metadata-Version: 2.4
+Name: ocr-tech
+Version: 0.1.0
+Summary: Hybrid Nepali + English OCR and document-structure extraction toolkit.
+Author: Ampixa
+License: Apache-2.0
+Requires-Python: >=3.11
+Description-Content-Type: text/markdown
+Provides-Extra: datasets
+Requires-Dist: datasets>=3.0.0; extra == "datasets"
+Requires-Dist: h5py>=3.11.0; extra == "datasets"
+Requires-Dist: huggingface-hub>=0.25.0; extra == "datasets"
+Requires-Dist: pillow>=10.0.0; extra == "datasets"
+Provides-Extra: eval
+Requires-Dist: pillow>=10.0.0; extra == "eval"
+Provides-Extra: engines
+Requires-Dist: paddleocr>=3.0.0; extra == "engines"
+Requires-Dist: pillow>=10.0.0; extra == "engines"
+Provides-Extra: surya
+Requires-Dist: surya-ocr>=0.20.0; extra == "surya"
+Requires-Dist: pillow>=10.0.0; extra == "surya"
+Provides-Extra: hf-recognizer
+Requires-Dist: accelerate>=1.1.0; extra == "hf-recognizer"
+Requires-Dist: protobuf>=5.28.0; extra == "hf-recognizer"
+Requires-Dist: sentencepiece>=0.2.0; extra == "hf-recognizer"
+Requires-Dist: transformers>=4.57.0; extra == "hf-recognizer"
+Requires-Dist: torch>=2.5.0; extra == "hf-recognizer"
+Requires-Dist: pillow>=10.0.0; extra == "hf-recognizer"
+Provides-Extra: vlm
+Requires-Dist: transformers>=4.50.0; extra == "vlm"
+Requires-Dist: torch>=2.5.0; extra == "vlm"
+Requires-Dist: pillow>=10.0.0; extra == "vlm"
+Provides-Extra: dev
+Requires-Dist: pytest>=8.0.0; extra == "dev"
+
+# ocr-tech
+
+Hybrid Nepali + English OCR and document-structure extraction toolkit.
+
+This repository is a runnable foundation for the document-understanding plan:
+
+- local OCR/structure pipeline first
+- optional PaddleOCR/Tesseract/remote model adapters
+- stable CLI commands for data prep, training recipes, parsing, and benchmarks
+- explicit output schema for Markdown, JSON, tables, and figures
+
+It does not claim that the fine-tuned recognizer is already trained. Training commands generate checked manifests, PaddleOCR label files, dictionaries, and recipe configs so long jobs can be run on a suitable host.
+
+## Install
+
+```bash
+python3 -m venv .venv
+. .venv/bin/activate
+python -m pip install -e '.[dev]'
+```
+
+Optional integrations:
+
+```bash
+python -m pip install -e '.[datasets,engines]'
+python -m pip install -e '.[hf-recognizer]'
+```
+
+The `hf-recognizer` extra is the real dependency set for TrOCR-style training and inference here. It includes `torch`, `transformers`, `accelerate`, `sentencepiece`, `protobuf`, and `pillow`.
+
+## CLI
+
+```bash
+ocrtech prepare-data labels.csv --out data/manifests --image-field image_path --text-field text
+ocrtech prepare-data labels.csv --out data/manifests --image-field image_path --text-field text --skip-invalid
+ocrtech prepare-data gauravgiri/nepali-ocr-dataset --hf --split train --limit 100 --out data/manifests
+ocrtech prepare-data prashant0919/nepali-synthetic-ocr-lines --hf --split train --limit 100 --out data/manifests
+ocrtech prepare-data nvidia/OCR-Synthetic-Multilingual-v1 --hf --hf-subset en --split test --limit 1000 --out data/manifests-english-test
+ocrtech merge-manifests data/manifests/gauravgiri__nepali-ocr-dataset-train.jsonl data/manifests/prashant0919__nepali-synthetic-ocr-lines-train.jsonl --out data/manifests/nepali-mixed-all.jsonl
+ocrtech audit-manifest data/manifests/labels-train.jsonl --require-slice nepali --require-slice english
+ocrtech split-manifest data/manifests/labels-train.jsonl --out data/splits --eval-ratio 0.15
+ocrtech rebalance-manifest data/splits/train.jsonl --out data/splits/train-rebalanced.jsonl --slice english --slice nepali
+ocrtech materialize-references data/splits/eval.jsonl --out data/references --rewritten-manifest data/splits/eval-with-refs.jsonl
+ocrtech create-eval-pack --out data/eval-pack --input-format image --degradation clean --degradation scan
+ocrtech create-eval-pack --out data/eval-pack-table-figure-dev-v1 --input-format image --template table-ledger --template figure-caption --count-per-template 8 --variant-offset 100 --degradation clean --degradation scan --degradation blur --degradation low_contrast --degradation skew
+ocrtech audit-eval-pack data/eval-pack/manifests/ocrtech-eval-pack.jsonl --require-claim-ready
+ocrtech train-recognizer --train-manifest data/splits/train.jsonl --eval-manifest data/splits/eval.jsonl --out runs/recognizer
+ocrtech train-recognizer --backend hf-vision-encoder-decoder --base-model microsoft/trocr-small-printed --train-manifest data/splits/train.jsonl --eval-manifest data/splits/eval.jsonl --out runs/hf-recognizer
+ocrtech export-recognizer --training-config runs/recognizer/paddle_recognizer.yml --checkpoint runs/recognizer/checkpoints/best_accuracy --out runs/recognizer/export
+ocrtech package-recognizer --inference-dir runs/recognizer/export/inference --dictionary runs/recognizer/nep_eng_dict.txt --out runs/recognizer/package --model-id ocrtech-nep-eng-rec-v1
+ocrtech package-hf-recognizer --model-dir runs/hf-recognizer/final-model --out runs/hf-recognizer/package --model-id ocrtech-hf-nep-eng-rec-v1 --base-model microsoft/trocr-small-printed
+ocrtech train-corrector --clean-manifest data/splits/train.jsonl --out runs/corrector
+ocrtech train-corrector --hf-dataset cfilt/RoundTripOCR-nepali --hf-split train --limit 1000 --out runs/corrector-cfilt
+ocrtech audit-model runs/recognizer/package/model-card.json
+ocrtech audit-remote-host --host 100.97.238.103 --user k2 --password-env OCRTECH_REMOTE_PASSWORD --workdir '~/ocr-tech' --require-path '~/ocr-tech' --min-free-gb 20 --require-paddle-training --out outputs/remote-audit
+ocrtech bootstrap-remote-host --host 100.97.238.103 --user k2 --password-env OCRTECH_REMOTE_PASSWORD --workdir '~/ocr-tech' --out outputs/remote-bootstrap
+ocrtech sync-remote-workspace --host 100.97.238.103 --user k2 --password-env OCRTECH_REMOTE_PASSWORD --local-root . --remote-workdir '~/ocr-tech' --exclude .venv --exclude outputs --exclude runs --out outputs/remote-sync
+ocrtech preflight-claim --eval-manifest data/eval-pack/manifests/ocrtech-eval-pack.jsonl --references-dir data/eval-pack/references --baselines candidate,tesseract,stock-paddle --candidate-model-config runs/recognizer/package/model-card.json --train-manifest data/splits/train.jsonl --out outputs/preflight
+ocrtech parse-doc examples/sample-page.txt --out outputs/sample --engine sidecar
+ocrtech benchmark examples/sample-page.txt --out outputs/bench --baselines ours
+ocrtech summarize-benchmark --benchmark-report outputs/bench/report.json --out outputs/bench-summary --candidate ours --baseline tesseract --metric cer
+ocrtech benchmark-error-analysis --benchmark-report outputs/bench/report.json --out outputs/bench-error-analysis --system surya --baseline tesseract --metric cer
+ocrtech export-failure-manifest --source-manifest data/splits/eval.jsonl --top-failures outputs/bench-error-analysis/top-failures.json --out data/splits/eval-hard.jsonl --split hard_eval
+ocrtech paper-benchmark-table --summary outputs/paper-claimpack-summary-tesseract/summary.json --summary outputs/paper-claimpack-summary-surya/summary.json --summary outputs/paper-claimpack-summary-stock-paddle/summary.json --out outputs/paper-claimpack-table --system candidate --system surya --system tesseract --system stock-paddle --label 'candidate=Candidate' --label 'surya=Surya' --label 'tesseract=Tesseract' --label 'stock-paddle=Stock Paddle' --source-preference 'candidate=outputs/paper-claimpack-summary-tesseract/summary.json' --source-preference 'tesseract=outputs/paper-claimpack-summary-tesseract/summary.json' --source-preference 'surya=outputs/paper-claimpack-summary-surya/summary.json' --source-preference 'stock-paddle=outputs/paper-claimpack-summary-stock-paddle/summary.json' --metric cer --metric table_cell_f1 --metric reading_order_pair_accuracy --metric latency_seconds
+ocrtech calibrate-quality-router --experiment-report outputs/calibration-experiment/experiment.json --out outputs/quality-router-calibration --model-id ocrtech-tesseract-quality-router --primary-engine tesseract --secondary-engine tesseract --primary-engine-kwarg 'language=nep+eng' --primary-engine-kwarg 'psm=6' --secondary-engine-kwarg 'language=nep+eng' --secondary-engine-kwarg 'psm=13'
+ocrtech calibrate-script-router --experiment-report outputs/script-calibration/experiment.json --out outputs/script-router-calibration --model-id ocrtech-tesseract-surya-script-router --primary-engine tesseract --secondary-engine surya --primary-engine-kwarg 'language=nep+eng' --primary-engine-kwarg 'psm=6' --secondary-engine-kwarg 'mode=auto'
+ocrtech calibrate-tesseract-psm-ensemble --primary-experiment-report outputs/psm13-calibration/experiment.json --variant-experiment psm7=outputs/psm7-calibration/experiment.json --variant-experiment psm11=outputs/psm11-calibration/experiment.json --variant-experiment psm13=outputs/psm13-calibration/experiment.json --out outputs/psm-ensemble-calibration --model-id ocrtech-tesseract-psm-ensemble
+ocrtech run-experiment --eval-manifest data/eval-pack/manifests/ocrtech-eval-pack.jsonl --out outputs/experiment --baselines candidate,tesseract,stock-paddle --candidate-model-config runs/recognizer/package/model-card.json
+ocrtech review-claim --experiment outputs/internal-claim/experiment.json --experiment outputs/ocrbench-v2/experiment.json --config claim-review.json --model-config runs/recognizer/package/model-card.json --out outputs/claim-review
+ocrtech validate-claim --benchmark-report outputs/bench/report.json --config validation.json --out outputs/validation
+```
+
+`parse-doc` writes:
+
+- `document.json`
+- `document.md`
+- `tables/*.csv`
+- `tables/*.html`
+- `figures/metadata.json`
+
+## Engines
+
+`auto` tries deterministic sidecar OCR first, then PaddleOCR, then Tesseract. Optional engines fail loudly when binaries or packages are missing.
+
+Sidecar inputs are useful for tests and staged pipelines. For `page.png`, provide one of:
+
+- `page.png.ocr.json`
+- `page.ocr.json`
+- `page.png.txt`
+- `page.txt`
+
+## Data
+
+Use `prepare-data` to verify actual fields and image paths before training. By default it fails on the first bad row. Use `--skip-invalid` when the upstream dataset is messy and you want a usable manifest plus an explicit reject log instead of a silent partial corpus.
+
+Use `merge-manifests` to assemble multi-source corpora without ad hoc `cat` pipelines, then `audit-manifest` before training and `split-manifest` to create deterministic leakage-safe train/eval manifests. The split groups exact sample signatures before assignment so duplicate image+text examples cannot land on both sides.
+
+Known Hugging Face adapters now stamp verified slice metadata automatically:
+
+- `gauravgiri/nepali-ocr-dataset`: `nepali`, `real`
+- `prashant0919/nepali-synthetic-ocr-lines`: `nepali`, `synthetic`
+- `nvidia/OCR-Synthetic-Multilingual-v1 --hf-subset en`: `english`, `synthetic`, `line_crop`, `en`
+
+Use `rebalance-manifest` only on the training split after `split-manifest`. Rebalancing before the split would turn deliberate duplication into leakage.
+
+Planned source datasets:
+
+- `gauravgiri/nepali-ocr-dataset`
+- `prashant0919/nepali-synthetic-ocr-lines`
+- `nvidia/OCR-Synthetic-Multilingual-v1`
+- `cfilt/RoundTripOCR-nepali`
+
+The verified Hugging Face adapters are intentionally dataset-specific where the upstream schema is non-standard:
+
+- `gauravgiri/nepali-ocr-dataset`: generic `image` + `text`
+- `prashant0919/nepali-synthetic-ocr-lines`: `metadata.jsonl` plus per-line image files, downloaded lazily for the requested rows
+- `cfilt/RoundTripOCR-nepali`: correction pairs via `ocr` and `correct`
+- `nvidia/OCR-Synthetic-Multilingual-v1`: HDF5 shards with `annotations.line_bboxes`; use `--hf-subset en` for English crops
+
+Some upstream corpora are dirty. For example, the current `gauravgiri/nepali-ocr-dataset` sample prefix includes null `text` rows, so use `--skip-invalid` when you want a prepared manifest plus an explicit reject log instead of a hard stop.
+
+## Baselines
+
+The benchmark command supports:
+
+- `ours`
+- `tesseract`
+- `stock-paddle`
+- `glm-ocr`
+- `paddleocr-vl`
+
+`glm-ocr` and `paddleocr-vl` are external command hooks:
+
+```bash
+export OCRTECH_GLM_OCR_CMD='python scripts/run_glm_ocr.py --input {input} --out {out}'
+export OCRTECH_PADDLEOCR_VL_CMD='python scripts/run_paddleocr_vl.py --input {input} --out {out}'
+```
+
+The command must include both `{input}` and `{out}` placeholders. It may print Markdown to stdout or write `{out}/document.md`; `ocrtech` now normalizes that Markdown into its own `document.json` schema so external VLM baselines can still be scored for text, table cells, and reading order.
+
+The bundled wrappers are thin adapters, not magic:
+
+- `scripts/run_glm_ocr.py` uses the official `transformers` path from the `zai-org/GLM-OCR` model card.
+- `scripts/run_paddleocr_vl.py` uses the official `PaddleOCRVL(...).predict(...)` path from the `PaddlePaddle/PaddleOCR-VL-1.6` model card.
+- GLM-OCR still expects a git `transformers` build upstream. On `k2`, the released `transformers 4.57.6` package was not enough to instantiate its processor classes; a dedicated Python 3.11 env with git `transformers` and `torchvision` was required before the wrapper would run.
+- PaddleOCR-VL still needs the OCR extras that the official docs call out, for example `pip install "paddlex[ocr]==3.7.1"`.
+
+## Validation Before SOTA Claims
+
+Use `validate-claim` before making any quality claim. The default validator is intentionally strict and will fail unless the benchmark report has held-out sample coverage, required slices, leakage checks, paired candidate-vs-baseline gates, and per-gate evidence such as paired wins and optional significance thresholds.
+
+Use `create-eval-pack` for internal mixed Nepali/English document tests and `audit-eval-pack` to check whether the pack is claim-ready. The internal pack now includes a real `multi_page` slice in addition to the single-page paragraph, table, form, and figure templates. Text packs are for pipeline smoke tests only; image packs are required for OCR claims.
+
+Use `preflight-claim` before `run-experiment` on any claim-grade run. It fails early on missing references, invalid model cards, missing baseline dependencies, non-claim-ready eval packs, bad validation configs, and train/eval leakage.
+
+For routed or thresholded candidates such as `quality_select_composite` and `script_select_composite`, claim-grade runs also require explicit calibration provenance in the model card. If the candidate was calibrated on the same eval manifest you are about to benchmark, `preflight-claim` now fails on purpose.
+
+For those routed candidates, claim-grade runs also need the raw component baselines in the same benchmark. If a `script_select_composite` candidate is built from Tesseract and Surya, the claim run must include `candidate,tesseract,surya`; otherwise the repo now fails preflight because distinctness cannot be checked honestly.
+
+Use `run-experiment` to benchmark every manifest input, write reproducibility metadata, and run claim validation in one output directory.
+
+Use `review-claim` after the internal pack and public benchmark suites have all been run. It audits the portfolio-level evidence bundle so one green experiment does not get misrepresented as a broad SOTA claim.
+
+Use a candidate model card for any real benchmark of `ours`; see [docs/MODELS.md](docs/MODELS.md).
+Use `filter-manifest` when a baseline is too expensive to run on the full pack and you need a reproducible exploratory subset instead of hand-editing a JSONL.
+
+See [docs/PREFLIGHT.md](docs/PREFLIGHT.md), [docs/CLAIM_REVIEW.md](docs/CLAIM_REVIEW.md), [docs/EVAL_PACK.md](docs/EVAL_PACK.md), [docs/MODELS.md](docs/MODELS.md), [docs/EXPERIMENTS.md](docs/EXPERIMENTS.md), and [docs/VALIDATION.md](docs/VALIDATION.md).
+
+## Remote Training
+
+Use `docs/REMOTE_TRAINING.md` for the current `k2` host notes, `audit-remote-host`, and the safe SSH workflow. Do not commit SSH passwords or machine-specific secrets.
+
+## Current HF Result
+
+The strongest verified TrOCR candidate so far is the rebalanced mixed-script run trained on `k2` and evaluated on a held-out `180`-sample mixed Nepali/English line set.
+
+That run is materially better than our own earlier HF candidates:
+
+- overall benchmark CER: `1.628157` -> `0.586139`
+- English CER: `0.379729` -> `0.300454`
+- Nepali CER: `7.870295` -> `2.014560`
+- real-slice CER: `12.702701` -> `1.770016`
+
+But the first named baseline comparison is still bad news for the project claim: on that same eval split, `tesseract` is better than the rebalanced candidate on overall, English, Nepali, real, and synthetic OCR metrics.
+
+The next attempted rescue path also failed. On June 14, 2026, a ByT5 text-correction model trained on `k2` from mined Tesseract noisy/clean pairs was packaged as a `text_correction_composite` candidate with raw Tesseract as the base engine. On the same held-out `180`-sample eval, that composite regressed catastrophically: overall CER `6.912065` versus raw Tesseract `0.329012`, with paired CER `0` wins, `170` losses, and `10` ties. That rules out the current Tesseract-plus-corrector path as a serious answer.
+
+There is one narrower improvement worth keeping, but it is not a claim-grade win. A routed Tesseract composite now exists as `quality_select_composite`: it runs default Tesseract (`psm=6`) and a secondary variant (`psm=13`), scores both outputs with the local `quality_score`, and switches only when the secondary beats the primary by a configured margin.
+
+The same-pack tuned run looked slightly better on the original `180`-sample mixed eval, but that was not honest enough. After splitting that pack into a separate calibration half (`89` samples) and untouched holdout half (`91` samples), the calibrated routed candidate still improved overall CER on the holdout, just by much less:
+
+- raw tesseract holdout overall CER: `0.342234`
+- routed tesseract holdout overall CER: `0.340608`
+- paired CER on holdout: `2` wins, `1` loss, `88` ties
+
+That makes it a plausible engineering baseline, not a frontier result. The effect size is tiny, the pack still is not claim-ready, and the real Devanagari recognizer problem remains open.
+
+We also tested a richer calibrated Tesseract ensemble over `psm=6/7/11/13` with learned quality-score biases. That looked better on the calibration half, but it failed on the untouched holdout: overall CER regressed from `0.342234` to `0.358352`. That is exactly the kind of result the new calibration workflow is supposed to expose.
+
+The more useful June 14, 2026 result is a calibrated Tesseract-plus-Surya script router on `k2`. Raw Surya was not competitive overall on the `91`-sample holdout (`2.198362` CER vs raw Tesseract `0.342234`), but it was materially better on the Nepali slice. A routed `script_select_composite` candidate calibrated on the separate `89`-sample half and evaluated on the untouched `91`-sample holdout did better than raw Tesseract across every reported slice:
+
+- raw tesseract holdout overall CER: `0.342234`
+- calibrated script router overall CER: `0.313084`
+- paired CER on holdout: `9` wins, `0` losses, `82` ties
+
+That is the strongest verified baseline improvement in the repo so far. It is still not a frontier claim, because it is one internal line-level split and not the full claim bundle, but it is a real out-of-sample gain and a better direction than the current TrOCR branch. The router now also supports `routing_granularity=page` for mixed multi-page documents; the calibrated `k2` result above is still the original document-level calibration, not a new page-level benchmark.
+
+We also ran an exploratory page-level script router on the same `91`-sample holdout, reusing the document-level threshold `0.4`. The result was identical to the document-level router (`0.313084` overall CER, `9` wins, `0` losses, `82` ties vs raw Tesseract). That is expected for this pack because it is dominated by single-page line-crop samples; page routing needs a real multi-page document pack before it can prove anything new.
+
+The internal image eval pack now has a real rendered `multi_page` slice with bundled page images and actual drawn table grids. On that small rendered smoke pack, the plain script router already beat Tesseract strongly on text (`0.243224` vs `0.540584` overall CER) and on the dedicated table page (`table_cell_f1` `1.0` vs `0.0`). A follow-up exploratory model with `secondary_structure_backfill=true` kept the same CER and backfilled Surya table structure on the multi-page report, lifting aggregate `table_cell_f1` from `0.5` to `1.0` on that smoke pack. That is still not claim-grade evidence because the pack is tiny and only `clean`, but it is a real document-capability improvement.
+
+The next step was to stop calling it smoke evidence and run the same backfill router on a claim-ready rendered image pack. That broader internal pack contains `25` samples across `clean`, `scan`, `blur`, `low_contrast`, and `skew`, and its audit passed cleanly. The calibrated backfill router also passed `preflight-claim` on that pack. Against raw Tesseract on the same rendered claim pack it still held up on text and structure:
+
+- overall CER: `0.248654` vs `0.689214`
+- blur CER: `0.260039` vs `0.991613`
+- scan CER: `0.237424` vs `0.593631`
+- skew CER: `0.239317` vs `0.766067`
+- aggregate `table_cell_f1`: `0.955556` vs `0.0`
+- aggregate `table_exact_match`: `0.8` vs `0.0`
+- paired CER: `9` wins, `1` loss, `15` ties
+
+That result is good enough to keep and bad enough to describe plainly. The multi-page slice tied Tesseract on CER (`0.315789` each) while still recovering table structure that Tesseract missed (`table_cell_f1` `0.911111` vs `0.0`). The form slice regressed slightly on CER (`0.231933` vs `0.230010`). Aggregate reading-order pair accuracy on this rendered pack is also still worse than Tesseract (`0.764` vs `0.816`). So the current candidate is meaningfully better on OCR robustness and table extraction for this internal rendered pack, but it is not yet a clean document-understanding leader.
+
+We then widened the comparison beyond Tesseract. Two more June 14, 2026 checks on `k2` matter:
+
+- raw Surya on the same `25`-sample rendered claim pack is better on text CER than the calibrated backfill router: `0.195260` vs `0.248654`
+- but the router is still not pointless: it ties Surya on aggregate `table_cell_f1` (`0.955556` each) and is slightly better on aggregate `reading_order_pair_accuracy` (`0.764000` vs `0.750909`)
+
+That means the current routed candidate is still not “better than what is out there” on this rendered document pack. Raw Surya is the stronger text OCR baseline here. The router is only defending a narrower position: it preserves comparable structure while staying closer to the existing Tesseract-centered stack.
+
+We also fixed a real integration bug in the local Paddle baseline. `paddleocr 3.7.0` on `k2` returns v3 `OCRResult` objects, and the old adapter in this repo treated them like the older tuple/list API and silently dropped their text. After fixing that parser and installing `paddlepaddle 3.3.1`, `stock-paddle` became a real benchmark target on `k2`. On this same rendered pack it is still a weak baseline overall:
+
+- stock-Paddle overall CER: `1.749081`
+- stock-Paddle aggregate `table_cell_f1`: `0.0`
+- stock-Paddle aggregate `reading_order_pair_accuracy`: `1.0`
+
+So the current picture is sharper now, not prettier: the routed candidate beats Tesseract and this stock-Paddle configuration on OCR robustness and table extraction, but it still loses to raw Surya on text CER.
+
+We then used the new `filter-manifest` helper to run a broader but still tractable rendered-document comparison on `k2`: a `5`-sample blur-only subset spanning paragraph, table, form, figure, and multi-page layouts. All `30` runs completed without error across `candidate`, `tesseract`, `surya`, `stock-paddle`, `glm-ocr`, and `paddleocr-vl`. The result sharpened the ranking again:
+
+- candidate CER: `0.223273`
+- raw Surya CER: `0.197601`
+- Tesseract CER: `0.732364`
+- stock-Paddle CER: `2.810426`
+- GLM-OCR CER: `2.820269`
+- PaddleOCR-VL CER: `18.470663`
+
+On that subset, the current backfill candidate still held the structure line where Tesseract and the weaker VLM baselines collapsed (`table_cell_f1 = 1.0` for the candidate versus `0.0` for Tesseract, stock-Paddle, GLM-OCR, and PaddleOCR-VL). But it still did not beat raw Surya on text CER. That keeps the same honest conclusion intact: on rendered document OCR text, the strongest baseline in this repo is still Surya, not the current routed candidate.
+
+The stricter rendered-document result is now explicit too. On `k2`, a larger rendered `claimpack-rendered-v2` split was calibrated separately and evaluated on an untouched `50`-sample holdout. That calibration selected `primary_script_threshold=0.0`, so the routed `script_select_composite` collapsed to "always pick Surya" on the calibration set. On the holdout:
+
+- candidate CER: `0.180893`
+- raw Surya CER: `0.180893`
+- candidate `table_cell_f1`: `0.947500`
+- raw Surya `table_cell_f1`: `0.970833`
+
+That is the ceiling of the current branch, not a win. The candidate no longer even has a text-vs-structure tradeoff story there; on this larger rendered holdout it effectively degenerates to Surya on text and still loses slightly on table structure. The claim guardrails now reject this case directly: routed candidates that collapse to one engine across all calibration samples fail `candidate-calibration` in both `preflight-claim` and `review-claim`.
+
+We also tested whether a quality-based Surya/Tesseract selector could recover anything on that same rendered-v2 setup. It did not. The rendered-v2 Surya quality router calibrated to `selected_threshold=0.0`, then landed at:
+
+- candidate CER: `0.181128`
+- raw Surya CER: `0.180893`
+- candidate `table_cell_f1`: `0.947500`
+- raw Surya `table_cell_f1`: `0.947500`
+- paired CER vs Surya: `0` wins, `1` loss, `49` ties
+
+That is not a distinct better engine. It is basically Surya with one extra mistake.
+
+We then tested `line_align_composite` on the same rendered-v2 holdout: keep Surya text, align it to Tesseract's line scaffold, and see whether the ordering gain is worth the merge. It was not:
+
+- candidate CER: `0.310549`
+- raw Surya CER: `0.180893`
+- candidate `table_cell_f1`: `0.897500`
+- raw Surya `table_cell_f1`: `0.970833`
+- candidate `reading_order_pair_accuracy`: `0.792727`
+- raw Surya `reading_order_pair_accuracy`: `0.750909`
+- paired CER vs Surya: `0` wins, `7` losses, `43` ties
+
+That is another useful paper result, but not a winning model branch. Better line ordering alone did not rescue the Surya/Tesseract composite family.
+
+The upper bound is now measured too. A sample-level oracle that chooses the better of raw Surya and raw Tesseract per holdout sample using ground-truth CER landed at:
+
+- oracle CER: `0.180529`
+- raw Surya CER: `0.180893`
+- raw Tesseract CER: `0.714207`
+- oracle choices: Surya `49`, Tesseract `1`
+- paired CER vs Surya: `1` win, `0` losses, `49` ties
+
+That closes the routing branch for text OCR. There is almost no remaining sample-level headroom in the Surya/Tesseract component family on rendered-v2. The next credible model-side step has to use a genuinely stronger recognizer or document model, not another selector over these same two engines.
+
+See [docs/EXPERIMENTS.md](docs/EXPERIMENTS.md) for the exact commands, artifact paths, and the current evidence gap.
+
+If you are turning this work into a paper, start from [docs/PAPER_NOTES.md](docs/PAPER_NOTES.md). Then use [docs/PAPER_RESULTS.md](docs/PAPER_RESULTS.md) for the current generated comparison tables and branch chronology tied to local artifacts.
+
+## References
+
+- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
+- [PP-StructureV3 docs](https://paddlepaddle.github.io/PaddleOCR/latest/version3.x/pipeline_usage/PP-StructureV3.html)
+- [PaddleX table structure recognition docs](https://paddlepaddle.github.io/PaddleX/3.4/en/module_usage/tutorials/ocr_modules/table_structure_recognition.html)
+- [PaddleOCR-VL-1.6](https://huggingface.co/PaddlePaddle/PaddleOCR-VL-1.6)
+- [Tesseract docs](https://tesseract-ocr.github.io/docs/)
+- [GLM-OCR](https://huggingface.co/zai-org/GLM-OCR)
+- [Surya OCR](https://github.com/datalab-to/surya)
diff --git a/src/ocr_tech.egg-info/SOURCES.txt b/src/ocr_tech.egg-info/SOURCES.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0bcaecbd0d6839581711cfd1d498cefe60733b6b
--- /dev/null
+++ b/src/ocr_tech.egg-info/SOURCES.txt
@@ -0,0 +1,62 @@
+README.md
+pyproject.toml
+src/ocr_tech.egg-info/PKG-INFO
+src/ocr_tech.egg-info/SOURCES.txt
+src/ocr_tech.egg-info/dependency_links.txt
+src/ocr_tech.egg-info/entry_points.txt
+src/ocr_tech.egg-info/requires.txt
+src/ocr_tech.egg-info/top_level.txt
+src/ocrtech/__init__.py
+src/ocrtech/benchmark.py
+src/ocrtech/calibration.py
+src/ocrtech/claim_review.py
+src/ocrtech/cli.py
+src/ocrtech/crops.py
+src/ocrtech/datasets.py
+src/ocrtech/engines.py
+src/ocrtech/error_analysis.py
+src/ocrtech/errors.py
+src/ocrtech/evalpack.py
+src/ocrtech/experiments.py
+src/ocrtech/external_outputs.py
+src/ocrtech/manifest.py
+src/ocrtech/markdown.py
+src/ocrtech/metrics.py
+src/ocrtech/models.py
+src/ocrtech/normalization.py
+src/ocrtech/oracle.py
+src/ocrtech/paper.py
+src/ocrtech/pipeline.py
+src/ocrtech/preflight.py
+src/ocrtech/public_benchmarks.py
+src/ocrtech/quality.py
+src/ocrtech/references.py
+src/ocrtech/remote.py
+src/ocrtech/schemas.py
+src/ocrtech/structure.py
+src/ocrtech/table_analysis.py
+src/ocrtech/tables.py
+src/ocrtech/training.py
+src/ocrtech/validation.py
+tests/test_claim_review.py
+tests/test_cli.py
+tests/test_datasets.py
+tests/test_engines.py
+tests/test_error_analysis.py
+tests/test_evalpack.py
+tests/test_experiments.py
+tests/test_external_outputs.py
+tests/test_manifest.py
+tests/test_models_candidate.py
+tests/test_normalization_metrics.py
+tests/test_oracle.py
+tests/test_paper.py
+tests/test_pipeline.py
+tests/test_preflight.py
+tests/test_public_benchmarks.py
+tests/test_public_table100_runner.py
+tests/test_references_validation.py
+tests/test_remote.py
+tests/test_table_analysis.py
+tests/test_tables.py
+tests/test_training_benchmark.py
\ No newline at end of file
diff --git a/src/ocr_tech.egg-info/dependency_links.txt b/src/ocr_tech.egg-info/dependency_links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc
--- /dev/null
+++ b/src/ocr_tech.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/src/ocr_tech.egg-info/entry_points.txt b/src/ocr_tech.egg-info/entry_points.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9d1d4c003d8fe5fe04051a54f44ef34687e03ac0
--- /dev/null
+++ b/src/ocr_tech.egg-info/entry_points.txt
@@ -0,0 +1,2 @@
+[console_scripts]
+ocrtech = ocrtech.cli:main
diff --git a/src/ocr_tech.egg-info/requires.txt b/src/ocr_tech.egg-info/requires.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1a42e0b7a268b83760d65cf9cfaea872952aa175
--- /dev/null
+++ b/src/ocr_tech.egg-info/requires.txt
@@ -0,0 +1,33 @@
+
+[datasets]
+datasets>=3.0.0
+h5py>=3.11.0
+huggingface-hub>=0.25.0
+pillow>=10.0.0
+
+[dev]
+pytest>=8.0.0
+
+[engines]
+paddleocr>=3.0.0
+pillow>=10.0.0
+
+[eval]
+pillow>=10.0.0
+
+[hf-recognizer]
+accelerate>=1.1.0
+protobuf>=5.28.0
+sentencepiece>=0.2.0
+transformers>=4.57.0
+torch>=2.5.0
+pillow>=10.0.0
+
+[surya]
+surya-ocr>=0.20.0
+pillow>=10.0.0
+
+[vlm]
+transformers>=4.50.0
+torch>=2.5.0
+pillow>=10.0.0
diff --git a/src/ocr_tech.egg-info/top_level.txt b/src/ocr_tech.egg-info/top_level.txt
new file mode 100644
index 0000000000000000000000000000000000000000..79fee9d6f6c0f5479420089979d8955fd0b60a92
--- /dev/null
+++ b/src/ocr_tech.egg-info/top_level.txt
@@ -0,0 +1 @@
+ocrtech
diff --git a/src/ocrtech/__init__.py b/src/ocrtech/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..7a652ec95fa73500589a5d5bf43628a88448f413
--- /dev/null
+++ b/src/ocrtech/__init__.py
@@ -0,0 +1,7 @@
+"""Nepali + English OCR and document-understanding toolkit."""
+
+from __future__ import annotations
+
+__all__ = ["__version__"]
+
+__version__ = "0.1.0"
diff --git a/src/ocrtech/admission.py b/src/ocrtech/admission.py
new file mode 100644
index 0000000000000000000000000000000000000000..a1b2098463d27de00aef200b1cff8cac92f6dc7f
--- /dev/null
+++ b/src/ocrtech/admission.py
@@ -0,0 +1,675 @@
+"""Recognizer admission decision artifacts."""
+
+from __future__ import annotations
+
+import json
+import math
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import ValidationError
+
+
+@dataclass(slots=True)
+class FailedAdmissionGate:
+ baseline: str
+ metric: str
+ slices: list[str] = field(default_factory=list)
+ pairs: int | None = None
+ candidate_mean: float | None = None
+ baseline_mean: float | None = None
+ absolute_improvement: float | None = None
+ relative_improvement: float | None = None
+ win_count: int | None = None
+ loss_count: int | None = None
+ tie_count: int | None = None
+ reason: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "baseline": self.baseline,
+ "metric": self.metric,
+ "slices": self.slices,
+ "pairs": self.pairs,
+ "candidate_mean": self.candidate_mean,
+ "baseline_mean": self.baseline_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ "win_count": self.win_count,
+ "loss_count": self.loss_count,
+ "tie_count": self.tie_count,
+ "reason": self.reason,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerAdmissionDecision:
+ validation_report: str
+ decision: str
+ claim_status: str
+ passed: bool
+ sample_count: int | None
+ missing_requirements: list[str] = field(default_factory=list)
+ failed_gates: list[FailedAdmissionGate] = field(default_factory=list)
+ next_actions: list[str] = field(default_factory=list)
+ decision_path: str | None = None
+ markdown_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "validation_report": self.validation_report,
+ "decision": self.decision,
+ "claim_status": self.claim_status,
+ "passed": self.passed,
+ "sample_count": self.sample_count,
+ "missing_requirements": self.missing_requirements,
+ "failed_gates": [gate.to_dict() for gate in self.failed_gates],
+ "next_actions": self.next_actions,
+ "decision_path": self.decision_path,
+ "markdown_path": self.markdown_path,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerFailureRun:
+ source_path: str
+ validation_report: str | None
+ model_card: str | None
+ model_id: str
+ backend: str
+ base_model: str
+ decision: str
+ claim_status: str
+ passed: bool
+ sample_count: int | None
+ failed_gate_count: int
+ total_pairs: int
+ total_wins: int
+ total_losses: int
+ total_ties: int
+ failed_slices: list[str]
+ failed_metrics: list[str]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "source_path": self.source_path,
+ "validation_report": self.validation_report,
+ "model_card": self.model_card,
+ "model_id": self.model_id,
+ "backend": self.backend,
+ "base_model": self.base_model,
+ "decision": self.decision,
+ "claim_status": self.claim_status,
+ "passed": self.passed,
+ "sample_count": self.sample_count,
+ "failed_gate_count": self.failed_gate_count,
+ "total_pairs": self.total_pairs,
+ "total_wins": self.total_wins,
+ "total_losses": self.total_losses,
+ "total_ties": self.total_ties,
+ "failed_slices": self.failed_slices,
+ "failed_metrics": self.failed_metrics,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerFailureFamily:
+ family_key: str
+ backend: str
+ base_model: str
+ run_count: int
+ rejected_count: int
+ admitted_count: int
+ total_failed_gates: int
+ total_pairs: int
+ total_wins: int
+ total_losses: int
+ total_ties: int
+ failed_slices: list[str]
+ failed_metrics: list[str]
+ recommendation: str
+ rationale: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "family_key": self.family_key,
+ "backend": self.backend,
+ "base_model": self.base_model,
+ "run_count": self.run_count,
+ "rejected_count": self.rejected_count,
+ "admitted_count": self.admitted_count,
+ "total_failed_gates": self.total_failed_gates,
+ "total_pairs": self.total_pairs,
+ "total_wins": self.total_wins,
+ "total_losses": self.total_losses,
+ "total_ties": self.total_ties,
+ "failed_slices": self.failed_slices,
+ "failed_metrics": self.failed_metrics,
+ "recommendation": self.recommendation,
+ "rationale": self.rationale,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerFailureReview:
+ admission_decisions: list[str]
+ validation_reports: list[str]
+ model_cards: list[str]
+ min_rejections_to_stop: int
+ runs: list[RecognizerFailureRun]
+ families: list[RecognizerFailureFamily]
+ next_actions: list[str]
+ review_path: str | None = None
+ markdown_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "admission_decisions": self.admission_decisions,
+ "validation_reports": self.validation_reports,
+ "model_cards": self.model_cards,
+ "min_rejections_to_stop": self.min_rejections_to_stop,
+ "runs": [run.to_dict() for run in self.runs],
+ "families": [family.to_dict() for family in self.families],
+ "next_actions": self.next_actions,
+ "review_path": self.review_path,
+ "markdown_path": self.markdown_path,
+ }
+
+
+def decide_recognizer_admission(validation_report: str | Path, output_dir: str | Path) -> RecognizerAdmissionDecision:
+ report_path = Path(validation_report)
+ try:
+ payload = json.loads(report_path.read_text(encoding="utf-8"))
+ except FileNotFoundError as exc:
+ raise ValidationError(f"admission validation report does not exist: {report_path}") from exc
+ except json.JSONDecodeError as exc:
+ raise ValidationError(f"invalid admission validation JSON {report_path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise ValidationError(f"admission validation report must be a JSON object: {report_path}")
+
+ claim_status = str(payload.get("claim_status") or "")
+ passed = bool(payload.get("passed"))
+ decision = "admit" if claim_status == "validated" and passed else "reject"
+ failed_gates = _failed_gates(payload)
+ missing_requirements = _missing_requirements(payload)
+ next_actions = _next_actions(decision, failed_gates, missing_requirements)
+
+ sample_count_value = payload.get("sample_count")
+ sample_count = int(sample_count_value) if isinstance(sample_count_value, int | float) and not isinstance(sample_count_value, bool) else None
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ decision_path = out / "recognizer-admission-decision.json"
+ markdown_path = out / "recognizer-admission-decision.md"
+ decision_report = RecognizerAdmissionDecision(
+ validation_report=str(report_path),
+ decision=decision,
+ claim_status=claim_status or "not_run",
+ passed=passed,
+ sample_count=sample_count,
+ missing_requirements=missing_requirements,
+ failed_gates=failed_gates,
+ next_actions=next_actions,
+ decision_path=str(decision_path),
+ markdown_path=str(markdown_path),
+ )
+ decision_path.write_text(json.dumps(decision_report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_markdown(markdown_path, decision_report)
+ return decision_report
+
+
+def review_recognizer_failures(
+ admission_decisions: list[str | Path],
+ validation_reports: list[str | Path],
+ output_dir: str | Path,
+ *,
+ model_cards: list[str | Path] | None = None,
+ min_rejections_to_stop: int = 3,
+) -> RecognizerFailureReview:
+ if min_rejections_to_stop < 1:
+ raise ValidationError("min_rejections_to_stop must be >= 1")
+ if not admission_decisions and not validation_reports:
+ raise ValidationError("recognizer failure review requires at least one admission decision or validation report")
+
+ cards = [Path(path) for path in (model_cards or [])]
+ card_payloads = [_read_json_object(path, "model card") for path in cards]
+ runs: list[RecognizerFailureRun] = []
+ for index, path_value in enumerate(admission_decisions):
+ path = Path(path_value)
+ decision_payload = _read_json_object(path, "recognizer admission decision")
+ validation_payload = _read_optional_validation_payload(decision_payload, path)
+ model_identity = _model_identity_for_run(index, card_payloads, cards, validation_payload, path)
+ runs.append(_failure_run_from_decision(path, decision_payload, model_identity))
+ offset = len(runs)
+ for index, path_value in enumerate(validation_reports):
+ path = Path(path_value)
+ validation_payload = _read_json_object(path, "admission validation report")
+ decision_payload = _decision_payload_from_validation(path, validation_payload)
+ model_identity = _model_identity_for_run(offset + index, card_payloads, cards, validation_payload, path)
+ runs.append(_failure_run_from_decision(path, decision_payload, model_identity))
+
+ families = _failure_families(runs, min_rejections_to_stop=min_rejections_to_stop)
+ next_actions = _failure_review_next_actions(families)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ review_path = out / "recognizer-failure-review.json"
+ markdown_path = out / "recognizer-failure-review.md"
+ review = RecognizerFailureReview(
+ admission_decisions=[str(Path(path)) for path in admission_decisions],
+ validation_reports=[str(Path(path)) for path in validation_reports],
+ model_cards=[str(path) for path in cards],
+ min_rejections_to_stop=min_rejections_to_stop,
+ runs=runs,
+ families=families,
+ next_actions=next_actions,
+ review_path=str(review_path),
+ markdown_path=str(markdown_path),
+ )
+ review_path.write_text(json.dumps(review.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_failure_review_markdown(markdown_path, review)
+ return review
+
+
+def stopped_recognizer_family_reasons(failure_review: str | Path, *, backend: str, base_model: str) -> list[str]:
+ review_path = Path(failure_review)
+ payload = _read_json_object(review_path, "recognizer failure review")
+ families = payload.get("families")
+ if not isinstance(families, list):
+ raise ValidationError(f"recognizer failure review missing families list: {review_path}")
+ canonical_base = _canonical_recognizer_base_model(base_model)
+ reasons: list[str] = []
+ for item in families:
+ if not isinstance(item, dict):
+ continue
+ family_backend = str(item.get("backend") or "")
+ family_base = _canonical_recognizer_base_model(str(item.get("base_model") or ""))
+ if family_backend != backend or family_base != canonical_base:
+ continue
+ if item.get("recommendation") != "stop_family":
+ continue
+ reasons.append(
+ "recognizer family is stopped by {review}: family={family} rejected_runs={rejected} "
+ "wins/losses/ties={wins}/{losses}/{ties}".format(
+ review=review_path,
+ family=item.get("family_key") or f"{family_backend}::{family_base}",
+ rejected=item.get("rejected_count"),
+ wins=item.get("total_wins"),
+ losses=item.get("total_losses"),
+ ties=item.get("total_ties"),
+ )
+ )
+ return reasons
+
+
+def assert_recognizer_family_not_stopped(failure_review: str | Path, *, backend: str, base_model: str) -> None:
+ reasons = stopped_recognizer_family_reasons(failure_review, backend=backend, base_model=base_model)
+ if reasons:
+ raise ValidationError("; ".join(reasons))
+
+
+def _missing_requirements(payload: dict[str, Any]) -> list[str]:
+ value = payload.get("missing_requirements")
+ if not isinstance(value, list):
+ return []
+ return [str(item) for item in value if isinstance(item, str) and item]
+
+
+def _failed_gates(payload: dict[str, Any]) -> list[FailedAdmissionGate]:
+ gates = payload.get("gates")
+ if not isinstance(gates, list):
+ return []
+ failed: list[FailedAdmissionGate] = []
+ for item in gates:
+ if not isinstance(item, dict) or item.get("passed") is True:
+ continue
+ gate = item.get("gate")
+ gate_payload = gate if isinstance(gate, dict) else {}
+ failed.append(
+ FailedAdmissionGate(
+ baseline=str(gate_payload.get("baseline") or ""),
+ metric=str(gate_payload.get("metric") or ""),
+ slices=_gate_slices(gate_payload),
+ pairs=_int_or_none(item.get("pairs")),
+ candidate_mean=_float_or_none(item.get("candidate_mean")),
+ baseline_mean=_float_or_none(item.get("baseline_mean")),
+ absolute_improvement=_float_or_none(item.get("absolute_improvement")),
+ relative_improvement=_float_or_none(item.get("relative_improvement")),
+ win_count=_int_or_none(item.get("win_count")),
+ loss_count=_int_or_none(item.get("loss_count")),
+ tie_count=_int_or_none(item.get("tie_count")),
+ reason=str(item.get("reason")) if item.get("reason") else None,
+ )
+ )
+ return failed
+
+
+def _gate_slices(gate: dict[str, Any]) -> list[str]:
+ value = gate.get("slices")
+ if isinstance(value, list):
+ return [str(item) for item in value if str(item)]
+ single = gate.get("slice")
+ return [str(single)] if single else []
+
+
+def _float_or_none(value: Any) -> float | None:
+ if isinstance(value, bool) or not isinstance(value, int | float):
+ return None
+ as_float = float(value)
+ return as_float if math.isfinite(as_float) else None
+
+
+def _int_or_none(value: Any) -> int | None:
+ if isinstance(value, bool) or not isinstance(value, int | float):
+ return None
+ as_float = float(value)
+ if not math.isfinite(as_float):
+ return None
+ return int(as_float)
+
+
+def _next_actions(decision: str, failed_gates: list[FailedAdmissionGate], missing_requirements: list[str]) -> list[str]:
+ if decision == "admit":
+ return [
+ "Attach this admission report to the model card and run claim preflight with --require-model-admission.",
+ "Promote the recognizer only through the full document SOTA portfolio; admission is not a final SOTA claim.",
+ ]
+ actions: list[str] = []
+ failed_slices = {slice_name.lower() for gate in failed_gates for slice_name in gate.slices}
+ failed_metrics = {gate.metric for gate in failed_gates}
+ losses = sum((gate.loss_count or 0) for gate in failed_gates)
+ wins = sum((gate.win_count or 0) for gate in failed_gates)
+ if "english" in failed_slices or "en" in failed_slices or "line_crop" in failed_slices:
+ actions.append("Do not train another Devanagari-only recognizer branch until English preservation is explicitly designed and gated.")
+ if "nepali" in failed_slices:
+ actions.append("Investigate the Nepali recognizer path separately; the current branch does not clear the Devanagari admission slice.")
+ if "cer" in failed_metrics or "wer" in failed_metrics:
+ actions.append("Prioritize recognizer correctness before document-structure integration; OCR gates are failing upstream.")
+ if losses > 0 and wins == 0:
+ actions.append("Stop this exact model family for engine promotion; it has no paired wins in the admission failure gates.")
+ if not actions and missing_requirements:
+ actions.append("Fix the missing validation requirements before spending more GPU time.")
+ if not actions:
+ actions.append("Treat this branch as rejected until a new validation report passes the admission gate.")
+ return actions
+
+
+def _write_markdown(path: Path, decision: RecognizerAdmissionDecision) -> None:
+ lines = [
+ "# Recognizer Admission Decision",
+ "",
+ f"Validation report: `{decision.validation_report}`",
+ f"Decision: `{decision.decision}`",
+ f"Claim status: `{decision.claim_status}`",
+ f"Passed: `{'yes' if decision.passed else 'no'}`",
+ f"Samples: `{decision.sample_count if decision.sample_count is not None else 'unknown'}`",
+ "",
+ "## Missing Requirements",
+ "",
+ ]
+ lines.extend(f"- {item}" for item in decision.missing_requirements) if decision.missing_requirements else lines.append("- none")
+ lines.extend(
+ [
+ "",
+ "## Failed Gates",
+ "",
+ "| baseline | metric | slices | pairs | candidate | baseline mean | abs improvement | wins | losses | ties | reason |",
+ "| --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |",
+ ]
+ )
+ if decision.failed_gates:
+ for gate in decision.failed_gates:
+ lines.append(
+ "| {baseline} | {metric} | {slices} | {pairs} | {candidate} | {baseline_mean} | {absolute} | {wins} | {losses} | {ties} | {reason} |".format(
+ baseline=gate.baseline,
+ metric=gate.metric,
+ slices=",".join(gate.slices),
+ pairs="" if gate.pairs is None else gate.pairs,
+ candidate=_format_optional_float(gate.candidate_mean),
+ baseline_mean=_format_optional_float(gate.baseline_mean),
+ absolute=_format_optional_float(gate.absolute_improvement),
+ wins="" if gate.win_count is None else gate.win_count,
+ losses="" if gate.loss_count is None else gate.loss_count,
+ ties="" if gate.tie_count is None else gate.tie_count,
+ reason=(gate.reason or "").replace("|", "\\|"),
+ )
+ )
+ else:
+ lines.append("| none | | | | | | | | | | |")
+ lines.extend(["", "## Next Actions", ""])
+ lines.extend(f"- {item}" for item in decision.next_actions) if decision.next_actions else lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _read_json_object(path: Path, label: str) -> dict[str, Any]:
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except FileNotFoundError as exc:
+ raise ValidationError(f"{label} does not exist: {path}") from exc
+ except json.JSONDecodeError as exc:
+ raise ValidationError(f"invalid {label} JSON {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise ValidationError(f"{label} must be a JSON object: {path}")
+ return payload
+
+
+def _read_optional_validation_payload(decision_payload: dict[str, Any], decision_path: Path) -> dict[str, Any] | None:
+ value = decision_payload.get("validation_report")
+ if not isinstance(value, str) or not value:
+ return None
+ path = Path(value)
+ if not path.is_absolute() and not path.exists():
+ path = decision_path.parent / path
+ if not path.exists():
+ return None
+ return _read_json_object(path, "admission validation report")
+
+
+def _decision_payload_from_validation(path: Path, payload: dict[str, Any]) -> dict[str, Any]:
+ claim_status = str(payload.get("claim_status") or "")
+ passed = bool(payload.get("passed"))
+ return {
+ "validation_report": str(path),
+ "decision": "admit" if claim_status == "validated" and passed else "reject",
+ "claim_status": claim_status or "not_run",
+ "passed": passed,
+ "sample_count": payload.get("sample_count"),
+ "failed_gates": [gate.to_dict() for gate in _failed_gates(payload)],
+ }
+
+
+def _model_identity_for_run(
+ index: int,
+ card_payloads: list[dict[str, Any]],
+ cards: list[Path],
+ validation_payload: dict[str, Any] | None,
+ source_path: Path,
+) -> tuple[str, str, str, str | None]:
+ if index < len(card_payloads):
+ payload = card_payloads[index]
+ return (
+ str(payload.get("model_id") or "unknown"),
+ str(payload.get("backend") or "unknown"),
+ str(payload.get("base_model") or "unknown"),
+ str(cards[index]),
+ )
+ if validation_payload:
+ candidate_path = _candidate_model_config_path(validation_payload, source_path)
+ if candidate_path and candidate_path.exists():
+ payload = _read_json_object(candidate_path, "candidate model card")
+ return (
+ str(payload.get("model_id") or "unknown"),
+ str(payload.get("backend") or "unknown"),
+ str(payload.get("base_model") or "unknown"),
+ str(candidate_path),
+ )
+ return ("unknown", "unknown", "unknown", None)
+
+
+def _candidate_model_config_path(validation_payload: dict[str, Any], source_path: Path) -> Path | None:
+ provenance = validation_payload.get("provenance")
+ if not isinstance(provenance, dict):
+ return None
+ candidate = provenance.get("candidate_model_config")
+ if not isinstance(candidate, dict):
+ return None
+ path_value = candidate.get("path")
+ if not isinstance(path_value, str) or not path_value:
+ return None
+ path = Path(path_value)
+ if path.is_absolute() or path.exists():
+ return path
+ relative = source_path.parent / path
+ return relative if relative.exists() else path
+
+
+def _failure_run_from_decision(path: Path, payload: dict[str, Any], model_identity: tuple[str, str, str, str | None]) -> RecognizerFailureRun:
+ gates = payload.get("failed_gates")
+ failed_gates = [_failed_gate_from_payload(item) for item in gates if isinstance(item, dict)] if isinstance(gates, list) else []
+ model_id, backend, base_model, model_card = model_identity
+ return RecognizerFailureRun(
+ source_path=str(path),
+ validation_report=str(payload.get("validation_report")) if payload.get("validation_report") else None,
+ model_card=model_card,
+ model_id=model_id,
+ backend=backend,
+ base_model=base_model,
+ decision=str(payload.get("decision") or "unknown"),
+ claim_status=str(payload.get("claim_status") or "not_run"),
+ passed=bool(payload.get("passed")),
+ sample_count=_int_or_none(payload.get("sample_count")),
+ failed_gate_count=len(failed_gates),
+ total_pairs=sum(gate.pairs or 0 for gate in failed_gates),
+ total_wins=sum(gate.win_count or 0 for gate in failed_gates),
+ total_losses=sum(gate.loss_count or 0 for gate in failed_gates),
+ total_ties=sum(gate.tie_count or 0 for gate in failed_gates),
+ failed_slices=sorted({slice_name for gate in failed_gates for slice_name in gate.slices}),
+ failed_metrics=sorted({gate.metric for gate in failed_gates if gate.metric}),
+ )
+
+
+def _failed_gate_from_payload(payload: dict[str, Any]) -> FailedAdmissionGate:
+ return FailedAdmissionGate(
+ baseline=str(payload.get("baseline") or ""),
+ metric=str(payload.get("metric") or ""),
+ slices=[str(item) for item in payload.get("slices", []) if str(item)] if isinstance(payload.get("slices"), list) else [],
+ pairs=_int_or_none(payload.get("pairs")),
+ candidate_mean=_float_or_none(payload.get("candidate_mean")),
+ baseline_mean=_float_or_none(payload.get("baseline_mean")),
+ absolute_improvement=_float_or_none(payload.get("absolute_improvement")),
+ relative_improvement=_float_or_none(payload.get("relative_improvement")),
+ win_count=_int_or_none(payload.get("win_count")),
+ loss_count=_int_or_none(payload.get("loss_count")),
+ tie_count=_int_or_none(payload.get("tie_count")),
+ reason=str(payload.get("reason")) if payload.get("reason") else None,
+ )
+
+
+def _failure_families(runs: list[RecognizerFailureRun], *, min_rejections_to_stop: int) -> list[RecognizerFailureFamily]:
+ grouped: dict[tuple[str, str], list[RecognizerFailureRun]] = {}
+ for run in runs:
+ grouped.setdefault((run.backend, _canonical_recognizer_base_model(run.base_model)), []).append(run)
+ families: list[RecognizerFailureFamily] = []
+ for (backend, base_model), family_runs in sorted(grouped.items()):
+ rejected = [run for run in family_runs if run.decision == "reject"]
+ admitted = [run for run in family_runs if run.decision == "admit"]
+ total_wins = sum(run.total_wins for run in family_runs)
+ total_losses = sum(run.total_losses for run in family_runs)
+ recommendation = "continue_with_new_gate"
+ rationale: list[str] = []
+ if len(rejected) >= min_rejections_to_stop and total_wins == 0 and total_losses > 0:
+ recommendation = "stop_family"
+ rationale.append(f"{len(rejected)} rejected runs meet the stop threshold of {min_rejections_to_stop}")
+ rationale.append("failed admission gates have zero paired wins")
+ elif rejected:
+ recommendation = "do_not_promote"
+ rationale.append(f"{len(rejected)} rejected runs remain unresolved")
+ else:
+ recommendation = "no_failure_guardrail"
+ rationale.append("no rejected runs were provided for this family")
+ families.append(
+ RecognizerFailureFamily(
+ family_key=f"{backend}::{base_model}",
+ backend=backend,
+ base_model=base_model,
+ run_count=len(family_runs),
+ rejected_count=len(rejected),
+ admitted_count=len(admitted),
+ total_failed_gates=sum(run.failed_gate_count for run in family_runs),
+ total_pairs=sum(run.total_pairs for run in family_runs),
+ total_wins=total_wins,
+ total_losses=total_losses,
+ total_ties=sum(run.total_ties for run in family_runs),
+ failed_slices=sorted({slice_name for run in family_runs for slice_name in run.failed_slices}),
+ failed_metrics=sorted({metric for run in family_runs for metric in run.failed_metrics}),
+ recommendation=recommendation,
+ rationale=rationale,
+ )
+ )
+ return families
+
+
+def _canonical_recognizer_base_model(base_model: str) -> str:
+ value = base_model.strip()
+ lowered = value.lower()
+ if "devanagari_pp-ocrv3_mobile_rec" in lowered:
+ return "PaddlePaddle/devanagari_PP-OCRv3_mobile_rec"
+ return value or "unknown"
+
+
+def _failure_review_next_actions(families: list[RecognizerFailureFamily]) -> list[str]:
+ if any(family.recommendation == "stop_family" for family in families):
+ return [
+ "Do not spend more GPU time on stopped recognizer families without a different base architecture or training objective.",
+ "Move engine work toward measurable document parsing with admitted recognizer components or a document-native model.",
+ "Keep these negative runs in the paper as ablation evidence, not as promoted model results.",
+ ]
+ if any(family.recommendation == "do_not_promote" for family in families):
+ return [
+ "Do not promote rejected recognizers into the engine until a new admission report passes.",
+ "Add more runs or model-card bindings before declaring a family stopped.",
+ ]
+ return ["No rejected recognizer family was strong enough to trigger a stop recommendation."]
+
+
+def _write_failure_review_markdown(path: Path, review: RecognizerFailureReview) -> None:
+ lines = [
+ "# Recognizer Failure Review",
+ "",
+ f"Admission decisions: `{len(review.admission_decisions)}`",
+ f"Validation reports: `{len(review.validation_reports)}`",
+ f"Model cards: `{len(review.model_cards)}`",
+ f"Stop threshold: `{review.min_rejections_to_stop}` rejected runs with zero paired wins",
+ "",
+ "## Families",
+ "",
+ "| family | runs | rejected | admitted | failed gates | pairs | wins | losses | slices | recommendation |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- | --- |",
+ ]
+ for family in review.families:
+ lines.append(
+ "| {family} | {runs} | {rejected} | {admitted} | {failed_gates} | {pairs} | {wins} | {losses} | {slices} | {recommendation} |".format(
+ family=family.family_key.replace("|", "\\|"),
+ runs=family.run_count,
+ rejected=family.rejected_count,
+ admitted=family.admitted_count,
+ failed_gates=family.total_failed_gates,
+ pairs=family.total_pairs,
+ wins=family.total_wins,
+ losses=family.total_losses,
+ slices=",".join(family.failed_slices),
+ recommendation=family.recommendation,
+ )
+ )
+ lines.extend(["", "## Runs", ""])
+ for run in review.runs:
+ family = f"{run.backend}::{_canonical_recognizer_base_model(run.base_model)}"
+ lines.append(
+ f"- `{run.source_path}`: decision=`{run.decision}` model=`{run.model_id}` family=`{family}` wins/losses/ties=`{run.total_wins}/{run.total_losses}/{run.total_ties}`"
+ )
+ lines.extend(["", "## Next Actions", ""])
+ lines.extend(f"- {item}" for item in review.next_actions)
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _format_optional_float(value: float | None) -> str:
+ return "" if value is None else f"{value:.6f}"
diff --git a/src/ocrtech/benchmark.py b/src/ocrtech/benchmark.py
new file mode 100644
index 0000000000000000000000000000000000000000..c710f357332625ef1b8dd826fbb4e97877141d5c
--- /dev/null
+++ b/src/ocrtech/benchmark.py
@@ -0,0 +1,1042 @@
+"""Benchmark runner for OCR engines and structured output."""
+
+from __future__ import annotations
+
+import json
+import multiprocessing
+import queue
+import signal
+import os
+import shlex
+import shutil
+import subprocess
+import time
+import traceback
+from dataclasses import dataclass, field
+import math
+from pathlib import Path
+from typing import Any, Callable
+
+from .engines import OcrEngine, create_engine
+from .errors import BenchmarkError, EngineUnavailableError, ParseError
+from .external_outputs import document_from_markdown
+from .manifest import ManifestEntry, load_manifest
+from .pipeline import export_document, parse_document
+from .quality import evaluate_document_quality
+from .references import load_reference, score_document
+from .schemas import Document
+from .structure import build_document
+from .validation import metric_direction, sample_key
+
+
+@dataclass(slots=True)
+class BaselineOutput:
+ text: str
+ document: Document | None = None
+
+
+@dataclass(slots=True)
+class BenchmarkResult:
+ baseline: str
+ input_path: str
+ status: str
+ latency_seconds: float
+ sample_id: str | None = None
+ slices: list[str] = field(default_factory=list)
+ metrics: dict[str, float] = field(default_factory=dict)
+ error: str | None = None
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "baseline": self.baseline,
+ "input_path": self.input_path,
+ "status": self.status,
+ "latency_seconds": self.latency_seconds,
+ "sample_id": self.sample_id,
+ "slices": self.slices,
+ "metrics": self.metrics,
+ "error": self.error,
+ }
+
+
+@dataclass(slots=True)
+class PairedMetricSummary:
+ baseline: str
+ slice_name: str
+ metric: str
+ direction: str
+ pairs: int
+ candidate_mean: float
+ baseline_mean: float
+ absolute_improvement: float
+ relative_improvement: float
+ win_count: int
+ loss_count: int
+ tie_count: int
+ win_rate: float | None
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "baseline": self.baseline,
+ "slice": self.slice_name,
+ "metric": self.metric,
+ "direction": self.direction,
+ "pairs": self.pairs,
+ "candidate_mean": self.candidate_mean,
+ "baseline_mean": self.baseline_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ "win_count": self.win_count,
+ "loss_count": self.loss_count,
+ "tie_count": self.tie_count,
+ "win_rate": self.win_rate,
+ }
+
+
+@dataclass(slots=True)
+class BenchmarkSummary:
+ report_path: str
+ candidate: str
+ baselines: list[str]
+ metrics: list[str]
+ aggregate_metrics: dict[str, dict[str, dict[str, float | int]]]
+ paired_metrics: list[PairedMetricSummary]
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "report_path": self.report_path,
+ "candidate": self.candidate,
+ "baselines": self.baselines,
+ "metrics": self.metrics,
+ "aggregate_metrics": self.aggregate_metrics,
+ "paired_metrics": [item.to_dict() for item in self.paired_metrics],
+ }
+
+
+def run_benchmark(
+ inputs: list[str | Path],
+ output_dir: str | Path,
+ *,
+ baselines: list[str],
+ references_dir: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ candidate_model_config: str | Path | None = None,
+ fallback_engine: str | None = None,
+ fallback_model_config: str | Path | None = None,
+ low_confidence_threshold: float = 0.80,
+ resume_existing: bool = False,
+ sample_timeout_seconds: int | None = None,
+) -> list[BenchmarkResult]:
+ if not inputs:
+ raise BenchmarkError("benchmark requires at least one input")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ reference_root = Path(references_dir) if references_dir else None
+ eval_entries = _load_eval_entries(eval_manifest)
+ results: list[BenchmarkResult] = []
+ for baseline in baselines:
+ runner: Callable[[Path, Path], BaselineOutput] | None = None
+ for input_item in inputs:
+ input_path = Path(input_item)
+ eval_entry = _entry_for_input(input_path, eval_entries)
+ start = time.perf_counter()
+ output_dir_for_input = out / baseline / input_path.stem
+ document_path = output_dir_for_input / "document.json"
+ try:
+ explicit_reference_path = None
+ if eval_entry is not None and isinstance(eval_entry.metadata.get("reference_path"), str):
+ explicit_reference_path = str(eval_entry.metadata["reference_path"])
+ if resume_existing and document_path.exists():
+ payload = json.loads(document_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise BenchmarkError(f"document JSON must be an object: {document_path}")
+ document = Document.from_dict(payload)
+ elapsed = 0.0
+ else:
+ if sample_timeout_seconds is None:
+ if runner is None:
+ runner = _make_baseline_runner(
+ baseline,
+ candidate_model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ )
+ output = runner(input_path, output_dir_for_input)
+ else:
+ output = _call_with_timeout(
+ lambda: _run_baseline(
+ baseline,
+ input_path,
+ output_dir_for_input,
+ candidate_model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ ),
+ sample_timeout_seconds,
+ description=f"{baseline} on {input_path}",
+ )
+ elapsed = time.perf_counter() - start
+ if output.document is None:
+ raise BenchmarkError(f"baseline {baseline!r} did not return a document for {input_path}")
+ document = output.document
+ metrics = score_document(document, document.text, load_reference(input_path, reference_root, explicit_path=explicit_reference_path))
+ metrics.update(_quality_metrics(document))
+ results.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="ok",
+ latency_seconds=elapsed,
+ sample_id=eval_entry.sample_id if eval_entry else None,
+ slices=_slices_for_entry(eval_entry),
+ metrics=metrics,
+ )
+ )
+ _write_reports(results, out)
+ except Exception as exc:
+ elapsed = time.perf_counter() - start
+ results.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=elapsed,
+ sample_id=eval_entry.sample_id if eval_entry else None,
+ slices=_slices_for_entry(eval_entry),
+ error=f"{type(exc).__name__}: {exc}",
+ )
+ )
+ _write_reports(results, out)
+ _write_reports(results, out)
+ return results
+
+
+def _call_with_timeout(
+ func: Callable[[], BaselineOutput],
+ timeout_seconds: int | None,
+ *,
+ description: str,
+) -> BaselineOutput:
+ if timeout_seconds is None:
+ return func()
+ if timeout_seconds < 1:
+ raise BenchmarkError("sample_timeout_seconds must be positive when provided")
+ if "fork" in multiprocessing.get_all_start_methods():
+ return _call_with_process_timeout(func, timeout_seconds, description=description)
+ if not hasattr(signal, "SIGALRM"):
+ return func()
+
+ def _timeout_handler(signum: int, frame: object) -> None:
+ raise TimeoutError(f"timed out after {timeout_seconds}s while running {description}")
+
+ previous_handler = signal.getsignal(signal.SIGALRM)
+ signal.signal(signal.SIGALRM, _timeout_handler)
+ previous_timer = signal.setitimer(signal.ITIMER_REAL, float(timeout_seconds))
+ try:
+ return func()
+ finally:
+ signal.setitimer(signal.ITIMER_REAL, 0.0)
+ signal.signal(signal.SIGALRM, previous_handler)
+ if previous_timer[0] > 0:
+ signal.setitimer(signal.ITIMER_REAL, previous_timer[0], previous_timer[1])
+
+
+def _call_with_process_timeout(
+ func: Callable[[], BaselineOutput],
+ timeout_seconds: int,
+ *,
+ description: str,
+) -> BaselineOutput:
+ context = multiprocessing.get_context("fork")
+ result_queue: multiprocessing.Queue[dict[str, object]] = context.Queue(maxsize=1)
+ process = context.Process(target=_run_timeout_child, args=(func, result_queue))
+ process.start()
+ process.join(float(timeout_seconds))
+ if process.is_alive():
+ process.terminate()
+ process.join(5)
+ if process.is_alive() and hasattr(process, "kill"):
+ process.kill()
+ process.join(5)
+ raise TimeoutError(f"timed out after {timeout_seconds}s while running {description}")
+ try:
+ payload = result_queue.get_nowait()
+ except queue.Empty as exc:
+ exit_code = process.exitcode
+ raise BenchmarkError(f"timeout worker exited without a result while running {description}; exit_code={exit_code}") from exc
+ status = payload.get("status")
+ if status == "ok":
+ output = payload.get("output")
+ if not isinstance(output, BaselineOutput):
+ raise BenchmarkError(f"timeout worker returned invalid output while running {description}")
+ return output
+ if status == "error":
+ error_type = str(payload.get("error_type") or "Exception")
+ message = str(payload.get("message") or "")
+ child_traceback = str(payload.get("traceback") or "")
+ raise BenchmarkError(f"{error_type}: {message}\nChild traceback:\n{child_traceback}")
+ raise BenchmarkError(f"timeout worker returned invalid status while running {description}: {status!r}")
+
+
+def _run_timeout_child(func: Callable[[], BaselineOutput], result_queue: multiprocessing.Queue[dict[str, object]]) -> None:
+ try:
+ result_queue.put({"status": "ok", "output": func()})
+ except BaseException as exc: # pragma: no cover - exercised through parent process.
+ result_queue.put(
+ {
+ "status": "error",
+ "error_type": type(exc).__name__,
+ "message": str(exc),
+ "traceback": traceback.format_exc(),
+ }
+ )
+
+
+def rescore_benchmark_report(
+ report_path: str | Path,
+ output_dir: str | Path,
+ *,
+ references_dir: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+) -> list[BenchmarkResult]:
+ source_report = Path(report_path)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ rows = _load_benchmark_rows(source_report)
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ reference_root = Path(references_dir) if references_dir else None
+ eval_entries = _load_eval_entries(eval_manifest)
+ benchmark_dir = source_report.parent
+ rescored: list[BenchmarkResult] = []
+ for row in rows:
+ baseline = str(row.get("baseline") or "")
+ input_path = Path(str(row.get("input_path") or ""))
+ eval_entry = _entry_for_input(input_path, eval_entries)
+ sample_id = str(row.get("sample_id") or (eval_entry.sample_id if eval_entry else "")) or None
+ slices = [str(item) for item in row.get("slices", [])] if isinstance(row.get("slices"), list) else _slices_for_entry(eval_entry)
+ latency = float(row.get("latency_seconds") or 0.0)
+ if row.get("status") != "ok":
+ rescored.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status=str(row.get("status") or "error"),
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=str(row.get("error") or ""),
+ )
+ )
+ continue
+ document_path = benchmark_dir / baseline / input_path.stem / "document.json"
+ if not document_path.exists():
+ rescored.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=f"missing document output for rescore: {document_path}",
+ )
+ )
+ continue
+ try:
+ _copy_existing_output_for_rescore(document_path.parent, out / baseline / input_path.stem)
+ payload = json.loads(document_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise BenchmarkError(f"document JSON must be an object: {document_path}")
+ document = Document.from_dict(payload)
+ explicit_reference_path = None
+ if eval_entry is not None and isinstance(eval_entry.metadata.get("reference_path"), str):
+ explicit_reference_path = str(eval_entry.metadata["reference_path"])
+ metrics = score_document(document, document.text, load_reference(input_path, reference_root, explicit_path=explicit_reference_path))
+ metrics.update(_quality_metrics(document))
+ rescored.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="ok",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ metrics=metrics,
+ )
+ )
+ except Exception as exc:
+ rescored.append(
+ BenchmarkResult(
+ baseline=baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=f"{type(exc).__name__}: {exc}",
+ )
+ )
+ _write_reports(rescored, out)
+ return rescored
+
+
+def derive_table_postprocess_benchmark(
+ report_path: str | Path,
+ output_dir: str | Path,
+ *,
+ source_baseline: str,
+ candidate_baseline: str = "candidate",
+ references_dir: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+) -> list[BenchmarkResult]:
+ source_report = Path(report_path)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ rows = _load_benchmark_rows(source_report)
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ reference_root = Path(references_dir) if references_dir else None
+ eval_entries = _load_eval_entries(eval_manifest)
+ benchmark_dir = source_report.parent
+ derived: list[BenchmarkResult] = []
+ for row in rows:
+ baseline = str(row.get("baseline") or "")
+ if baseline != source_baseline:
+ continue
+ input_path = Path(str(row.get("input_path") or ""))
+ eval_entry = _entry_for_input(input_path, eval_entries)
+ sample_id = str(row.get("sample_id") or (eval_entry.sample_id if eval_entry else "")) or None
+ slices = [str(item) for item in row.get("slices", [])] if isinstance(row.get("slices"), list) else _slices_for_entry(eval_entry)
+ latency = float(row.get("latency_seconds") or 0.0)
+ source_output_dir = benchmark_dir / source_baseline / input_path.stem
+ source_document_path = source_output_dir / "document.json"
+ target_source_dir = out / source_baseline / input_path.stem
+ target_candidate_dir = out / candidate_baseline / input_path.stem
+ if row.get("status") != "ok":
+ derived.append(
+ BenchmarkResult(
+ baseline=source_baseline,
+ input_path=str(input_path),
+ status=str(row.get("status") or "error"),
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=str(row.get("error") or ""),
+ )
+ )
+ derived.append(
+ BenchmarkResult(
+ baseline=candidate_baseline,
+ input_path=str(input_path),
+ status=str(row.get("status") or "error"),
+ latency_seconds=0.0,
+ sample_id=sample_id,
+ slices=slices,
+ error=f"source baseline {source_baseline} failed",
+ )
+ )
+ continue
+ if not source_document_path.exists():
+ error = f"missing source document output: {source_document_path}"
+ derived.append(
+ BenchmarkResult(
+ baseline=source_baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=error,
+ )
+ )
+ derived.append(
+ BenchmarkResult(
+ baseline=candidate_baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=0.0,
+ sample_id=sample_id,
+ slices=slices,
+ error=error,
+ )
+ )
+ continue
+ try:
+ _copy_existing_output_for_rescore(source_output_dir, target_source_dir)
+ _copy_existing_output_for_rescore(source_output_dir, target_candidate_dir)
+ payload = json.loads(source_document_path.read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise BenchmarkError(f"document JSON must be an object: {source_document_path}")
+ source_document = Document.from_dict(payload)
+ candidate_document, _stats = _derive_table_postprocessed_document(source_document, source_baseline=source_baseline)
+ export_document(candidate_document, target_candidate_dir, input_path)
+ explicit_reference_path = None
+ if eval_entry is not None and isinstance(eval_entry.metadata.get("reference_path"), str):
+ explicit_reference_path = str(eval_entry.metadata["reference_path"])
+ reference = load_reference(input_path, reference_root, explicit_path=explicit_reference_path)
+ source_metrics = score_document(source_document, source_document.text, reference)
+ source_metrics.update(_quality_metrics(source_document))
+ candidate_metrics = score_document(candidate_document, candidate_document.text, reference)
+ candidate_metrics.update(_quality_metrics(candidate_document))
+ derived.append(
+ BenchmarkResult(
+ baseline=source_baseline,
+ input_path=str(input_path),
+ status="ok",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ metrics=source_metrics,
+ )
+ )
+ derived.append(
+ BenchmarkResult(
+ baseline=candidate_baseline,
+ input_path=str(input_path),
+ status="ok",
+ latency_seconds=0.0,
+ sample_id=sample_id,
+ slices=slices,
+ metrics=candidate_metrics,
+ )
+ )
+ except Exception as exc:
+ derived.append(
+ BenchmarkResult(
+ baseline=source_baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=latency,
+ sample_id=sample_id,
+ slices=slices,
+ error=f"{type(exc).__name__}: {exc}",
+ )
+ )
+ derived.append(
+ BenchmarkResult(
+ baseline=candidate_baseline,
+ input_path=str(input_path),
+ status="error",
+ latency_seconds=0.0,
+ sample_id=sample_id,
+ slices=slices,
+ error=f"{type(exc).__name__}: {exc}",
+ )
+ )
+ if not derived:
+ raise BenchmarkError(f"benchmark report has no rows for source baseline {source_baseline!r}")
+ _write_reports(derived, out)
+ return derived
+
+
+def _derive_table_postprocessed_document(document: Document, *, source_baseline: str) -> tuple[Document, dict[str, object]]:
+ from .tables import infer_repeated_header_colspans, normalize_table_grid_structure
+
+ tables = []
+ inferred_colspans = 0
+ dropped_columns = 0
+ merged_rows = 0
+ changed_tables = 0
+ for table in document.tables:
+ current = table
+ current, inferred = infer_repeated_header_colspans(current)
+ current, changed = normalize_table_grid_structure(current)
+ if inferred or changed:
+ changed_tables += 1
+ inferred_colspans += inferred
+ dropped_columns += int(current.metadata.get("normalized_table_grid_dropped_columns") or 0)
+ merged_rows += int(current.metadata.get("normalized_table_grid_merged_rows") or 0)
+ tables.append(current)
+ metadata = dict(document.metadata)
+ metadata["derived_table_postprocess"] = {
+ "source_baseline": source_baseline,
+ "inferred_table_header_colspans": inferred_colspans,
+ "normalized_table_grid_dropped_columns": dropped_columns,
+ "normalized_table_grid_merged_rows": merged_rows,
+ "changed_tables": changed_tables,
+ }
+ derived = Document(
+ source_path=document.source_path,
+ pages=document.pages,
+ tables=tables,
+ figures=document.figures,
+ metadata=metadata,
+ )
+ return derived, metadata["derived_table_postprocess"]
+
+
+def _copy_existing_output_for_rescore(source_dir: Path, target_dir: Path) -> None:
+ if source_dir.resolve() == target_dir.resolve():
+ return
+ if target_dir.exists():
+ shutil.rmtree(target_dir)
+ shutil.copytree(source_dir, target_dir)
+
+
+def summarize_benchmark_report(
+ report_path: str | Path,
+ output_dir: str | Path,
+ *,
+ candidate: str = "candidate",
+ baselines: list[str] | None = None,
+ metrics: list[str] | None = None,
+) -> BenchmarkSummary:
+ rows = _load_benchmark_rows(report_path)
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ aggregate_metrics = _aggregate_metrics(rows)
+ available_baselines = sorted({str(row.get("baseline") or "") for row in rows if str(row.get("baseline") or "")})
+ if candidate not in available_baselines:
+ raise BenchmarkError(f"candidate baseline {candidate!r} is not present in benchmark report")
+ compare_baselines = baselines or [name for name in available_baselines if name != candidate]
+ missing = [name for name in compare_baselines if name not in available_baselines]
+ if missing:
+ raise BenchmarkError(f"requested baselines missing from benchmark report: {', '.join(missing)}")
+ paired_metrics: list[PairedMetricSummary] = []
+ selected_metrics = metrics or ["cer"]
+ slices = _distinct_slices(rows)
+ for baseline in compare_baselines:
+ for metric in selected_metrics:
+ direction = metric_direction(metric)
+ for slice_name in slices:
+ summary = _summarize_paired_metric(rows, candidate, baseline, metric, direction, slice_name)
+ if summary is not None:
+ paired_metrics.append(summary)
+ summary = BenchmarkSummary(
+ report_path=str(Path(report_path)),
+ candidate=candidate,
+ baselines=compare_baselines,
+ metrics=selected_metrics,
+ aggregate_metrics=aggregate_metrics,
+ paired_metrics=paired_metrics,
+ )
+ _write_benchmark_summary(summary, Path(output_dir))
+ return summary
+
+
+def _run_baseline(
+ baseline: str,
+ input_path: Path,
+ output_dir: Path,
+ *,
+ candidate_model_config: str | Path | None = None,
+ fallback_engine: str | None = None,
+ fallback_model_config: str | Path | None = None,
+ low_confidence_threshold: float = 0.80,
+) -> BaselineOutput:
+ return _make_baseline_runner(
+ baseline,
+ candidate_model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ )(input_path, output_dir)
+
+
+def _make_baseline_runner(
+ baseline: str,
+ *,
+ candidate_model_config: str | Path | None = None,
+ fallback_engine: str | None = None,
+ fallback_model_config: str | Path | None = None,
+ low_confidence_threshold: float = 0.80,
+) -> Callable[[Path, Path], BaselineOutput]:
+ name = baseline.lower()
+ if name in {"ours", "ocrtech", "candidate"}:
+ if fallback_engine or fallback_model_config:
+ engine_name = "candidate" if candidate_model_config else "auto"
+ return lambda input_path, output_dir: _run_candidate_with_fallback(
+ input_path,
+ output_dir,
+ engine_name=engine_name,
+ candidate_model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ )
+ engine_name = "candidate" if candidate_model_config else "auto"
+ engine_kwargs = {"model_config": candidate_model_config} if engine_name == "candidate" else {}
+ engine = create_engine(engine_name, **engine_kwargs)
+ return lambda input_path, output_dir: _run_reusable_engine(engine, input_path, output_dir)
+ if name in {"tesseract", "stock-paddle", "paddleocr", "paddle", "surya"}:
+ engine_name = "paddleocr" if name in {"stock-paddle", "paddleocr", "paddle"} else name
+ engine = create_engine(engine_name)
+ return lambda input_path, output_dir: _run_reusable_engine(engine, input_path, output_dir)
+ if name in {"glm-ocr", "paddleocr-vl"}:
+ return lambda input_path, output_dir: _run_external_command(name, input_path, output_dir)
+ raise BenchmarkError(f"Unknown baseline: {baseline}")
+
+
+def _run_candidate_with_fallback(
+ input_path: Path,
+ output_dir: Path,
+ *,
+ engine_name: str,
+ candidate_model_config: str | Path | None,
+ fallback_engine: str | None,
+ fallback_model_config: str | Path | None,
+ low_confidence_threshold: float,
+) -> BaselineOutput:
+ document = parse_document(
+ input_path,
+ output_dir,
+ engine_name=engine_name,
+ model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ )
+ return BaselineOutput(text=document.text, document=document)
+
+
+def _run_reusable_engine(engine: OcrEngine, input_path: Path, output_dir: Path) -> BaselineOutput:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ engine_output = engine.recognize(input_path)
+ document = build_document(str(input_path), engine_output)
+ quality = evaluate_document_quality(document)
+ document.metadata["quality"] = quality.to_dict()
+ export_document(document, output_dir, input_path)
+ return BaselineOutput(text=document.text, document=document)
+
+
+def _run_external_command(name: str, input_path: Path, output_dir: Path) -> BaselineOutput:
+ env_key = "OCRTECH_GLM_OCR_CMD" if name == "glm-ocr" else "OCRTECH_PADDLEOCR_VL_CMD"
+ template = os.environ.get(env_key)
+ if not template:
+ raise EngineUnavailableError(f"{name} requires {env_key} command template")
+ output_dir.mkdir(parents=True, exist_ok=True)
+ command = [part.format(input=str(input_path), out=str(output_dir)) for part in shlex.split(template)]
+ completed = subprocess.run(command, check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ raise ParseError(f"{name} failed: {completed.stderr.strip()}")
+ output_text = completed.stdout.strip()
+ if output_text:
+ (output_dir / "stdout.txt").write_text(output_text + "\n", encoding="utf-8")
+ if completed.stderr.strip():
+ (output_dir / "stderr.txt").write_text(completed.stderr.strip() + "\n", encoding="utf-8")
+ text_file = output_dir / "document.md"
+ if text_file.exists():
+ output_text = text_file.read_text(encoding="utf-8")
+ elif output_text:
+ text_file.write_text(output_text + ("\n" if not output_text.endswith("\n") else ""), encoding="utf-8")
+ document_file = output_dir / "document.json"
+ document = None
+ if document_file.exists():
+ payload = json.loads(document_file.read_text(encoding="utf-8"))
+ if isinstance(payload, dict):
+ document = Document.from_dict(payload)
+ if not output_text:
+ output_text = document.text
+ elif text_file.exists():
+ document = document_from_markdown(input_path, text_file.read_text(encoding="utf-8"), metadata={"engine": name, "command": template})
+ quality = evaluate_document_quality(document)
+ document.metadata["quality"] = quality.to_dict()
+ export_document(document, output_dir, input_path)
+ output_text = (output_dir / "document.md").read_text(encoding="utf-8")
+ return BaselineOutput(text=output_text, document=document)
+
+
+def _quality_metrics(document: Document) -> dict[str, float]:
+ quality_payload = document.metadata.get("quality") if document.metadata else None
+ if isinstance(quality_payload, dict):
+ score = quality_payload.get("quality_score")
+ metrics = quality_payload.get("metrics")
+ else:
+ quality = evaluate_document_quality(document)
+ score = quality.quality_score
+ metrics = quality.metrics
+ out: dict[str, float] = {}
+ if isinstance(score, int | float):
+ out["quality_score"] = float(score)
+ if isinstance(metrics, dict):
+ line_count = metrics.get("line_count")
+ low = metrics.get("low_confidence_line_count")
+ missing = metrics.get("missing_confidence_line_count")
+ if isinstance(line_count, int | float) and line_count:
+ if isinstance(low, int | float):
+ out["low_confidence_line_rate"] = float(low) / float(line_count)
+ if isinstance(missing, int | float):
+ out["missing_confidence_line_rate"] = float(missing) / float(line_count)
+ fallback = document.metadata.get("fallback") if document.metadata else None
+ if isinstance(fallback, dict):
+ triggered = bool(fallback.get("triggered"))
+ out["fallback_triggered"] = 1.0 if triggered else 0.0
+ out["fallback_succeeded"] = 1.0 if triggered and fallback.get("outcome") == "success" else 0.0
+ out["fallback_failed"] = 1.0 if triggered and fallback.get("outcome") == "error" else 0.0
+ primary_confidence = fallback.get("primary_average_confidence")
+ threshold = fallback.get("threshold")
+ if isinstance(primary_confidence, int | float) and math.isfinite(float(primary_confidence)):
+ out["fallback_primary_average_confidence"] = float(primary_confidence)
+ if isinstance(threshold, int | float) and math.isfinite(float(threshold)):
+ out["fallback_threshold"] = float(threshold)
+ return out
+
+
+def _write_reports(results: list[BenchmarkResult], out: Path) -> None:
+ payload = [result.to_dict() for result in results]
+ (out / "report.json").write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# OCR Benchmark",
+ "",
+ "| baseline | sample | input | slices | status | latency_s | CER | WER | order | table_f1 | fallback | fallback_failed | error |",
+ "| --- | --- | --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |",
+ ]
+ for result in results:
+ metrics = result.metrics
+ lines.append(
+ "| {baseline} | {sample} | {input_path} | {slices} | {status} | {latency:.3f} | {cer} | {wer} | {order} | {table_f1} | {fallback} | {fallback_failed} | {error} |".format(
+ baseline=result.baseline,
+ sample=result.sample_id or "",
+ input_path=result.input_path,
+ slices=",".join(result.slices),
+ status=result.status,
+ latency=result.latency_seconds,
+ cer=f"{metrics['cer']:.4f}" if "cer" in metrics else "",
+ wer=f"{metrics['wer']:.4f}" if "wer" in metrics else "",
+ order=f"{metrics['reading_order_pair_accuracy']:.4f}" if "reading_order_pair_accuracy" in metrics else "",
+ table_f1=f"{metrics['table_cell_f1']:.4f}" if "table_cell_f1" in metrics else "",
+ fallback=f"{metrics['fallback_triggered']:.0f}" if "fallback_triggered" in metrics else "",
+ fallback_failed=f"{metrics['fallback_failed']:.0f}" if "fallback_failed" in metrics else "",
+ error=(result.error or "").replace("|", "\\|"),
+ )
+ )
+ (out / "report.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _load_eval_entries(eval_manifest: str | Path | None) -> list[ManifestEntry]:
+ if eval_manifest is None:
+ return []
+ return load_manifest(eval_manifest)
+
+
+def _load_benchmark_rows(path: str | Path) -> list[dict[str, Any]]:
+ try:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise BenchmarkError(f"invalid benchmark report JSON {path}: {exc}") from exc
+ if not isinstance(payload, list):
+ raise BenchmarkError("benchmark report must be a JSON list")
+ rows: list[dict[str, Any]] = []
+ for index, item in enumerate(payload):
+ if not isinstance(item, dict):
+ raise BenchmarkError(f"benchmark row {index} must be an object")
+ rows.append(dict(item))
+ return rows
+
+
+def _entry_for_input(input_path: Path, entries: list[ManifestEntry]) -> ManifestEntry | None:
+ if not entries:
+ return None
+ try:
+ resolved_input = input_path.resolve()
+ except OSError:
+ resolved_input = input_path
+ for entry in entries:
+ entry_path = Path(entry.image_path)
+ try:
+ resolved_entry = entry_path.resolve()
+ except OSError:
+ resolved_entry = entry_path
+ if resolved_input == resolved_entry or str(input_path) == entry.image_path:
+ return entry
+ return None
+
+
+def _slices_for_entry(entry: ManifestEntry | None) -> list[str]:
+ if entry is None:
+ return []
+ values: set[str] = set()
+ metadata = entry.metadata or {}
+ for key in ("slice", "script", "document_type", "degradation", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _aggregate_metrics(rows: list[dict[str, Any]]) -> dict[str, dict[str, dict[str, float | int]]]:
+ grouped: dict[str, dict[str, dict[str, list[float]]]] = {}
+ for row in rows:
+ if row.get("status") != "ok":
+ continue
+ baseline = str(row.get("baseline") or "")
+ if not baseline:
+ continue
+ slices = sorted({str(item) for item in row.get("slices") or []}) or ["all"]
+ slices.append("all")
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ for slice_name in slices:
+ slice_bucket = grouped.setdefault(baseline, {}).setdefault(slice_name, {})
+ latency_value = row.get("latency_seconds")
+ if isinstance(latency_value, int | float) and math.isfinite(float(latency_value)):
+ slice_bucket.setdefault("latency_seconds", []).append(float(latency_value))
+ for metric_name, value in metrics.items():
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ slice_bucket.setdefault(str(metric_name), []).append(float(value))
+ aggregates: dict[str, dict[str, dict[str, float | int]]] = {}
+ for baseline, slice_map in grouped.items():
+ aggregates[baseline] = {}
+ for slice_name, metric_map in slice_map.items():
+ aggregates[baseline][slice_name] = {
+ metric_name: sum(values) / len(values)
+ for metric_name, values in sorted(metric_map.items())
+ if values
+ }
+ if metric_map:
+ first_values = next(iter(metric_map.values()))
+ aggregates[baseline][slice_name]["sample_count"] = len(first_values)
+ return aggregates
+
+
+def _distinct_slices(rows: list[dict[str, Any]]) -> list[str]:
+ values = {"all"}
+ for row in rows:
+ for slice_name in row.get("slices") or []:
+ text = str(slice_name)
+ if text:
+ values.add(text)
+ return sorted(values)
+
+
+def _summarize_paired_metric(
+ rows: list[dict[str, Any]],
+ candidate: str,
+ baseline: str,
+ metric: str,
+ direction: str,
+ slice_name: str,
+) -> PairedMetricSummary | None:
+ candidate_values = _rows_by_sample(rows, candidate, metric, slice_name)
+ baseline_values = _rows_by_sample(rows, baseline, metric, slice_name)
+ shared = sorted(set(candidate_values) & set(baseline_values))
+ if not shared:
+ return None
+ candidate_series = [candidate_values[key] for key in shared]
+ baseline_series = [baseline_values[key] for key in shared]
+ candidate_mean = sum(candidate_series) / len(candidate_series)
+ baseline_mean = sum(baseline_series) / len(baseline_series)
+ absolute_improvement = _absolute_improvement(candidate_mean, baseline_mean, direction)
+ relative_improvement = _relative_improvement(absolute_improvement, baseline_mean)
+ wins, losses, ties = _paired_outcome_counts(candidate_series, baseline_series, direction)
+ non_ties = wins + losses
+ return PairedMetricSummary(
+ baseline=baseline,
+ slice_name=slice_name,
+ metric=metric,
+ direction=direction,
+ pairs=len(shared),
+ candidate_mean=candidate_mean,
+ baseline_mean=baseline_mean,
+ absolute_improvement=absolute_improvement,
+ relative_improvement=relative_improvement,
+ win_count=wins,
+ loss_count=losses,
+ tie_count=ties,
+ win_rate=(wins / non_ties) if non_ties else None,
+ )
+
+
+def _rows_by_sample(rows: list[dict[str, Any]], baseline: str, metric: str, slice_name: str) -> dict[str, float]:
+ values: dict[str, float] = {}
+ for row in rows:
+ if row.get("baseline") != baseline or row.get("status") != "ok":
+ continue
+ if slice_name != "all" and slice_name not in set(row.get("slices") or []):
+ continue
+ metrics = row.get("metrics") or {}
+ if metric not in metrics:
+ continue
+ value = metrics[metric]
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ values[sample_key(row)] = float(value)
+ return values
+
+
+def _absolute_improvement(candidate_value: float, baseline_value: float, direction: str) -> float:
+ if direction == "lower":
+ return baseline_value - candidate_value
+ return candidate_value - baseline_value
+
+
+def _relative_improvement(absolute_improvement: float, baseline_mean: float) -> float:
+ denominator = abs(baseline_mean)
+ if denominator == 0:
+ return math.inf if absolute_improvement > 0 else 0.0
+ return absolute_improvement / denominator
+
+
+def _paired_outcome_counts(candidate_values: list[float], baseline_values: list[float], direction: str) -> tuple[int, int, int]:
+ wins = 0
+ losses = 0
+ ties = 0
+ for candidate_value, baseline_value in zip(candidate_values, baseline_values, strict=True):
+ improvement = _absolute_improvement(candidate_value, baseline_value, direction)
+ if improvement > 0:
+ wins += 1
+ elif improvement < 0:
+ losses += 1
+ else:
+ ties += 1
+ return wins, losses, ties
+
+
+def _write_benchmark_summary(summary: BenchmarkSummary, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ (output_dir / "summary.json").write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Benchmark Summary",
+ "",
+ f"Report: `{summary.report_path}`",
+ f"Candidate: `{summary.candidate}`",
+ "",
+ "## Paired Comparisons",
+ "",
+ "| baseline | slice | metric | direction | pairs | candidate | baseline | improvement | relative | wins | losses | ties | win_rate |",
+ "| --- | --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ if summary.paired_metrics:
+ for item in summary.paired_metrics:
+ lines.append(
+ "| {baseline} | {slice} | {metric} | {direction} | {pairs} | {candidate_mean:.6f} | {baseline_mean:.6f} | {improvement:.6f} | {relative:.6f} | {wins} | {losses} | {ties} | {win_rate} |".format(
+ baseline=item.baseline,
+ slice=item.slice_name,
+ metric=item.metric,
+ direction=item.direction,
+ pairs=item.pairs,
+ candidate_mean=item.candidate_mean,
+ baseline_mean=item.baseline_mean,
+ improvement=item.absolute_improvement,
+ relative=item.relative_improvement,
+ wins=item.win_count,
+ losses=item.loss_count,
+ ties=item.tie_count,
+ win_rate=f"{item.win_rate:.4f}" if item.win_rate is not None else "",
+ )
+ )
+ else:
+ lines.append("| none | | | | 0 | | | | | | | | |")
+ lines.extend(["", "## Aggregate Metrics", ""])
+ for baseline, slice_map in sorted(summary.aggregate_metrics.items()):
+ lines.append(f"### {baseline}")
+ lines.append("")
+ lines.append("| slice | sample_count | metric | mean |")
+ lines.append("| --- | ---: | --- | ---: |")
+ for slice_name, metrics in sorted(slice_map.items()):
+ sample_count = metrics.get("sample_count", "")
+ for metric_name, value in sorted(metrics.items()):
+ if metric_name == "sample_count":
+ continue
+ lines.append(f"| {slice_name} | {sample_count} | {metric_name} | {float(value):.6f} |")
+ lines.append("")
+ (output_dir / "summary.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/calibration.py b/src/ocrtech/calibration.py
new file mode 100644
index 0000000000000000000000000000000000000000..8325bd3741f489dde3830c11650199d4a49a0c98
--- /dev/null
+++ b/src/ocrtech/calibration.py
@@ -0,0 +1,794 @@
+"""Calibration helpers for routed OCR candidates."""
+
+from __future__ import annotations
+
+import json
+import math
+import re
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import BenchmarkError
+from .experiments import ExperimentReport
+from .manifest import sha256_file
+from .models import write_model_card
+from .validation import metric_direction, sample_key
+
+
+@dataclass(slots=True)
+class ThresholdTrial:
+ threshold: float
+ pairs: int
+ candidate_picks: int
+ chosen_mean: float
+ primary_mean: float
+ absolute_improvement: float
+ relative_improvement: float
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "threshold": self.threshold,
+ "pairs": self.pairs,
+ "candidate_picks": self.candidate_picks,
+ "chosen_mean": self.chosen_mean,
+ "primary_mean": self.primary_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ }
+
+
+@dataclass(slots=True)
+class CalibrationReport:
+ experiment_report: str
+ benchmark_report: str
+ eval_manifest: str
+ candidate_baseline: str
+ primary_baseline: str
+ metric: str
+ direction: str
+ selected_threshold: float
+ selected_trial: ThresholdTrial
+ trials: list[ThresholdTrial] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "experiment_report": self.experiment_report,
+ "benchmark_report": self.benchmark_report,
+ "eval_manifest": self.eval_manifest,
+ "candidate_baseline": self.candidate_baseline,
+ "primary_baseline": self.primary_baseline,
+ "metric": self.metric,
+ "direction": self.direction,
+ "selected_threshold": self.selected_threshold,
+ "selected_trial": self.selected_trial.to_dict(),
+ "trials": [trial.to_dict() for trial in self.trials],
+ }
+
+
+@dataclass(slots=True)
+class ScriptThresholdTrial:
+ threshold: float
+ pairs: int
+ secondary_picks: int
+ chosen_mean: float
+ primary_mean: float
+ absolute_improvement: float
+ relative_improvement: float
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "threshold": self.threshold,
+ "pairs": self.pairs,
+ "secondary_picks": self.secondary_picks,
+ "chosen_mean": self.chosen_mean,
+ "primary_mean": self.primary_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ }
+
+
+@dataclass(slots=True)
+class ScriptCalibrationReport:
+ experiment_report: str
+ benchmark_report: str
+ eval_manifest: str
+ primary_baseline: str
+ secondary_baseline: str
+ metric: str
+ direction: str
+ script: str
+ selected_threshold: float
+ selected_trial: ScriptThresholdTrial
+ trials: list[ScriptThresholdTrial] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "experiment_report": self.experiment_report,
+ "benchmark_report": self.benchmark_report,
+ "eval_manifest": self.eval_manifest,
+ "primary_baseline": self.primary_baseline,
+ "secondary_baseline": self.secondary_baseline,
+ "metric": self.metric,
+ "direction": self.direction,
+ "script": self.script,
+ "selected_threshold": self.selected_threshold,
+ "selected_trial": self.selected_trial.to_dict(),
+ "trials": [trial.to_dict() for trial in self.trials],
+ }
+
+
+def calibrate_quality_router(
+ experiment_report: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ primary_engine: str,
+ secondary_engine: str,
+ primary_engine_kwargs: dict[str, Any] | None = None,
+ secondary_engine_kwargs: dict[str, Any] | None = None,
+ candidate_baseline: str = "candidate",
+ primary_baseline: str = "tesseract",
+ metric: str = "cer",
+ direction: str | None = None,
+ threshold_start: float = -0.20,
+ threshold_end: float = 0.20,
+ threshold_step: float = 0.01,
+ base_model: str = "tesseract-ocr",
+ notes: str | None = None,
+) -> tuple[CalibrationReport, Path]:
+ experiment = _load_experiment_report(experiment_report)
+ report_rows = _load_benchmark_rows(experiment.benchmark_report)
+ resolved_direction = direction or metric_direction(metric)
+ trials = _trial_thresholds(
+ report_rows,
+ candidate_baseline=candidate_baseline,
+ primary_baseline=primary_baseline,
+ metric=metric,
+ direction=resolved_direction,
+ threshold_start=threshold_start,
+ threshold_end=threshold_end,
+ threshold_step=threshold_step,
+ )
+ if not trials:
+ raise BenchmarkError("quality router calibration produced no valid threshold trials")
+ selected = _select_best_trial(trials, resolved_direction)
+ calibration = CalibrationReport(
+ experiment_report=str(Path(experiment_report)),
+ benchmark_report=experiment.benchmark_report,
+ eval_manifest=experiment.eval_manifest,
+ candidate_baseline=candidate_baseline,
+ primary_baseline=primary_baseline,
+ metric=metric,
+ direction=resolved_direction,
+ selected_threshold=selected.threshold,
+ selected_trial=selected,
+ trials=trials,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "calibration.json").write_text(json.dumps(calibration.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (out / "calibration.md").write_text(_render_calibration_markdown(calibration), encoding="utf-8")
+ model_path = write_model_card(
+ out / "model-card.json",
+ model_id=model_id,
+ backend="quality_select_composite",
+ base_model=base_model,
+ backend_kwargs={
+ "primary_engine": primary_engine,
+ "secondary_engine": secondary_engine,
+ "primary_engine_kwargs": primary_engine_kwargs or {},
+ "secondary_engine_kwargs": secondary_engine_kwargs or {},
+ "secondary_quality_margin": selected.threshold,
+ },
+ provenance={
+ "calibration": {
+ "experiment_report": {"path": str(Path(experiment_report)), "sha256": _maybe_sha256(Path(experiment_report))},
+ "benchmark_report": {"path": experiment.benchmark_report, "sha256": _maybe_sha256(Path(experiment.benchmark_report))},
+ "eval_manifest": {"path": experiment.eval_manifest, "sha256": _maybe_sha256(Path(experiment.eval_manifest))},
+ "candidate_baseline": candidate_baseline,
+ "primary_baseline": primary_baseline,
+ "metric": metric,
+ "direction": resolved_direction,
+ "selected_threshold": selected.threshold,
+ "threshold_start": threshold_start,
+ "threshold_end": threshold_end,
+ "threshold_step": threshold_step,
+ }
+ },
+ metrics_report=out / "calibration.json",
+ notes=notes,
+ )
+ return calibration, model_path
+
+
+def calibrate_script_router(
+ experiment_report: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ primary_engine: str,
+ secondary_engine: str,
+ primary_engine_kwargs: dict[str, Any] | None = None,
+ secondary_engine_kwargs: dict[str, Any] | None = None,
+ primary_baseline: str = "tesseract",
+ secondary_baseline: str = "surya",
+ metric: str = "cer",
+ direction: str | None = None,
+ script: str = "devanagari",
+ threshold_start: float = 0.0,
+ threshold_end: float = 0.6,
+ threshold_step: float = 0.05,
+ routing_granularity: str = "document",
+ secondary_structure_backfill: bool = False,
+ base_model: str = "tesseract+surya",
+ notes: str | None = None,
+) -> tuple[ScriptCalibrationReport, Path]:
+ experiment = _load_experiment_report(experiment_report)
+ report_rows = _load_benchmark_rows(experiment.benchmark_report)
+ resolved_direction = direction or metric_direction(metric)
+ trials = _trial_script_thresholds(
+ experiment,
+ report_rows,
+ primary_baseline=primary_baseline,
+ secondary_baseline=secondary_baseline,
+ metric=metric,
+ direction=resolved_direction,
+ script=script,
+ threshold_start=threshold_start,
+ threshold_end=threshold_end,
+ threshold_step=threshold_step,
+ )
+ if not trials:
+ raise BenchmarkError("script router calibration produced no valid threshold trials")
+ selected = _select_best_script_trial(trials, resolved_direction)
+ calibration = ScriptCalibrationReport(
+ experiment_report=str(Path(experiment_report)),
+ benchmark_report=experiment.benchmark_report,
+ eval_manifest=experiment.eval_manifest,
+ primary_baseline=primary_baseline,
+ secondary_baseline=secondary_baseline,
+ metric=metric,
+ direction=resolved_direction,
+ script=script,
+ selected_threshold=selected.threshold,
+ selected_trial=selected,
+ trials=trials,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "calibration.json").write_text(json.dumps(calibration.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (out / "calibration.md").write_text(_render_script_calibration_markdown(calibration), encoding="utf-8")
+ model_path = write_model_card(
+ out / "model-card.json",
+ model_id=model_id,
+ backend="script_select_composite",
+ base_model=base_model,
+ backend_kwargs={
+ "primary_engine": primary_engine,
+ "secondary_engine": secondary_engine,
+ "primary_engine_kwargs": primary_engine_kwargs or {},
+ "secondary_engine_kwargs": secondary_engine_kwargs or {},
+ "script": script,
+ "primary_script_threshold": selected.threshold,
+ "routing_granularity": routing_granularity,
+ "secondary_structure_backfill": secondary_structure_backfill,
+ },
+ provenance={
+ "calibration": {
+ "experiment_report": {"path": str(Path(experiment_report)), "sha256": _maybe_sha256(Path(experiment_report))},
+ "benchmark_report": {"path": experiment.benchmark_report, "sha256": _maybe_sha256(Path(experiment.benchmark_report))},
+ "eval_manifest": {"path": experiment.eval_manifest, "sha256": _maybe_sha256(Path(experiment.eval_manifest))},
+ "primary_baseline": primary_baseline,
+ "secondary_baseline": secondary_baseline,
+ "metric": metric,
+ "direction": resolved_direction,
+ "script": script,
+ "selected_threshold": selected.threshold,
+ "threshold_start": threshold_start,
+ "threshold_end": threshold_end,
+ "threshold_step": threshold_step,
+ "routing_granularity": routing_granularity,
+ "secondary_structure_backfill": secondary_structure_backfill,
+ }
+ },
+ metrics_report=out / "calibration.json",
+ notes=notes,
+ )
+ return calibration, model_path
+
+
+def _load_experiment_report(path: str | Path) -> ExperimentReport:
+ raw = json.loads(Path(path).read_text(encoding="utf-8"))
+ if not isinstance(raw, dict):
+ raise BenchmarkError("experiment report must be a JSON object")
+ return ExperimentReport(
+ experiment_id=str(raw.get("experiment_id") or ""),
+ output_dir=str(raw.get("output_dir") or ""),
+ eval_manifest=str(raw.get("eval_manifest") or ""),
+ references_dir=str(raw["references_dir"]) if raw.get("references_dir") is not None else None,
+ baselines=[str(item) for item in raw.get("baselines", [])],
+ input_count=int(raw.get("input_count") or 0),
+ datasets=[str(item) for item in raw.get("datasets", [])],
+ slice_counts={str(key): int(value) for key, value in dict(raw.get("slice_counts") or {}).items()},
+ benchmark_report=str(raw.get("benchmark_report") or ""),
+ benchmark_status_counts={str(key): int(value) for key, value in dict(raw.get("benchmark_status_counts") or {}).items()},
+ validation_report=str(raw["validation_report"]) if raw.get("validation_report") is not None else None,
+ validation_status=str(raw["validation_status"]) if raw.get("validation_status") is not None else None,
+ environment=dict(raw.get("environment") or {}),
+ )
+
+
+def _load_benchmark_rows(path: str | Path) -> list[dict[str, Any]]:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ if not isinstance(payload, list):
+ raise BenchmarkError("benchmark report must be a JSON list")
+ rows: list[dict[str, Any]] = []
+ for index, item in enumerate(payload):
+ if not isinstance(item, dict):
+ raise BenchmarkError(f"benchmark row {index} must be an object")
+ rows.append(dict(item))
+ return rows
+
+
+_DEVANAGARI_RE = re.compile(r"[\u0900-\u097F]")
+_LATIN_RE = re.compile(r"[A-Za-z]")
+
+
+def _script_ratio(text: str, script: str) -> float:
+ non_space = [char for char in text if not char.isspace()]
+ if not non_space:
+ return 0.0
+ normalized = script.strip().lower()
+ if normalized == "devanagari":
+ matches = sum(1 for char in non_space if _DEVANAGARI_RE.match(char))
+ return matches / len(non_space)
+ if normalized in {"latin", "english"}:
+ matches = sum(1 for char in non_space if _LATIN_RE.match(char))
+ return matches / len(non_space)
+ raise BenchmarkError(f"unsupported script calibration target: {script!r}")
+
+
+def _trial_script_thresholds(
+ experiment: ExperimentReport,
+ rows: list[dict[str, Any]],
+ *,
+ primary_baseline: str,
+ secondary_baseline: str,
+ metric: str,
+ direction: str,
+ script: str,
+ threshold_start: float,
+ threshold_end: float,
+ threshold_step: float,
+) -> list[ScriptThresholdTrial]:
+ if threshold_step <= 0:
+ raise BenchmarkError("threshold_step must be positive")
+ primary_rows = {sample_key(row): row for row in rows if row.get("baseline") == primary_baseline and row.get("status") == "ok"}
+ secondary_rows = {sample_key(row): row for row in rows if row.get("baseline") == secondary_baseline and row.get("status") == "ok"}
+ shared = sorted(set(primary_rows) & set(secondary_rows))
+ if not shared:
+ raise BenchmarkError(f"no paired rows for primary={primary_baseline} vs secondary={secondary_baseline} on metric={metric}")
+ output_root = Path(experiment.output_dir) / "benchmark" / primary_baseline
+ thresholds = _threshold_grid(threshold_start, threshold_end, threshold_step)
+ ratios: dict[str, float] = {}
+ for sample_id in shared:
+ input_path = Path(primary_rows[sample_id]["input_path"])
+ document_path = output_root / input_path.stem / "document.md"
+ if not document_path.exists():
+ raise BenchmarkError(f"primary benchmark output is missing document.md for {sample_id}: {document_path}")
+ ratios[sample_id] = _script_ratio(document_path.read_text(encoding="utf-8"), script)
+ trials: list[ScriptThresholdTrial] = []
+ for threshold in thresholds:
+ chosen_metrics: list[float] = []
+ primary_metrics: list[float] = []
+ secondary_picks = 0
+ for sample_id in shared:
+ primary_row = primary_rows[sample_id]
+ secondary_row = secondary_rows[sample_id]
+ metric_primary = (primary_row.get("metrics") or {}).get(metric)
+ metric_secondary = (secondary_row.get("metrics") or {}).get(metric)
+ if not _finite_number(metric_primary) or not _finite_number(metric_secondary):
+ continue
+ if ratios[sample_id] > threshold:
+ chosen_metrics.append(float(metric_secondary))
+ secondary_picks += 1
+ else:
+ chosen_metrics.append(float(metric_primary))
+ primary_metrics.append(float(metric_primary))
+ if not chosen_metrics:
+ continue
+ chosen_mean = sum(chosen_metrics) / len(chosen_metrics)
+ primary_mean = sum(primary_metrics) / len(primary_metrics)
+ absolute_improvement = _absolute_improvement(chosen_mean, primary_mean, direction)
+ relative_improvement = _relative_improvement(absolute_improvement, primary_mean)
+ trials.append(
+ ScriptThresholdTrial(
+ threshold=threshold,
+ pairs=len(chosen_metrics),
+ secondary_picks=secondary_picks,
+ chosen_mean=chosen_mean,
+ primary_mean=primary_mean,
+ absolute_improvement=absolute_improvement,
+ relative_improvement=relative_improvement,
+ )
+ )
+ return trials
+
+
+def _trial_thresholds(
+ rows: list[dict[str, Any]],
+ *,
+ candidate_baseline: str,
+ primary_baseline: str,
+ metric: str,
+ direction: str,
+ threshold_start: float,
+ threshold_end: float,
+ threshold_step: float,
+) -> list[ThresholdTrial]:
+ if threshold_step <= 0:
+ raise BenchmarkError("threshold_step must be positive")
+ paired: dict[str, tuple[dict[str, Any], dict[str, Any]]] = {}
+ candidate_rows = {sample_key(row): row for row in rows if row.get("baseline") == candidate_baseline and row.get("status") == "ok"}
+ primary_rows = {sample_key(row): row for row in rows if row.get("baseline") == primary_baseline and row.get("status") == "ok"}
+ for key in sorted(set(candidate_rows) & set(primary_rows)):
+ candidate_row = candidate_rows[key]
+ primary_row = primary_rows[key]
+ if metric not in (candidate_row.get("metrics") or {}) or metric not in (primary_row.get("metrics") or {}):
+ continue
+ candidate_quality = (candidate_row.get("metrics") or {}).get("quality_score")
+ primary_quality = (primary_row.get("metrics") or {}).get("quality_score")
+ if not _finite_number(candidate_quality) or not _finite_number(primary_quality):
+ continue
+ metric_candidate = (candidate_row.get("metrics") or {}).get(metric)
+ metric_primary = (primary_row.get("metrics") or {}).get(metric)
+ if not _finite_number(metric_candidate) or not _finite_number(metric_primary):
+ continue
+ paired[key] = (candidate_row, primary_row)
+ if not paired:
+ raise BenchmarkError(f"no paired rows for candidate={candidate_baseline} vs primary={primary_baseline} on metric={metric}")
+
+ thresholds = _threshold_grid(threshold_start, threshold_end, threshold_step)
+ trials: list[ThresholdTrial] = []
+ for threshold in thresholds:
+ chosen_metrics: list[float] = []
+ primary_metrics: list[float] = []
+ candidate_picks = 0
+ for candidate_row, primary_row in paired.values():
+ candidate_quality = float(candidate_row["metrics"]["quality_score"])
+ primary_quality = float(primary_row["metrics"]["quality_score"])
+ metric_candidate = float(candidate_row["metrics"][metric])
+ metric_primary = float(primary_row["metrics"][metric])
+ if candidate_quality - primary_quality > threshold:
+ chosen_metrics.append(metric_candidate)
+ candidate_picks += 1
+ else:
+ chosen_metrics.append(metric_primary)
+ primary_metrics.append(metric_primary)
+ chosen_mean = sum(chosen_metrics) / len(chosen_metrics)
+ primary_mean = sum(primary_metrics) / len(primary_metrics)
+ absolute_improvement = _absolute_improvement(chosen_mean, primary_mean, direction)
+ relative_improvement = _relative_improvement(absolute_improvement, primary_mean)
+ trials.append(
+ ThresholdTrial(
+ threshold=threshold,
+ pairs=len(chosen_metrics),
+ candidate_picks=candidate_picks,
+ chosen_mean=chosen_mean,
+ primary_mean=primary_mean,
+ absolute_improvement=absolute_improvement,
+ relative_improvement=relative_improvement,
+ )
+ )
+ return trials
+
+
+def _threshold_grid(start: float, end: float, step: float) -> list[float]:
+ values: list[float] = []
+ current = start
+ limit = end + (step / 2)
+ while current <= limit:
+ values.append(round(current, 10))
+ current += step
+ return values
+
+
+def _select_best_trial(trials: list[ThresholdTrial], direction: str) -> ThresholdTrial:
+ if direction == "lower":
+ return min(trials, key=lambda item: (item.chosen_mean, item.candidate_picks, -item.threshold))
+ return max(trials, key=lambda item: (item.chosen_mean, -item.candidate_picks, item.threshold))
+
+
+def _select_best_script_trial(trials: list[ScriptThresholdTrial], direction: str) -> ScriptThresholdTrial:
+ if direction == "lower":
+ return min(trials, key=lambda item: (item.chosen_mean, item.secondary_picks, item.threshold))
+ return max(trials, key=lambda item: (item.chosen_mean, -item.secondary_picks, -item.threshold))
+
+
+def _absolute_improvement(candidate_value: float, baseline_value: float, direction: str) -> float:
+ if direction == "lower":
+ return baseline_value - candidate_value
+ return candidate_value - baseline_value
+
+
+def _relative_improvement(absolute_improvement: float, baseline_mean: float) -> float:
+ denominator = abs(baseline_mean)
+ if denominator == 0:
+ return math.inf if absolute_improvement > 0 else 0.0
+ return absolute_improvement / denominator
+
+
+def _finite_number(value: object) -> bool:
+ return isinstance(value, int | float) and math.isfinite(float(value))
+
+
+def _maybe_sha256(path: Path) -> str | None:
+ return sha256_file(path) if path.exists() and path.is_file() else None
+
+
+def _render_calibration_markdown(report: CalibrationReport) -> str:
+ lines = [
+ "# Quality Router Calibration",
+ "",
+ f"Experiment report: `{report.experiment_report}`",
+ f"Benchmark report: `{report.benchmark_report}`",
+ f"Eval manifest: `{report.eval_manifest}`",
+ f"Candidate baseline: `{report.candidate_baseline}`",
+ f"Primary baseline: `{report.primary_baseline}`",
+ f"Metric: `{report.metric}`",
+ f"Direction: `{report.direction}`",
+ f"Selected threshold: `{report.selected_threshold:.6f}`",
+ "",
+ "| threshold | pairs | candidate_picks | chosen_mean | primary_mean | improvement | relative |",
+ "| ---: | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ for trial in report.trials:
+ lines.append(
+ f"| {trial.threshold:.6f} | {trial.pairs} | {trial.candidate_picks} | {trial.chosen_mean:.6f} | {trial.primary_mean:.6f} | {trial.absolute_improvement:.6f} | {trial.relative_improvement:.6f} |"
+ )
+ return "\n".join(lines) + "\n"
+
+
+def _render_script_calibration_markdown(report: ScriptCalibrationReport) -> str:
+ lines = [
+ "# Script Router Calibration",
+ "",
+ f"Experiment report: `{report.experiment_report}`",
+ f"Benchmark report: `{report.benchmark_report}`",
+ f"Eval manifest: `{report.eval_manifest}`",
+ f"Primary baseline: `{report.primary_baseline}`",
+ f"Secondary baseline: `{report.secondary_baseline}`",
+ f"Metric: `{report.metric}`",
+ f"Direction: `{report.direction}`",
+ f"Script: `{report.script}`",
+ f"Selected threshold: `{report.selected_threshold:.6f}`",
+ "",
+ "| threshold | pairs | secondary_picks | chosen_mean | primary_mean | improvement | relative |",
+ "| ---: | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ for trial in report.trials:
+ lines.append(
+ f"| {trial.threshold:.6f} | {trial.pairs} | {trial.secondary_picks} | {trial.chosen_mean:.6f} | {trial.primary_mean:.6f} | {trial.absolute_improvement:.6f} | {trial.relative_improvement:.6f} |"
+ )
+ return "\n".join(lines) + "\n"
+
+
+@dataclass(slots=True)
+class EnsembleTrial:
+ biases: dict[str, float]
+ pairs: int
+ alternative_picks: int
+ chosen_mean: float
+ primary_mean: float
+ absolute_improvement: float
+ relative_improvement: float
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "biases": self.biases,
+ "pairs": self.pairs,
+ "alternative_picks": self.alternative_picks,
+ "chosen_mean": self.chosen_mean,
+ "primary_mean": self.primary_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ }
+
+
+@dataclass(slots=True)
+class EnsembleCalibrationReport:
+ primary_experiment_report: str
+ variant_experiments: dict[str, str]
+ benchmark_reports: dict[str, str]
+ eval_manifest: str
+ primary_label: str
+ metric: str
+ direction: str
+ selected_biases: dict[str, float]
+ selected_trial: EnsembleTrial
+ trials: list[EnsembleTrial] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "primary_experiment_report": self.primary_experiment_report,
+ "variant_experiments": self.variant_experiments,
+ "benchmark_reports": self.benchmark_reports,
+ "eval_manifest": self.eval_manifest,
+ "primary_label": self.primary_label,
+ "metric": self.metric,
+ "direction": self.direction,
+ "selected_biases": self.selected_biases,
+ "selected_trial": self.selected_trial.to_dict(),
+ "trials": [trial.to_dict() for trial in self.trials],
+ }
+
+
+def calibrate_tesseract_psm_ensemble(
+ primary_experiment_report: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ variant_experiment_reports: dict[str, str | Path],
+ metric: str = "cer",
+ direction: str | None = None,
+ bias_start: float = -0.12,
+ bias_end: float = 0.12,
+ bias_step: float = 0.02,
+ language: str = "nep+eng",
+ selection_margin: float = 0.0,
+ notes: str | None = None,
+) -> tuple[EnsembleCalibrationReport, Path]:
+ if not variant_experiment_reports:
+ raise BenchmarkError("tesseract ensemble calibration requires at least one variant experiment report")
+ primary_experiment = _load_experiment_report(primary_experiment_report)
+ resolved_direction = direction or metric_direction(metric)
+ primary_rows = _load_variant_rows(primary_experiment.benchmark_report, baseline="tesseract")
+ variant_rows: dict[str, dict[str, dict[str, Any]]] = {}
+ variant_reports: dict[str, str] = {}
+ for label, path in sorted(variant_experiment_reports.items()):
+ experiment = _load_experiment_report(path)
+ if experiment.eval_manifest != primary_experiment.eval_manifest:
+ raise BenchmarkError(f"variant experiment {path} does not use the same eval manifest as the primary experiment")
+ variant_rows[label] = _load_variant_rows(experiment.benchmark_report, baseline="candidate")
+ variant_reports[label] = experiment.benchmark_report
+ shared = set(primary_rows)
+ for values in variant_rows.values():
+ shared &= set(values)
+ if not shared:
+ raise BenchmarkError("no shared samples across primary and variant experiment reports")
+ shared_ids = sorted(shared)
+ bias_values = _threshold_grid(bias_start, bias_end, bias_step)
+ trials: list[EnsembleTrial] = []
+ labels = sorted(variant_rows)
+ import itertools
+
+ for combo in itertools.product(bias_values, repeat=len(labels)):
+ biases = dict(zip(labels, combo, strict=True))
+ chosen_metrics: list[float] = []
+ primary_metrics: list[float] = []
+ alternative_picks = 0
+ for sample_id in shared_ids:
+ primary = primary_rows[sample_id]
+ scored = [(primary["metrics"].get("quality_score", -1.0), primary, None)]
+ for label in labels:
+ row = variant_rows[label][sample_id]
+ scored.append((float(row["metrics"].get("quality_score", -1.0)) + biases[label], row, label))
+ selected_quality, selected_row, selected_label = max(scored, key=lambda item: item[0])
+ if selected_label is not None and selected_quality <= float(primary["metrics"].get("quality_score", -1.0)) + selection_margin:
+ selected_row = primary
+ selected_label = None
+ chosen_metrics.append(float(selected_row["metrics"][metric]))
+ primary_metrics.append(float(primary["metrics"][metric]))
+ if selected_label is not None:
+ alternative_picks += 1
+ chosen_mean = sum(chosen_metrics) / len(chosen_metrics)
+ primary_mean = sum(primary_metrics) / len(primary_metrics)
+ absolute_improvement = _absolute_improvement(chosen_mean, primary_mean, resolved_direction)
+ relative_improvement = _relative_improvement(absolute_improvement, primary_mean)
+ trials.append(
+ EnsembleTrial(
+ biases=biases,
+ pairs=len(shared_ids),
+ alternative_picks=alternative_picks,
+ chosen_mean=chosen_mean,
+ primary_mean=primary_mean,
+ absolute_improvement=absolute_improvement,
+ relative_improvement=relative_improvement,
+ )
+ )
+ if not trials:
+ raise BenchmarkError("tesseract ensemble calibration produced no trials")
+ selected = _select_best_ensemble_trial(trials, resolved_direction)
+ report = EnsembleCalibrationReport(
+ primary_experiment_report=str(Path(primary_experiment_report)),
+ variant_experiments={label: str(path) for label, path in variant_experiment_reports.items()},
+ benchmark_reports={"primary": primary_experiment.benchmark_report, **variant_reports},
+ eval_manifest=primary_experiment.eval_manifest,
+ primary_label="psm6",
+ metric=metric,
+ direction=resolved_direction,
+ selected_biases=selected.biases,
+ selected_trial=selected,
+ trials=trials,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "calibration.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (out / "calibration.md").write_text(_render_ensemble_calibration_markdown(report), encoding="utf-8")
+ alternatives = [
+ {"label": label, "engine": "tesseract", "engine_kwargs": {"language": language, "psm": int(label.removeprefix("psm"))}, "quality_bias": bias}
+ for label, bias in sorted(selected.biases.items())
+ ]
+ model_path = write_model_card(
+ out / "model-card.json",
+ model_id=model_id,
+ backend="quality_ranked_ensemble",
+ base_model="tesseract-ocr",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "primary_engine_kwargs": {"language": language, "psm": 6},
+ "alternative_engines": alternatives,
+ "selection_margin": selection_margin,
+ },
+ provenance={
+ "calibration": {
+ "eval_manifest": {"path": primary_experiment.eval_manifest, "sha256": _maybe_sha256(Path(primary_experiment.eval_manifest))},
+ "primary_experiment_report": {"path": str(Path(primary_experiment_report)), "sha256": _maybe_sha256(Path(primary_experiment_report))},
+ "variant_experiments": {
+ label: {"path": str(path), "sha256": _maybe_sha256(Path(path))}
+ for label, path in variant_experiment_reports.items()
+ },
+ "metric": metric,
+ "direction": resolved_direction,
+ "selected_biases": selected.biases,
+ "selection_margin": selection_margin,
+ "bias_start": bias_start,
+ "bias_end": bias_end,
+ "bias_step": bias_step,
+ }
+ },
+ metrics_report=out / "calibration.json",
+ notes=notes,
+ )
+ return report, model_path
+
+
+def _load_variant_rows(path: str | Path, *, baseline: str) -> dict[str, dict[str, Any]]:
+ rows = _load_benchmark_rows(path)
+ selected: dict[str, dict[str, Any]] = {}
+ for row in rows:
+ if row.get("baseline") != baseline or row.get("status") != "ok":
+ continue
+ selected[sample_key(row)] = row
+ if not selected:
+ raise BenchmarkError(f"no benchmark rows found for baseline={baseline} in {path}")
+ return selected
+
+
+def _select_best_ensemble_trial(trials: list[EnsembleTrial], direction: str) -> EnsembleTrial:
+ if direction == "lower":
+ return min(trials, key=lambda item: (item.chosen_mean, item.alternative_picks, sorted(item.biases.items())))
+ return max(trials, key=lambda item: (item.chosen_mean, -item.alternative_picks, sorted(item.biases.items())))
+
+
+def _render_ensemble_calibration_markdown(report: EnsembleCalibrationReport) -> str:
+ labels = sorted(report.selected_biases)
+ lines = [
+ "# Quality Ranked Ensemble Calibration",
+ "",
+ f"Primary experiment report: `{report.primary_experiment_report}`",
+ f"Eval manifest: `{report.eval_manifest}`",
+ f"Metric: `{report.metric}`",
+ f"Direction: `{report.direction}`",
+ f"Selected biases: `{report.selected_biases}`",
+ "",
+ "| biases | pairs | alternative_picks | chosen_mean | primary_mean | improvement | relative |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ for trial in report.trials:
+ bias_text = ", ".join(f"{label}={trial.biases[label]:.2f}" for label in labels)
+ lines.append(
+ f"| {bias_text} | {trial.pairs} | {trial.alternative_picks} | {trial.chosen_mean:.6f} | {trial.primary_mean:.6f} | {trial.absolute_improvement:.6f} | {trial.relative_improvement:.6f} |"
+ )
+ return "\n".join(lines) + "\n"
diff --git a/src/ocrtech/claim_review.py b/src/ocrtech/claim_review.py
new file mode 100644
index 0000000000000000000000000000000000000000..88f5d6a85494cfbb5efd8d9da79aee79302bdbb6
--- /dev/null
+++ b/src/ocrtech/claim_review.py
@@ -0,0 +1,1530 @@
+"""Portfolio-level claim review across multiple benchmark experiments."""
+
+from __future__ import annotations
+
+import json
+import math
+from dataclasses import dataclass, field
+from fnmatch import fnmatch
+from pathlib import Path
+from typing import Any
+
+from .errors import ClaimReviewError
+from .manifest import ManifestEntry, load_manifest, sha256_file
+from .models import ModelCard, audit_model_card, component_baseline_names, inspect_routed_calibration_collapse, model_admission_status, trained_recognizer_provenance_status
+from .validation import gate_has_quantitative_evidence, sample_key
+
+
+@dataclass(slots=True)
+class RequiredValidationGate:
+ baseline: str
+ metric: str
+ slices: list[str] = field(default_factory=list)
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any]) -> "RequiredValidationGate":
+ baseline = str(data.get("baseline") or "")
+ metric = str(data.get("metric") or "")
+ if not baseline:
+ raise ClaimReviewError("required_validation_gates baseline is required")
+ if not metric:
+ raise ClaimReviewError("required_validation_gates metric is required")
+ return cls(baseline=baseline, metric=metric, slices=_string_list(data.get("slices")))
+
+ def to_dict(self) -> dict[str, Any]:
+ return {"baseline": self.baseline, "metric": self.metric, "slices": self.slices}
+
+
+@dataclass(slots=True)
+class RequiredExperiment:
+ name: str
+ datasets: list[str] = field(default_factory=list)
+ eval_manifest_patterns: list[str] = field(default_factory=list)
+ require_validation_status: str | None = None
+ required_validation_config: str | None = None
+ require_baselines: list[str] = field(default_factory=list)
+ required_metrics: list[str] = field(default_factory=list)
+ required_metric_slices: dict[str, list[str]] = field(default_factory=dict)
+ required_output_artifacts: list[str] = field(default_factory=list)
+ required_output_artifact_slices: dict[str, list[str]] = field(default_factory=dict)
+ required_validation_gates: list[RequiredValidationGate] = field(default_factory=list)
+ require_no_errors: bool = True
+ required_slices: list[str] = field(default_factory=list)
+ require_candidate_fallback_metrics: bool = False
+ max_candidate_fallback_trigger_rate: float | None = None
+ max_candidate_fallback_failed_rate: float | None = None
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any]) -> "RequiredExperiment":
+ name = str(data.get("name") or "")
+ if not name:
+ raise ClaimReviewError("required_experiment.name is required")
+ datasets = _string_list(data.get("datasets"))
+ eval_manifest_patterns = _string_list(data.get("eval_manifest_patterns"))
+ if not datasets and not eval_manifest_patterns:
+ raise ClaimReviewError(f"required experiment {name!r} must define datasets or eval_manifest_patterns")
+ require_validation_status = data.get("require_validation_status")
+ if require_validation_status is not None:
+ require_validation_status = str(require_validation_status)
+ required_validation_config = data.get("required_validation_config")
+ if required_validation_config is not None:
+ required_validation_config = str(required_validation_config)
+ require_baselines = _string_list(data.get("require_baselines"))
+ required_metrics = _string_list(data.get("required_metrics"))
+ required_metric_slices = _metric_slice_requirements(data.get("required_metric_slices"))
+ required_output_artifacts = _string_list(data.get("required_output_artifacts"))
+ required_output_artifact_slices = _metric_slice_requirements(data.get("required_output_artifact_slices"))
+ required_validation_gates = _required_validation_gates(data.get("required_validation_gates"))
+ _validate_required_validation_gates(
+ name,
+ require_validation_status,
+ require_baselines,
+ required_metrics,
+ required_validation_gates,
+ )
+ required_slices = _string_list(data.get("required_slices"))
+ require_candidate_fallback_metrics = bool(data.get("require_candidate_fallback_metrics", False))
+ max_candidate_fallback_trigger_rate = _optional_rate(data.get("max_candidate_fallback_trigger_rate"), "max_candidate_fallback_trigger_rate")
+ max_candidate_fallback_failed_rate = _optional_rate(data.get("max_candidate_fallback_failed_rate"), "max_candidate_fallback_failed_rate")
+ return cls(
+ name=name,
+ datasets=datasets,
+ eval_manifest_patterns=eval_manifest_patterns,
+ require_validation_status=require_validation_status,
+ required_validation_config=required_validation_config,
+ require_baselines=require_baselines,
+ required_metrics=required_metrics,
+ required_metric_slices=required_metric_slices,
+ required_output_artifacts=required_output_artifacts,
+ required_output_artifact_slices=required_output_artifact_slices,
+ required_validation_gates=required_validation_gates,
+ require_no_errors=bool(data.get("require_no_errors", True)),
+ required_slices=required_slices,
+ require_candidate_fallback_metrics=require_candidate_fallback_metrics,
+ max_candidate_fallback_trigger_rate=max_candidate_fallback_trigger_rate,
+ max_candidate_fallback_failed_rate=max_candidate_fallback_failed_rate,
+ )
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "name": self.name,
+ "datasets": self.datasets,
+ "eval_manifest_patterns": self.eval_manifest_patterns,
+ "require_validation_status": self.require_validation_status,
+ "required_validation_config": self.required_validation_config,
+ "require_baselines": self.require_baselines,
+ "required_metrics": self.required_metrics,
+ "required_metric_slices": self.required_metric_slices,
+ "required_output_artifacts": self.required_output_artifacts,
+ "required_output_artifact_slices": self.required_output_artifact_slices,
+ "required_validation_gates": [gate.to_dict() for gate in self.required_validation_gates],
+ "require_no_errors": self.require_no_errors,
+ "required_slices": self.required_slices,
+ "require_candidate_fallback_metrics": self.require_candidate_fallback_metrics,
+ "max_candidate_fallback_trigger_rate": self.max_candidate_fallback_trigger_rate,
+ "max_candidate_fallback_failed_rate": self.max_candidate_fallback_failed_rate,
+ }
+
+
+@dataclass(slots=True)
+class ClaimReviewConfig:
+ required_experiments: list[RequiredExperiment]
+ require_shared_candidate_model: bool = True
+ require_fallback_model_present: bool = False
+ require_candidate_fallback_provenance: bool = False
+ require_shared_fallback_model: bool = True
+ require_model_audit_passed: bool = True
+ require_fallback_model_audit_passed: bool = True
+ require_trained_recognizer: bool = False
+ require_model_admission: bool = False
+
+ @classmethod
+ def from_path(cls, path: str | Path | None) -> "ClaimReviewConfig":
+ if path is None:
+ return default_claim_review_config()
+ try:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise ClaimReviewError(f"invalid claim review config JSON {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise ClaimReviewError("claim review config must be a JSON object")
+ required = payload.get("required_experiments", [])
+ if not isinstance(required, list):
+ raise ClaimReviewError("required_experiments must be a list")
+ experiments = [RequiredExperiment.from_dict(item) for item in required]
+ if not experiments:
+ raise ClaimReviewError("claim review config must define at least one required experiment")
+ return cls(
+ required_experiments=experiments,
+ require_shared_candidate_model=bool(payload.get("require_shared_candidate_model", True)),
+ require_fallback_model_present=bool(payload.get("require_fallback_model_present", False)),
+ require_candidate_fallback_provenance=bool(payload.get("require_candidate_fallback_provenance", False)),
+ require_shared_fallback_model=bool(payload.get("require_shared_fallback_model", True)),
+ require_model_audit_passed=bool(payload.get("require_model_audit_passed", True)),
+ require_fallback_model_audit_passed=bool(payload.get("require_fallback_model_audit_passed", True)),
+ require_trained_recognizer=bool(payload.get("require_trained_recognizer", False)),
+ require_model_admission=bool(payload.get("require_model_admission", False)),
+ )
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "required_experiments": [item.to_dict() for item in self.required_experiments],
+ "require_shared_candidate_model": self.require_shared_candidate_model,
+ "require_fallback_model_present": self.require_fallback_model_present,
+ "require_candidate_fallback_provenance": self.require_candidate_fallback_provenance,
+ "require_shared_fallback_model": self.require_shared_fallback_model,
+ "require_model_audit_passed": self.require_model_audit_passed,
+ "require_fallback_model_audit_passed": self.require_fallback_model_audit_passed,
+ "require_trained_recognizer": self.require_trained_recognizer,
+ "require_model_admission": self.require_model_admission,
+ }
+
+
+@dataclass(slots=True)
+class ClaimReviewCheck:
+ name: str
+ status: str
+ summary: str
+ details: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "name": self.name,
+ "status": self.status,
+ "summary": self.summary,
+ "details": self.details,
+ }
+
+
+@dataclass(slots=True)
+class ExperimentEvidence:
+ experiment_path: str
+ experiment_id: str
+ eval_manifest: str
+ eval_manifest_sha256: str | None
+ recorded_eval_manifest_sha256: str | None
+ eval_entries: list[ManifestEntry]
+ datasets: list[str]
+ slice_counts: dict[str, int]
+ baselines: list[str]
+ benchmark_report: str
+ benchmark_rows: list[dict[str, Any]]
+ benchmark_status_counts: dict[str, int]
+ validation_status: str | None
+ validation_report: str | None
+ validation_config: str | None
+ validation_config_sha256: str | None
+ train_manifests: list[dict[str, str | None]]
+ candidate_model_config: str | None
+ candidate_model_config_sha256: str | None
+ fallback_model_config: str | None
+ fallback_model_config_sha256: str | None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "experiment_path": self.experiment_path,
+ "experiment_id": self.experiment_id,
+ "eval_manifest": self.eval_manifest,
+ "eval_manifest_sha256": self.eval_manifest_sha256,
+ "recorded_eval_manifest_sha256": self.recorded_eval_manifest_sha256,
+ "datasets": self.datasets,
+ "slice_counts": self.slice_counts,
+ "baselines": self.baselines,
+ "benchmark_report": self.benchmark_report,
+ "benchmark_status_counts": self.benchmark_status_counts,
+ "validation_status": self.validation_status,
+ "validation_report": self.validation_report,
+ "validation_config": self.validation_config,
+ "validation_config_sha256": self.validation_config_sha256,
+ "train_manifests": self.train_manifests,
+ "candidate_model_config": self.candidate_model_config,
+ "candidate_model_config_sha256": self.candidate_model_config_sha256,
+ "fallback_model_config": self.fallback_model_config,
+ "fallback_model_config_sha256": self.fallback_model_config_sha256,
+ }
+
+
+@dataclass(slots=True)
+class ClaimReviewReport:
+ passed: bool
+ config: dict[str, Any]
+ model_config: str | None
+ experiments: list[ExperimentEvidence]
+ checks: list[ClaimReviewCheck]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "config": self.config,
+ "model_config": self.model_config,
+ "experiments": [item.to_dict() for item in self.experiments],
+ "checks": [item.to_dict() for item in self.checks],
+ }
+
+
+def review_claim(
+ experiment_reports: list[str | Path],
+ output_dir: str | Path,
+ *,
+ config_path: str | Path | None = None,
+ model_config: str | Path | None = None,
+) -> ClaimReviewReport:
+ if not experiment_reports:
+ raise ClaimReviewError("claim review requires at least one experiment report")
+ config = ClaimReviewConfig.from_path(config_path)
+ evidence = [_load_experiment_evidence(path) for path in experiment_reports]
+ checks: list[ClaimReviewCheck] = []
+ checks.append(_shared_candidate_model_check(evidence, model_config, config))
+ checks.append(_fallback_model_check(evidence, config))
+ checks.append(_candidate_fallback_provenance_check(evidence, model_config, config))
+ checks.append(_trained_recognizer_check(evidence, model_config, config))
+ checks.append(_model_admission_review_check(evidence, model_config, config))
+ checks.append(_candidate_calibration_review_check(evidence, model_config))
+ checks.append(_candidate_baseline_equivalence_check(evidence, model_config))
+ checks.extend(_required_experiment_checks(evidence, config))
+ report = ClaimReviewReport(
+ passed=all(check.status != "fail" for check in checks),
+ config=config.to_dict(),
+ model_config=str(model_config) if model_config else None,
+ experiments=evidence,
+ checks=checks,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ _write_claim_review(report, out)
+ return report
+
+
+def default_claim_review_config() -> ClaimReviewConfig:
+ return ClaimReviewConfig(
+ required_experiments=[
+ RequiredExperiment(
+ name="internal-nepali-pack",
+ datasets=["ocrtech-eval-pack"],
+ require_validation_status="validated",
+ require_baselines=["candidate", "tesseract", "stock-paddle", "glm-ocr", "paddleocr-vl"],
+ required_metrics=[
+ "cer",
+ "wer",
+ "table_cell_f1",
+ "reading_order_pair_accuracy",
+ "figure_detection_f1",
+ "figure_caption_cer",
+ ],
+ required_slices=["nepali", "english", "table", "reading_order", "figure", "scan"],
+ )
+ ]
+ )
+
+
+def _load_experiment_evidence(path: str | Path) -> ExperimentEvidence:
+ experiment_path = Path(path)
+ _require_existing_file(experiment_path, "experiment report")
+ try:
+ payload = json.loads(experiment_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise ClaimReviewError(f"invalid experiment JSON {experiment_path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise ClaimReviewError(f"experiment report must be a JSON object: {experiment_path}")
+
+ eval_manifest = str(payload.get("eval_manifest") or "")
+ if not eval_manifest:
+ raise ClaimReviewError(f"experiment report missing eval_manifest: {experiment_path}")
+ _require_existing_file(Path(eval_manifest), f"eval_manifest in {experiment_path}")
+ eval_entries = load_manifest(eval_manifest)
+ eval_manifest_sha256 = sha256_file(Path(eval_manifest)) if Path(eval_manifest).exists() else None
+ datasets = sorted({entry.dataset for entry in eval_entries})
+ slice_counts = _slice_counts(eval_entries)
+
+ benchmark_report = str(payload.get("benchmark_report") or "")
+ if not benchmark_report:
+ raise ClaimReviewError(f"experiment report missing benchmark_report: {experiment_path}")
+ _require_existing_file(Path(benchmark_report), f"benchmark_report in {experiment_path}")
+ benchmark_rows = _load_benchmark_report(benchmark_report)
+ baselines = sorted({str(item.get("baseline") or "") for item in benchmark_rows if str(item.get("baseline") or "")})
+ benchmark_status_counts = _status_counts(benchmark_rows)
+ environment = dict(payload.get("environment") or {})
+
+ return ExperimentEvidence(
+ experiment_path=str(experiment_path),
+ experiment_id=str(payload.get("experiment_id") or experiment_path.stem),
+ eval_manifest=eval_manifest,
+ eval_manifest_sha256=eval_manifest_sha256,
+ recorded_eval_manifest_sha256=str(environment["eval_manifest_sha256"]) if environment.get("eval_manifest_sha256") else None,
+ eval_entries=eval_entries,
+ datasets=datasets,
+ slice_counts=slice_counts,
+ baselines=baselines,
+ benchmark_report=benchmark_report,
+ benchmark_rows=benchmark_rows,
+ benchmark_status_counts={str(key): int(value) for key, value in benchmark_status_counts.items()},
+ validation_status=str(payload["validation_status"]) if payload.get("validation_status") is not None else None,
+ validation_report=str(payload["validation_report"]) if payload.get("validation_report") is not None else None,
+ validation_config=str(environment["validation_config"]) if environment.get("validation_config") else None,
+ validation_config_sha256=str(environment["validation_config_sha256"]) if environment.get("validation_config_sha256") else None,
+ train_manifests=_environment_manifest_hashes(environment.get("train_manifests")),
+ candidate_model_config=str(environment["candidate_model_config"]) if environment.get("candidate_model_config") else None,
+ candidate_model_config_sha256=str(environment["candidate_model_config_sha256"]) if environment.get("candidate_model_config_sha256") else None,
+ fallback_model_config=str(environment["fallback_model_config"]) if environment.get("fallback_model_config") else None,
+ fallback_model_config_sha256=str(environment["fallback_model_config_sha256"]) if environment.get("fallback_model_config_sha256") else None,
+ )
+
+
+def _shared_candidate_model_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+ config: ClaimReviewConfig,
+) -> ClaimReviewCheck:
+ candidate_refs = [item for item in experiments if any(baseline in {"candidate", "ours", "ocrtech"} for baseline in item.baselines)]
+ details: list[str] = []
+ shas = sorted({item.candidate_model_config_sha256 for item in candidate_refs if item.candidate_model_config_sha256})
+ missing = [item.experiment_id for item in candidate_refs if not item.candidate_model_config_sha256]
+ if missing:
+ return ClaimReviewCheck(
+ "candidate-model",
+ "fail",
+ "candidate experiments are missing candidate_model_config_sha256",
+ details=missing,
+ )
+ if config.require_shared_candidate_model and len(shas) > 1:
+ return ClaimReviewCheck("candidate-model", "fail", "candidate experiments do not share one model config", details=shas)
+
+ if model_config is not None:
+ model_path = Path(model_config)
+ if not model_path.exists():
+ return ClaimReviewCheck("candidate-model", "fail", f"explicit model config does not exist: {model_path}")
+ explicit_sha = sha256_file(model_path)
+ if shas and explicit_sha not in shas:
+ return ClaimReviewCheck(
+ "candidate-model",
+ "fail",
+ "explicit model config does not match experiment evidence",
+ details=[f"explicit_sha256={explicit_sha}", *shas],
+ )
+ if config.require_model_audit_passed:
+ audit = audit_model_card(model_path)
+ details.extend(audit.warnings)
+ if not audit.passed:
+ return ClaimReviewCheck("candidate-model", "fail", "explicit model card failed audit", details=[*audit.issues, *details])
+ return ClaimReviewCheck("candidate-model", "pass", f"explicit model card audited: {audit.model_id}", details=details)
+ return ClaimReviewCheck("candidate-model", "pass", "explicit model config matches experiment evidence")
+
+ if candidate_refs and config.require_model_audit_passed:
+ model_paths = sorted({item.candidate_model_config for item in candidate_refs if item.candidate_model_config})
+ if len(model_paths) != 1:
+ return ClaimReviewCheck(
+ "candidate-model",
+ "fail",
+ "claim review requires one explicit candidate model path across candidate experiments",
+ details=model_paths,
+ )
+ model_path = Path(model_paths[0])
+ if not model_path.exists():
+ return ClaimReviewCheck("candidate-model", "fail", f"candidate model config does not exist: {model_path}")
+ actual_sha = sha256_file(model_path)
+ if actual_sha not in shas:
+ return ClaimReviewCheck(
+ "candidate-model",
+ "fail",
+ "candidate model config sha256 does not match experiment evidence",
+ details=[f"path={model_path}", f"actual_sha256={actual_sha}", *shas],
+ )
+ audit = audit_model_card(model_path)
+ details.extend(audit.warnings)
+ if not audit.passed:
+ return ClaimReviewCheck("candidate-model", "fail", "candidate model card failed audit", details=[*audit.issues, *details])
+ return ClaimReviewCheck(
+ "candidate-model",
+ "pass",
+ f"candidate model card hash-checked and audited: {audit.model_id}",
+ details=[f"path={model_path}", f"sha256={actual_sha}", *details],
+ )
+
+ if candidate_refs:
+ return ClaimReviewCheck("candidate-model", "pass", "candidate experiments share one model config")
+ return ClaimReviewCheck("candidate-model", "warn", "no candidate baselines found in supplied experiments")
+
+
+def _fallback_model_check(experiments: list[ExperimentEvidence], config: ClaimReviewConfig) -> ClaimReviewCheck:
+ candidate_refs = [item for item in experiments if any(baseline in {"candidate", "ours", "ocrtech"} for baseline in item.baselines)]
+ missing_required = [
+ item.experiment_id
+ for item in candidate_refs
+ if not item.fallback_model_config and not item.fallback_model_config_sha256
+ ]
+ if config.require_fallback_model_present and missing_required:
+ return ClaimReviewCheck(
+ "fallback-model",
+ "fail",
+ "candidate experiments are missing required fallback_model_config provenance",
+ details=missing_required,
+ )
+ fallback_refs = [item for item in candidate_refs if item.fallback_model_config or item.fallback_model_config_sha256]
+ if not fallback_refs:
+ return ClaimReviewCheck("fallback-model", "pass", "no fallback model config recorded in candidate experiments")
+ missing_path = [item.experiment_id for item in fallback_refs if not item.fallback_model_config]
+ if missing_path:
+ return ClaimReviewCheck("fallback-model", "fail", "fallback model sha256 is recorded but fallback_model_config path is missing", details=missing_path)
+ missing_sha = [item.experiment_id for item in fallback_refs if not item.fallback_model_config_sha256]
+ if missing_sha:
+ return ClaimReviewCheck("fallback-model", "fail", "fallback model config path is recorded but sha256 is missing", details=missing_sha)
+ shas = sorted({item.fallback_model_config_sha256 for item in fallback_refs if item.fallback_model_config_sha256})
+ if config.require_shared_fallback_model and len(shas) > 1:
+ return ClaimReviewCheck("fallback-model", "fail", "candidate experiments do not share one fallback model config", details=shas)
+
+ details: list[str] = []
+ model_paths = sorted({item.fallback_model_config for item in fallback_refs if item.fallback_model_config})
+ for model_path_text in model_paths:
+ model_path = Path(model_path_text)
+ matching_shas = sorted({item.fallback_model_config_sha256 for item in fallback_refs if item.fallback_model_config == model_path_text})
+ if not model_path.exists():
+ return ClaimReviewCheck("fallback-model", "fail", f"fallback model config does not exist: {model_path}")
+ actual_sha = sha256_file(model_path)
+ if actual_sha not in matching_shas:
+ return ClaimReviewCheck(
+ "fallback-model",
+ "fail",
+ "fallback model config sha256 does not match experiment evidence",
+ details=[f"path={model_path}", f"actual_sha256={actual_sha}", *matching_shas],
+ )
+ if config.require_fallback_model_audit_passed:
+ audit = audit_model_card(model_path)
+ details.extend(f"{model_path}: {warning}" for warning in audit.warnings)
+ if not audit.passed:
+ return ClaimReviewCheck(
+ "fallback-model",
+ "fail",
+ "fallback model card failed audit",
+ details=[f"{model_path}: {issue}" for issue in audit.issues] + details,
+ )
+ details.append(f"{model_path}: audited model_id={audit.model_id}")
+ return ClaimReviewCheck("fallback-model", "pass", "fallback model configs are present, hash-checked, and audited", details=details)
+
+
+def _candidate_fallback_provenance_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+ config: ClaimReviewConfig,
+) -> ClaimReviewCheck:
+ if not config.require_candidate_fallback_provenance:
+ return ClaimReviewCheck("candidate-fallback-provenance", "pass", "candidate fallback provenance is not required by config")
+ model_path = _single_candidate_model_path(experiments, model_config)
+ if model_path is None:
+ return ClaimReviewCheck("candidate-fallback-provenance", "fail", "candidate fallback provenance requires one candidate model path")
+ if not model_path.exists():
+ return ClaimReviewCheck("candidate-fallback-provenance", "fail", f"candidate model config does not exist: {model_path}")
+ card = ModelCard.from_path(model_path)
+ payload = card.provenance.get("fallback_model_card")
+ if not isinstance(payload, dict):
+ return ClaimReviewCheck("candidate-fallback-provenance", "fail", "candidate model card missing provenance.fallback_model_card")
+ path_value = payload.get("path")
+ if not isinstance(path_value, str) or not path_value:
+ return ClaimReviewCheck("candidate-fallback-provenance", "fail", "candidate fallback_model_card.path is missing")
+ fallback_path = Path(path_value)
+ if not fallback_path.is_absolute():
+ fallback_path = model_path.parent / fallback_path
+ if not fallback_path.exists():
+ return ClaimReviewCheck("candidate-fallback-provenance", "fail", f"candidate fallback model card does not exist: {fallback_path}")
+ declared_sha = payload.get("sha256")
+ actual_sha = sha256_file(fallback_path)
+ if isinstance(declared_sha, str) and declared_sha and declared_sha != actual_sha:
+ return ClaimReviewCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate fallback model card sha256 mismatch",
+ details=[f"expected={declared_sha}", f"actual={actual_sha}", f"path={fallback_path}"],
+ )
+ fallback_refs = [item for item in experiments if item.fallback_model_config_sha256]
+ mismatches = [
+ f"{item.experiment_id}: experiment_fallback_sha256={item.fallback_model_config_sha256} candidate_fallback_sha256={actual_sha}"
+ for item in fallback_refs
+ if item.fallback_model_config_sha256 != actual_sha
+ ]
+ if mismatches:
+ return ClaimReviewCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate fallback model card does not match experiment fallback_model_config",
+ details=mismatches,
+ )
+ audit = audit_model_card(fallback_path)
+ if not audit.passed:
+ return ClaimReviewCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate fallback model card failed audit",
+ details=[*audit.issues, *audit.warnings],
+ )
+ return ClaimReviewCheck(
+ "candidate-fallback-provenance",
+ "pass",
+ "candidate fallback model provenance matches reviewed experiment fallback configs",
+ details=[f"fallback_model_card={fallback_path}", f"sha256={actual_sha}", *audit.warnings],
+ )
+
+
+def _trained_recognizer_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+ config: ClaimReviewConfig,
+) -> ClaimReviewCheck:
+ if not config.require_trained_recognizer:
+ return ClaimReviewCheck("trained-recognizer", "pass", "trained recognizer provenance is not required by config")
+ model_path = _single_candidate_model_path(experiments, model_config)
+ if model_path is None:
+ return ClaimReviewCheck("trained-recognizer", "fail", "trained recognizer review requires one candidate model path")
+ if not model_path.exists():
+ return ClaimReviewCheck("trained-recognizer", "fail", f"candidate model config does not exist: {model_path}")
+ card = ModelCard.from_path(model_path)
+ status = trained_recognizer_provenance_status(card, model_path)
+ if not status.passed:
+ return ClaimReviewCheck(
+ "trained-recognizer",
+ "fail",
+ "candidate model lacks trained local recognizer provenance",
+ details=status.details,
+ )
+ return ClaimReviewCheck("trained-recognizer", "pass", "candidate includes trained local recognizer provenance", details=status.details)
+
+
+def _model_admission_review_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+ config: ClaimReviewConfig,
+) -> ClaimReviewCheck:
+ if not config.require_model_admission:
+ return ClaimReviewCheck("model-admission", "pass", "model admission validation is not required by config")
+ model_path = _single_candidate_model_path(experiments, model_config)
+ if model_path is None:
+ return ClaimReviewCheck("model-admission", "fail", "model admission review requires one candidate model path")
+ if not model_path.exists():
+ return ClaimReviewCheck("model-admission", "fail", f"candidate model config does not exist: {model_path}")
+ card = ModelCard.from_path(model_path)
+ status = model_admission_status(card, model_path)
+ if not status.passed:
+ return ClaimReviewCheck("model-admission", "fail", "candidate model has not passed admission validation", details=status.details)
+ return ClaimReviewCheck("model-admission", "pass", "candidate model passed admission validation", details=status.details)
+
+
+def _single_candidate_model_path(experiments: list[ExperimentEvidence], model_config: str | Path | None) -> Path | None:
+ if model_config is not None:
+ return Path(model_config)
+ candidate_refs = [item for item in experiments if any(baseline in {"candidate", "ours", "ocrtech"} for baseline in item.baselines)]
+ distinct_paths = sorted({item.candidate_model_config for item in candidate_refs if item.candidate_model_config})
+ if len(distinct_paths) != 1:
+ return None
+ return Path(distinct_paths[0])
+
+
+def _required_experiment_checks(experiments: list[ExperimentEvidence], config: ClaimReviewConfig) -> list[ClaimReviewCheck]:
+ checks: list[ClaimReviewCheck] = []
+ for required in config.required_experiments:
+ matches = [item for item in experiments if _matches_required_experiment(item, required)]
+ if not matches:
+ checks.append(
+ ClaimReviewCheck(
+ f"required:{required.name}",
+ "fail",
+ "no experiment matches the required dataset/pattern constraints",
+ details=[*required.datasets, *required.eval_manifest_patterns],
+ )
+ )
+ continue
+ if len(matches) > 1:
+ checks.append(
+ ClaimReviewCheck(
+ f"required:{required.name}",
+ "fail",
+ "multiple experiments match one required slot; tighten the claim config",
+ details=[item.experiment_path for item in matches],
+ )
+ )
+ continue
+ evidence = matches[0]
+ checks.append(_evaluate_required_experiment(evidence, required))
+ return checks
+
+
+def _candidate_calibration_review_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+) -> ClaimReviewCheck:
+ candidate_refs = [item for item in experiments if any(baseline in {"candidate", "ours", "ocrtech"} for baseline in item.baselines)]
+ if not candidate_refs:
+ return ClaimReviewCheck("candidate-calibration", "warn", "no candidate experiments found; calibration review skipped")
+ model_path = Path(model_config) if model_config is not None else None
+ if model_path is None:
+ distinct_paths = sorted({item.candidate_model_config for item in candidate_refs if item.candidate_model_config})
+ if len(distinct_paths) != 1:
+ return ClaimReviewCheck("candidate-calibration", "warn", "candidate calibration review skipped because no single model path is available")
+ model_path = Path(distinct_paths[0])
+ if not model_path.exists():
+ return ClaimReviewCheck("candidate-calibration", "fail", f"candidate model config does not exist: {model_path}")
+ card = ModelCard.from_path(model_path)
+ if card.backend not in {"quality_select_composite", "quality_ranked_ensemble", "script_select_composite"}:
+ return ClaimReviewCheck("candidate-calibration", "pass", "candidate backend does not require routed-threshold calibration review")
+ calibration = card.provenance.get("calibration")
+ if not isinstance(calibration, dict):
+ return ClaimReviewCheck("candidate-calibration", "fail", f"{card.backend} candidate is missing provenance.calibration")
+ eval_payload = calibration.get("eval_manifest")
+ if not isinstance(eval_payload, dict):
+ return ClaimReviewCheck("candidate-calibration", "fail", f"{card.backend} calibration is missing eval_manifest provenance")
+ calibration_sha = eval_payload.get("sha256")
+ if not isinstance(calibration_sha, str) or not calibration_sha:
+ return ClaimReviewCheck("candidate-calibration", "fail", f"{card.backend} calibration eval manifest is missing sha256")
+ overlaps = [item.experiment_id for item in candidate_refs if item.eval_manifest_sha256 and item.eval_manifest_sha256 == calibration_sha]
+ if overlaps:
+ return ClaimReviewCheck(
+ "candidate-calibration",
+ "fail",
+ f"{card.backend} calibration eval manifest matches a reviewed experiment eval manifest",
+ details=overlaps,
+ )
+ threshold = calibration.get("selected_threshold")
+ details = []
+ if isinstance(threshold, int | float):
+ details.append(f"selected_threshold={float(threshold):.6f}")
+ collapse_reason, collapse_details = inspect_routed_calibration_collapse(card, model_path)
+ if collapse_reason is not None:
+ return ClaimReviewCheck("candidate-calibration", "fail", collapse_reason, details=[*details, *collapse_details])
+ return ClaimReviewCheck("candidate-calibration", "pass", f"{card.backend} calibration provenance is separate from reviewed eval manifests", details=details)
+
+
+def _candidate_baseline_equivalence_check(
+ experiments: list[ExperimentEvidence],
+ model_config: str | Path | None,
+) -> ClaimReviewCheck:
+ candidate_refs = [item for item in experiments if any(baseline in {"candidate", "ours", "ocrtech"} for baseline in item.baselines)]
+ if not candidate_refs:
+ return ClaimReviewCheck("candidate-distinctness", "warn", "no candidate experiments found; baseline-equivalence review skipped")
+ model_path = Path(model_config) if model_config is not None else None
+ if model_path is None:
+ distinct_paths = sorted({item.candidate_model_config for item in candidate_refs if item.candidate_model_config})
+ if len(distinct_paths) != 1:
+ return ClaimReviewCheck("candidate-distinctness", "warn", "candidate distinctness review skipped because no single model path is available")
+ model_path = Path(distinct_paths[0])
+ if not model_path.exists():
+ return ClaimReviewCheck("candidate-distinctness", "fail", f"candidate model config does not exist: {model_path}")
+ card = ModelCard.from_path(model_path)
+ component_baselines = _component_baselines_for_card(card)
+ if not component_baselines:
+ return ClaimReviewCheck("candidate-distinctness", "pass", "candidate backend does not require component-baseline distinctness review")
+
+ checked: list[str] = []
+ for evidence in candidate_refs:
+ candidate_baseline = _candidate_baseline_name(evidence.baselines)
+ if candidate_baseline is None:
+ continue
+ for component_baseline in component_baselines:
+ if component_baseline not in evidence.baselines:
+ continue
+ paired = _paired_metric_outcomes(
+ evidence.benchmark_rows,
+ candidate_baseline,
+ component_baseline,
+ metric="cer",
+ slice_name="all",
+ )
+ if paired is None:
+ continue
+ checked.append(f"{evidence.experiment_id}:{component_baseline}")
+ if paired["pairs"] > 0 and paired["win_count"] == 0 and paired["loss_count"] == 0:
+ return ClaimReviewCheck(
+ "candidate-distinctness",
+ "fail",
+ f"candidate is indistinguishable from component baseline {component_baseline} on reviewed holdout CER",
+ details=[
+ f"experiment={evidence.experiment_id}",
+ f"pairs={paired['pairs']}",
+ f"candidate_mean={paired['candidate_mean']:.6f}",
+ f"baseline_mean={paired['baseline_mean']:.6f}",
+ "metric=cer",
+ "slice=all",
+ ],
+ )
+ if checked:
+ return ClaimReviewCheck(
+ "candidate-distinctness",
+ "pass",
+ "candidate is measurably distinct from reviewed component baselines on holdout CER",
+ details=checked,
+ )
+ return ClaimReviewCheck(
+ "candidate-distinctness",
+ "warn",
+ "no reviewed experiment includes component baselines needed for distinctness checks",
+ details=component_baselines,
+ )
+
+
+def _component_baselines_for_card(card: ModelCard) -> list[str]:
+ return component_baseline_names(card)
+
+
+def _candidate_baseline_name(baselines: list[str]) -> str | None:
+ for name in ("candidate", "ours", "ocrtech"):
+ if name in baselines:
+ return name
+ return None
+
+
+def _paired_metric_outcomes(
+ rows: list[dict[str, Any]],
+ candidate_baseline: str,
+ baseline: str,
+ *,
+ metric: str,
+ slice_name: str,
+ tolerance: float = 1e-12,
+) -> dict[str, float | int] | None:
+ candidate_values = _rows_by_sample(rows, candidate_baseline, metric, slice_name)
+ baseline_values = _rows_by_sample(rows, baseline, metric, slice_name)
+ shared = sorted(set(candidate_values) & set(baseline_values))
+ if not shared:
+ return None
+ candidate_series = [candidate_values[key] for key in shared]
+ baseline_series = [baseline_values[key] for key in shared]
+ wins = 0
+ losses = 0
+ ties = 0
+ for candidate_value, baseline_value in zip(candidate_series, baseline_series, strict=True):
+ delta = baseline_value - candidate_value
+ if delta > tolerance:
+ wins += 1
+ elif delta < -tolerance:
+ losses += 1
+ else:
+ ties += 1
+ return {
+ "pairs": len(shared),
+ "candidate_mean": sum(candidate_series) / len(candidate_series),
+ "baseline_mean": sum(baseline_series) / len(baseline_series),
+ "win_count": wins,
+ "loss_count": losses,
+ "tie_count": ties,
+ }
+
+
+def _rows_by_sample(rows: list[dict[str, Any]], baseline: str, metric: str, slice_name: str) -> dict[str, float]:
+ values: dict[str, float] = {}
+ for row in rows:
+ if row.get("baseline") != baseline or row.get("status") != "ok":
+ continue
+ if slice_name != "all" and slice_name not in set(row.get("slices") or []):
+ continue
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ value = metrics.get(metric)
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ values[sample_key(row)] = float(value)
+ return values
+
+
+def _matches_required_experiment(evidence: ExperimentEvidence, required: RequiredExperiment) -> bool:
+ if required.datasets and not (set(required.datasets) & set(evidence.datasets)):
+ return False
+ if required.eval_manifest_patterns and not any(fnmatch(evidence.eval_manifest, pattern) for pattern in required.eval_manifest_patterns):
+ return False
+ return True
+
+
+def _evaluate_required_experiment(evidence: ExperimentEvidence, required: RequiredExperiment) -> ClaimReviewCheck:
+ details: list[str] = [f"experiment={evidence.experiment_id}", f"eval_manifest={evidence.eval_manifest}"]
+ failures: list[str] = []
+ if not evidence.recorded_eval_manifest_sha256:
+ failures.append("experiment missing environment.eval_manifest_sha256")
+ elif evidence.recorded_eval_manifest_sha256 != evidence.eval_manifest_sha256:
+ failures.append(
+ "experiment eval_manifest sha256 does not match environment.eval_manifest_sha256"
+ )
+ failures.extend(_benchmark_eval_manifest_binding_failures(evidence))
+ if required.require_validation_status is not None and evidence.validation_status != required.require_validation_status:
+ failures.append(
+ f"validation_status {evidence.validation_status or 'not_run'} != required {required.require_validation_status}"
+ )
+ if required.required_validation_config is not None:
+ failures.extend(_required_validation_config_failures(evidence, required.required_validation_config))
+ if required.require_validation_status is not None:
+ if not evidence.validation_report:
+ failures.append("validation_report is missing")
+ elif not Path(evidence.validation_report).exists():
+ failures.append(f"validation_report does not exist: {evidence.validation_report}")
+ else:
+ failures.extend(_validation_report_failures(evidence.validation_report, required.require_validation_status, evidence))
+ failures.extend(_validation_gate_failures(evidence.validation_report, required.required_validation_gates))
+ missing_baselines = [baseline for baseline in required.require_baselines if baseline not in evidence.baselines]
+ if missing_baselines:
+ failures.append(f"missing baselines: {', '.join(missing_baselines)}")
+ missing_baseline_samples = _missing_required_baseline_sample_coverage(evidence, required.require_baselines)
+ if missing_baseline_samples:
+ failures.append(f"missing baseline sample coverage: {', '.join(missing_baseline_samples)}")
+ if required.require_no_errors and evidence.benchmark_status_counts.get("error", 0) > 0:
+ failures.append(f"benchmark has {evidence.benchmark_status_counts['error']} error rows")
+ missing_slices = [slice_name for slice_name in required.required_slices if evidence.slice_counts.get(slice_name, 0) < 1]
+ if missing_slices:
+ failures.append(f"missing slices: {', '.join(missing_slices)}")
+ metric_baselines = required.require_baselines or (["candidate"] if "candidate" in evidence.baselines else evidence.baselines)
+ missing_metrics = _missing_required_metrics(evidence.benchmark_rows, metric_baselines, required.required_metrics)
+ if missing_metrics:
+ failures.append(f"missing metrics: {', '.join(missing_metrics)}")
+ missing_metric_slices = _missing_required_metric_slices(evidence.benchmark_rows, metric_baselines, required.required_metric_slices)
+ if missing_metric_slices:
+ failures.append(f"missing metric slice coverage: {', '.join(missing_metric_slices)}")
+ missing_paired_metrics = _missing_required_paired_metric_coverage(
+ evidence.benchmark_rows,
+ metric_baselines,
+ required.required_metrics,
+ required.required_metric_slices,
+ )
+ if missing_paired_metrics:
+ failures.append(f"missing paired metric coverage: {', '.join(missing_paired_metrics)}")
+ missing_artifacts = _missing_required_output_artifacts(evidence, required)
+ if missing_artifacts:
+ failures.append(f"missing output artifacts: {', '.join(missing_artifacts)}")
+ failures.extend(_candidate_fallback_policy_failures(evidence.benchmark_rows, evidence.baselines, required))
+ details.append(f"datasets={', '.join(evidence.datasets)}")
+ details.append(f"baselines={', '.join(evidence.baselines)}")
+ if required.required_metrics:
+ details.append(f"required_metrics={', '.join(required.required_metrics)}")
+ if required.required_validation_config is not None:
+ details.append(f"required_validation_config={required.required_validation_config}")
+ if required.required_metric_slices:
+ details.append(
+ "required_metric_slices="
+ + ", ".join(f"{metric}@{'+'.join(slices)}" for metric, slices in sorted(required.required_metric_slices.items()))
+ )
+ if required.required_output_artifacts:
+ details.append(f"required_output_artifacts={', '.join(required.required_output_artifacts)}")
+ if required.required_output_artifact_slices:
+ details.append(
+ "required_output_artifact_slices="
+ + ", ".join(f"{artifact}@{'+'.join(slices)}" for artifact, slices in sorted(required.required_output_artifact_slices.items()))
+ )
+ if required.required_validation_gates:
+ details.append(
+ "required_validation_gates="
+ + ", ".join(
+ f"{gate.baseline}:{gate.metric}@{'+'.join(gate.slices) if gate.slices else 'any'}"
+ for gate in required.required_validation_gates
+ )
+ )
+ if required.require_candidate_fallback_metrics:
+ details.append("require_candidate_fallback_metrics=true")
+ if required.max_candidate_fallback_trigger_rate is not None:
+ details.append(f"max_candidate_fallback_trigger_rate={required.max_candidate_fallback_trigger_rate:.6f}")
+ if required.max_candidate_fallback_failed_rate is not None:
+ details.append(f"max_candidate_fallback_failed_rate={required.max_candidate_fallback_failed_rate:.6f}")
+ if failures:
+ return ClaimReviewCheck(f"required:{required.name}", "fail", "; ".join(failures), details=details)
+ summary = "required experiment evidence is present and passes configured checks"
+ return ClaimReviewCheck(f"required:{required.name}", "pass", summary, details=details)
+
+
+def _load_benchmark_report(path: str | Path) -> list[dict[str, Any]]:
+ _require_existing_file(Path(path), "benchmark report")
+ try:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise ClaimReviewError(f"invalid benchmark report JSON {path}: {exc}") from exc
+ if not isinstance(payload, list):
+ raise ClaimReviewError(f"benchmark report must be a JSON list: {path}")
+ rows: list[dict[str, Any]] = []
+ for index, item in enumerate(payload):
+ if not isinstance(item, dict):
+ raise ClaimReviewError(f"benchmark row {index} must be an object: {path}")
+ rows.append(dict(item))
+ return rows
+
+
+def _benchmark_eval_manifest_binding_failures(evidence: ExperimentEvidence) -> list[str]:
+ entries_by_sample = {entry.sample_id: entry for entry in evidence.eval_entries}
+ failures: list[str] = []
+ for row in evidence.benchmark_rows:
+ if row.get("status") != "ok":
+ continue
+ sample_id_value = row.get("sample_id")
+ if not isinstance(sample_id_value, str) or not sample_id_value:
+ continue
+ entry = entries_by_sample.get(sample_id_value)
+ if entry is None:
+ _append_once(failures, f"benchmark row sample_id not in eval_manifest: {sample_id_value}")
+ continue
+ input_path_value = row.get("input_path")
+ if not isinstance(input_path_value, str) or not input_path_value:
+ _append_once(failures, f"benchmark row missing input_path for sample_id: {sample_id_value}")
+ continue
+ if not _same_path(input_path_value, entry.image_path):
+ _append_once(failures, f"benchmark row input_path does not match eval_manifest for sample_id: {sample_id_value}")
+ row_slices = row.get("slices")
+ if not isinstance(row_slices, list):
+ _append_once(failures, f"benchmark row slices missing or invalid for sample_id: {sample_id_value}")
+ continue
+ if {str(item) for item in row_slices if str(item)} != set(_entry_slices(entry)):
+ _append_once(failures, f"benchmark row slices do not match eval_manifest for sample_id: {sample_id_value}")
+ return failures
+
+
+def _append_once(items: list[str], value: str) -> None:
+ if value not in items:
+ items.append(value)
+
+
+def _missing_required_baseline_sample_coverage(evidence: ExperimentEvidence, required_baselines: list[str]) -> list[str]:
+ if not required_baselines:
+ return []
+ required_samples = {entry.sample_id for entry in evidence.eval_entries}
+ if not required_samples:
+ return []
+ missing: list[str] = []
+ for baseline in required_baselines:
+ ok_samples = {
+ str(row.get("sample_id"))
+ for row in evidence.benchmark_rows
+ if row.get("baseline") == baseline
+ and row.get("status") == "ok"
+ and isinstance(row.get("sample_id"), str)
+ and row.get("sample_id")
+ }
+ baseline_missing = sorted(required_samples - ok_samples)
+ if not baseline_missing:
+ continue
+ preview = ", ".join(baseline_missing[:5])
+ suffix = f" (+{len(baseline_missing) - 5} more)" if len(baseline_missing) > 5 else ""
+ missing.append(f"{baseline}:{preview}{suffix}")
+ return missing
+
+
+def _same_path(left: str, right: str) -> bool:
+ left_path = Path(left)
+ right_path = Path(right)
+ try:
+ if left_path.exists() and right_path.exists():
+ return left_path.resolve() == right_path.resolve()
+ except OSError:
+ pass
+ return str(left_path) == str(right_path)
+
+
+def _required_validation_config_failures(evidence: ExperimentEvidence, required_validation_config: str) -> list[str]:
+ config_path = Path(required_validation_config)
+ if not config_path.exists():
+ return [f"required validation config does not exist: {required_validation_config}"]
+ if not config_path.is_file():
+ return [f"required validation config is not a file: {required_validation_config}"]
+ expected_sha = sha256_file(config_path)
+ failures: list[str] = []
+ if not evidence.validation_config:
+ failures.append(f"experiment missing required validation_config: {required_validation_config}")
+ if not evidence.validation_config_sha256:
+ failures.append(f"experiment missing validation_config_sha256 for required config: {required_validation_config}")
+ elif evidence.validation_config_sha256 != expected_sha:
+ failures.append(
+ f"experiment validation_config sha256 does not match required config {required_validation_config}: "
+ f"expected={expected_sha} actual={evidence.validation_config_sha256}"
+ )
+ return failures
+
+
+def _validation_report_failures(path: str | Path, required_status: str, evidence: ExperimentEvidence) -> list[str]:
+ report_path = Path(path)
+ try:
+ payload = json.loads(report_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ return [f"validation_report invalid JSON: {report_path}: {exc}"]
+ if not isinstance(payload, dict):
+ return [f"validation_report must be a JSON object: {report_path}"]
+ claim_status = str(payload.get("claim_status") or "")
+ if claim_status != required_status:
+ return [f"validation_report claim_status {claim_status or 'not_run'} != required {required_status}"]
+ if required_status == "validated" and payload.get("passed") is not True:
+ return ["validation_report passed is not true"]
+ failures: list[str] = []
+ provenance = payload.get("provenance")
+ if not isinstance(provenance, dict):
+ return ["validation_report missing provenance"]
+ benchmark_payload = provenance.get("benchmark_report")
+ if not isinstance(benchmark_payload, dict):
+ failures.append("validation_report missing provenance.benchmark_report")
+ else:
+ benchmark_sha = benchmark_payload.get("sha256")
+ expected_benchmark_sha = sha256_file(Path(evidence.benchmark_report))
+ if benchmark_sha != expected_benchmark_sha:
+ failures.append("validation_report benchmark_report sha256 does not match experiment benchmark_report")
+ eval_payload = provenance.get("eval_manifest")
+ if not isinstance(eval_payload, dict):
+ failures.append("validation_report missing provenance.eval_manifest")
+ else:
+ eval_sha = eval_payload.get("sha256")
+ if eval_sha != evidence.eval_manifest_sha256:
+ failures.append("validation_report eval_manifest sha256 does not match experiment eval_manifest")
+ config_payload = provenance.get("validation_config")
+ if evidence.validation_config_sha256 is not None:
+ if not isinstance(config_payload, dict):
+ failures.append("validation_report missing provenance.validation_config")
+ elif config_payload.get("sha256") != evidence.validation_config_sha256:
+ failures.append("validation_report validation_config sha256 does not match experiment validation_config")
+ elif config_payload not in (None, {}):
+ failures.append("validation_report validation_config provenance is present but experiment has no validation_config")
+ validation_train_manifests = _environment_manifest_hashes(provenance.get("train_manifests"))
+ if _manifest_hash_signature(validation_train_manifests) != _manifest_hash_signature(evidence.train_manifests):
+ failures.append("validation_report train_manifests provenance does not match experiment train_manifests")
+ _append_optional_provenance_hash_failure(
+ failures,
+ provenance,
+ "candidate_model_config",
+ evidence.candidate_model_config_sha256,
+ "candidate_model_config",
+ )
+ _append_optional_provenance_hash_failure(
+ failures,
+ provenance,
+ "fallback_model_config",
+ evidence.fallback_model_config_sha256,
+ "fallback_model_config",
+ )
+ return failures
+
+
+def _append_optional_provenance_hash_failure(
+ failures: list[str],
+ provenance: dict[str, Any],
+ key: str,
+ expected_sha256: str | None,
+ label: str,
+) -> None:
+ payload = provenance.get(key)
+ if expected_sha256 is not None:
+ if not isinstance(payload, dict):
+ failures.append(f"validation_report missing provenance.{key}")
+ elif payload.get("sha256") != expected_sha256:
+ failures.append(f"validation_report {label} sha256 does not match experiment {label}")
+ elif payload not in (None, {}):
+ failures.append(f"validation_report {label} provenance is present but experiment has no {label}")
+
+
+def _validation_gate_failures(path: str | Path, required_gates: list[RequiredValidationGate]) -> list[str]:
+ if not required_gates:
+ return []
+ report_path = Path(path)
+ try:
+ payload = json.loads(report_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ return [f"validation_report invalid JSON: {report_path}: {exc}"]
+ if not isinstance(payload, dict):
+ return [f"validation_report must be a JSON object: {report_path}"]
+ gate_results = payload.get("gates")
+ if not isinstance(gate_results, list):
+ return ["validation_report missing gates"]
+ failures: list[str] = []
+ for required in required_gates:
+ if not any(_validation_gate_matches(item, required) for item in gate_results):
+ slice_suffix = "@" + "+".join(required.slices) if required.slices else ""
+ failures.append(f"missing passing validation gate: {required.baseline}:{required.metric}{slice_suffix}")
+ return failures
+
+
+def _validation_gate_matches(item: Any, required: RequiredValidationGate) -> bool:
+ if not isinstance(item, dict) or item.get("passed") is not True:
+ return False
+ gate = item.get("gate")
+ if not isinstance(gate, dict):
+ return False
+ if gate.get("baseline") != required.baseline or gate.get("metric") != required.metric:
+ return False
+ if not required.slices:
+ return gate_has_quantitative_evidence(item)
+ gate_slices = gate.get("slices")
+ if not isinstance(gate_slices, list):
+ gate_slice = gate.get("slice")
+ gate_slices = [gate_slice] if gate_slice else []
+ return set(required.slices).issubset({str(slice_name) for slice_name in gate_slices}) and gate_has_quantitative_evidence(item)
+
+
+def _require_existing_file(path: Path, label: str) -> None:
+ if not path.exists():
+ raise ClaimReviewError(f"{label} does not exist: {path}")
+ if not path.is_file():
+ raise ClaimReviewError(f"{label} is not a file: {path}")
+
+
+def _missing_required_metrics(rows: list[dict[str, Any]], baselines: list[str], required_metrics: list[str]) -> list[str]:
+ missing: list[str] = []
+ if not required_metrics:
+ return missing
+ for baseline in baselines:
+ ok_rows = [row for row in rows if row.get("baseline") == baseline and row.get("status") == "ok"]
+ for metric in required_metrics:
+ if not any(_row_has_finite_metric(row, metric) for row in ok_rows):
+ missing.append(f"{baseline}:{metric}")
+ return missing
+
+
+def _missing_required_metric_slices(rows: list[dict[str, Any]], baselines: list[str], requirements: dict[str, list[str]]) -> list[str]:
+ missing: list[str] = []
+ if not requirements:
+ return missing
+ for baseline in baselines:
+ ok_rows = [row for row in rows if row.get("baseline") == baseline and row.get("status") == "ok"]
+ for metric, slices in requirements.items():
+ for slice_name in slices:
+ if not any(slice_name in set(row.get("slices") or []) and _row_has_finite_metric(row, metric) for row in ok_rows):
+ missing.append(f"{baseline}:{metric}@{slice_name}")
+ return missing
+
+
+def _missing_required_paired_metric_coverage(
+ rows: list[dict[str, Any]],
+ baselines: list[str],
+ required_metrics: list[str],
+ required_metric_slices: dict[str, list[str]],
+) -> list[str]:
+ missing: list[str] = []
+ if not required_metrics:
+ return missing
+ candidate = _candidate_baseline_name(baselines)
+ if candidate is None:
+ return missing
+ comparison_baselines = [baseline for baseline in baselines if baseline != candidate]
+ for baseline in comparison_baselines:
+ for metric in required_metrics:
+ slice_names = required_metric_slices.get(metric) or ["all"]
+ for slice_name in slice_names:
+ if _paired_metric_outcomes(rows, candidate, baseline, metric=metric, slice_name=slice_name) is None:
+ missing.append(f"{candidate}:{baseline}:{metric}@{slice_name}")
+ return missing
+
+
+def _missing_required_output_artifacts(evidence: ExperimentEvidence, required: RequiredExperiment) -> list[str]:
+ if not required.required_output_artifacts and not required.required_output_artifact_slices:
+ return []
+ candidate = _candidate_baseline_name(evidence.baselines)
+ if candidate is None:
+ return ["candidate output artifacts require a candidate/ours baseline"]
+ ok_rows = [row for row in evidence.benchmark_rows if row.get("baseline") == candidate and row.get("status") == "ok"]
+ if not ok_rows:
+ return [f"candidate output artifacts have no ok rows for {candidate}"]
+ benchmark_dir = Path(evidence.benchmark_report).parent
+ missing: list[str] = []
+ for row in ok_rows:
+ output_dir = benchmark_dir / candidate / Path(str(row.get("input_path") or "")).stem
+ sample = sample_key(row)
+ for artifact in required.required_output_artifacts:
+ artifact_issue = _output_artifact_issue(output_dir, artifact)
+ if artifact_issue is not None:
+ missing.append(f"{candidate}:{sample}:{artifact} ({artifact_issue})")
+ row_slices = {str(item) for item in row.get("slices", [])}
+ for artifact, slices in required.required_output_artifact_slices.items():
+ for slice_name in slices:
+ if slice_name not in row_slices:
+ continue
+ artifact_issue = _output_artifact_issue(output_dir, artifact)
+ if artifact_issue is not None:
+ missing.append(f"{candidate}:{sample}:{artifact}@{slice_name} ({artifact_issue})")
+ return missing
+
+
+def _output_artifact_issue(output_dir: Path, artifact: str) -> str | None:
+ if artifact == "document_json":
+ return _json_file_issue(output_dir / "document.json", expected_type=dict, required_keys=("pages", "tables", "figures"))
+ if artifact == "document_md":
+ return _nonempty_file_issue(output_dir / "document.md")
+ if artifact == "quality_json":
+ return _json_file_issue(output_dir / "quality.json", expected_type=dict)
+ if artifact == "table_csv_html":
+ tables_dir = output_dir / "tables"
+ if not tables_dir.is_dir():
+ return "tables directory missing"
+ csv_issue = _any_nonempty_file_issue(tables_dir, "*.csv")
+ html_issue = _any_nonempty_file_issue(tables_dir, "*.html")
+ if csv_issue is not None:
+ return f"csv {csv_issue}"
+ if html_issue is not None:
+ return f"html {html_issue}"
+ return None
+ if artifact == "figure_metadata":
+ return _json_file_issue(output_dir / "figures" / "metadata.json", expected_type=list, require_nonempty=True)
+ if artifact == "figure_images":
+ figures_dir = output_dir / "figures"
+ if not figures_dir.is_dir():
+ return "figures directory missing"
+ image_files = [
+ path
+ for path in figures_dir.iterdir()
+ if path.is_file() and path.suffix.lower() in {".png", ".jpg", ".jpeg", ".webp"}
+ ]
+ if not image_files:
+ return "no image files"
+ if not any(path.stat().st_size > 0 for path in image_files):
+ return "image files are empty"
+ return None
+ return "unknown artifact type"
+
+
+def _json_file_issue(
+ path: Path,
+ *,
+ expected_type: type[dict[str, Any]] | type[list[Any]],
+ required_keys: tuple[str, ...] = (),
+ require_nonempty: bool = False,
+) -> str | None:
+ if not path.is_file():
+ return "missing"
+ if path.stat().st_size == 0:
+ return "empty"
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ return f"invalid json: {exc}"
+ if not isinstance(payload, expected_type):
+ return f"expected {expected_type.__name__}"
+ if require_nonempty and not payload:
+ return "empty payload"
+ if isinstance(payload, dict):
+ missing_keys = [key for key in required_keys if key not in payload]
+ if missing_keys:
+ return f"missing keys: {', '.join(missing_keys)}"
+ return None
+
+
+def _nonempty_file_issue(path: Path) -> str | None:
+ if not path.is_file():
+ return "missing"
+ if path.stat().st_size == 0:
+ return "empty"
+ return None
+
+
+def _any_nonempty_file_issue(directory: Path, pattern: str) -> str | None:
+ files = [path for path in directory.glob(pattern) if path.is_file()]
+ if not files:
+ return f"missing {pattern}"
+ if not any(path.stat().st_size > 0 for path in files):
+ return f"empty {pattern}"
+ return None
+
+
+def _candidate_fallback_policy_failures(rows: list[dict[str, Any]], baselines: list[str], required: RequiredExperiment) -> list[str]:
+ if (
+ not required.require_candidate_fallback_metrics
+ and required.max_candidate_fallback_trigger_rate is None
+ and required.max_candidate_fallback_failed_rate is None
+ ):
+ return []
+ candidate = _candidate_baseline_name(baselines)
+ if candidate is None:
+ return ["candidate fallback policy requires a candidate/ours baseline"]
+ ok_rows = [row for row in rows if row.get("baseline") == candidate and row.get("status") == "ok"]
+ if not ok_rows:
+ return [f"candidate fallback policy has no ok rows for {candidate}"]
+ failures: list[str] = []
+ if required.require_candidate_fallback_metrics:
+ missing_triggered = [sample_key(row) for row in ok_rows if not _row_has_finite_metric(row, "fallback_triggered")]
+ missing_failed = [sample_key(row) for row in ok_rows if not _row_has_finite_metric(row, "fallback_failed")]
+ if missing_triggered:
+ failures.append(f"missing candidate fallback_triggered metrics on {len(missing_triggered)} rows")
+ if missing_failed:
+ failures.append(f"missing candidate fallback_failed metrics on {len(missing_failed)} rows")
+ if required.max_candidate_fallback_trigger_rate is not None:
+ trigger_rate = _mean_metric(ok_rows, "fallback_triggered")
+ if trigger_rate is None:
+ failures.append("candidate fallback_triggered metrics are missing for trigger-rate limit")
+ elif trigger_rate > required.max_candidate_fallback_trigger_rate:
+ failures.append(
+ f"candidate fallback trigger rate {trigger_rate:.6f} exceeds max {required.max_candidate_fallback_trigger_rate:.6f}"
+ )
+ if required.max_candidate_fallback_failed_rate is not None:
+ failed_rate = _mean_metric(ok_rows, "fallback_failed")
+ if failed_rate is None:
+ failures.append("candidate fallback_failed metrics are missing for failure-rate limit")
+ elif failed_rate > required.max_candidate_fallback_failed_rate:
+ failures.append(
+ f"candidate fallback failure rate {failed_rate:.6f} exceeds max {required.max_candidate_fallback_failed_rate:.6f}"
+ )
+ return failures
+
+
+def _mean_metric(rows: list[dict[str, Any]], metric: str) -> float | None:
+ values: list[float] = []
+ for row in rows:
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ value = metrics.get(metric)
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ values.append(float(value))
+ if not values:
+ return None
+ return sum(values) / len(values)
+
+
+def _row_has_finite_metric(row: dict[str, Any], metric: str) -> bool:
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ return False
+ value = metrics.get(metric)
+ return isinstance(value, int | float) and math.isfinite(float(value))
+
+
+def _optional_rate(value: Any, field_name: str) -> float | None:
+ if value is None:
+ return None
+ if not isinstance(value, int | float):
+ raise ClaimReviewError(f"{field_name} must be a number between 0 and 1")
+ rate = float(value)
+ if not math.isfinite(rate) or rate < 0.0 or rate > 1.0:
+ raise ClaimReviewError(f"{field_name} must be a number between 0 and 1")
+ return rate
+
+
+def _status_counts(rows: list[dict[str, Any]]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ for item in rows:
+ status = str(item.get("status") or "")
+ if not status:
+ continue
+ counts[status] = counts.get(status, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _slice_counts(entries: list[ManifestEntry]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ seen: set[tuple[str, str]] = set()
+ for entry in entries:
+ for slice_name in _entry_slices(entry):
+ pair = (entry.sample_id, slice_name)
+ if pair in seen:
+ continue
+ seen.add(pair)
+ counts[slice_name] = counts.get(slice_name, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _entry_slices(entry: ManifestEntry) -> list[str]:
+ values: set[str] = set()
+ metadata = entry.metadata or {}
+ for key in ("slice", "script", "document_type", "degradation", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _string_list(value: Any) -> list[str]:
+ if value is None:
+ return []
+ if not isinstance(value, list):
+ raise ClaimReviewError("expected a list of strings")
+ result = [str(item) for item in value if str(item)]
+ if len(result) != len(value):
+ raise ClaimReviewError("list items must be non-empty strings")
+ return result
+
+
+def _environment_manifest_hashes(value: Any) -> list[dict[str, str | None]]:
+ if not isinstance(value, list):
+ return []
+ manifests: list[dict[str, str | None]] = []
+ for item in value:
+ if not isinstance(item, dict):
+ continue
+ path = item.get("path")
+ sha = item.get("sha256")
+ manifests.append(
+ {
+ "path": str(path) if path is not None else None,
+ "sha256": str(sha) if sha is not None else None,
+ }
+ )
+ return manifests
+
+
+def _manifest_hash_signature(manifests: list[dict[str, str | None]]) -> list[tuple[str | None, str | None]]:
+ return sorted(
+ ((item.get("path"), item.get("sha256")) for item in manifests),
+ key=lambda item: (item[0] or "", item[1] or ""),
+ )
+
+
+def _metric_slice_requirements(value: Any) -> dict[str, list[str]]:
+ if value is None:
+ return {}
+ if not isinstance(value, dict):
+ raise ClaimReviewError("required_metric_slices must be an object mapping metric names to slice lists")
+ result: dict[str, list[str]] = {}
+ for metric, slices in value.items():
+ metric_name = str(metric)
+ if not metric_name:
+ raise ClaimReviewError("required_metric_slices metric names must be non-empty strings")
+ parsed_slices = _string_list(slices)
+ if not parsed_slices:
+ raise ClaimReviewError(f"required_metric_slices for {metric_name!r} must define at least one slice")
+ result[metric_name] = parsed_slices
+ return result
+
+
+def _required_validation_gates(value: Any) -> list[RequiredValidationGate]:
+ if value is None:
+ return []
+ if not isinstance(value, list):
+ raise ClaimReviewError("required_validation_gates must be a list")
+ gates: list[RequiredValidationGate] = []
+ for item in value:
+ if not isinstance(item, dict):
+ raise ClaimReviewError("required_validation_gates items must be objects")
+ gates.append(RequiredValidationGate.from_dict(item))
+ return gates
+
+
+def _validate_required_validation_gates(
+ experiment_name: str,
+ require_validation_status: str | None,
+ require_baselines: list[str],
+ required_metrics: list[str],
+ required_validation_gates: list[RequiredValidationGate],
+) -> None:
+ if not required_validation_gates:
+ return
+ if require_validation_status is None:
+ raise ClaimReviewError(f"required experiment {experiment_name!r} defines required_validation_gates without require_validation_status")
+ baseline_set = set(require_baselines)
+ missing_baselines = sorted({gate.baseline for gate in required_validation_gates if gate.baseline not in baseline_set})
+ if missing_baselines:
+ raise ClaimReviewError(
+ f"required experiment {experiment_name!r} has validation gate baselines not listed in require_baselines: {', '.join(missing_baselines)}"
+ )
+ metric_set = set(required_metrics)
+ missing_metrics = sorted({gate.metric for gate in required_validation_gates if gate.metric not in metric_set})
+ if missing_metrics:
+ raise ClaimReviewError(
+ f"required experiment {experiment_name!r} has validation gate metrics not listed in required_metrics: {', '.join(missing_metrics)}"
+ )
+
+
+def _write_claim_review(report: ClaimReviewReport, output_dir: Path) -> None:
+ (output_dir / "claim-review.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# OCR Claim Review",
+ "",
+ f"Passed: `{'yes' if report.passed else 'no'}`",
+ f"Model config: `{report.model_config or ''}`",
+ "",
+ "| check | status | summary |",
+ "| --- | --- | --- |",
+ ]
+ for check in report.checks:
+ summary = check.summary.replace("|", "\\|")
+ lines.append(f"| {check.name} | {check.status} | {summary} |")
+ for detail in check.details:
+ escaped_detail = detail.replace("|", "\\|")
+ lines.append(f"| | | {escaped_detail} |")
+ lines.extend(["", "## Experiments", ""])
+ for experiment in report.experiments:
+ lines.append(f"- `{experiment.experiment_id}` datasets=`{', '.join(experiment.datasets)}` baselines=`{', '.join(experiment.baselines)}`")
+ (output_dir / "claim-review.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/cli.py b/src/ocrtech/cli.py
new file mode 100644
index 0000000000000000000000000000000000000000..a0bb275c198b6f688a3d83a7845cc901a9dbad86
--- /dev/null
+++ b/src/ocrtech/cli.py
@@ -0,0 +1,1849 @@
+"""Command-line interface for ocrtech."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import sys
+from pathlib import Path
+
+from .admission import assert_recognizer_family_not_stopped, decide_recognizer_admission, review_recognizer_failures
+from .benchmark import derive_table_postprocess_benchmark, rescore_benchmark_report, run_benchmark, summarize_benchmark_report
+from .calibration import calibrate_quality_router, calibrate_script_router, calibrate_tesseract_psm_ensemble
+from .claim_review import review_claim
+from .crops import extract_crop_manifest
+from .datasets import audit_manifest, audit_recognizer_corpus, build_recognizer_corpus, filter_manifest, merge_manifests, rebalance_manifest, split_manifest
+from .error_analysis import analyze_benchmark_errors, export_failure_manifest
+from .errors import OcrTechError
+from .evalpack import audit_eval_pack, create_eval_pack
+from .experiments import run_experiment
+from .language_registry import audit_font_renderability, audit_language_registry
+from .manifest import inspect_hf_dataset, load_manifest, normalize_manifest_images, prepare_hf_dataset, prepare_local_dataset
+from .models import audit_model_card, write_model_card
+from .oracle import build_benchmark_oracle
+from .paper import export_paper_benchmark_table
+from .pipeline import parse_document
+from .preflight import run_claim_preflight
+from .public_benchmarks import audit_public_benchmark_manifest, list_public_benchmarks, prepare_public_benchmark
+from .references import materialize_references
+from .remote import DEFAULT_PYTHON_CANDIDATES, audit_remote_host, bootstrap_remote_host, sync_remote_workspace
+from .source_audit import (
+ DEFAULT_GORKHAPATRA_CATEGORY_URLS,
+ DEFAULT_GORKHAPATRA_EPAPER_URL,
+ DEFAULT_NAYA_NEPAL_PUBLICATION_URL,
+ audit_gorkhapatra_language_pages,
+ audit_gorkhapatra_source,
+ prepare_gorkhapatra_language_page_review,
+ prepare_gorkhapatra_language_page_pack,
+ prepare_gorkhapatra_pack,
+)
+from .table_analysis import analyze_table_cells
+from .training import (
+ PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED,
+ bundle_recognizer_training,
+ finalize_hf_recognizer_run,
+ generate_correction_pairs,
+ package_hf_text_corrector_model,
+ package_hf_recognizer_model,
+ package_paddleocr_model,
+ write_corrector_recipe,
+ write_hf_text_corrector_recipe,
+ write_hf_recognizer_recipe,
+ write_recognizer_export_recipe,
+ write_recognizer_recipe,
+)
+from .validation import validate_claim
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(prog="ocrtech", description="Nepali + English OCR document parser")
+ subparsers = parser.add_subparsers(dest="command", required=True)
+
+ prepare = subparsers.add_parser("prepare-data", help="download/verify/convert datasets into manifests")
+ prepare.add_argument("source", help="local CSV/JSONL/directory or Hugging Face dataset id")
+ prepare.add_argument("--out", default="data/manifests", help="output manifest directory")
+ prepare.add_argument("--dataset-name", help="manifest dataset name")
+ prepare.add_argument("--split", default="train", help="dataset split")
+ prepare.add_argument("--image-field", help="explicit image field")
+ prepare.add_argument("--text-field", help="explicit text field")
+ prepare.add_argument("--hf-subset", help="known HF dataset subset/language selector (for example: en)")
+ prepare.add_argument("--limit", type=int, help="max rows to convert")
+ prepare.add_argument("--hf", action="store_true", help="load source with Hugging Face datasets")
+ prepare.add_argument("--skip-invalid", action="store_true", help="skip invalid rows and write a reject report")
+ prepare.add_argument("--strict-chars", action="store_true", help="reject unsupported dictionary characters")
+ prepare.add_argument("--slice", action="append", default=[], help="slice label to stamp into manifest metadata; repeatable")
+ prepare.set_defaults(func=cmd_prepare_data)
+
+ inspect_hf = subparsers.add_parser("inspect-hf-dataset", help="inspect a Hugging Face dataset schema before manifest conversion")
+ inspect_hf.add_argument("dataset_id", help="Hugging Face dataset id")
+ inspect_hf.add_argument("--out", default="outputs/hf-dataset-inspection")
+ inspect_hf.add_argument("--split", default="train")
+ inspect_hf.add_argument("--hf-subset", help="dataset subset/language selector")
+ inspect_hf.add_argument("--image-field", help="explicit image field")
+ inspect_hf.add_argument("--text-field", help="explicit text field")
+ inspect_hf.add_argument("--limit", type=int, default=3)
+ inspect_hf.set_defaults(func=cmd_inspect_hf_dataset)
+
+ audit_manifest_parser = subparsers.add_parser("audit-manifest", help="audit a training or evaluation manifest")
+ audit_manifest_parser.add_argument("manifest")
+ audit_manifest_parser.add_argument("--out", default="outputs/manifest-audit")
+ audit_manifest_parser.add_argument("--no-verify-hashes", action="store_true")
+ audit_manifest_parser.add_argument("--require-slice", action="append", default=[])
+ audit_manifest_parser.add_argument("--strict-chars", action="store_true")
+ audit_manifest_parser.set_defaults(func=cmd_audit_manifest)
+
+ split = subparsers.add_parser("split-manifest", help="create deterministic leakage-safe train/eval manifests")
+ split.add_argument("manifest")
+ split.add_argument("--out", default="data/splits")
+ split.add_argument("--eval-ratio", type=float, default=0.15)
+ split.add_argument("--seed", type=int, default=13)
+ split.add_argument("--stratify-by", choices=["slices", "dataset", "document_type", "none"], default="slices")
+ split.add_argument("--group-by", choices=["sample_signature", "text_sha256", "image_sha256", "image_path", "sample_id"], default="sample_signature")
+ split.set_defaults(func=cmd_split_manifest)
+
+ rebalance = subparsers.add_parser("rebalance-manifest", help="upsample underrepresented slices in a manifest for training")
+ rebalance.add_argument("manifest")
+ rebalance.add_argument("--out", default="data/manifests/rebalanced.jsonl")
+ rebalance.add_argument("--slice", action="append", default=[], help="slice to rebalance; repeatable")
+ rebalance.add_argument("--target-count", type=int, help="target count per requested slice; defaults to the largest requested slice")
+ rebalance.add_argument("--seed", type=int, default=13)
+ rebalance.set_defaults(func=cmd_rebalance_manifest)
+
+ corpus_audit = subparsers.add_parser("audit-recognizer-corpus", help="audit train/eval manifests before recognizer training")
+ corpus_audit.add_argument("--train-manifest", required=True)
+ corpus_audit.add_argument("--eval-manifest", required=True)
+ corpus_audit.add_argument("--out", default="outputs/recognizer-corpus-audit")
+ corpus_audit.add_argument("--min-train-samples", type=int, default=1000)
+ corpus_audit.add_argument("--min-eval-samples", type=int, default=100)
+ corpus_audit.add_argument("--min-train-english", type=int, default=200)
+ corpus_audit.add_argument("--min-train-devanagari", type=int, default=200)
+ corpus_audit.add_argument("--min-train-mixed", type=int, default=25)
+ corpus_audit.add_argument("--min-eval-english", type=int, default=50)
+ corpus_audit.add_argument("--min-eval-devanagari", type=int, default=50)
+ corpus_audit.add_argument("--min-eval-mixed", type=int, default=10)
+ corpus_audit.add_argument("--min-train-latin-only", type=int, default=50)
+ corpus_audit.add_argument("--min-train-devanagari-only", type=int, default=50)
+ corpus_audit.add_argument("--min-eval-latin-only", type=int, default=10)
+ corpus_audit.add_argument("--min-eval-devanagari-only", type=int, default=10)
+ corpus_audit.add_argument("--min-train-real", type=int, default=100)
+ corpus_audit.add_argument("--min-train-synthetic", type=int, default=100)
+ corpus_audit.set_defaults(func=cmd_audit_recognizer_corpus)
+
+ corpus_build = subparsers.add_parser("build-recognizer-corpus", help="assemble and upsample a recognizer training manifest by script buckets")
+ corpus_build.add_argument("manifests", nargs="+")
+ corpus_build.add_argument("--out", required=True)
+ corpus_build.add_argument("--target-latin-only", type=int, default=0)
+ corpus_build.add_argument("--target-devanagari-only", type=int, default=0)
+ corpus_build.add_argument("--target-mixed", type=int, default=0)
+ corpus_build.add_argument("--target-real", type=int, default=0)
+ corpus_build.add_argument("--target-synthetic", type=int, default=0)
+ corpus_build.add_argument("--seed", type=int, default=13)
+ corpus_build.set_defaults(func=cmd_build_recognizer_corpus)
+
+ merge = subparsers.add_parser("merge-manifests", help="combine multiple manifests into one auditable corpus")
+ merge.add_argument("manifests", nargs="+")
+ merge.add_argument("--out", default="data/manifests/combined.jsonl")
+ merge.set_defaults(func=cmd_merge_manifests)
+
+ filter_parser = subparsers.add_parser("filter-manifest", help="select a reproducible subset of a manifest")
+ filter_parser.add_argument("manifest")
+ filter_parser.add_argument("--out", default="data/manifests/filtered.jsonl")
+ filter_parser.add_argument("--sample-id", action="append", default=[], help="exact sample_id to include; repeatable")
+ filter_parser.add_argument("--slice", action="append", default=[], help="required slice label; repeatable")
+ filter_parser.add_argument("--document-type", action="append", default=[], help="required document_type metadata value; repeatable")
+ filter_parser.add_argument("--degradation", action="append", default=[], help="required degradation metadata value; repeatable")
+ filter_parser.add_argument("--limit", type=int)
+ filter_parser.set_defaults(func=cmd_filter_manifest)
+
+ refs = subparsers.add_parser("materialize-references", help="write benchmark reference files from a manifest and optionally rewrite manifest metadata")
+ refs.add_argument("manifest")
+ refs.add_argument("--out", default="data/references")
+ refs.add_argument("--rewritten-manifest", help="optional manifest output path with metadata.reference_path populated")
+ refs.set_defaults(func=cmd_materialize_references)
+
+ normalize_images = subparsers.add_parser("normalize-manifest-images", help="copy/convert manifest images to OCR-supported suffixes")
+ normalize_images.add_argument("manifest")
+ normalize_images.add_argument("--out", default="data/normalized-images")
+ normalize_images.add_argument("--image-dir-name", default="images")
+ normalize_images.add_argument("--output-manifest-name", default="manifest-images-normalized.jsonl")
+ normalize_images.set_defaults(func=cmd_normalize_manifest_images)
+
+ create_eval = subparsers.add_parser("create-eval-pack", help="generate a held-out Nepali + English document eval pack")
+ create_eval.add_argument("--out", default="data/eval-pack", help="eval-pack output directory")
+ create_eval.add_argument("--count-per-template", type=int, default=1)
+ create_eval.add_argument("--input-format", choices=["text", "image"], default="text")
+ create_eval.add_argument("--degradation", action="append", help="degradation to generate; repeatable")
+ create_eval.add_argument("--seed", type=int, default=13)
+ create_eval.add_argument("--font-path", help="font path for image rendering")
+ create_eval.add_argument("--template", action="append", default=[], help="template name to generate; repeatable")
+ create_eval.add_argument("--variant-offset", type=int, default=0, help="starting copy index for generated template variants")
+ create_eval.set_defaults(func=cmd_create_eval_pack)
+
+ audit_eval = subparsers.add_parser("audit-eval-pack", help="audit eval-pack manifest integrity and claim readiness")
+ audit_eval.add_argument("manifest", help="eval-pack manifest JSONL")
+ audit_eval.add_argument("--out", default="outputs/eval-pack-audit")
+ audit_eval.add_argument("--require-claim-ready", action="store_true")
+ audit_eval.set_defaults(func=cmd_audit_eval_pack)
+
+ crops = subparsers.add_parser("extract-crops", help="extract line/cell/caption recognizer crops from rendered eval-pack layout metadata")
+ crops.add_argument("manifest", help="source eval-pack manifest JSONL")
+ crops.add_argument("--out", default="data/crops", help="crop manifest output directory")
+ crops.add_argument("--crop-type", action="append", default=[], choices=["line", "table-cell", "figure-caption"], help="crop type to extract; repeatable")
+ crops.add_argument("--split", default="train", help="split label for emitted crop manifest rows")
+ crops.add_argument("--dataset-name", default="ocrtech-crops")
+ crops.add_argument("--min-text-length", type=int, default=1)
+ crops.set_defaults(func=cmd_extract_crops)
+
+ train_rec = subparsers.add_parser("train-recognizer", help="write a PaddleOCR recognizer training recipe")
+ train_rec.add_argument("--train-manifest", required=True)
+ train_rec.add_argument("--eval-manifest", required=True)
+ train_rec.add_argument("--out", default="runs/recognizer")
+ train_rec.add_argument("--backend", choices=["paddleocr", "hf-vision-encoder-decoder"], default="paddleocr")
+ train_rec.add_argument("--base-model", default=PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED)
+ train_rec.add_argument("--dictionary")
+ train_rec.add_argument("--max-target-length", type=int, default=128)
+ train_rec.add_argument("--train-batch-size", type=int, default=8)
+ train_rec.add_argument("--eval-batch-size", type=int, default=8)
+ train_rec.add_argument("--learning-rate", type=float, default=5e-5)
+ train_rec.add_argument("--epochs", type=float, default=3.0)
+ train_rec.add_argument("--failure-review", help="recognizer-failure-review.json used to reject stopped model families")
+ train_rec.add_argument("--run", action="store_true", help="run PaddleOCR training command after writing config")
+ train_rec.set_defaults(func=cmd_train_recognizer)
+
+ export_rec = subparsers.add_parser("export-recognizer", help="write or run a PaddleOCR recognizer export recipe")
+ export_rec.add_argument("--training-config", required=True)
+ export_rec.add_argument("--checkpoint", required=True)
+ export_rec.add_argument("--out", default="runs/recognizer/export")
+ export_rec.add_argument("--inference-dir")
+ export_rec.add_argument("--paddleocr-dir", default="PaddleOCR")
+ export_rec.add_argument("--run", action="store_true")
+ export_rec.set_defaults(func=cmd_export_recognizer)
+
+ package_rec = subparsers.add_parser("package-recognizer", help="package PaddleOCR inference artifacts into a candidate model card")
+ package_rec.add_argument("--inference-dir", required=True)
+ package_rec.add_argument("--dictionary", required=True)
+ package_rec.add_argument("--out", default="runs/recognizer/package")
+ package_rec.add_argument("--model-id", required=True)
+ package_rec.add_argument("--base-model", default=PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED)
+ package_rec.add_argument("--train-manifest")
+ package_rec.add_argument("--eval-manifest")
+ package_rec.add_argument("--training-summary")
+ package_rec.add_argument("--metrics-report")
+ package_rec.add_argument("--admission-validation-report")
+ package_rec.set_defaults(func=cmd_package_recognizer)
+
+ bundle_rec = subparsers.add_parser("bundle-recognizer-training", help="package recognizer recipe, manifests, and images for transfer to a training host")
+ bundle_rec.add_argument("--recipe-dir", required=True)
+ bundle_rec.add_argument("--train-manifest", required=True)
+ bundle_rec.add_argument("--eval-manifest", required=True)
+ bundle_rec.add_argument("--out", default="runs/recognizer-training-bundle")
+ bundle_rec.add_argument("--archive-name", default="recognizer-training-bundle.tar.gz")
+ bundle_rec.add_argument("--base-dir", default=".")
+ bundle_rec.add_argument("--failure-review", help="recognizer-failure-review.json used to reject stopped model families before bundling")
+ bundle_rec.add_argument("--require-corpus-audit", action="store_true", help="fail unless train/eval manifests pass recognizer corpus coverage checks")
+ bundle_rec.add_argument("--min-train-samples", type=int, default=1000)
+ bundle_rec.add_argument("--min-eval-samples", type=int, default=100)
+ bundle_rec.add_argument("--min-train-english", type=int, default=200)
+ bundle_rec.add_argument("--min-train-devanagari", type=int, default=200)
+ bundle_rec.add_argument("--min-train-mixed", type=int, default=25)
+ bundle_rec.add_argument("--min-eval-english", type=int, default=50)
+ bundle_rec.add_argument("--min-eval-devanagari", type=int, default=50)
+ bundle_rec.add_argument("--min-eval-mixed", type=int, default=10)
+ bundle_rec.add_argument("--min-train-latin-only", type=int, default=50)
+ bundle_rec.add_argument("--min-train-devanagari-only", type=int, default=50)
+ bundle_rec.add_argument("--min-eval-latin-only", type=int, default=10)
+ bundle_rec.add_argument("--min-eval-devanagari-only", type=int, default=10)
+ bundle_rec.add_argument("--min-train-real", type=int, default=100)
+ bundle_rec.add_argument("--min-train-synthetic", type=int, default=100)
+ bundle_rec.set_defaults(func=cmd_bundle_recognizer_training)
+
+ package_hf = subparsers.add_parser("package-hf-recognizer", help="package a Hugging Face OCR model directory into a candidate model card")
+ package_hf.add_argument("--model-dir", required=True)
+ package_hf.add_argument("--out", default="runs/hf-recognizer/package")
+ package_hf.add_argument("--model-id", required=True)
+ package_hf.add_argument("--base-model", required=True)
+ package_hf.add_argument("--train-manifest")
+ package_hf.add_argument("--eval-manifest")
+ package_hf.add_argument("--training-summary")
+ package_hf.add_argument("--metrics-report")
+ package_hf.add_argument("--admission-validation-report")
+ package_hf.add_argument("--max-new-tokens", type=int, default=128)
+ package_hf.set_defaults(func=cmd_package_hf_recognizer)
+
+ finalize_hf = subparsers.add_parser("finalize-hf-recognizer-run", help="package and audit a completed Hugging Face recognizer training run")
+ finalize_hf.add_argument("--run-dir", required=True)
+ finalize_hf.add_argument("--out")
+ finalize_hf.add_argument("--model-id", required=True)
+ finalize_hf.add_argument("--base-model", required=True)
+ finalize_hf.add_argument("--train-manifest")
+ finalize_hf.add_argument("--eval-manifest")
+ finalize_hf.add_argument("--training-summary")
+ finalize_hf.add_argument("--admission-validation-report")
+ finalize_hf.add_argument("--max-new-tokens", type=int, default=128)
+ finalize_hf.set_defaults(func=cmd_finalize_hf_recognizer_run)
+
+ package_hf_corrector = subparsers.add_parser("package-hf-corrector", help="package a Hugging Face text corrector into a composite OCR candidate model card")
+ package_hf_corrector.add_argument("--model-dir", required=True)
+ package_hf_corrector.add_argument("--out", default="runs/hf-corrector/package")
+ package_hf_corrector.add_argument("--model-id", required=True)
+ package_hf_corrector.add_argument("--base-model", required=True)
+ package_hf_corrector.add_argument("--base-engine", default="tesseract")
+ package_hf_corrector.add_argument("--base-engine-kwarg", action="append", default=[], help="base OCR engine kwarg as key=value; repeatable")
+ package_hf_corrector.add_argument("--train-manifest")
+ package_hf_corrector.add_argument("--eval-manifest")
+ package_hf_corrector.add_argument("--metrics-report")
+ package_hf_corrector.add_argument("--max-new-tokens", type=int, default=256)
+ package_hf_corrector.set_defaults(func=cmd_package_hf_corrector)
+
+ pair_mining = subparsers.add_parser("generate-correction-pairs", help="run an OCR engine on a manifest and write noisy-clean correction pairs")
+ pair_mining.add_argument("--manifest", required=True)
+ pair_mining.add_argument("--out", required=True)
+ pair_mining.add_argument("--engine", default="tesseract", choices=["tesseract", "paddleocr", "surya", "candidate", "ours", "sidecar"])
+ pair_mining.add_argument("--model-config")
+ pair_mining.add_argument("--limit", type=int)
+ pair_mining.add_argument("--only-errors", action="store_true")
+ pair_mining.set_defaults(func=cmd_generate_correction_pairs)
+
+ train_corr = subparsers.add_parser("train-corrector", help="write an OCR correction training recipe")
+ train_corr.add_argument("--out", default="runs/corrector")
+ train_corr.add_argument("--clean-manifest", help="clean OCR manifest used to synthesize noisy pairs")
+ train_corr.add_argument("--pairs-source", help="JSONL with noisy_text and clean_text fields")
+ train_corr.add_argument("--hf-dataset", help="verified HF correction dataset id, for example cfilt/RoundTripOCR-nepali")
+ train_corr.add_argument("--hf-split", default="train")
+ train_corr.add_argument("--limit", type=int)
+ train_corr.add_argument("--seed", type=int, default=13)
+ train_corr.add_argument("--backend", choices=["recipe", "hf-seq2seq"], default="recipe")
+ train_corr.add_argument("--base-model", default="google/byt5-small")
+ train_corr.add_argument("--eval-ratio", type=float, default=0.1)
+ train_corr.add_argument("--max-source-length", type=int, default=256)
+ train_corr.add_argument("--max-target-length", type=int, default=256)
+ train_corr.add_argument("--train-batch-size", type=int, default=16)
+ train_corr.add_argument("--eval-batch-size", type=int, default=16)
+ train_corr.add_argument("--learning-rate", type=float, default=5e-5)
+ train_corr.add_argument("--epochs", type=float, default=3.0)
+ train_corr.add_argument("--run", action="store_true")
+ train_corr.set_defaults(func=cmd_train_corrector)
+
+ model_card = subparsers.add_parser("create-model-card", help="write a candidate model artifact card")
+ model_card.add_argument("--out", required=True)
+ model_card.add_argument("--model-id", required=True)
+ model_card.add_argument("--backend", choices=["paddleocr", "sidecar", "tesseract", "surya", "hf_vision_encoder_decoder", "text_correction_composite", "quality_select_composite", "quality_ranked_ensemble", "script_select_composite", "line_align_composite", "table_cell_refine_composite", "figure_caption_refine_composite"], default="paddleocr")
+ model_card.add_argument("--base-model", default=PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED)
+ model_card.add_argument("--artifact", action="append", default=[], help="required model artifact path; repeatable")
+ model_card.add_argument("--backend-kwarg", action="append", default=[], help="backend kwarg as key=value; repeatable")
+ model_card.add_argument("--paddleocr-kwarg", action="append", default=[], help="deprecated alias for --backend-kwarg; repeatable")
+ model_card.add_argument("--train-manifest")
+ model_card.add_argument("--eval-manifest")
+ model_card.add_argument("--metrics-report")
+ model_card.add_argument("--admission-validation-report")
+ model_card.add_argument("--fallback-model-card", help="fallback component model-card path to record in provenance")
+ model_card.add_argument("--notes")
+ model_card.set_defaults(func=cmd_create_model_card)
+
+ model_audit = subparsers.add_parser("audit-model", help="audit a candidate model card and artifacts")
+ model_audit.add_argument("model_config")
+ model_audit.add_argument("--out", default="outputs/model-audit")
+ model_audit.set_defaults(func=cmd_audit_model)
+
+ parse = subparsers.add_parser("parse-doc", help="convert image/PDF/text sidecar to Markdown, JSON, tables, and figures")
+ parse.add_argument("input")
+ parse.add_argument("--out", default="outputs/document")
+ parse.add_argument("--engine", default="auto", choices=["auto", "sidecar", "tesseract", "paddleocr", "surya", "candidate", "ours"])
+ parse.add_argument("--model-config", help="candidate model card path when --engine candidate/ours")
+ parse.add_argument("--fallback-engine", choices=["sidecar", "tesseract", "paddleocr", "surya"])
+ parse.add_argument("--fallback-model-config", help="candidate model card path to use as a selective fallback engine")
+ parse.add_argument("--low-confidence-threshold", type=float, default=0.80)
+ parse.add_argument("--fallback-min-quality-score", type=float, help="trigger configured fallback when primary document quality score is below this value")
+ parse.set_defaults(func=cmd_parse_doc)
+
+ benchmark = subparsers.add_parser("benchmark", help="compare OCR baselines on the same files")
+ benchmark.add_argument("inputs", nargs="*")
+ benchmark.add_argument("--inputs-from-manifest", help="load benchmark input paths from a manifest image_path field")
+ benchmark.add_argument("--out", default="outputs/benchmark")
+ benchmark.add_argument("--baselines", default="ours,tesseract,stock-paddle,glm-ocr,paddleocr-vl")
+ benchmark.add_argument("--references-dir")
+ benchmark.add_argument("--eval-manifest")
+ benchmark.add_argument("--candidate-model-config")
+ benchmark.add_argument("--fallback-engine", choices=["sidecar", "tesseract", "paddleocr", "surya"])
+ benchmark.add_argument("--fallback-model-config", help="candidate model card path to use as a selective fallback engine")
+ benchmark.add_argument("--low-confidence-threshold", type=float, default=0.80)
+ benchmark.add_argument("--fallback-min-quality-score", type=float, help="trigger configured candidate fallback when primary document quality score is below this value")
+ benchmark.add_argument("--resume-existing", action="store_true", help="score existing document.json outputs and run only missing pages")
+ benchmark.add_argument("--sample-timeout-seconds", type=int, help="mark one page as error if a baseline exceeds this runtime")
+ benchmark.add_argument("--capture-gpu-metrics", action="store_true", help="sample nvidia-smi before and after each benchmark row when available")
+ benchmark.set_defaults(func=cmd_benchmark)
+
+ summarize = subparsers.add_parser("summarize-benchmark", help="summarize aggregate and paired benchmark metrics from report.json")
+ summarize.add_argument("--benchmark-report", required=True)
+ summarize.add_argument("--out", default="outputs/benchmark-summary")
+ summarize.add_argument("--candidate", default="candidate")
+ summarize.add_argument("--baseline", action="append", default=[], help="baseline to compare against candidate; repeatable")
+ summarize.add_argument("--metric", action="append", default=[], help="metric to summarize in paired comparisons; repeatable")
+ summarize.set_defaults(func=cmd_summarize_benchmark)
+
+ rescore = subparsers.add_parser("rescore-benchmark", help="recompute benchmark metrics from existing document.json outputs")
+ rescore.add_argument("--benchmark-report", required=True)
+ rescore.add_argument("--out", default="outputs/benchmark-rescored")
+ rescore.add_argument("--references-dir")
+ rescore.add_argument("--eval-manifest")
+ rescore.set_defaults(func=cmd_rescore_benchmark)
+
+ derive_table = subparsers.add_parser(
+ "derive-table-postprocess-benchmark",
+ help="derive a table-postprocessed candidate from an existing baseline document output",
+ )
+ derive_table.add_argument("--benchmark-report", required=True)
+ derive_table.add_argument("--out", default="outputs/benchmark-table-postprocess-derived")
+ derive_table.add_argument("--source-baseline", required=True)
+ derive_table.add_argument("--candidate-baseline", default="candidate")
+ derive_table.add_argument("--references-dir")
+ derive_table.add_argument("--eval-manifest")
+ derive_table.set_defaults(func=cmd_derive_table_postprocess_benchmark)
+
+ table_cells = subparsers.add_parser("analyze-table-cells", help="analyze cell-level table OCR errors from benchmark document outputs")
+ table_cells.add_argument("--benchmark-report", required=True)
+ table_cells.add_argument("--eval-manifest", required=True)
+ table_cells.add_argument("--out", default="outputs/table-cell-analysis")
+ table_cells.add_argument("--candidate", default="candidate")
+ table_cells.add_argument("--baseline", action="append", default=[], help="baseline to compare against candidate; repeatable")
+ table_cells.add_argument("--top-n", type=int, default=25)
+ table_cells.set_defaults(func=cmd_analyze_table_cells)
+
+ paper_table = subparsers.add_parser("paper-benchmark-table", help="merge benchmark summary artifacts into a paper-ready comparison table")
+ paper_table.add_argument("--summary", action="append", default=[], required=True, help="path to summarize-benchmark summary.json; repeatable")
+ paper_table.add_argument("--out", default="outputs/paper-table")
+ paper_table.add_argument("--slice", default="all")
+ paper_table.add_argument("--metric", action="append", default=[], help="aggregate metric column to include; repeatable")
+ paper_table.add_argument("--system", action="append", default=[], help="system row to include and order explicitly; repeatable")
+ paper_table.add_argument("--label", action="append", default=[], help="display label override as system=Label; repeatable")
+ paper_table.add_argument("--source-preference", action="append", default=[], help="pin a system to one summary artifact as system=path; repeatable")
+ paper_table.add_argument("--title", help="optional table title")
+ paper_table.set_defaults(func=cmd_paper_benchmark_table)
+
+ oracle = subparsers.add_parser("benchmark-oracle", help="compute per-sample oracle headroom from a benchmark report")
+ oracle.add_argument("--benchmark-report", required=True)
+ oracle.add_argument("--out", default="outputs/benchmark-oracle")
+ oracle.add_argument("--metric", default="cer")
+ oracle.add_argument("--direction", choices=["lower", "higher"])
+ oracle.add_argument("--system", action="append", default=[], help="system to include in oracle selection; repeatable")
+ oracle.add_argument("--oracle-name", default="oracle")
+ oracle.set_defaults(func=cmd_benchmark_oracle)
+
+ error_analysis = subparsers.add_parser("benchmark-error-analysis", help="rank hard samples and slice gaps from a benchmark report")
+ error_analysis.add_argument("--benchmark-report", required=True)
+ error_analysis.add_argument("--out", default="outputs/benchmark-error-analysis")
+ error_analysis.add_argument("--system", required=True)
+ error_analysis.add_argument("--baseline", action="append", default=[], help="baseline to compare against system; repeatable")
+ error_analysis.add_argument("--metric", default="cer")
+ error_analysis.add_argument("--direction", choices=["lower", "higher"])
+ error_analysis.add_argument("--top-n", type=int, default=20)
+ error_analysis.set_defaults(func=cmd_benchmark_error_analysis)
+
+ failure_manifest = subparsers.add_parser("export-failure-manifest", help="write a manifest from ranked benchmark failure rows")
+ failure_manifest.add_argument("--source-manifest", required=True)
+ failure_manifest.add_argument("--top-failures", required=True)
+ failure_manifest.add_argument("--out", required=True)
+ failure_manifest.add_argument("--split", help="optional split override for selected entries")
+ failure_manifest.set_defaults(func=cmd_export_failure_manifest)
+
+ admission_decision = subparsers.add_parser("recognizer-admission-decision", help="summarize whether a recognizer admission validation report promotes or rejects a model branch")
+ admission_decision.add_argument("--validation-report", required=True)
+ admission_decision.add_argument("--out", default="outputs/recognizer-admission-decision")
+ admission_decision.set_defaults(func=cmd_recognizer_admission_decision)
+
+ failure_review = subparsers.add_parser("recognizer-failure-review", help="aggregate recognizer admission failures across runs and flag exhausted model families")
+ failure_review.add_argument("--admission-decision", action="append", default=[], help="recognizer-admission-decision.json path; repeatable")
+ failure_review.add_argument("--validation-report", action="append", default=[], help="validation.json path to convert into a review input; repeatable")
+ failure_review.add_argument("--model-card", action="append", default=[], help="model-card.json path matched to inputs by order when provenance is unavailable; repeatable")
+ failure_review.add_argument("--min-rejections-to-stop", type=int, default=3)
+ failure_review.add_argument("--out", default="outputs/recognizer-failure-review")
+ failure_review.set_defaults(func=cmd_recognizer_failure_review)
+
+ calibrate = subparsers.add_parser("calibrate-quality-router", help="calibrate a quality-routed composite candidate from a calibration experiment")
+ calibrate.add_argument("--experiment-report", required=True)
+ calibrate.add_argument("--out", default="outputs/quality-router-calibration")
+ calibrate.add_argument("--model-id", required=True)
+ calibrate.add_argument("--base-model", default="tesseract-ocr")
+ calibrate.add_argument("--primary-engine", required=True)
+ calibrate.add_argument("--secondary-engine", required=True)
+ calibrate.add_argument("--primary-engine-kwarg", action="append", default=[], help="primary engine kwarg as key=value; repeatable")
+ calibrate.add_argument("--secondary-engine-kwarg", action="append", default=[], help="secondary engine kwarg as key=value; repeatable")
+ calibrate.add_argument("--candidate-baseline", default="candidate")
+ calibrate.add_argument("--primary-baseline", default="tesseract")
+ calibrate.add_argument("--metric", default="cer")
+ calibrate.add_argument("--direction", choices=["lower", "higher"])
+ calibrate.add_argument("--threshold-start", type=float, default=-0.20)
+ calibrate.add_argument("--threshold-end", type=float, default=0.20)
+ calibrate.add_argument("--threshold-step", type=float, default=0.01)
+ calibrate.add_argument("--notes")
+ calibrate.set_defaults(func=cmd_calibrate_quality_router)
+
+ calibrate_script = subparsers.add_parser("calibrate-script-router", help="calibrate a script-routed composite candidate from a calibration experiment")
+ calibrate_script.add_argument("--experiment-report", required=True)
+ calibrate_script.add_argument("--out", default="outputs/script-router-calibration")
+ calibrate_script.add_argument("--model-id", required=True)
+ calibrate_script.add_argument("--base-model", default="tesseract+surya")
+ calibrate_script.add_argument("--primary-engine", required=True)
+ calibrate_script.add_argument("--secondary-engine", required=True)
+ calibrate_script.add_argument("--primary-engine-kwarg", action="append", default=[], help="primary engine kwarg as key=value; repeatable")
+ calibrate_script.add_argument("--secondary-engine-kwarg", action="append", default=[], help="secondary engine kwarg as key=value; repeatable")
+ calibrate_script.add_argument("--primary-baseline", default="tesseract")
+ calibrate_script.add_argument("--secondary-baseline", default="surya")
+ calibrate_script.add_argument("--metric", default="cer")
+ calibrate_script.add_argument("--direction", choices=["lower", "higher"])
+ calibrate_script.add_argument("--script", default="devanagari")
+ calibrate_script.add_argument("--threshold-start", type=float, default=0.0)
+ calibrate_script.add_argument("--threshold-end", type=float, default=0.6)
+ calibrate_script.add_argument("--threshold-step", type=float, default=0.05)
+ calibrate_script.add_argument("--routing-granularity", choices=["document", "page"], default="document")
+ calibrate_script.add_argument("--secondary-structure-backfill", action="store_true")
+ calibrate_script.add_argument("--notes")
+ calibrate_script.set_defaults(func=cmd_calibrate_script_router)
+
+ calibrate_ensemble = subparsers.add_parser("calibrate-tesseract-psm-ensemble", help="calibrate a quality-ranked Tesseract PSM ensemble from separate variant experiments")
+ calibrate_ensemble.add_argument("--primary-experiment-report", required=True)
+ calibrate_ensemble.add_argument("--variant-experiment", action="append", default=[], help="variant label and experiment report as label=path; repeatable")
+ calibrate_ensemble.add_argument("--out", default="outputs/tesseract-psm-ensemble-calibration")
+ calibrate_ensemble.add_argument("--model-id", required=True)
+ calibrate_ensemble.add_argument("--metric", default="cer")
+ calibrate_ensemble.add_argument("--direction", choices=["lower", "higher"])
+ calibrate_ensemble.add_argument("--bias-start", type=float, default=-0.12)
+ calibrate_ensemble.add_argument("--bias-end", type=float, default=0.12)
+ calibrate_ensemble.add_argument("--bias-step", type=float, default=0.02)
+ calibrate_ensemble.add_argument("--language", default="nep+eng")
+ calibrate_ensemble.add_argument("--selection-margin", type=float, default=0.0)
+ calibrate_ensemble.add_argument("--notes")
+ calibrate_ensemble.set_defaults(func=cmd_calibrate_tesseract_psm_ensemble)
+
+ experiment = subparsers.add_parser("run-experiment", help="run benchmark and validation from an eval manifest")
+ experiment.add_argument("--eval-manifest", required=True)
+ experiment.add_argument("--out", default="outputs/experiment")
+ experiment.add_argument("--baselines", default="ours,tesseract,stock-paddle,glm-ocr,paddleocr-vl")
+ experiment.add_argument("--references-dir")
+ experiment.add_argument("--validation-config")
+ experiment.add_argument("--candidate-model-config")
+ experiment.add_argument("--fallback-engine", choices=["sidecar", "tesseract", "paddleocr", "surya"])
+ experiment.add_argument("--fallback-model-config", help="candidate model card path to use as a selective fallback engine")
+ experiment.add_argument("--low-confidence-threshold", type=float, default=0.80)
+ experiment.add_argument("--fallback-min-quality-score", type=float, help="trigger configured candidate fallback when primary document quality score is below this value")
+ experiment.add_argument("--train-manifest", action="append", default=[])
+ experiment.add_argument("--skip-validation", action="store_true")
+ experiment.add_argument("--require-validated", action="store_true")
+ experiment.add_argument("--preflight", action="store_true", help="run claim preflight before benchmark and stop on failure")
+ experiment.add_argument("--allow-smoke-eval-pack", action="store_true", help="allow smoke eval packs during run-experiment preflight")
+ experiment.add_argument("--require-trained-recognizer", action="store_true", help="require trained recognizer provenance during run-experiment preflight")
+ experiment.add_argument("--require-model-admission", action="store_true", help="require passing recognizer admission during run-experiment preflight")
+ experiment.set_defaults(func=cmd_run_experiment)
+
+ preflight = subparsers.add_parser("preflight-claim", help="fail early if claim benchmark inputs, models, references, or engines are not ready")
+ preflight.add_argument("--eval-manifest", required=True)
+ preflight.add_argument("--out", default="outputs/preflight")
+ preflight.add_argument("--baselines", default="candidate,tesseract,stock-paddle,glm-ocr,paddleocr-vl")
+ preflight.add_argument("--references-dir")
+ preflight.add_argument("--candidate-model-config")
+ preflight.add_argument("--fallback-model-config", help="fallback model card path to audit before claim benchmark runs")
+ preflight.add_argument("--validation-config")
+ preflight.add_argument("--train-manifest", action="append", default=[])
+ preflight.add_argument("--allow-smoke-eval-pack", action="store_true")
+ preflight.add_argument("--require-trained-recognizer", action="store_true")
+ preflight.add_argument("--require-model-admission", action="store_true")
+ preflight.set_defaults(func=cmd_preflight_claim)
+
+ public_list = subparsers.add_parser("list-public-benchmarks", help="list known public benchmark registry entries")
+ public_list.set_defaults(func=cmd_list_public_benchmarks)
+
+ public_prepare = subparsers.add_parser("prepare-public-benchmark", help="convert a verified public benchmark into an auditable manifest")
+ public_prepare.add_argument("benchmark", choices=["opendatalab/OmniDocBench"])
+ public_prepare.add_argument("--out", required=True)
+ public_prepare.add_argument("--limit", type=int)
+ public_prepare.add_argument("--language")
+ public_prepare.add_argument("--subset")
+ public_prepare.add_argument("--data-source")
+ public_prepare.add_argument("--require-tables", action="store_true")
+ public_prepare.add_argument("--annotation-path", help="local OmniDocBench.json path for offline/schema-fixture conversion")
+ public_prepare.add_argument("--local-image-root", help="local dataset root containing images/ for offline conversion")
+ public_prepare.set_defaults(func=cmd_prepare_public_benchmark)
+
+ public_audit = subparsers.add_parser("audit-public-benchmark", help="audit a public benchmark manifest for claim readiness")
+ public_audit.add_argument("manifest")
+ public_audit.add_argument("--out", default="outputs/public-benchmark-audit")
+ public_audit.add_argument("--benchmark", help="override benchmark name when manifest metadata is ambiguous")
+ public_audit.add_argument("--min-samples", type=int)
+ public_audit.add_argument("--allow-missing-reference-paths", action="store_true")
+ public_audit.set_defaults(func=cmd_audit_public_benchmark)
+
+ gorkhapatra_audit = subparsers.add_parser("audit-gorkhapatra-source", help="audit Gorkhapatra/Naya Nepal article images and epaper PDFs")
+ gorkhapatra_audit.add_argument("--out", default="outputs/gorkhapatra-source-audit")
+ gorkhapatra_audit.add_argument("--category-url", action="append", default=[], help="Naya Nepal category URL; repeatable")
+ gorkhapatra_audit.add_argument("--epaper-url", action="append", default=[], help="Gorkhapatra epaper list URL; repeatable")
+ gorkhapatra_audit.add_argument("--category-html", action="append", default=[], help="local category HTML fixture/path; repeatable")
+ gorkhapatra_audit.add_argument("--epaper-html", action="append", default=[], help="local epaper list HTML fixture/path; repeatable")
+ gorkhapatra_audit.add_argument("--no-default-urls", action="store_true", help="only use explicitly supplied URLs/HTML files")
+ gorkhapatra_audit.add_argument("--download-assets", action="store_true", help="download and hash discovered article images/PDFs")
+ gorkhapatra_audit.add_argument("--max-article-images", type=int, default=0, help="max article images to download; 0 means no limit")
+ gorkhapatra_audit.add_argument("--max-epaper-pdfs", type=int, default=0, help="max epaper PDFs to download; 0 means no limit")
+ gorkhapatra_audit.add_argument("--timeout-seconds", type=float, default=30.0)
+ gorkhapatra_audit.set_defaults(func=cmd_audit_gorkhapatra_source)
+
+ gorkhapatra_pack = subparsers.add_parser("prepare-gorkhapatra-pack", help="turn a Gorkhapatra source audit into a pending-reference validation manifest")
+ gorkhapatra_pack.add_argument("source_audit_json")
+ gorkhapatra_pack.add_argument("--out", default="data/gorkhapatra-pack")
+ gorkhapatra_pack.add_argument("--no-article-images", action="store_true")
+ gorkhapatra_pack.add_argument("--no-epaper-pages", action="store_true")
+ gorkhapatra_pack.add_argument("--max-article-images", type=int, default=0)
+ gorkhapatra_pack.add_argument("--max-epaper-pdfs", type=int, default=0)
+ gorkhapatra_pack.add_argument("--max-pages-per-pdf", type=int, default=2)
+ gorkhapatra_pack.add_argument("--split", default="eval")
+ gorkhapatra_pack.add_argument("--dataset-name", default="gorkhapatra-naya-nepal")
+ gorkhapatra_pack.set_defaults(func=cmd_prepare_gorkhapatra_pack)
+
+ language_pages = subparsers.add_parser("audit-gorkhapatra-language-pages", help="align Naya Nepal publication cards to same-date Gorkhapatra PDF language pages")
+ language_pages.add_argument("--out", default="outputs/gorkhapatra-language-pages")
+ language_pages.add_argument("--publication-url", action="append", default=[])
+ language_pages.add_argument("--epaper-url", action="append", default=[])
+ language_pages.add_argument("--publication-html", action="append", default=[])
+ language_pages.add_argument("--epaper-html", action="append", default=[])
+ language_pages.add_argument("--no-default-urls", action="store_true")
+ language_pages.add_argument("--download-pdfs", action="store_true")
+ language_pages.add_argument("--render-pages", action="store_true")
+ language_pages.add_argument("--max-publication-items", type=int, default=0)
+ language_pages.add_argument("--max-epaper-pdfs", type=int, default=0)
+ language_pages.add_argument("--timeout-seconds", type=float, default=30.0)
+ language_pages.set_defaults(func=cmd_audit_gorkhapatra_language_pages)
+
+ language_page_pack = subparsers.add_parser("prepare-gorkhapatra-language-page-pack", help="turn language-page alignment hits into a pending-reference manifest")
+ language_page_pack.add_argument("language_page_audit_json")
+ language_page_pack.add_argument("--out", default="data/gorkhapatra-language-page-pack")
+ language_page_pack.add_argument("--split", default="eval")
+ language_page_pack.add_argument("--dataset-name", default="gorkhapatra-language-pages")
+ language_page_pack.add_argument("--max-samples", type=int, default=0)
+ language_page_pack.set_defaults(func=cmd_prepare_gorkhapatra_language_page_pack)
+
+ language_page_review = subparsers.add_parser("prepare-gorkhapatra-language-page-review", help="write a manual review sheet for language-page candidates")
+ language_page_review.add_argument("language_page_pack_manifest")
+ language_page_review.add_argument("--out", default="data/gorkhapatra-language-page-review")
+ language_page_review.set_defaults(func=cmd_prepare_gorkhapatra_language_page_review)
+
+ language_registry = subparsers.add_parser("audit-language-registry", help="audit a multilingual OCR language registry")
+ language_registry.add_argument("registry")
+ language_registry.add_argument("--out", default="outputs/language-registry-audit")
+ language_registry.add_argument("--min-nepal-languages", type=int, default=10)
+ language_registry.add_argument("--allow-non-limbu-first", action="store_true")
+ language_registry.add_argument("--no-verify-local-paths", action="store_true")
+ language_registry.set_defaults(func=cmd_audit_language_registry)
+
+ font_audit = subparsers.add_parser("audit-font-renderability", help="audit registry font coverage and optional rendered samples")
+ font_audit.add_argument("registry")
+ font_audit.add_argument("--out", default="outputs/font-renderability-audit")
+ font_audit.add_argument("--all-scripts", action="store_true", help="audit secondary/future scripts in addition to primary scripts")
+ font_audit.add_argument("--min-coverage-ratio", type=float, default=0.95)
+ font_audit.add_argument("--render-samples", action="store_true", help="write sample PNGs when Pillow is installed")
+ font_audit.set_defaults(func=cmd_audit_font_renderability)
+
+ remote = subparsers.add_parser("audit-remote-host", help="audit a remote host for training and benchmark readiness")
+ remote.add_argument("--host", required=True)
+ remote.add_argument("--user")
+ remote.add_argument("--port", type=int, default=22)
+ remote.add_argument("--password-env")
+ remote.add_argument("--min-python", default="3.11")
+ remote.add_argument("--min-free-gb", type=float, default=20.0)
+ remote.add_argument("--workdir")
+ remote.add_argument("--require-gpu", action="store_true")
+ remote.add_argument("--require-paddle-training", action="store_true", help="fail if the host is not a valid official Paddle training target")
+ remote.add_argument("--python-candidate", action="append", default=[])
+ remote.add_argument("--require-command", action="append", default=[])
+ remote.add_argument("--optional-command", action="append", default=[])
+ remote.add_argument("--require-path", action="append", default=[])
+ remote.add_argument("--out", default="outputs/remote-audit")
+ remote.set_defaults(func=cmd_audit_remote_host)
+
+ bootstrap = subparsers.add_parser("bootstrap-remote-host", help="provision remote workdir and Python virtualenv for training")
+ bootstrap.add_argument("--host", required=True)
+ bootstrap.add_argument("--user")
+ bootstrap.add_argument("--port", type=int, default=22)
+ bootstrap.add_argument("--password-env")
+ bootstrap.add_argument("--workdir", required=True)
+ bootstrap.add_argument("--min-python", default="3.11")
+ bootstrap.add_argument("--python-candidate", action="append", default=[])
+ bootstrap.add_argument("--venv-name", default=".venv")
+ bootstrap.add_argument("--recreate-venv", action="store_true")
+ bootstrap.add_argument("--out", default="outputs/remote-bootstrap")
+ bootstrap.set_defaults(func=cmd_bootstrap_remote_host)
+
+ sync_remote = subparsers.add_parser("sync-remote-workspace", help="copy the current workspace to a remote host workdir")
+ sync_remote.add_argument("--host", required=True)
+ sync_remote.add_argument("--user")
+ sync_remote.add_argument("--port", type=int, default=22)
+ sync_remote.add_argument("--password-env")
+ sync_remote.add_argument("--local-root", default=".")
+ sync_remote.add_argument("--remote-workdir", required=True)
+ sync_remote.add_argument("--exclude", action="append", default=[])
+ sync_remote.add_argument("--out", default="outputs/remote-sync")
+ sync_remote.set_defaults(func=cmd_sync_remote_workspace)
+
+ review = subparsers.add_parser("review-claim", help="audit a full SOTA claim bundle across multiple experiment reports")
+ review.add_argument("--experiment", action="append", required=True, help="experiment.json path; repeatable")
+ review.add_argument("--config")
+ review.add_argument("--model-config")
+ review.add_argument("--out", default="outputs/claim-review")
+ review.set_defaults(func=cmd_review_claim)
+
+ validate = subparsers.add_parser("validate-claim", help="validate whether benchmark evidence supports a SOTA claim")
+ validate.add_argument("--benchmark-report", required=True, help="benchmark report.json path")
+ validate.add_argument("--out", default="outputs/validation", help="validation report directory")
+ validate.add_argument("--config", help="validation gates JSON")
+ validate.add_argument("--eval-manifest", help="held-out evaluation manifest")
+ validate.add_argument("--train-manifest", action="append", default=[], help="training manifest to check for leakage; repeatable")
+ validate.add_argument("--candidate-model-config", help="candidate model card path to record in validation provenance")
+ validate.add_argument("--fallback-model-config", help="fallback model card path to record in validation provenance")
+ validate.set_defaults(func=cmd_validate_claim)
+ return parser
+
+
+def cmd_prepare_data(args: argparse.Namespace) -> int:
+ if args.hf:
+ path = prepare_hf_dataset(
+ args.source,
+ args.out,
+ dataset=args.dataset_name,
+ split=args.split,
+ image_field=args.image_field,
+ text_field=args.text_field,
+ hf_subset=args.hf_subset,
+ limit=args.limit,
+ skip_invalid=args.skip_invalid,
+ strict_chars=args.strict_chars,
+ slices=args.slice,
+ )
+ else:
+ path = prepare_local_dataset(
+ args.source,
+ args.out,
+ dataset=args.dataset_name,
+ split=args.split,
+ image_field=args.image_field,
+ text_field=args.text_field,
+ limit=args.limit,
+ skip_invalid=args.skip_invalid,
+ strict_chars=args.strict_chars,
+ slices=args.slice,
+ )
+ print(path.manifest_path)
+ print(path.summary_json_path)
+ print(path.summary_md_path)
+ if path.rejects_path:
+ print(path.rejects_path)
+ print(f"prepared={path.sample_count} rejected={path.rejected_count}")
+ return 0
+
+
+def cmd_inspect_hf_dataset(args: argparse.Namespace) -> int:
+ report = inspect_hf_dataset(
+ args.dataset_id,
+ args.out,
+ split=args.split,
+ hf_subset=args.hf_subset,
+ image_field=args.image_field,
+ text_field=args.text_field,
+ limit=args.limit,
+ )
+ print(report.output_json_path)
+ print(report.output_md_path)
+ print(f"passed={report.passed} inspected={report.inspected_count}")
+ return 0 if report.passed else 1
+
+
+def cmd_audit_manifest(args: argparse.Namespace) -> int:
+ audit = audit_manifest(
+ args.manifest,
+ args.out,
+ verify_hashes=not args.no_verify_hashes,
+ require_slices=args.require_slice,
+ strict_chars=args.strict_chars,
+ )
+ print(Path(args.out) / "manifest-audit.json")
+ print(Path(args.out) / "manifest-audit.md")
+ print(f"passed={audit.passed} samples={audit.sample_count}")
+ return 0 if audit.passed else 1
+
+
+def cmd_split_manifest(args: argparse.Namespace) -> int:
+ summary = split_manifest(
+ args.manifest,
+ args.out,
+ eval_ratio=args.eval_ratio,
+ seed=args.seed,
+ stratify_by=args.stratify_by,
+ group_by=args.group_by,
+ )
+ print(summary.train_manifest)
+ print(summary.eval_manifest)
+ print(f"train={summary.train_count} eval={summary.eval_count} leakage_passed={summary.leakage_passed}")
+ return 0
+
+
+def cmd_rebalance_manifest(args: argparse.Namespace) -> int:
+ summary = rebalance_manifest(args.manifest, args.out, slices=args.slice, target_count=args.target_count, seed=args.seed)
+ out_path = Path(args.out)
+ print(summary.output_manifest)
+ print(out_path.with_name(f"{out_path.stem}-rebalance.json"))
+ print(out_path.with_name(f"{out_path.stem}-rebalance.md"))
+ print(f"original={summary.original_count} rebalanced={summary.rebalanced_count} target={summary.target_count}")
+ return 0
+
+
+def cmd_audit_recognizer_corpus(args: argparse.Namespace) -> int:
+ audit = audit_recognizer_corpus(
+ args.train_manifest,
+ args.eval_manifest,
+ args.out,
+ min_train_samples=args.min_train_samples,
+ min_eval_samples=args.min_eval_samples,
+ min_train_english=args.min_train_english,
+ min_train_devanagari=args.min_train_devanagari,
+ min_train_mixed=args.min_train_mixed,
+ min_eval_english=args.min_eval_english,
+ min_eval_devanagari=args.min_eval_devanagari,
+ min_eval_mixed=args.min_eval_mixed,
+ min_train_latin_only=args.min_train_latin_only,
+ min_train_devanagari_only=args.min_train_devanagari_only,
+ min_eval_latin_only=args.min_eval_latin_only,
+ min_eval_devanagari_only=args.min_eval_devanagari_only,
+ min_train_real=args.min_train_real,
+ min_train_synthetic=args.min_train_synthetic,
+ )
+ print(Path(args.out) / "recognizer-corpus-audit.json")
+ print(Path(args.out) / "recognizer-corpus-audit.md")
+ print(f"passed={audit.passed} train={audit.train_profile.sample_count} eval={audit.eval_profile.sample_count}")
+ return 0 if audit.passed else 1
+
+
+def cmd_build_recognizer_corpus(args: argparse.Namespace) -> int:
+ summary = build_recognizer_corpus(
+ args.manifests,
+ args.out,
+ target_latin_only=args.target_latin_only,
+ target_devanagari_only=args.target_devanagari_only,
+ target_mixed=args.target_mixed,
+ target_real=args.target_real,
+ target_synthetic=args.target_synthetic,
+ seed=args.seed,
+ )
+ out_path = Path(args.out)
+ print(summary.output_manifest)
+ print(out_path.with_name(f"{out_path.stem}-recognizer-corpus-build.json"))
+ print(out_path.with_name(f"{out_path.stem}-recognizer-corpus-build.md"))
+ print(f"source={summary.source_count} output={summary.output_count}")
+ return 0
+
+
+def cmd_merge_manifests(args: argparse.Namespace) -> int:
+ summary = merge_manifests(args.manifests, args.out)
+ out_path = Path(args.out)
+ print(summary.output_manifest)
+ print(out_path.with_name(f"{out_path.stem}-merge.json"))
+ print(out_path.with_name(f"{out_path.stem}-merge.md"))
+ print(f"samples={summary.sample_count} inputs={len(summary.input_manifests)} warnings={len(summary.warnings)}")
+ return 0
+
+
+def cmd_filter_manifest(args: argparse.Namespace) -> int:
+ summary = filter_manifest(
+ args.manifest,
+ args.out,
+ sample_ids=args.sample_id,
+ slices=args.slice,
+ document_types=args.document_type,
+ degradations=args.degradation,
+ limit=args.limit,
+ )
+ out_path = Path(args.out)
+ print(summary.output_manifest)
+ print(out_path.with_name(f"{out_path.stem}-filter.json"))
+ print(out_path.with_name(f"{out_path.stem}-filter.md"))
+ print(f"selected={summary.selected_count} source={summary.source_count}")
+ return 0
+
+
+def cmd_materialize_references(args: argparse.Namespace) -> int:
+ report = materialize_references(args.manifest, args.out, rewritten_manifest_path=args.rewritten_manifest)
+ print(report.references_dir)
+ if report.rewritten_manifest:
+ print(report.rewritten_manifest)
+ print(report.summary_json_path)
+ print(report.summary_md_path)
+ print(f"samples={report.sample_count}")
+ return 0
+
+
+def cmd_normalize_manifest_images(args: argparse.Namespace) -> int:
+ report = normalize_manifest_images(
+ args.manifest,
+ args.out,
+ image_dir_name=args.image_dir_name,
+ output_manifest_name=args.output_manifest_name,
+ )
+ print(report.manifest_path)
+ print(report.summary_json_path)
+ print(report.summary_md_path)
+ print(f"samples={report.sample_count} copied={report.copied_count} converted={report.converted_count}")
+ return 0
+
+
+def cmd_create_eval_pack(args: argparse.Namespace) -> int:
+ summary = create_eval_pack(
+ args.out,
+ count_per_template=args.count_per_template,
+ input_format=args.input_format,
+ degradations=args.degradation,
+ seed=args.seed,
+ font_path=args.font_path,
+ templates=args.template or None,
+ variant_offset=args.variant_offset,
+ )
+ print(summary.manifest_path)
+ print(f"samples={summary.sample_count} claim_ready={summary.claim_ready}")
+ return 0
+
+
+def cmd_audit_eval_pack(args: argparse.Namespace) -> int:
+ audit = audit_eval_pack(args.manifest, args.out)
+ print(Path(args.out) / "eval-pack-audit.json")
+ print(Path(args.out) / "eval-pack-audit.md")
+ print(f"passed={audit.passed} claim_ready={audit.claim_ready}")
+ if not audit.passed or (args.require_claim_ready and not audit.claim_ready):
+ return 1
+ return 0
+
+
+def cmd_extract_crops(args: argparse.Namespace) -> int:
+ summary = extract_crop_manifest(
+ args.manifest,
+ args.out,
+ crop_types=args.crop_type or None,
+ split=args.split,
+ dataset_name=args.dataset_name,
+ min_text_length=args.min_text_length,
+ )
+ print(summary.manifest_path)
+ print(Path(args.out) / "crop-manifest-summary.json")
+ print(Path(args.out) / "crop-manifest-summary.md")
+ print(f"crops={summary.crop_count} skipped={summary.skipped_count}")
+ return 0
+
+
+def cmd_train_recognizer(args: argparse.Namespace) -> int:
+ if args.backend == "hf-vision-encoder-decoder":
+ if args.failure_review:
+ assert_recognizer_family_not_stopped(args.failure_review, backend="hf_vision_encoder_decoder", base_model=args.base_model)
+ path = write_hf_recognizer_recipe(
+ args.train_manifest,
+ args.eval_manifest,
+ args.out,
+ base_model=args.base_model,
+ max_target_length=args.max_target_length,
+ per_device_train_batch_size=args.train_batch_size,
+ per_device_eval_batch_size=args.eval_batch_size,
+ learning_rate=args.learning_rate,
+ num_train_epochs=args.epochs,
+ run=args.run,
+ )
+ else:
+ path = write_recognizer_recipe(
+ args.train_manifest,
+ args.eval_manifest,
+ args.out,
+ base_model=args.base_model,
+ dictionary_path=args.dictionary,
+ train_batch_size=args.train_batch_size,
+ eval_batch_size=args.eval_batch_size,
+ learning_rate=args.learning_rate,
+ epochs=args.epochs,
+ failure_review=args.failure_review,
+ run=args.run,
+ )
+ print(path)
+ return 0
+
+
+def cmd_export_recognizer(args: argparse.Namespace) -> int:
+ path = write_recognizer_export_recipe(
+ args.training_config,
+ args.checkpoint,
+ args.out,
+ inference_dir=args.inference_dir,
+ paddleocr_dir=args.paddleocr_dir,
+ run=args.run,
+ )
+ print(path)
+ return 0
+
+
+def cmd_package_recognizer(args: argparse.Namespace) -> int:
+ path = package_paddleocr_model(
+ args.inference_dir,
+ args.out,
+ model_id=args.model_id,
+ dictionary_path=args.dictionary,
+ base_model=args.base_model,
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ training_summary=args.training_summary,
+ metrics_report=args.metrics_report,
+ admission_validation_report=args.admission_validation_report,
+ )
+ print(path)
+ return 0
+
+
+def cmd_bundle_recognizer_training(args: argparse.Namespace) -> int:
+ bundle = bundle_recognizer_training(
+ args.recipe_dir,
+ args.out,
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ archive_name=args.archive_name,
+ base_dir=args.base_dir,
+ require_corpus_audit=args.require_corpus_audit,
+ min_train_samples=args.min_train_samples,
+ min_eval_samples=args.min_eval_samples,
+ min_train_english=args.min_train_english,
+ min_train_devanagari=args.min_train_devanagari,
+ min_train_mixed=args.min_train_mixed,
+ min_eval_english=args.min_eval_english,
+ min_eval_devanagari=args.min_eval_devanagari,
+ min_eval_mixed=args.min_eval_mixed,
+ min_train_latin_only=args.min_train_latin_only,
+ min_train_devanagari_only=args.min_train_devanagari_only,
+ min_eval_latin_only=args.min_eval_latin_only,
+ min_eval_devanagari_only=args.min_eval_devanagari_only,
+ min_train_real=args.min_train_real,
+ min_train_synthetic=args.min_train_synthetic,
+ failure_review=args.failure_review,
+ )
+ print(bundle.archive_path)
+ print(bundle.manifest_path)
+ print(bundle.readme_path)
+ print(f"files={bundle.file_count} bytes={bundle.total_bytes}")
+ return 0
+
+
+def cmd_package_hf_recognizer(args: argparse.Namespace) -> int:
+ path = package_hf_recognizer_model(
+ args.model_dir,
+ args.out,
+ model_id=args.model_id,
+ base_model=args.base_model,
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ training_summary=args.training_summary,
+ metrics_report=args.metrics_report,
+ admission_validation_report=args.admission_validation_report,
+ max_new_tokens=args.max_new_tokens,
+ )
+ print(path)
+ return 0
+
+
+def cmd_finalize_hf_recognizer_run(args: argparse.Namespace) -> int:
+ result = finalize_hf_recognizer_run(
+ args.run_dir,
+ output_dir=args.out,
+ model_id=args.model_id,
+ base_model=args.base_model,
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ training_summary=args.training_summary,
+ admission_validation_report=args.admission_validation_report,
+ max_new_tokens=args.max_new_tokens,
+ )
+ print(result.model_card_path)
+ print(result.audit_path)
+ print(result.report_json_path)
+ print(result.report_md_path)
+ print(f"audit_passed={result.audit_passed}")
+ return 0 if result.audit_passed else 1
+
+
+def cmd_package_hf_corrector(args: argparse.Namespace) -> int:
+ path = package_hf_text_corrector_model(
+ args.model_dir,
+ args.out,
+ model_id=args.model_id,
+ base_model=args.base_model,
+ base_engine=args.base_engine,
+ base_engine_kwargs=_parse_key_values(args.base_engine_kwarg),
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ metrics_report=args.metrics_report,
+ max_new_tokens=args.max_new_tokens,
+ )
+ print(path)
+ return 0
+
+
+def cmd_generate_correction_pairs(args: argparse.Namespace) -> int:
+ path = generate_correction_pairs(
+ args.manifest,
+ args.out,
+ engine_name=args.engine,
+ model_config=args.model_config,
+ limit=args.limit,
+ only_errors=args.only_errors,
+ )
+ print(path)
+ return 0
+
+
+def cmd_train_corrector(args: argparse.Namespace) -> int:
+ recipe_path = write_corrector_recipe(
+ args.out,
+ clean_manifest=args.clean_manifest,
+ pairs_source=args.pairs_source,
+ hf_dataset=args.hf_dataset,
+ hf_split=args.hf_split,
+ limit=args.limit,
+ seed=args.seed,
+ )
+ if args.backend == "recipe":
+ print(recipe_path)
+ return 0
+ path = write_hf_text_corrector_recipe(
+ Path(args.out) / "correction_pairs.jsonl",
+ args.out,
+ base_model=args.base_model,
+ max_source_length=args.max_source_length,
+ max_target_length=args.max_target_length,
+ per_device_train_batch_size=args.train_batch_size,
+ per_device_eval_batch_size=args.eval_batch_size,
+ learning_rate=args.learning_rate,
+ num_train_epochs=args.epochs,
+ eval_ratio=args.eval_ratio,
+ seed=args.seed,
+ run=args.run,
+ )
+ print(path)
+ return 0
+
+
+def cmd_create_model_card(args: argparse.Namespace) -> int:
+ path = write_model_card(
+ args.out,
+ model_id=args.model_id,
+ backend=args.backend,
+ base_model=args.base_model,
+ artifact_paths=args.artifact,
+ backend_kwargs=_parse_key_values([*args.backend_kwarg, *args.paddleocr_kwarg]),
+ train_manifest=args.train_manifest,
+ eval_manifest=args.eval_manifest,
+ metrics_report=args.metrics_report,
+ admission_validation_report=args.admission_validation_report,
+ fallback_model_card=args.fallback_model_card,
+ notes=args.notes,
+ )
+ print(path)
+ return 0
+
+
+def cmd_audit_model(args: argparse.Namespace) -> int:
+ audit = audit_model_card(args.model_config, args.out)
+ print(Path(args.out) / "model-audit.json")
+ print(Path(args.out) / "model-audit.md")
+ print(f"passed={audit.passed} model_id={audit.model_id}")
+ return 0 if audit.passed else 1
+
+
+def cmd_parse_doc(args: argparse.Namespace) -> int:
+ document = parse_document(
+ args.input,
+ args.out,
+ engine_name=args.engine,
+ model_config=args.model_config,
+ fallback_engine=args.fallback_engine,
+ fallback_model_config=args.fallback_model_config,
+ low_confidence_threshold=args.low_confidence_threshold,
+ fallback_min_quality_score=args.fallback_min_quality_score,
+ )
+ print(Path(args.out) / "document.json")
+ print(Path(args.out) / "document.md")
+ print(f"pages={len(document.pages)} tables={len(document.tables)} figures={len(document.figures)}")
+ return 0
+
+
+def cmd_benchmark(args: argparse.Namespace) -> int:
+ baselines = [item.strip() for item in args.baselines.split(",") if item.strip()]
+ inputs = list(args.inputs)
+ if args.inputs_from_manifest:
+ inputs.extend(_benchmark_inputs_from_manifest(args.inputs_from_manifest))
+ if not inputs:
+ raise OcrTechError("benchmark requires positional inputs or --inputs-from-manifest")
+ eval_manifest = args.eval_manifest or args.inputs_from_manifest
+ results = run_benchmark(
+ inputs,
+ args.out,
+ baselines=baselines,
+ references_dir=args.references_dir,
+ eval_manifest=eval_manifest,
+ candidate_model_config=args.candidate_model_config,
+ fallback_engine=args.fallback_engine,
+ fallback_model_config=args.fallback_model_config,
+ low_confidence_threshold=args.low_confidence_threshold,
+ fallback_min_quality_score=args.fallback_min_quality_score,
+ resume_existing=args.resume_existing,
+ sample_timeout_seconds=args.sample_timeout_seconds,
+ capture_gpu_metrics=args.capture_gpu_metrics,
+ )
+ print(Path(args.out) / "report.json")
+ print(Path(args.out) / "report.md")
+ print(f"runs={len(results)}")
+ return 0
+
+
+def _benchmark_inputs_from_manifest(manifest_path: str | Path) -> list[str]:
+ manifest = Path(manifest_path)
+ entries = load_manifest(manifest)
+ if not entries:
+ raise OcrTechError(f"benchmark input manifest is empty: {manifest}")
+ inputs: list[str] = []
+ for entry in entries:
+ raw_path = Path(entry.image_path)
+ if raw_path.is_absolute():
+ resolved = raw_path
+ elif raw_path.exists():
+ resolved = raw_path
+ else:
+ resolved = manifest.parent / raw_path
+ if not resolved.exists():
+ raise OcrTechError(f"benchmark input does not exist for sample {entry.sample_id}: {resolved}")
+ if resolved.is_dir():
+ raise OcrTechError(f"benchmark input is a directory for sample {entry.sample_id}: {resolved}")
+ inputs.append(str(resolved))
+ return inputs
+
+
+def cmd_summarize_benchmark(args: argparse.Namespace) -> int:
+ summary = summarize_benchmark_report(
+ args.benchmark_report,
+ args.out,
+ candidate=args.candidate,
+ baselines=args.baseline or None,
+ metrics=args.metric or None,
+ )
+ print(Path(args.out) / "summary.json")
+ print(Path(args.out) / "summary.md")
+ print(f"candidate={summary.candidate} paired={len(summary.paired_metrics)}")
+ return 0
+
+
+def cmd_rescore_benchmark(args: argparse.Namespace) -> int:
+ results = rescore_benchmark_report(
+ args.benchmark_report,
+ args.out,
+ references_dir=args.references_dir,
+ eval_manifest=args.eval_manifest,
+ )
+ print(Path(args.out) / "report.json")
+ print(Path(args.out) / "report.md")
+ print(f"runs={len(results)}")
+ return 0
+
+
+def cmd_derive_table_postprocess_benchmark(args: argparse.Namespace) -> int:
+ results = derive_table_postprocess_benchmark(
+ args.benchmark_report,
+ args.out,
+ source_baseline=args.source_baseline,
+ candidate_baseline=args.candidate_baseline,
+ references_dir=args.references_dir,
+ eval_manifest=args.eval_manifest,
+ )
+ print(Path(args.out) / "report.json")
+ print(Path(args.out) / "report.md")
+ print(f"runs={len(results)}")
+ return 0
+
+
+def cmd_analyze_table_cells(args: argparse.Namespace) -> int:
+ analysis = analyze_table_cells(
+ args.benchmark_report,
+ args.eval_manifest,
+ args.out,
+ candidate=args.candidate,
+ baselines=args.baseline or None,
+ top_n=args.top_n,
+ )
+ print(Path(args.out) / "table-cell-analysis.json")
+ print(Path(args.out) / "table-cell-analysis.md")
+ print(f"systems={len(analysis.systems)} paired={len(analysis.paired)} failures={len(analysis.top_failures)}")
+ return 0
+
+
+def cmd_paper_benchmark_table(args: argparse.Namespace) -> int:
+ display_names: dict[str, str] = {}
+ for item in args.label:
+ key, separator, value = str(item).partition("=")
+ if not separator or not key or not value:
+ raise OcrTechError(f"invalid --label value {item!r}; expected system=Label")
+ display_names[key] = value
+ source_preferences: dict[str, str] = {}
+ for item in args.source_preference:
+ key, separator, value = str(item).partition("=")
+ if not separator or not key or not value:
+ raise OcrTechError(f"invalid --source-preference value {item!r}; expected system=path")
+ source_preferences[key] = value
+ table = export_paper_benchmark_table(
+ args.summary,
+ args.out,
+ slice_name=args.slice,
+ metrics=args.metric or None,
+ systems=args.system or None,
+ display_names=display_names,
+ source_preferences=source_preferences,
+ title=args.title,
+ )
+ print(Path(args.out) / "paper-table.json")
+ print(Path(args.out) / "paper-table.md")
+ print(f"rows={len(table.rows)} slice={table.slice_name}")
+ return 0
+
+
+def cmd_benchmark_oracle(args: argparse.Namespace) -> int:
+ report, summary = build_benchmark_oracle(
+ args.benchmark_report,
+ args.out,
+ metric=args.metric,
+ systems=args.system or None,
+ direction=args.direction,
+ oracle_name=args.oracle_name,
+ )
+ print(Path(args.out) / "oracle-analysis.json")
+ print(Path(args.out) / "oracle-analysis.md")
+ print(Path(args.out) / "oracle-choices.json")
+ print(Path(args.out) / "oracle-summary" / "summary.json")
+ print(f"oracle={report.oracle_name} samples={report.sample_count} paired={len(summary.paired_metrics)}")
+ return 0
+
+
+def cmd_benchmark_error_analysis(args: argparse.Namespace) -> int:
+ analysis = analyze_benchmark_errors(
+ args.benchmark_report,
+ args.out,
+ system=args.system,
+ baselines=args.baseline or None,
+ metric=args.metric,
+ direction=args.direction,
+ top_n=args.top_n,
+ )
+ print(Path(args.out) / "error-analysis.json")
+ print(Path(args.out) / "error-analysis.md")
+ print(Path(args.out) / "top-failures.json")
+ print(f"system={analysis.system} samples={analysis.sample_count} metric={analysis.metric}")
+ return 0
+
+
+def cmd_export_failure_manifest(args: argparse.Namespace) -> int:
+ export = export_failure_manifest(
+ args.source_manifest,
+ args.top_failures,
+ args.out,
+ split=args.split,
+ )
+ print(export.output_manifest)
+ print(export.summary_path)
+ print(f"selected={export.selected_count} split={export.split or ''}")
+ return 0
+
+
+def cmd_calibrate_quality_router(args: argparse.Namespace) -> int:
+ calibration, model_path = calibrate_quality_router(
+ args.experiment_report,
+ args.out,
+ model_id=args.model_id,
+ base_model=args.base_model,
+ primary_engine=args.primary_engine,
+ secondary_engine=args.secondary_engine,
+ primary_engine_kwargs=_parse_key_values(args.primary_engine_kwarg),
+ secondary_engine_kwargs=_parse_key_values(args.secondary_engine_kwarg),
+ candidate_baseline=args.candidate_baseline,
+ primary_baseline=args.primary_baseline,
+ metric=args.metric,
+ direction=args.direction,
+ threshold_start=args.threshold_start,
+ threshold_end=args.threshold_end,
+ threshold_step=args.threshold_step,
+ notes=args.notes,
+ )
+ print(Path(args.out) / "calibration.json")
+ print(Path(args.out) / "calibration.md")
+ print(model_path)
+ print(f"selected_threshold={calibration.selected_threshold:.6f}")
+ return 0
+
+
+def cmd_calibrate_script_router(args: argparse.Namespace) -> int:
+ calibration, model_path = calibrate_script_router(
+ args.experiment_report,
+ args.out,
+ model_id=args.model_id,
+ base_model=args.base_model,
+ primary_engine=args.primary_engine,
+ secondary_engine=args.secondary_engine,
+ primary_engine_kwargs=_parse_key_values(args.primary_engine_kwarg),
+ secondary_engine_kwargs=_parse_key_values(args.secondary_engine_kwarg),
+ primary_baseline=args.primary_baseline,
+ secondary_baseline=args.secondary_baseline,
+ metric=args.metric,
+ direction=args.direction,
+ script=args.script,
+ threshold_start=args.threshold_start,
+ threshold_end=args.threshold_end,
+ threshold_step=args.threshold_step,
+ routing_granularity=args.routing_granularity,
+ secondary_structure_backfill=args.secondary_structure_backfill,
+ notes=args.notes,
+ )
+ print(Path(args.out) / "calibration.json")
+ print(Path(args.out) / "calibration.md")
+ print(model_path)
+ print(f"selected_threshold={calibration.selected_threshold:.6f}")
+ return 0
+
+
+def cmd_calibrate_tesseract_psm_ensemble(args: argparse.Namespace) -> int:
+ report, model_path = calibrate_tesseract_psm_ensemble(
+ args.primary_experiment_report,
+ args.out,
+ model_id=args.model_id,
+ variant_experiment_reports=_parse_labeled_paths(args.variant_experiment),
+ metric=args.metric,
+ direction=args.direction,
+ bias_start=args.bias_start,
+ bias_end=args.bias_end,
+ bias_step=args.bias_step,
+ language=args.language,
+ selection_margin=args.selection_margin,
+ notes=args.notes,
+ )
+ print(Path(args.out) / "calibration.json")
+ print(Path(args.out) / "calibration.md")
+ print(model_path)
+ print(f"selected_biases={report.selected_biases}")
+ return 0
+
+
+def cmd_run_experiment(args: argparse.Namespace) -> int:
+ baselines = [item.strip() for item in args.baselines.split(",") if item.strip()]
+ report = run_experiment(
+ args.eval_manifest,
+ args.out,
+ baselines=baselines,
+ references_dir=args.references_dir,
+ validation_config=args.validation_config,
+ candidate_model_config=args.candidate_model_config,
+ fallback_engine=args.fallback_engine,
+ fallback_model_config=args.fallback_model_config,
+ low_confidence_threshold=args.low_confidence_threshold,
+ fallback_min_quality_score=args.fallback_min_quality_score,
+ train_manifests=args.train_manifest,
+ run_validation=not args.skip_validation,
+ run_preflight=args.preflight,
+ require_claim_ready_eval_pack=not args.allow_smoke_eval_pack,
+ require_trained_recognizer=args.require_trained_recognizer,
+ require_model_admission=args.require_model_admission,
+ )
+ print(Path(args.out) / "experiment.json")
+ print(Path(args.out) / "experiment.md")
+ print(f"benchmark={report.benchmark_report}")
+ print(f"validation={report.validation_status or 'not_run'}")
+ if args.require_validated and report.validation_status != "validated":
+ return 1
+ return 0
+
+
+def cmd_preflight_claim(args: argparse.Namespace) -> int:
+ baselines = [item.strip() for item in args.baselines.split(",") if item.strip()]
+ report = run_claim_preflight(
+ args.eval_manifest,
+ args.out,
+ baselines=baselines,
+ references_dir=args.references_dir,
+ candidate_model_config=args.candidate_model_config,
+ fallback_model_config=args.fallback_model_config,
+ train_manifests=args.train_manifest,
+ validation_config=args.validation_config,
+ require_claim_ready_eval_pack=not args.allow_smoke_eval_pack,
+ require_trained_recognizer=args.require_trained_recognizer,
+ require_model_admission=args.require_model_admission,
+ )
+ print(Path(args.out) / "preflight.json")
+ print(Path(args.out) / "preflight.md")
+ print(f"passed={report.passed} samples={report.sample_count}")
+ return 0 if report.passed else 1
+
+
+def cmd_audit_remote_host(args: argparse.Namespace) -> int:
+ min_python = _parse_python_version(args.min_python)
+ report = audit_remote_host(
+ args.host,
+ args.out,
+ user=args.user,
+ port=args.port,
+ password_env=args.password_env,
+ min_python=min_python,
+ min_free_gb=args.min_free_gb,
+ workdir=args.workdir,
+ require_gpu=args.require_gpu,
+ require_paddle_training=args.require_paddle_training,
+ python_candidates=args.python_candidate or DEFAULT_PYTHON_CANDIDATES,
+ require_commands=args.require_command or None,
+ optional_commands=args.optional_command or None,
+ require_paths=args.require_path,
+ )
+ print(Path(args.out) / "remote-audit.json")
+ print(Path(args.out) / "remote-audit.md")
+ print(f"passed={report.passed} host={report.host}")
+ return 0 if report.passed else 1
+
+
+def cmd_bootstrap_remote_host(args: argparse.Namespace) -> int:
+ min_python = _parse_python_version(args.min_python)
+ report = bootstrap_remote_host(
+ args.host,
+ args.out,
+ user=args.user,
+ port=args.port,
+ password_env=args.password_env,
+ workdir=args.workdir,
+ min_python=min_python,
+ python_candidates=args.python_candidate or DEFAULT_PYTHON_CANDIDATES,
+ venv_name=args.venv_name,
+ recreate_venv=args.recreate_venv,
+ )
+ print(Path(args.out) / "remote-bootstrap.json")
+ print(Path(args.out) / "remote-bootstrap.md")
+ print(f"passed={report.passed} workdir={report.workdir} venv={report.venv_dir}")
+ return 0 if report.passed else 1
+
+
+def cmd_sync_remote_workspace(args: argparse.Namespace) -> int:
+ report = sync_remote_workspace(
+ args.local_root,
+ args.out,
+ host=args.host,
+ user=args.user,
+ port=args.port,
+ password_env=args.password_env,
+ remote_workdir=args.remote_workdir,
+ exclude_patterns=args.exclude or None,
+ )
+ print(Path(args.out) / "remote-sync.json")
+ print(Path(args.out) / "remote-sync.md")
+ print(f"passed={report.passed} remote_workdir={report.remote_workdir}")
+ return 0 if report.passed else 1
+
+
+def cmd_review_claim(args: argparse.Namespace) -> int:
+ report = review_claim(
+ args.experiment,
+ args.out,
+ config_path=args.config,
+ model_config=args.model_config,
+ )
+ print(Path(args.out) / "claim-review.json")
+ print(Path(args.out) / "claim-review.md")
+ print(f"passed={report.passed} experiments={len(report.experiments)}")
+ return 0 if report.passed else 1
+
+
+def cmd_validate_claim(args: argparse.Namespace) -> int:
+ report = validate_claim(
+ args.benchmark_report,
+ args.out,
+ config_path=args.config,
+ eval_manifest=args.eval_manifest,
+ train_manifests=args.train_manifest,
+ candidate_model_config=args.candidate_model_config,
+ fallback_model_config=args.fallback_model_config,
+ )
+ print(Path(args.out) / "validation.json")
+ print(Path(args.out) / "validation.md")
+ print(f"status={report.claim_status}")
+ if not report.passed:
+ return 1
+ return 0
+
+
+def cmd_recognizer_admission_decision(args: argparse.Namespace) -> int:
+ decision = decide_recognizer_admission(args.validation_report, args.out)
+ print(Path(args.out) / "recognizer-admission-decision.json")
+ print(Path(args.out) / "recognizer-admission-decision.md")
+ print(f"decision={decision.decision} status={decision.claim_status}")
+ return 0 if decision.decision == "admit" else 1
+
+
+def cmd_recognizer_failure_review(args: argparse.Namespace) -> int:
+ review = review_recognizer_failures(
+ args.admission_decision,
+ args.validation_report,
+ args.out,
+ model_cards=args.model_card,
+ min_rejections_to_stop=args.min_rejections_to_stop,
+ )
+ stopped_count = sum(1 for family in review.families if family.recommendation == "stop_family")
+ print(Path(args.out) / "recognizer-failure-review.json")
+ print(Path(args.out) / "recognizer-failure-review.md")
+ print(f"families={len(review.families)} stopped={stopped_count}")
+ return 1 if stopped_count else 0
+
+
+def cmd_list_public_benchmarks(args: argparse.Namespace) -> int:
+ _ = args
+ for spec in list_public_benchmarks():
+ print(f"{spec.dataset}\t{spec.title}\tmin_samples={spec.min_samples}\t{spec.url}")
+ return 0
+
+
+def cmd_prepare_public_benchmark(args: argparse.Namespace) -> int:
+ report = prepare_public_benchmark(
+ args.benchmark,
+ args.out,
+ limit=args.limit,
+ language=args.language,
+ subset=args.subset,
+ data_source=args.data_source,
+ require_tables=args.require_tables,
+ annotation_path=args.annotation_path,
+ local_image_root=args.local_image_root,
+ )
+ print(report.summary_json_path)
+ print(report.summary_md_path)
+ print(f"manifest={report.manifest_path} samples={report.sample_count} benchmark={report.benchmark}")
+ return 0
+
+
+def cmd_audit_public_benchmark(args: argparse.Namespace) -> int:
+ audit = audit_public_benchmark_manifest(
+ args.manifest,
+ args.out,
+ benchmark=args.benchmark,
+ min_samples=args.min_samples,
+ require_reference_paths=not args.allow_missing_reference_paths,
+ )
+ print(Path(args.out) / "public-benchmark-audit.json")
+ print(Path(args.out) / "public-benchmark-audit.md")
+ print(f"passed={audit.passed} samples={audit.sample_count} benchmark={audit.benchmark}")
+ return 0 if audit.passed else 1
+
+
+def cmd_audit_gorkhapatra_source(args: argparse.Namespace) -> int:
+ category_urls = list(args.category_url)
+ epaper_urls = list(args.epaper_url)
+ if not args.no_default_urls:
+ if not category_urls and not args.category_html:
+ category_urls = list(DEFAULT_GORKHAPATRA_CATEGORY_URLS)
+ if not epaper_urls and not args.epaper_html:
+ epaper_urls = [DEFAULT_GORKHAPATRA_EPAPER_URL]
+ audit = audit_gorkhapatra_source(
+ args.out,
+ category_urls=category_urls,
+ epaper_urls=epaper_urls,
+ category_html_paths=args.category_html,
+ epaper_html_paths=args.epaper_html,
+ download_assets=args.download_assets,
+ max_article_images=args.max_article_images,
+ max_epaper_pdfs=args.max_epaper_pdfs,
+ timeout_seconds=args.timeout_seconds,
+ )
+ print(Path(args.out) / "gorkhapatra-source-audit.json")
+ print(Path(args.out) / "gorkhapatra-source-audit.md")
+ print(f"articles={audit.article_count} epapers={audit.epaper_count} downloaded={audit.downloaded_count} warnings={len(audit.warnings)}")
+ return 0
+
+
+def cmd_prepare_gorkhapatra_pack(args: argparse.Namespace) -> int:
+ summary = prepare_gorkhapatra_pack(
+ args.source_audit_json,
+ args.out,
+ include_article_images=not args.no_article_images,
+ include_epaper_pages=not args.no_epaper_pages,
+ max_article_images=args.max_article_images,
+ max_epaper_pdfs=args.max_epaper_pdfs,
+ max_pages_per_pdf=args.max_pages_per_pdf,
+ split=args.split,
+ dataset_name=args.dataset_name,
+ )
+ print(summary.manifest_path)
+ print(Path(args.out) / "gorkhapatra-pack.json")
+ print(Path(args.out) / "gorkhapatra-pack.md")
+ print(f"samples={summary.sample_count} article_images={summary.article_image_count} epaper_pages={summary.epaper_page_count}")
+ return 0
+
+
+def cmd_audit_gorkhapatra_language_pages(args: argparse.Namespace) -> int:
+ publication_urls = list(args.publication_url)
+ epaper_urls = list(args.epaper_url)
+ if not args.no_default_urls:
+ if not publication_urls and not args.publication_html:
+ publication_urls = [DEFAULT_NAYA_NEPAL_PUBLICATION_URL]
+ if not epaper_urls and not args.epaper_html:
+ epaper_urls = [DEFAULT_GORKHAPATRA_EPAPER_URL]
+ audit = audit_gorkhapatra_language_pages(
+ args.out,
+ publication_urls=publication_urls,
+ epaper_urls=epaper_urls,
+ publication_html_paths=args.publication_html,
+ epaper_html_paths=args.epaper_html,
+ download_pdfs=args.download_pdfs,
+ render_pages=args.render_pages,
+ max_publication_items=args.max_publication_items,
+ max_epaper_pdfs=args.max_epaper_pdfs,
+ timeout_seconds=args.timeout_seconds,
+ )
+ print(Path(args.out) / "gorkhapatra-language-pages.json")
+ print(Path(args.out) / "gorkhapatra-language-pages.md")
+ print(
+ f"publication_items={audit.publication_item_count} "
+ f"aligned={audit.aligned_count} language_page_hits={audit.language_page_hit_count} warnings={len(audit.warnings)}"
+ )
+ return 0
+
+
+def cmd_prepare_gorkhapatra_language_page_pack(args: argparse.Namespace) -> int:
+ summary = prepare_gorkhapatra_language_page_pack(
+ args.language_page_audit_json,
+ args.out,
+ split=args.split,
+ dataset_name=args.dataset_name,
+ max_samples=args.max_samples,
+ )
+ print(summary.manifest_path)
+ print(Path(args.out) / "gorkhapatra-language-page-pack.json")
+ print(Path(args.out) / "gorkhapatra-language-page-pack.md")
+ print(f"samples={summary.sample_count} copied_pages={summary.copied_page_count} warnings={len(summary.warnings)}")
+ return 0
+
+
+def cmd_prepare_gorkhapatra_language_page_review(args: argparse.Namespace) -> int:
+ summary = prepare_gorkhapatra_language_page_review(
+ args.language_page_pack_manifest,
+ args.out,
+ )
+ print(summary.review_json_path)
+ print(summary.review_csv_path)
+ print(summary.review_md_path)
+ print(
+ f"samples={summary.sample_count} pending_review={summary.pending_review_count} "
+ f"claim_eligible={summary.claim_evidence_eligible_count} warnings={len(summary.warnings)}"
+ )
+ return 0
+
+
+def cmd_audit_language_registry(args: argparse.Namespace) -> int:
+ audit = audit_language_registry(
+ args.registry,
+ args.out,
+ min_nepal_languages=args.min_nepal_languages,
+ require_limbu_first=not args.allow_non_limbu_first,
+ verify_local_paths=not args.no_verify_local_paths,
+ )
+ print(Path(args.out) / "language-registry-audit.json")
+ print(Path(args.out) / "language-registry-audit.md")
+ print(
+ "passed="
+ f"{audit.passed} languages={audit.language_count} "
+ f"nepal_languages={audit.counted_nepal_language_count} first_targets={','.join(audit.first_target_ids)}"
+ )
+ return 0 if audit.passed else 1
+
+
+def cmd_audit_font_renderability(args: argparse.Namespace) -> int:
+ audit = audit_font_renderability(
+ args.registry,
+ args.out,
+ primary_only=not args.all_scripts,
+ min_coverage_ratio=args.min_coverage_ratio,
+ render_samples=args.render_samples,
+ )
+ print(Path(args.out) / "font-renderability-audit.json")
+ print(Path(args.out) / "font-renderability-audit.md")
+ print(
+ "passed="
+ f"{audit.passed} scripts={audit.script_count} candidates={audit.candidate_count} "
+ f"rendered={sum(1 for candidate in audit.candidates if candidate.render_status == 'rendered')}"
+ )
+ return 0 if audit.passed else 1
+
+
+def main(argv: list[str] | None = None) -> int:
+ parser = build_parser()
+ args = parser.parse_args(argv)
+ try:
+ return int(args.func(args))
+ except OcrTechError as exc:
+ print(f"ocrtech: error: {exc}", file=sys.stderr)
+ return 2
+
+
+def _parse_key_values(values: list[str]) -> dict[str, object]:
+ parsed: dict[str, object] = {}
+ for item in values:
+ if "=" not in item:
+ raise OcrTechError(f"expected key=value for --paddleocr-kwarg, got {item!r}")
+ key, value = item.split("=", 1)
+ if not key:
+ raise OcrTechError("paddleocr kwarg key cannot be empty")
+ parsed[key] = _coerce_scalar(value)
+ return parsed
+
+
+def _parse_labeled_paths(values: list[str]) -> dict[str, str]:
+ parsed: dict[str, str] = {}
+ for item in values:
+ if "=" not in item:
+ raise OcrTechError(f"expected label=path, got {item!r}")
+ label, path = item.split("=", 1)
+ if not label or not path:
+ raise OcrTechError(f"expected non-empty label=path, got {item!r}")
+ parsed[label] = path
+ return parsed
+
+
+def _coerce_scalar(value: str) -> object:
+ stripped = value.strip()
+ if stripped.startswith("{") or stripped.startswith("["):
+ try:
+ return json.loads(stripped)
+ except json.JSONDecodeError:
+ pass
+ lowered = value.lower()
+ if lowered == "true":
+ return True
+ if lowered == "false":
+ return False
+ if lowered == "none":
+ return None
+ try:
+ return int(value)
+ except ValueError:
+ try:
+ return float(value)
+ except ValueError:
+ return value
+
+
+def _parse_python_version(value: str) -> tuple[int, int]:
+ parts = value.strip().split(".")
+ if len(parts) != 2:
+ raise OcrTechError(f"expected MINOR python version like 3.11, got {value!r}")
+ try:
+ major = int(parts[0])
+ minor = int(parts[1])
+ except ValueError as exc:
+ raise OcrTechError(f"python version must be numeric, got {value!r}") from exc
+ if major < 1 or minor < 0:
+ raise OcrTechError(f"invalid python version: {value!r}")
+ return major, minor
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/src/ocrtech/crops.py b/src/ocrtech/crops.py
new file mode 100644
index 0000000000000000000000000000000000000000..76b2564832821f89c69458d322da398808e55ff0
--- /dev/null
+++ b/src/ocrtech/crops.py
@@ -0,0 +1,289 @@
+"""Extract recognizer training crops from rendered eval-pack references."""
+
+from __future__ import annotations
+
+import json
+from collections import Counter
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, sha256_path, sha256_text, write_manifest
+
+
+SUPPORTED_CROP_TYPES = {"line", "table_cell", "figure_caption"}
+
+
+@dataclass(slots=True)
+class CropManifestSummary:
+ manifest_path: str
+ source_manifest: str
+ crop_count: int
+ source_sample_count: int
+ crop_type_counts: dict[str, int]
+ skipped_count: int
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "source_manifest": self.source_manifest,
+ "crop_count": self.crop_count,
+ "source_sample_count": self.source_sample_count,
+ "crop_type_counts": self.crop_type_counts,
+ "skipped_count": self.skipped_count,
+ "warnings": self.warnings,
+ }
+
+
+def extract_crop_manifest(
+ manifest_path: str | Path,
+ output_dir: str | Path,
+ *,
+ crop_types: list[str] | None = None,
+ split: str = "train",
+ dataset_name: str = "ocrtech-crops",
+ min_text_length: int = 1,
+) -> CropManifestSummary:
+ if min_text_length < 1:
+ raise DataValidationError("min_text_length must be at least 1")
+ requested = [item.replace("-", "_") for item in (crop_types or ["line", "table_cell", "figure_caption"])]
+ unknown = sorted(set(requested) - SUPPORTED_CROP_TYPES)
+ if unknown:
+ raise DataValidationError(f"unsupported crop types: {', '.join(unknown)}")
+ source_entries = load_manifest(manifest_path)
+ if not source_entries:
+ raise DataValidationError("extract-crops requires a non-empty source manifest")
+
+ out = Path(output_dir)
+ images_dir = out / "images"
+ manifests_dir = out / "manifests"
+ images_dir.mkdir(parents=True, exist_ok=True)
+ manifests_dir.mkdir(parents=True, exist_ok=True)
+
+ crop_entries: list[ManifestEntry] = []
+ warnings: list[str] = []
+ skipped_count = 0
+ for source_entry in source_entries:
+ reference_path = _reference_path(source_entry)
+ reference = _load_reference(reference_path)
+ layout = _reference_layout(reference, reference_path)
+ figure_caption_lines = _figure_caption_line_ids(reference)
+ page_by_index = _layout_pages(layout)
+ if layout.get("unavailable_pages"):
+ warnings.append(f"{source_entry.sample_id}: skipped unavailable layout pages {layout['unavailable_pages']}")
+ for page_index, page_layout in page_by_index.items():
+ page_image = _page_image_path(Path(source_entry.image_path), page_index)
+ if not page_image.exists():
+ raise DataValidationError(f"missing page image for {source_entry.sample_id} page {page_index}: {page_image}")
+ page_crops = _page_crops(page_layout, requested, figure_caption_lines, min_text_length=min_text_length)
+ for crop_index, crop in enumerate(page_crops):
+ crop_path = images_dir / f"{source_entry.sample_id}-p{page_index:04d}-{crop['kind']}-{crop_index:04d}.png"
+ _write_crop(page_image, crop_path, crop["bbox"])
+ crop_text = str(crop["text"])
+ crop_sha = sha256_path(crop_path)
+ text_sha = sha256_text(crop_text)
+ crop_entries.append(
+ ManifestEntry(
+ sample_id=f"{source_entry.sample_id}::{crop['kind']}::{page_index:04d}::{crop_index:04d}",
+ dataset=dataset_name,
+ split=split,
+ image_path=str(crop_path),
+ text=crop_text,
+ sha256=crop_sha,
+ metadata={
+ "slices": sorted({*(_entry_slices(source_entry)), "crop", str(crop["kind"])}),
+ "source_sample_id": source_entry.sample_id,
+ "source_manifest": str(manifest_path),
+ "source_image_path": source_entry.image_path,
+ "source_reference_path": str(reference_path),
+ "page_index": page_index,
+ "crop_type": crop["kind"],
+ "bbox": crop["bbox"],
+ "text_sha256": text_sha,
+ "sample_sha256": sha256_text(f"{crop_sha}\n{text_sha}"),
+ },
+ )
+ )
+ skipped_count += int(page_layout.get("skipped_crop_count", 0))
+
+ if not crop_entries:
+ raise DataValidationError("no crops extracted; source references may be missing supported layout metadata")
+ manifest_out = manifests_dir / "crops.jsonl"
+ write_manifest(crop_entries, manifest_out)
+ counts = Counter(str(entry.metadata.get("crop_type")) for entry in crop_entries)
+ summary = CropManifestSummary(
+ manifest_path=str(manifest_out),
+ source_manifest=str(manifest_path),
+ crop_count=len(crop_entries),
+ source_sample_count=len(source_entries),
+ crop_type_counts=dict(sorted(counts.items())),
+ skipped_count=skipped_count,
+ warnings=warnings,
+ )
+ (out / "crop-manifest-summary.json").write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_summary_markdown(summary, out / "crop-manifest-summary.md")
+ return summary
+
+
+def _reference_path(entry: ManifestEntry) -> Path:
+ value = entry.metadata.get("reference_path") if entry.metadata else None
+ if not value:
+ raise DataValidationError(f"missing reference_path metadata for {entry.sample_id}")
+ path = Path(str(value))
+ if not path.exists():
+ raise DataValidationError(f"missing reference file for {entry.sample_id}: {path}")
+ return path
+
+
+def _load_reference(path: Path) -> dict[str, Any]:
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"invalid reference JSON {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"reference must be an object: {path}")
+ return payload
+
+
+def _reference_layout(reference: dict[str, Any], reference_path: Path) -> dict[str, Any]:
+ metadata = reference.get("metadata")
+ if not isinstance(metadata, dict):
+ raise DataValidationError(f"reference metadata must be an object: {reference_path}")
+ layout = metadata.get("layout")
+ if not isinstance(layout, dict):
+ raise DataValidationError(f"reference has no renderer layout metadata: {reference_path}")
+ pages = layout.get("pages")
+ if not isinstance(pages, list):
+ raise DataValidationError(f"reference layout pages must be a list: {reference_path}")
+ return layout
+
+
+def _figure_caption_line_ids(reference: dict[str, Any]) -> set[str]:
+ line_ids: set[str] = set()
+ figures = reference.get("figures", [])
+ if not isinstance(figures, list):
+ raise DataValidationError("reference figures must be a list")
+ for figure in figures:
+ if not isinstance(figure, dict):
+ raise DataValidationError("reference figure entries must be objects")
+ caption = str(figure.get("caption") or "")
+ for line_id in figure.get("line_ids", []):
+ if caption and isinstance(line_id, str):
+ line_ids.add(line_id)
+ return line_ids
+
+
+def _layout_pages(layout: dict[str, Any]) -> dict[int, dict[str, Any]]:
+ pages: dict[int, dict[str, Any]] = {}
+ for raw_page in layout.get("pages", []):
+ if not isinstance(raw_page, dict):
+ raise DataValidationError("layout page entries must be objects")
+ page_index = raw_page.get("page_index")
+ if not isinstance(page_index, int):
+ raise DataValidationError("layout page_index must be an integer")
+ pages[page_index] = raw_page
+ return pages
+
+
+def _page_image_path(source_path: Path, page_index: int) -> Path:
+ if source_path.is_dir():
+ return source_path / f"page-{page_index + 1:04d}.png"
+ if page_index != 0:
+ raise DataValidationError(f"single image source cannot provide page {page_index}: {source_path}")
+ return source_path
+
+
+def _page_crops(
+ page_layout: dict[str, Any],
+ crop_types: list[str],
+ figure_caption_lines: set[str],
+ *,
+ min_text_length: int,
+) -> list[dict[str, Any]]:
+ crops: list[dict[str, Any]] = []
+ skipped = 0
+ if "line" in crop_types or "figure_caption" in crop_types:
+ lines = page_layout.get("lines", [])
+ if not isinstance(lines, list):
+ raise DataValidationError("layout lines must be a list")
+ for line in lines:
+ if not isinstance(line, dict):
+ raise DataValidationError("layout line entries must be objects")
+ text = str(line.get("text") or "").strip()
+ line_id = str(line.get("line_id") or "")
+ if not text or len(text) < min_text_length or text.startswith("[Figure:"):
+ skipped += 1
+ continue
+ if "line" in crop_types:
+ crops.append({"kind": "line", "text": text, "bbox": _bbox(line.get("bbox"))})
+ if "figure_caption" in crop_types and line_id in figure_caption_lines:
+ crops.append({"kind": "figure_caption", "text": text, "bbox": _bbox(line.get("bbox"))})
+ if "table_cell" in crop_types:
+ cells = page_layout.get("table_cells", [])
+ if not isinstance(cells, list):
+ raise DataValidationError("layout table_cells must be a list")
+ for cell in cells:
+ if not isinstance(cell, dict):
+ raise DataValidationError("layout table cell entries must be objects")
+ text = str(cell.get("text") or "").strip()
+ if not text or len(text) < min_text_length:
+ skipped += 1
+ continue
+ crops.append({"kind": "table_cell", "text": text, "bbox": _bbox(cell.get("text_bbox") or cell.get("bbox"))})
+ page_layout["skipped_crop_count"] = skipped
+ return crops
+
+
+def _bbox(value: Any) -> list[int]:
+ if not isinstance(value, list) or len(value) != 4:
+ raise DataValidationError(f"crop bbox must be a four-item list, got: {value!r}")
+ coordinates = [int(item) for item in value]
+ x1, y1, x2, y2 = coordinates
+ if x2 <= x1 or y2 <= y1:
+ raise DataValidationError(f"invalid crop bbox: {coordinates}")
+ return coordinates
+
+
+def _write_crop(source_image: Path, crop_path: Path, bbox: list[int]) -> None:
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise DataValidationError("crop extraction requires Pillow. Install ocr-tech[eval].") from exc
+ with Image.open(source_image) as image:
+ width, height = image.size
+ x1, y1, x2, y2 = bbox
+ clamped = [max(0, x1), max(0, y1), min(width, x2), min(height, y2)]
+ if clamped[2] <= clamped[0] or clamped[3] <= clamped[1]:
+ raise DataValidationError(f"crop bbox outside image bounds for {source_image}: {bbox}")
+ crop_path.parent.mkdir(parents=True, exist_ok=True)
+ image.crop(tuple(clamped)).save(crop_path)
+
+
+def _entry_slices(entry: ManifestEntry) -> list[str]:
+ value = entry.metadata.get("slices") if entry.metadata else []
+ if isinstance(value, list):
+ return [str(item) for item in value if str(item)]
+ if isinstance(value, str) and value:
+ return [value]
+ return []
+
+
+def _write_summary_markdown(summary: CropManifestSummary, path: Path) -> None:
+ lines = [
+ "# Crop Manifest",
+ "",
+ f"Manifest: `{summary.manifest_path}`",
+ f"Source manifest: `{summary.source_manifest}`",
+ f"Source samples: `{summary.source_sample_count}`",
+ f"Crops: `{summary.crop_count}`",
+ f"Skipped candidates: `{summary.skipped_count}`",
+ "",
+ "## Crop Types",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.crop_type_counts.items())
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in summary.warnings) if summary.warnings else lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/datasets.py b/src/ocrtech/datasets.py
new file mode 100644
index 0000000000000000000000000000000000000000..b3748a80297ede53b40fce58fa396a155722de43
--- /dev/null
+++ b/src/ocrtech/datasets.py
@@ -0,0 +1,1093 @@
+"""Manifest audit and leakage-safe split helpers."""
+
+from __future__ import annotations
+
+import json
+import random
+from collections import Counter, defaultdict
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, read_jsonl, sha256_path, sha256_text, write_manifest
+from .normalization import script_counts, unsupported_characters
+from .validation import check_leakage
+
+
+@dataclass(slots=True)
+class ManifestAudit:
+ manifest_path: str
+ passed: bool
+ sample_count: int
+ dataset_counts: dict[str, int]
+ split_counts: dict[str, int]
+ slice_counts: dict[str, int]
+ script_counts: dict[str, int]
+ issues: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "passed": self.passed,
+ "sample_count": self.sample_count,
+ "dataset_counts": self.dataset_counts,
+ "split_counts": self.split_counts,
+ "slice_counts": self.slice_counts,
+ "script_counts": self.script_counts,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class SplitSummary:
+ train_manifest: str
+ eval_manifest: str
+ train_count: int
+ eval_count: int
+ group_count: int
+ group_by: str
+ seed: int
+ leakage_passed: bool
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "train_manifest": self.train_manifest,
+ "eval_manifest": self.eval_manifest,
+ "train_count": self.train_count,
+ "eval_count": self.eval_count,
+ "group_count": self.group_count,
+ "group_by": self.group_by,
+ "seed": self.seed,
+ "leakage_passed": self.leakage_passed,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class MergeSummary:
+ output_manifest: str
+ input_manifests: list[str]
+ sample_count: int
+ dataset_counts: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "output_manifest": self.output_manifest,
+ "input_manifests": self.input_manifests,
+ "sample_count": self.sample_count,
+ "dataset_counts": self.dataset_counts,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class RebalanceSummary:
+ output_manifest: str
+ source_manifest: str
+ original_count: int
+ rebalanced_count: int
+ target_count: int
+ slice_counts_before: dict[str, int]
+ slice_counts_after: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "output_manifest": self.output_manifest,
+ "source_manifest": self.source_manifest,
+ "original_count": self.original_count,
+ "rebalanced_count": self.rebalanced_count,
+ "target_count": self.target_count,
+ "slice_counts_before": self.slice_counts_before,
+ "slice_counts_after": self.slice_counts_after,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class FilterSummary:
+ output_manifest: str
+ source_manifest: str
+ source_count: int
+ selected_count: int
+ sample_id_filters: list[str] = field(default_factory=list)
+ slice_filters: list[str] = field(default_factory=list)
+ document_type_filters: list[str] = field(default_factory=list)
+ degradation_filters: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "output_manifest": self.output_manifest,
+ "source_manifest": self.source_manifest,
+ "source_count": self.source_count,
+ "selected_count": self.selected_count,
+ "sample_id_filters": self.sample_id_filters,
+ "slice_filters": self.slice_filters,
+ "document_type_filters": self.document_type_filters,
+ "degradation_filters": self.degradation_filters,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerCorpusProfile:
+ manifest_path: str
+ sample_count: int
+ dataset_counts: dict[str, int]
+ slice_counts: dict[str, int]
+ script_counts: dict[str, int]
+ script_sample_counts: dict[str, int]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "sample_count": self.sample_count,
+ "dataset_counts": self.dataset_counts,
+ "slice_counts": self.slice_counts,
+ "script_counts": self.script_counts,
+ "script_sample_counts": self.script_sample_counts,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerCorpusAudit:
+ train_manifest: str
+ eval_manifest: str
+ passed: bool
+ train_profile: RecognizerCorpusProfile
+ eval_profile: RecognizerCorpusProfile
+ leakage_passed: bool
+ issues: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "train_manifest": self.train_manifest,
+ "eval_manifest": self.eval_manifest,
+ "passed": self.passed,
+ "train_profile": self.train_profile.to_dict(),
+ "eval_profile": self.eval_profile.to_dict(),
+ "leakage_passed": self.leakage_passed,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class RecognizerCorpusBuildSummary:
+ output_manifest: str
+ input_manifests: list[str]
+ source_count: int
+ output_count: int
+ target_counts: dict[str, int]
+ bucket_counts_before: dict[str, int]
+ bucket_counts_after: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "output_manifest": self.output_manifest,
+ "input_manifests": self.input_manifests,
+ "source_count": self.source_count,
+ "output_count": self.output_count,
+ "target_counts": self.target_counts,
+ "bucket_counts_before": self.bucket_counts_before,
+ "bucket_counts_after": self.bucket_counts_after,
+ "warnings": self.warnings,
+ }
+
+
+def audit_manifest(
+ manifest_path: str | Path,
+ output_dir: str | Path | None = None,
+ *,
+ verify_hashes: bool = True,
+ require_slices: list[str] | None = None,
+ strict_chars: bool = False,
+) -> ManifestAudit:
+ path = Path(manifest_path)
+ rows = list(read_jsonl(path))
+ entries: list[ManifestEntry] = []
+ issues: list[str] = []
+ warnings: list[str] = []
+ sample_ids: set[str] = set()
+ image_paths: set[str] = set()
+ image_hashes: set[str] = set()
+ sample_hashes: set[str] = set()
+ dataset_counts: Counter[str] = Counter()
+ split_counts: Counter[str] = Counter()
+ slice_counts: Counter[str] = Counter()
+ aggregate_scripts: Counter[str] = Counter()
+
+ for row_index, row in enumerate(rows):
+ try:
+ entry = ManifestEntry.from_dict(row)
+ except DataValidationError as exc:
+ issues.append(f"row {row_index}: {exc}")
+ continue
+ entries.append(entry)
+ if entry.sample_id in sample_ids:
+ issues.append(f"duplicate sample_id: {entry.sample_id}")
+ sample_ids.add(entry.sample_id)
+ if entry.image_path in image_paths:
+ warnings.append(f"duplicate image_path: {entry.image_path}")
+ image_paths.add(entry.image_path)
+ input_path = Path(entry.image_path)
+ if not input_path.exists():
+ issues.append(f"missing image_path for {entry.sample_id}: {input_path}")
+ elif verify_hashes:
+ actual = sha256_path(input_path)
+ if entry.sha256 and entry.sha256 != actual:
+ issues.append(f"sha256 mismatch for {entry.sample_id}: manifest={entry.sha256} actual={actual}")
+ if actual in image_hashes:
+ warnings.append(f"duplicate image sha256: {actual}")
+ image_hashes.add(actual)
+ elif entry.sha256:
+ if entry.sha256 in image_hashes:
+ warnings.append(f"duplicate image sha256: {entry.sha256}")
+ image_hashes.add(entry.sha256)
+
+ text_sha = sha256_text(entry.text)
+ metadata_text_sha = entry.metadata.get("text_sha256") if entry.metadata else None
+ if metadata_text_sha and metadata_text_sha != text_sha:
+ issues.append(f"text_sha256 mismatch for {entry.sample_id}")
+ sample_sha = _entry_sample_signature(entry)
+ if sample_sha in sample_hashes:
+ warnings.append(f"duplicate sample signature: {sample_sha}")
+ sample_hashes.add(sample_sha)
+ if strict_chars:
+ unsupported = unsupported_characters(entry.text)
+ if unsupported:
+ issues.append(f"unsupported characters for {entry.sample_id}: {unsupported}")
+ dataset_counts[entry.dataset] += 1
+ split_counts[entry.split] += 1
+ for slice_name in entry_slices(entry):
+ slice_counts[slice_name] += 1
+ aggregate_scripts.update(script_counts(entry.text))
+
+ for required in require_slices or []:
+ if slice_counts.get(required, 0) == 0:
+ issues.append(f"required slice missing: {required}")
+
+ audit = ManifestAudit(
+ manifest_path=str(path),
+ passed=not issues,
+ sample_count=len(entries),
+ dataset_counts=dict(sorted(dataset_counts.items())),
+ split_counts=dict(sorted(split_counts.items())),
+ slice_counts=dict(sorted(slice_counts.items())),
+ script_counts=dict(sorted(aggregate_scripts.items())),
+ issues=issues,
+ warnings=warnings,
+ )
+ if output_dir is not None:
+ _write_audit(audit, Path(output_dir))
+ return audit
+
+
+def build_recognizer_corpus(
+ manifest_paths: list[str | Path],
+ output_manifest: str | Path,
+ *,
+ target_latin_only: int = 0,
+ target_devanagari_only: int = 0,
+ target_mixed: int = 0,
+ target_real: int = 0,
+ target_synthetic: int = 0,
+ seed: int = 13,
+) -> RecognizerCorpusBuildSummary:
+ if not manifest_paths:
+ raise DataValidationError("build-recognizer-corpus requires at least one input manifest")
+ targets = {
+ "latin_only": target_latin_only,
+ "devanagari_only": target_devanagari_only,
+ "mixed_devanagari_latin": target_mixed,
+ "real": target_real,
+ "synthetic": target_synthetic,
+ }
+ invalid = [name for name, value in targets.items() if value < 0]
+ if invalid:
+ raise DataValidationError(f"recognizer corpus targets must be non-negative: {', '.join(invalid)}")
+ if all(value == 0 for value in targets.values()):
+ raise DataValidationError("build-recognizer-corpus requires at least one positive target")
+
+ entries: list[ManifestEntry] = []
+ seen_sample_ids: set[str] = set()
+ seen_signatures: set[str] = set()
+ warnings: list[str] = []
+ for manifest_path in manifest_paths:
+ for entry in load_manifest(manifest_path):
+ if entry.sample_id in seen_sample_ids:
+ raise DataValidationError(f"duplicate sample_id across recognizer corpus inputs: {entry.sample_id}")
+ seen_sample_ids.add(entry.sample_id)
+ signature = _entry_sample_signature(entry)
+ if signature in seen_signatures:
+ warnings.append(f"duplicate sample signature across recognizer corpus inputs: {entry.sample_id}")
+ seen_signatures.add(signature)
+ entries.append(entry)
+ if not entries:
+ raise DataValidationError("build-recognizer-corpus requires non-empty input manifests")
+
+ output_entries = list(entries)
+ rng = random.Random(seed)
+ duplicate_index = 0
+ counts_before = _recognizer_bucket_counts(output_entries)
+ for bucket_name, target in targets.items():
+ if target <= 0:
+ continue
+ current = _recognizer_bucket_counts(output_entries).get(bucket_name, 0)
+ if current >= target:
+ continue
+ bucket = [entry for entry in output_entries if _entry_in_recognizer_bucket(entry, bucket_name)]
+ if not bucket:
+ raise DataValidationError(f"recognizer corpus cannot satisfy missing bucket: {bucket_name}")
+ deficit = target - current
+ warnings.append(f"upsampled recognizer bucket {bucket_name} by {deficit} samples")
+ for _ in range(deficit):
+ source = rng.choice(bucket)
+ duplicate_index += 1
+ output_entries.append(_duplicate_recognizer_corpus_entry(source, bucket_name=bucket_name, duplicate_index=duplicate_index))
+
+ out_path = Path(output_manifest)
+ write_manifest(output_entries, out_path)
+ summary = RecognizerCorpusBuildSummary(
+ output_manifest=str(out_path),
+ input_manifests=[str(Path(path)) for path in manifest_paths],
+ source_count=len(entries),
+ output_count=len(output_entries),
+ target_counts={key: value for key, value in targets.items() if value > 0},
+ bucket_counts_before=_recognizer_bucket_counts(entries),
+ bucket_counts_after=_recognizer_bucket_counts(output_entries),
+ warnings=warnings,
+ )
+ _write_recognizer_corpus_build_summary(summary, out_path)
+ return summary
+
+
+def audit_recognizer_corpus(
+ train_manifest: str | Path,
+ eval_manifest: str | Path,
+ output_dir: str | Path | None = None,
+ *,
+ min_train_samples: int = 1000,
+ min_eval_samples: int = 100,
+ min_train_english: int = 200,
+ min_train_devanagari: int = 200,
+ min_train_mixed: int = 25,
+ min_eval_english: int = 50,
+ min_eval_devanagari: int = 50,
+ min_eval_mixed: int = 10,
+ min_train_latin_only: int = 50,
+ min_train_devanagari_only: int = 50,
+ min_eval_latin_only: int = 10,
+ min_eval_devanagari_only: int = 10,
+ min_train_real: int = 100,
+ min_train_synthetic: int = 100,
+) -> RecognizerCorpusAudit:
+ thresholds = {
+ "min_train_samples": min_train_samples,
+ "min_eval_samples": min_eval_samples,
+ "min_train_english": min_train_english,
+ "min_train_devanagari": min_train_devanagari,
+ "min_train_mixed": min_train_mixed,
+ "min_eval_english": min_eval_english,
+ "min_eval_devanagari": min_eval_devanagari,
+ "min_eval_mixed": min_eval_mixed,
+ "min_train_latin_only": min_train_latin_only,
+ "min_train_devanagari_only": min_train_devanagari_only,
+ "min_eval_latin_only": min_eval_latin_only,
+ "min_eval_devanagari_only": min_eval_devanagari_only,
+ "min_train_real": min_train_real,
+ "min_train_synthetic": min_train_synthetic,
+ }
+ invalid_thresholds = [name for name, value in thresholds.items() if value < 0]
+ if invalid_thresholds:
+ raise DataValidationError(f"recognizer corpus thresholds must be non-negative: {', '.join(invalid_thresholds)}")
+
+ train_path = Path(train_manifest)
+ eval_path = Path(eval_manifest)
+ train_entries = load_manifest(train_path)
+ eval_entries = load_manifest(eval_path)
+ train_profile = _recognizer_corpus_profile(train_path, train_entries)
+ eval_profile = _recognizer_corpus_profile(eval_path, eval_entries)
+ leakage = check_leakage([train_path], eval_path)
+
+ issues: list[str] = []
+ warnings: list[str] = []
+ _append_minimum_issue(issues, "train samples", train_profile.sample_count, min_train_samples)
+ _append_minimum_issue(issues, "eval samples", eval_profile.sample_count, min_eval_samples)
+ _append_minimum_issue(issues, "train latin-script samples", train_profile.script_sample_counts.get("contains_latin", 0), min_train_english)
+ _append_minimum_issue(issues, "train devanagari-script samples", train_profile.script_sample_counts.get("contains_devanagari", 0), min_train_devanagari)
+ _append_minimum_issue(issues, "train mixed-script samples", train_profile.script_sample_counts.get("mixed_devanagari_latin", 0), min_train_mixed)
+ _append_minimum_issue(issues, "eval latin-script samples", eval_profile.script_sample_counts.get("contains_latin", 0), min_eval_english)
+ _append_minimum_issue(issues, "eval devanagari-script samples", eval_profile.script_sample_counts.get("contains_devanagari", 0), min_eval_devanagari)
+ _append_minimum_issue(issues, "eval mixed-script samples", eval_profile.script_sample_counts.get("mixed_devanagari_latin", 0), min_eval_mixed)
+ _append_minimum_issue(issues, "train latin-only samples", train_profile.script_sample_counts.get("latin_only", 0), min_train_latin_only)
+ _append_minimum_issue(issues, "train devanagari-only samples", train_profile.script_sample_counts.get("devanagari_only", 0), min_train_devanagari_only)
+ _append_minimum_issue(issues, "eval latin-only samples", eval_profile.script_sample_counts.get("latin_only", 0), min_eval_latin_only)
+ _append_minimum_issue(issues, "eval devanagari-only samples", eval_profile.script_sample_counts.get("devanagari_only", 0), min_eval_devanagari_only)
+ _append_minimum_issue(issues, "train real slice samples", train_profile.slice_counts.get("real", 0), min_train_real)
+ _append_minimum_issue(issues, "train synthetic slice samples", train_profile.slice_counts.get("synthetic", 0), min_train_synthetic)
+ if not leakage.passed:
+ issues.append(f"train/eval leakage detected: {leakage.overlaps}")
+ if eval_profile.slice_counts.get("hard_eval", 0) == 0:
+ warnings.append("eval manifest has no hard_eval slice; recognizer admission should still use a separate hard gate")
+ if train_profile.script_sample_counts.get("latin_only", 0) == 0:
+ warnings.append("train manifest has no latin-only samples; English preservation is unlikely")
+ if train_profile.script_sample_counts.get("devanagari_only", 0) == 0:
+ warnings.append("train manifest has no devanagari-only samples; Nepali isolation is unlikely")
+
+ audit = RecognizerCorpusAudit(
+ train_manifest=str(train_path),
+ eval_manifest=str(eval_path),
+ passed=not issues,
+ train_profile=train_profile,
+ eval_profile=eval_profile,
+ leakage_passed=leakage.passed,
+ issues=issues,
+ warnings=warnings,
+ )
+ if output_dir is not None:
+ _write_recognizer_corpus_audit(audit, Path(output_dir))
+ return audit
+
+
+def split_manifest(
+ manifest_path: str | Path,
+ output_dir: str | Path,
+ *,
+ eval_ratio: float = 0.15,
+ seed: int = 13,
+ stratify_by: str = "slices",
+ group_by: str = "sample_signature",
+ train_name: str = "train.jsonl",
+ eval_name: str = "eval.jsonl",
+) -> SplitSummary:
+ if eval_ratio <= 0 or eval_ratio >= 1:
+ raise DataValidationError("eval_ratio must be between 0 and 1")
+ entries = load_manifest(manifest_path)
+ if len(entries) < 2:
+ raise DataValidationError("split-manifest requires at least two entries")
+ groups = _group_entries(entries, group_by=group_by)
+ if len(groups) < 2:
+ raise DataValidationError("split-manifest requires at least two unique sample groups")
+ rng = random.Random(seed)
+ strata: dict[str, list[tuple[str, list[ManifestEntry]]]] = defaultdict(list)
+ for group_key, group_entries in groups.items():
+ strata[_stratum_key(group_entries, stratify_by)].append((group_key, group_entries))
+
+ eval_group_keys: set[str] = set()
+ for stratum, stratum_groups in sorted(strata.items()):
+ shuffled = list(stratum_groups)
+ rng.shuffle(shuffled)
+ target = max(1, round(len(shuffled) * eval_ratio)) if len(shuffled) > 1 else 0
+ for group_key, _ in shuffled[:target]:
+ eval_group_keys.add(group_key)
+
+ if not eval_group_keys:
+ eval_group_keys.add(sorted(groups)[0])
+ if len(eval_group_keys) == len(groups):
+ eval_group_keys.remove(sorted(eval_group_keys)[-1])
+
+ train_entries: list[ManifestEntry] = []
+ eval_entries: list[ManifestEntry] = []
+ for group_key, group_entries in groups.items():
+ target = eval_entries if group_key in eval_group_keys else train_entries
+ split_name = "eval" if group_key in eval_group_keys else "train"
+ target.extend(_with_split(entry, split_name) for entry in group_entries)
+
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ train_path = out / train_name
+ eval_path = out / eval_name
+ write_manifest(train_entries, train_path)
+ write_manifest(eval_entries, eval_path)
+ leakage = check_leakage([train_path], eval_path)
+ warnings: list[str] = []
+ if not leakage.passed:
+ raise DataValidationError(f"generated split has leakage: {leakage.to_dict()}")
+ if not eval_entries:
+ warnings.append("eval split is empty")
+ if not train_entries:
+ warnings.append("train split is empty")
+ summary = SplitSummary(
+ train_manifest=str(train_path),
+ eval_manifest=str(eval_path),
+ train_count=len(train_entries),
+ eval_count=len(eval_entries),
+ group_count=len(groups),
+ group_by=group_by,
+ seed=seed,
+ leakage_passed=leakage.passed,
+ warnings=warnings,
+ )
+ _write_split_summary(summary, out)
+ return summary
+
+
+def merge_manifests(
+ manifest_paths: list[str | Path],
+ output_manifest: str | Path,
+) -> MergeSummary:
+ if len(manifest_paths) < 2:
+ raise DataValidationError("merge-manifests requires at least two input manifests")
+ merged: list[ManifestEntry] = []
+ sample_ids: set[str] = set()
+ sample_signatures: set[str] = set()
+ dataset_counts: Counter[str] = Counter()
+ warnings: list[str] = []
+ ordered_inputs = [str(Path(path)) for path in manifest_paths]
+
+ for manifest_path in manifest_paths:
+ entries = load_manifest(manifest_path)
+ for entry in entries:
+ if entry.sample_id in sample_ids:
+ raise DataValidationError(f"duplicate sample_id across merged manifests: {entry.sample_id}")
+ sample_ids.add(entry.sample_id)
+ signature = _entry_sample_signature(entry)
+ if signature in sample_signatures:
+ warnings.append(f"duplicate sample signature across merged manifests: {entry.sample_id}")
+ sample_signatures.add(signature)
+ dataset_counts[entry.dataset] += 1
+ merged.append(entry)
+ out_path = Path(output_manifest)
+ write_manifest(merged, out_path)
+ summary = MergeSummary(
+ output_manifest=str(out_path),
+ input_manifests=ordered_inputs,
+ sample_count=len(merged),
+ dataset_counts=dict(sorted(dataset_counts.items())),
+ warnings=warnings,
+ )
+ _write_merge_summary(summary, out_path)
+ return summary
+
+
+def rebalance_manifest(
+ manifest_path: str | Path,
+ output_manifest: str | Path,
+ *,
+ slices: list[str],
+ target_count: int | None = None,
+ seed: int = 13,
+) -> RebalanceSummary:
+ if not slices:
+ raise DataValidationError("rebalance-manifest requires at least one --slice")
+ requested_slices = [slice_name.strip() for slice_name in slices if slice_name.strip()]
+ if not requested_slices:
+ raise DataValidationError("rebalance-manifest requires at least one non-empty --slice")
+ entries = load_manifest(manifest_path)
+ if not entries:
+ raise DataValidationError("rebalance-manifest requires a non-empty manifest")
+ buckets: dict[str, list[ManifestEntry]] = {slice_name: [] for slice_name in requested_slices}
+ for entry in entries:
+ entry_slice_set = set(entry_slices(entry))
+ for slice_name in requested_slices:
+ if slice_name in entry_slice_set:
+ buckets[slice_name].append(entry)
+ missing = [slice_name for slice_name, bucket in buckets.items() if not bucket]
+ if missing:
+ raise DataValidationError(f"rebalance-manifest missing requested slices: {', '.join(missing)}")
+ before_counts = {slice_name: len(bucket) for slice_name, bucket in buckets.items()}
+ target = target_count if target_count is not None else max(before_counts.values())
+ if target <= 0:
+ raise DataValidationError("rebalance-manifest target_count must be positive")
+ rng = random.Random(seed)
+ rebalanced = list(entries)
+ duplicate_index = 0
+ warnings: list[str] = []
+ for slice_name, bucket in buckets.items():
+ deficit = target - len(bucket)
+ if deficit <= 0:
+ continue
+ warnings.append(f"upsampled slice {slice_name} by {deficit} samples")
+ for _ in range(deficit):
+ source = rng.choice(bucket)
+ duplicate_index += 1
+ rebalanced.append(_duplicate_entry(source, slice_name=slice_name, duplicate_index=duplicate_index))
+ out_path = Path(output_manifest)
+ write_manifest(rebalanced, out_path)
+ after_counts = Counter[str]()
+ for entry in rebalanced:
+ for slice_name in requested_slices:
+ if slice_name in set(entry_slices(entry)):
+ after_counts[slice_name] += 1
+ summary = RebalanceSummary(
+ output_manifest=str(out_path),
+ source_manifest=str(Path(manifest_path)),
+ original_count=len(entries),
+ rebalanced_count=len(rebalanced),
+ target_count=target,
+ slice_counts_before=dict(sorted(before_counts.items())),
+ slice_counts_after=dict(sorted(after_counts.items())),
+ warnings=warnings,
+ )
+ _write_rebalance_summary(summary, out_path)
+ return summary
+
+
+def filter_manifest(
+ manifest_path: str | Path,
+ output_manifest: str | Path,
+ *,
+ sample_ids: list[str] | None = None,
+ slices: list[str] | None = None,
+ document_types: list[str] | None = None,
+ degradations: list[str] | None = None,
+ limit: int | None = None,
+) -> FilterSummary:
+ entries = load_manifest(manifest_path)
+ requested_sample_ids = [value for value in (sample_ids or []) if value]
+ requested_slices = [value for value in (slices or []) if value]
+ requested_document_types = [value for value in (document_types or []) if value]
+ requested_degradations = [value for value in (degradations or []) if value]
+ if not any([requested_sample_ids, requested_slices, requested_document_types, requested_degradations, limit is not None]):
+ raise DataValidationError("filter-manifest requires at least one filter or --limit")
+
+ selected = [
+ entry
+ for entry in entries
+ if _matches_entry_filters(
+ entry,
+ sample_ids=requested_sample_ids,
+ slices=requested_slices,
+ document_types=requested_document_types,
+ degradations=requested_degradations,
+ )
+ ]
+ if requested_sample_ids:
+ selected_by_id = {entry.sample_id for entry in selected}
+ missing = [sample_id for sample_id in requested_sample_ids if sample_id not in selected_by_id]
+ if missing:
+ raise DataValidationError(f"requested sample_ids not found after filtering: {', '.join(missing)}")
+ if limit is not None:
+ if limit <= 0:
+ raise DataValidationError("limit must be positive")
+ selected = selected[:limit]
+ if not selected:
+ raise DataValidationError("filter-manifest produced zero samples")
+
+ out_path = Path(output_manifest)
+ write_manifest(selected, out_path)
+ summary = FilterSummary(
+ output_manifest=str(out_path),
+ source_manifest=str(Path(manifest_path)),
+ source_count=len(entries),
+ selected_count=len(selected),
+ sample_id_filters=requested_sample_ids,
+ slice_filters=requested_slices,
+ document_type_filters=requested_document_types,
+ degradation_filters=requested_degradations,
+ )
+ _write_filter_summary(summary, out_path)
+ return summary
+
+
+def entry_slices(entry: ManifestEntry) -> list[str]:
+ metadata = entry.metadata or {}
+ values: set[str] = set()
+ for key in ("slice", "script", "document_type", "degradation", "language", "input_format"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _recognizer_bucket_counts(entries: list[ManifestEntry]) -> dict[str, int]:
+ counts: Counter[str] = Counter()
+ for entry in entries:
+ for bucket_name in ("latin_only", "devanagari_only", "mixed_devanagari_latin", "real", "synthetic"):
+ if _entry_in_recognizer_bucket(entry, bucket_name):
+ counts[bucket_name] += 1
+ return dict(sorted(counts.items()))
+
+
+def _entry_in_recognizer_bucket(entry: ManifestEntry, bucket_name: str) -> bool:
+ counts = script_counts(entry.text)
+ has_devanagari = counts.get("devanagari", 0) > 0
+ has_latin = counts.get("latin", 0) > 0
+ if bucket_name == "latin_only":
+ return has_latin and not has_devanagari
+ if bucket_name == "devanagari_only":
+ return has_devanagari and not has_latin
+ if bucket_name == "mixed_devanagari_latin":
+ return has_latin and has_devanagari
+ if bucket_name in {"real", "synthetic"}:
+ return bucket_name in set(entry_slices(entry))
+ raise DataValidationError(f"unknown recognizer corpus bucket: {bucket_name}")
+
+
+def _duplicate_recognizer_corpus_entry(entry: ManifestEntry, *, bucket_name: str, duplicate_index: int) -> ManifestEntry:
+ metadata = dict(entry.metadata or {})
+ metadata["recognizer_corpus_source_sample_id"] = entry.sample_id
+ metadata["recognizer_corpus_bucket"] = bucket_name
+ metadata["recognizer_corpus_duplicate"] = True
+ return ManifestEntry(
+ sample_id=f"{entry.sample_id}~recognizer-{bucket_name}-{duplicate_index:06d}",
+ dataset=entry.dataset,
+ split=entry.split,
+ image_path=entry.image_path,
+ text=entry.text,
+ sha256=entry.sha256,
+ metadata=metadata,
+ )
+
+
+def _recognizer_corpus_profile(path: Path, entries: list[ManifestEntry]) -> RecognizerCorpusProfile:
+ dataset_counts: Counter[str] = Counter()
+ slice_counts: Counter[str] = Counter()
+ aggregate_scripts: Counter[str] = Counter()
+ script_sample_counts: Counter[str] = Counter()
+ for entry in entries:
+ dataset_counts[entry.dataset] += 1
+ for slice_name in entry_slices(entry):
+ slice_counts[slice_name] += 1
+ counts = script_counts(entry.text)
+ aggregate_scripts.update(counts)
+ has_devanagari = counts.get("devanagari", 0) > 0
+ has_latin = counts.get("latin", 0) > 0
+ if has_latin:
+ script_sample_counts["contains_latin"] += 1
+ if has_devanagari:
+ script_sample_counts["contains_devanagari"] += 1
+ if has_latin and has_devanagari:
+ script_sample_counts["mixed_devanagari_latin"] += 1
+ elif has_latin:
+ script_sample_counts["latin_only"] += 1
+ elif has_devanagari:
+ script_sample_counts["devanagari_only"] += 1
+ else:
+ script_sample_counts["other_only"] += 1
+ return RecognizerCorpusProfile(
+ manifest_path=str(path),
+ sample_count=len(entries),
+ dataset_counts=dict(sorted(dataset_counts.items())),
+ slice_counts=dict(sorted(slice_counts.items())),
+ script_counts=dict(sorted(aggregate_scripts.items())),
+ script_sample_counts=dict(sorted(script_sample_counts.items())),
+ )
+
+
+def _append_minimum_issue(issues: list[str], label: str, actual: int, required: int) -> None:
+ if actual < required:
+ issues.append(f"{label} {actual} < required {required}")
+
+
+def _group_entries(entries: list[ManifestEntry], *, group_by: str = "sample_signature") -> dict[str, list[ManifestEntry]]:
+ if group_by not in {"sample_signature", "text_sha256", "image_sha256", "image_path", "sample_id"}:
+ raise DataValidationError("group_by must be one of: sample_signature, text_sha256, image_sha256, image_path, sample_id")
+ groups: dict[str, list[ManifestEntry]] = defaultdict(list)
+ for entry in entries:
+ groups[_entry_group_key(entry, group_by)].append(entry)
+ return dict(groups)
+
+
+def _entry_group_key(entry: ManifestEntry, group_by: str) -> str:
+ metadata = entry.metadata or {}
+ if group_by == "sample_signature":
+ return _entry_sample_signature(entry)
+ if group_by == "text_sha256":
+ value = metadata.get("text_sha256")
+ return str(value) if value else sha256_text(entry.text)
+ if group_by == "image_sha256":
+ return str(entry.sha256 or entry.image_path)
+ if group_by == "image_path":
+ return entry.image_path
+ if group_by == "sample_id":
+ return entry.sample_id
+ raise DataValidationError("group_by must be one of: sample_signature, text_sha256, image_sha256, image_path, sample_id")
+
+
+def _entry_sample_signature(entry: ManifestEntry) -> str:
+ metadata = entry.metadata or {}
+ sample_hash = metadata.get("sample_sha256")
+ if isinstance(sample_hash, str) and sample_hash:
+ return sample_hash
+ image_hash = entry.sha256 or entry.image_path
+ text_hash = metadata.get("text_sha256") if isinstance(metadata.get("text_sha256"), str) else sha256_text(entry.text)
+ return sha256_text(f"{image_hash}\n{text_hash}")
+
+
+def _stratum_key(entries: list[ManifestEntry], stratify_by: str) -> str:
+ if stratify_by == "none":
+ return "all"
+ if stratify_by == "dataset":
+ return entries[0].dataset
+ if stratify_by == "document_type":
+ return str((entries[0].metadata or {}).get("document_type") or "unknown")
+ if stratify_by != "slices":
+ raise DataValidationError("stratify_by must be one of: slices, dataset, document_type, none")
+ slices = sorted({slice_name for entry in entries for slice_name in entry_slices(entry)})
+ return ",".join(slices) if slices else "unsliced"
+
+
+def _with_split(entry: ManifestEntry, split: str) -> ManifestEntry:
+ metadata = dict(entry.metadata)
+ metadata["original_split"] = entry.split
+ return ManifestEntry(
+ sample_id=entry.sample_id,
+ dataset=entry.dataset,
+ split=split,
+ image_path=entry.image_path,
+ text=entry.text,
+ sha256=entry.sha256,
+ metadata=metadata,
+ )
+
+
+def _duplicate_entry(entry: ManifestEntry, *, slice_name: str, duplicate_index: int) -> ManifestEntry:
+ metadata = dict(entry.metadata or {})
+ metadata["rebalance_source_sample_id"] = entry.sample_id
+ metadata["rebalance_slice"] = slice_name
+ metadata["rebalance_duplicate"] = True
+ return ManifestEntry(
+ sample_id=f"{entry.sample_id}~rebalance-{slice_name}-{duplicate_index:06d}",
+ dataset=entry.dataset,
+ split=entry.split,
+ image_path=entry.image_path,
+ text=entry.text,
+ sha256=entry.sha256,
+ metadata=metadata,
+ )
+
+
+def _matches_entry_filters(
+ entry: ManifestEntry,
+ *,
+ sample_ids: list[str],
+ slices: list[str],
+ document_types: list[str],
+ degradations: list[str],
+) -> bool:
+ metadata = entry.metadata or {}
+ if sample_ids and entry.sample_id not in set(sample_ids):
+ return False
+ entry_slice_set = set(entry_slices(entry))
+ if slices and not set(slices).issubset(entry_slice_set):
+ return False
+ document_type = str(metadata.get("document_type") or "")
+ if document_types and document_type not in set(document_types):
+ return False
+ degradation = str(metadata.get("degradation") or "")
+ if degradations and degradation not in set(degradations):
+ return False
+ return True
+
+
+def _write_audit(audit: ManifestAudit, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ (output_dir / "manifest-audit.json").write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Manifest Audit",
+ "",
+ f"Passed: `{'yes' if audit.passed else 'no'}`",
+ f"Samples: `{audit.sample_count}`",
+ "",
+ "## Issues",
+ "",
+ ]
+ lines.extend(f"- {item}" for item in audit.issues) if audit.issues else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {item}" for item in audit.warnings) if audit.warnings else lines.append("- none")
+ (output_dir / "manifest-audit.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_recognizer_corpus_audit(audit: RecognizerCorpusAudit, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ json_path = output_dir / "recognizer-corpus-audit.json"
+ md_path = output_dir / "recognizer-corpus-audit.md"
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Recognizer Corpus Audit",
+ "",
+ f"Passed: `{'yes' if audit.passed else 'no'}`",
+ f"Train manifest: `{audit.train_manifest}`",
+ f"Eval manifest: `{audit.eval_manifest}`",
+ f"Leakage check: `{'pass' if audit.leakage_passed else 'fail'}`",
+ "",
+ "## Profiles",
+ "",
+ "| split | samples | latin | devanagari | mixed | real | synthetic |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: |",
+ _recognizer_profile_row("train", audit.train_profile),
+ _recognizer_profile_row("eval", audit.eval_profile),
+ "",
+ "## Issues",
+ "",
+ ]
+ lines.extend(f"- {item}" for item in audit.issues) if audit.issues else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {item}" for item in audit.warnings) if audit.warnings else lines.append("- none")
+ lines.extend(
+ [
+ "",
+ "## Next Actions",
+ "",
+ ]
+ )
+ lines.extend(_recognizer_corpus_next_actions(audit))
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_recognizer_corpus_build_summary(summary: RecognizerCorpusBuildSummary, output_manifest: Path) -> None:
+ summary_json = output_manifest.with_name(f"{output_manifest.stem}-recognizer-corpus-build.json")
+ summary_md = output_manifest.with_name(f"{output_manifest.stem}-recognizer-corpus-build.md")
+ summary_json.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Recognizer Corpus Build",
+ "",
+ f"Output manifest: `{summary.output_manifest}`",
+ f"Source samples: `{summary.source_count}`",
+ f"Output samples: `{summary.output_count}`",
+ "",
+ "## Targets",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.target_counts.items()) if summary.target_counts else lines.append("- none")
+ lines.extend(["", "## Bucket Counts Before", ""])
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.bucket_counts_before.items()) if summary.bucket_counts_before else lines.append("- none")
+ lines.extend(["", "## Bucket Counts After", ""])
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.bucket_counts_after.items()) if summary.bucket_counts_after else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {item}" for item in summary.warnings) if summary.warnings else lines.append("- none")
+ summary_md.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _recognizer_profile_row(split: str, profile: RecognizerCorpusProfile) -> str:
+ scripts = profile.script_sample_counts
+ slices = profile.slice_counts
+ return (
+ f"| {split} | {profile.sample_count} | {scripts.get('contains_latin', 0)} | "
+ f"{scripts.get('contains_devanagari', 0)} | {scripts.get('mixed_devanagari_latin', 0)} | "
+ f"{slices.get('real', 0)} | {slices.get('synthetic', 0)} |"
+ )
+
+
+def _recognizer_corpus_next_actions(audit: RecognizerCorpusAudit) -> list[str]:
+ if audit.passed:
+ return ["- corpus passes the configured recognizer training gate"]
+ actions: list[str] = []
+ issue_text = "\n".join(audit.issues)
+ if "latin-script" in issue_text:
+ actions.append("- add or upsample English/Latin line crops before training")
+ if "devanagari-script" in issue_text:
+ actions.append("- add or upsample Nepali/Devanagari line crops before training")
+ if "mixed-script" in issue_text:
+ actions.append("- add mixed Nepali/English samples so the recognizer sees script transitions")
+ if "latin-only" in issue_text:
+ actions.append("- add Latin-only English samples to protect English preservation")
+ if "devanagari-only" in issue_text:
+ actions.append("- add Devanagari-only Nepali samples to prevent mixed-script-only overfitting")
+ if "real slice" in issue_text:
+ actions.append("- add real scanned/captured Nepali data; synthetic-only training is not enough")
+ if "synthetic slice" in issue_text:
+ actions.append("- add synthetic coverage for controllable character and layout diversity")
+ if "leakage" in issue_text:
+ actions.append("- regenerate train/eval split with leakage-safe grouping before training")
+ if not actions:
+ actions.append("- inspect failed thresholds and rebuild the training manifest")
+ return actions
+
+
+def _write_split_summary(summary: SplitSummary, output_dir: Path) -> None:
+ (output_dir / "split-summary.json").write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Manifest Split",
+ "",
+ f"Train manifest: `{summary.train_manifest}`",
+ f"Eval manifest: `{summary.eval_manifest}`",
+ f"Train samples: `{summary.train_count}`",
+ f"Eval samples: `{summary.eval_count}`",
+ f"Sample groups: `{summary.group_count}`",
+ f"Group by: `{summary.group_by}`",
+ f"Leakage check: `{'pass' if summary.leakage_passed else 'fail'}`",
+ "",
+ "## Warnings",
+ "",
+ ]
+ lines.extend(f"- {item}" for item in summary.warnings) if summary.warnings else lines.append("- none")
+ (output_dir / "split-summary.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_merge_summary(summary: MergeSummary, output_manifest: Path) -> None:
+ summary_json = output_manifest.with_name(f"{output_manifest.stem}-merge.json")
+ summary_md = output_manifest.with_name(f"{output_manifest.stem}-merge.md")
+ summary_json.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Manifest Merge",
+ "",
+ f"Output manifest: `{summary.output_manifest}`",
+ f"Samples: `{summary.sample_count}`",
+ "",
+ "## Input Manifests",
+ "",
+ ]
+ lines.extend(f"- `{path}`" for path in summary.input_manifests)
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {item}" for item in summary.warnings) if summary.warnings else lines.append("- none")
+ summary_md.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_rebalance_summary(summary: RebalanceSummary, output_manifest: Path) -> None:
+ summary_json = output_manifest.with_name(f"{output_manifest.stem}-rebalance.json")
+ summary_md = output_manifest.with_name(f"{output_manifest.stem}-rebalance.md")
+ summary_json.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Manifest Rebalance",
+ "",
+ f"Source manifest: `{summary.source_manifest}`",
+ f"Output manifest: `{summary.output_manifest}`",
+ f"Original samples: `{summary.original_count}`",
+ f"Rebalanced samples: `{summary.rebalanced_count}`",
+ f"Target count: `{summary.target_count}`",
+ "",
+ "## Slice Counts Before",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.slice_counts_before.items())
+ lines.extend(["", "## Slice Counts After", ""])
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.slice_counts_after.items())
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {item}" for item in summary.warnings) if summary.warnings else lines.append("- none")
+ summary_md.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_filter_summary(summary: FilterSummary, output_manifest: Path) -> None:
+ summary_json = output_manifest.with_name(f"{output_manifest.stem}-filter.json")
+ summary_md = output_manifest.with_name(f"{output_manifest.stem}-filter.md")
+ summary_json.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Manifest Filter",
+ "",
+ f"Source manifest: `{summary.source_manifest}`",
+ f"Output manifest: `{summary.output_manifest}`",
+ f"Source samples: `{summary.source_count}`",
+ f"Selected samples: `{summary.selected_count}`",
+ f"Sample IDs: `{', '.join(summary.sample_id_filters)}`",
+ f"Slices: `{', '.join(summary.slice_filters)}`",
+ f"Document types: `{', '.join(summary.document_type_filters)}`",
+ f"Degradations: `{', '.join(summary.degradation_filters)}`",
+ "",
+ "## Warnings",
+ "",
+ ]
+ lines.extend(f"- {item}" for item in summary.warnings) if summary.warnings else lines.append("- none")
+ summary_md.write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/engines.py b/src/ocrtech/engines.py
new file mode 100644
index 0000000000000000000000000000000000000000..03b2f178cbe8e3e8f80cc556138172dc5cad182f
--- /dev/null
+++ b/src/ocrtech/engines.py
@@ -0,0 +1,2491 @@
+"""Optional OCR engine adapters."""
+
+from __future__ import annotations
+
+import csv
+import html
+import json
+import os
+import re
+import shutil
+import subprocess
+import tempfile
+from dataclasses import dataclass, field, replace
+from html.parser import HTMLParser
+from pathlib import Path
+from typing import Protocol
+
+from .errors import DataValidationError, EngineUnavailableError, ParseError
+from .metrics import bbox_iou, edit_distance
+from .models import ModelCard, audit_model_card
+from .normalization import normalize_ocr_text
+from .schemas import BBox, Figure, Page, Table, TableCell, TextLine, validate_confidence
+
+
+@dataclass(slots=True)
+class EngineOutput:
+ pages: list[Page]
+ tables: list[Table] = field(default_factory=list)
+ figures: list[Figure] = field(default_factory=list)
+ metadata: dict[str, object] = field(default_factory=dict)
+
+ @property
+ def average_confidence(self) -> float | None:
+ values = [
+ line.confidence
+ for page in self.pages
+ for line in page.text_lines
+ if line.confidence is not None
+ ]
+ return sum(values) / len(values) if values else None
+
+
+class OcrEngine(Protocol):
+ name: str
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ """Recognize an image or document and return page text lines."""
+
+
+def _synthetic_lines_from_text(text: str, page_index: int = 0) -> list[TextLine]:
+ lines: list[TextLine] = []
+ y = 0
+ for index, raw_line in enumerate(text.splitlines()):
+ line_text = normalize_ocr_text(raw_line)
+ if not line_text.strip():
+ y += 28
+ continue
+ line = TextLine(
+ text=line_text,
+ bbox=BBox(0, y, max(50, len(line_text) * 9), 22),
+ confidence=1.0,
+ page_index=page_index,
+ line_id=f"p{page_index}-l{index}",
+ )
+ lines.append(line)
+ y += 28
+ return lines
+
+
+def sidecar_candidates(input_path: Path) -> list[Path]:
+ if input_path.is_dir():
+ return [
+ input_path / "document.ocr.json",
+ input_path / "document.txt",
+ input_path / "document.md",
+ ]
+ candidates = [
+ input_path.with_suffix(input_path.suffix + ".ocr.json"),
+ input_path.with_suffix(".ocr.json"),
+ input_path.with_suffix(input_path.suffix + ".txt"),
+ input_path.with_suffix(".txt"),
+ ]
+ if input_path.suffix.lower() in {".txt", ".md"}:
+ candidates.insert(0, input_path)
+ unique: list[Path] = []
+ for candidate in candidates:
+ if candidate not in unique:
+ unique.append(candidate)
+ return unique
+
+
+def has_sidecar(input_path: Path) -> bool:
+ return any(candidate.exists() for candidate in sidecar_candidates(input_path))
+
+
+def _bundle_page_paths(input_path: Path) -> list[Path]:
+ if not input_path.is_dir():
+ return []
+ allowed_suffixes = {".png", ".jpg", ".jpeg", ".tif", ".tiff", ".bmp", ".webp"}
+ page_paths = [path for path in sorted(input_path.iterdir()) if path.is_file() and path.suffix.lower() in allowed_suffixes]
+ if not page_paths:
+ raise ParseError(f"page bundle directory has no supported image files: {input_path}")
+ return page_paths
+
+
+def _pages_from_lines(lines: list[TextLine], *, metadata: dict[str, object] | None = None) -> list[Page]:
+ grouped: dict[int, list[TextLine]] = {}
+ for line in lines:
+ grouped.setdefault(line.page_index, []).append(line)
+ pages: list[Page] = []
+ for page_index in sorted(grouped):
+ pages.append(Page(page_index=page_index, text_lines=grouped[page_index], metadata=dict(metadata or {})))
+ return pages
+
+
+def _merge_engine_outputs(outputs: list[EngineOutput], *, engine_name: str) -> EngineOutput:
+ pages: list[Page] = []
+ tables: list[Table] = []
+ figures: list[Figure] = []
+ metadata: dict[str, object] = {"engine": engine_name}
+ for output in outputs:
+ pages.extend(output.pages)
+ tables.extend(output.tables)
+ figures.extend(output.figures)
+ return EngineOutput(pages=pages, tables=tables, figures=figures, metadata=metadata)
+
+
+class SidecarEngine:
+ """Deterministic engine for fixtures and pre-OCR text sidecars."""
+
+ name = "sidecar"
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ for candidate in sidecar_candidates(input_path):
+ if not candidate.exists():
+ continue
+ if candidate.suffix == ".json" or candidate.name.endswith(".ocr.json"):
+ return self._read_json(candidate)
+ return self._read_text(candidate)
+ raise EngineUnavailableError(
+ f"No OCR sidecar found for {input_path}. Expected one of: "
+ + ", ".join(str(path) for path in sidecar_candidates(input_path))
+ )
+
+ def _read_text(self, path: Path) -> EngineOutput:
+ text = path.read_text(encoding="utf-8")
+ lines = _synthetic_lines_from_text(text)
+ page = Page(page_index=0, width=None, height=None, text_lines=lines, metadata={"sidecar_path": str(path)})
+ return EngineOutput(pages=[page], metadata={"engine": self.name, "sidecar_path": str(path)})
+
+ def _read_json(self, path: Path) -> EngineOutput:
+ try:
+ data = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid OCR sidecar JSON {path}: {exc}") from exc
+ raw_pages = data.get("pages")
+ if not isinstance(raw_pages, list):
+ raise DataValidationError(f"OCR sidecar {path} must contain a pages list")
+ pages: list[Page] = []
+ for page_index, raw_page in enumerate(raw_pages):
+ if not isinstance(raw_page, dict):
+ raise DataValidationError(f"OCR sidecar page {page_index} must be an object")
+ lines = [
+ TextLine.from_dict(raw_line, page_index=page_index)
+ for raw_line in raw_page.get("lines", raw_page.get("text_lines", []))
+ ]
+ for line_index, line in enumerate(lines):
+ if line.line_id is None:
+ line.line_id = f"p{page_index}-l{line_index}"
+ pages.append(
+ Page(
+ page_index=page_index,
+ width=raw_page.get("width"),
+ height=raw_page.get("height"),
+ text_lines=lines,
+ metadata=dict(raw_page.get("metadata") or {}),
+ )
+ )
+ tables = [Table.from_dict(item) for item in data.get("tables", [])]
+ figures = [Figure.from_dict(item) for item in data.get("figures", [])]
+ metadata = dict(data.get("metadata") or {})
+ metadata.update({"engine": self.name, "sidecar_path": str(path)})
+ return EngineOutput(pages=pages, tables=tables, figures=figures, metadata=metadata)
+
+
+class TesseractEngine:
+ name = "tesseract"
+
+ def __init__(self, *, language: str = "nep+eng", psm: int = 6) -> None:
+ self.language = language
+ self.psm = psm
+ self.binary = shutil.which("tesseract")
+ if self.binary is None:
+ raise EngineUnavailableError("tesseract binary is not installed or not on PATH")
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ if input_path.is_dir():
+ outputs: list[EngineOutput] = []
+ for page_index, page_path in enumerate(_bundle_page_paths(input_path)):
+ lines = self._recognize_page(page_path, page_index=page_index)
+ outputs.append(
+ EngineOutput(
+ pages=[Page(page_index=page_index, text_lines=lines, metadata={"engine": self.name, "language": self.language})],
+ metadata={"engine": self.name, "language": self.language},
+ )
+ )
+ return _merge_engine_outputs(outputs, engine_name=self.name)
+ lines = self._recognize_page(input_path, page_index=0)
+ page = Page(page_index=0, text_lines=lines, metadata={"engine": self.name, "language": self.language})
+ return EngineOutput(pages=[page], metadata={"engine": self.name, "language": self.language})
+
+ def _recognize_page(self, input_path: Path, *, page_index: int) -> list[TextLine]:
+ command = [
+ self.binary or "tesseract",
+ str(input_path),
+ "stdout",
+ "-l",
+ self.language,
+ "--psm",
+ str(self.psm),
+ "tsv",
+ ]
+ completed = subprocess.run(command, check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ raise ParseError(f"tesseract failed for {input_path}: {completed.stderr.strip()}")
+ return self._parse_tsv(completed.stdout, page_offset=page_index)
+
+ def _parse_tsv(self, text: str, *, page_offset: int = 0) -> list[TextLine]:
+ reader = csv.DictReader(text.splitlines(), delimiter="\t")
+ grouped: dict[tuple[str, str, str, str], list[dict[str, str]]] = {}
+ for row in reader:
+ if row.get("level") != "5":
+ continue
+ word = row.get("text", "")
+ if not word.strip():
+ continue
+ key = (row.get("page_num", "1"), row.get("block_num", "0"), row.get("par_num", "0"), row.get("line_num", "0"))
+ grouped.setdefault(key, []).append(row)
+ lines: list[TextLine] = []
+ for line_index, (key, rows) in enumerate(sorted(grouped.items(), key=lambda item: tuple(int(part) for part in item[0]))):
+ boxes = []
+ confidences = []
+ words = []
+ for row in rows:
+ x = int(float(row.get("left", "0") or 0))
+ y = int(float(row.get("top", "0") or 0))
+ w = int(float(row.get("width", "0") or 0))
+ h = int(float(row.get("height", "0") or 0))
+ boxes.append(BBox(x, y, w, h))
+ words.append(row.get("text", ""))
+ try:
+ conf = float(row.get("conf", "-1"))
+ except ValueError:
+ conf = -1
+ if conf >= 0:
+ confidences.append(conf / 100)
+ from .schemas import union_bbox
+
+ page_index = page_offset + max(0, int(key[0]) - 1)
+ confidence = sum(confidences) / len(confidences) if confidences else None
+ lines.append(
+ TextLine(
+ text=normalize_ocr_text(" ".join(words)),
+ bbox=union_bbox(boxes),
+ confidence=confidence,
+ page_index=page_index,
+ line_id=f"p{page_index}-l{line_index}",
+ )
+ )
+ return lines
+
+
+class PaddleOcrEngine:
+ name = "paddleocr"
+
+ def __init__(self, **kwargs: object) -> None:
+ try:
+ from paddleocr import PaddleOCR
+ except ImportError as exc:
+ raise EngineUnavailableError("paddleocr is not installed. Install ocr-tech[engines].") from exc
+ paddle_kwargs = dict(kwargs) if kwargs else {"lang": "ne"}
+ self.ocr = PaddleOCR(**paddle_kwargs)
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ if input_path.is_dir():
+ outputs: list[EngineOutput] = []
+ for page_index, page_path in enumerate(_bundle_page_paths(input_path)):
+ raw_result = self._run_ocr(page_path)
+ lines = self._parse_result(raw_result, page_index=page_index)
+ outputs.append(
+ EngineOutput(
+ pages=[Page(page_index=page_index, text_lines=lines, metadata={"engine": self.name})],
+ metadata={"engine": self.name},
+ )
+ )
+ return _merge_engine_outputs(outputs, engine_name=self.name)
+ raw_result = self._run_ocr(input_path)
+ lines = self._parse_result(raw_result, page_index=0)
+ page = Page(page_index=0, text_lines=lines, metadata={"engine": self.name})
+ return EngineOutput(pages=[page], metadata={"engine": self.name})
+
+ def _run_ocr(self, input_path: Path) -> object:
+ if hasattr(self.ocr, "predict"):
+ return self.ocr.predict(str(input_path))
+ if hasattr(self.ocr, "ocr"):
+ return self.ocr.ocr(str(input_path), cls=True)
+ raise EngineUnavailableError("Installed paddleocr object exposes neither predict() nor ocr()")
+
+ def _parse_result(self, raw_result: object, *, page_index: int) -> list[TextLine]:
+ lines: list[TextLine] = []
+ candidates = raw_result
+ if isinstance(raw_result, list) and len(raw_result) == 1 and isinstance(raw_result[0], list):
+ candidates = raw_result[0]
+ if not isinstance(candidates, list):
+ raise ParseError(f"Unsupported PaddleOCR result type: {type(raw_result).__name__}")
+ line_index = 0
+ for item in candidates:
+ parsed_lines = self._parse_page_result(item)
+ if parsed_lines is None:
+ parsed = self._parse_line(item)
+ parsed_lines = [] if parsed is None else [parsed]
+ for text, bbox, confidence in parsed_lines:
+ lines.append(
+ TextLine(
+ text=normalize_ocr_text(text),
+ bbox=bbox,
+ confidence=confidence,
+ page_index=page_index,
+ line_id=f"p{page_index}-l{line_index}",
+ )
+ )
+ line_index += 1
+ return lines
+
+ def _parse_page_result(self, item: object) -> list[tuple[str, BBox, float | None]] | None:
+ payload = self._result_mapping(item)
+ if payload is None:
+ return None
+ texts = payload.get("rec_texts")
+ boxes = payload.get("rec_polys") or payload.get("dt_polys")
+ scores = payload.get("rec_scores")
+ if not isinstance(texts, list) or not isinstance(boxes, list):
+ return None
+ parsed_lines: list[tuple[str, BBox, float | None]] = []
+ for index, text in enumerate(texts):
+ if text is None:
+ continue
+ if index >= len(boxes):
+ continue
+ confidence = None
+ if isinstance(scores, list) and index < len(scores) and scores[index] is not None:
+ confidence = float(scores[index])
+ parsed_lines.append((str(text), _bbox_from_paddle_box(boxes[index]), confidence))
+ return parsed_lines
+
+ def _result_mapping(self, item: object) -> dict[str, object] | None:
+ payload: object = item
+ if not isinstance(payload, dict):
+ payload = getattr(item, "json", None)
+ if not isinstance(payload, dict):
+ return None
+ nested = payload.get("res")
+ if isinstance(nested, dict):
+ return nested
+ return payload
+
+ def _parse_line(self, item: object) -> tuple[str, BBox, float | None] | None:
+ if isinstance(item, dict):
+ text = item.get("text") or item.get("rec_text") or item.get("transcription")
+ score = item.get("score") or item.get("confidence") or item.get("rec_score")
+ bbox_value = item.get("bbox") or item.get("box") or item.get("dt_polys")
+ if text is None:
+ return None
+ return str(text), _bbox_from_paddle_box(bbox_value), float(score) if score is not None else None
+ if isinstance(item, list | tuple) and len(item) >= 2:
+ bbox_value = item[0]
+ rec = item[1]
+ if isinstance(rec, list | tuple) and rec:
+ text = str(rec[0])
+ score = float(rec[1]) if len(rec) > 1 and rec[1] is not None else None
+ return text, _bbox_from_paddle_box(bbox_value), score
+ return None
+
+
+class SuryaEngine:
+ name = "surya"
+
+ def __init__(
+ self,
+ *,
+ mode: str = "auto",
+ line_mode_max_height: int = 256,
+ line_mode_min_aspect_ratio: float = 3.0,
+ table_recognition_mode: str = "full",
+ ) -> None:
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise EngineUnavailableError("Pillow is not installed. Install ocr-tech[surya].") from exc
+ try:
+ from surya.inference import SuryaInferenceManager
+ from surya.layout.schema import LayoutBox, LayoutResult
+ from surya.recognition import RecognitionPredictor
+ from surya.table_rec import TableRecPredictor
+ except ImportError as exc:
+ raise EngineUnavailableError("surya-ocr is not installed. Install ocr-tech[surya].") from exc
+
+ normalized_mode = mode.strip().lower()
+ if normalized_mode not in {"auto", "full_page", "block"}:
+ raise EngineUnavailableError(f"unsupported surya mode: {mode!r}")
+ normalized_table_mode = table_recognition_mode.strip().lower()
+ if normalized_table_mode not in {"simple", "full"}:
+ raise EngineUnavailableError(f"unsupported surya table recognition mode: {table_recognition_mode!r}")
+ if shutil.which("llama-server") is None and not os.environ.get("LLAMA_CPP_BINARY"):
+ raise EngineUnavailableError("surya requires llama-server on PATH or LLAMA_CPP_BINARY to be set")
+
+ self.mode = normalized_mode
+ self.line_mode_max_height = int(line_mode_max_height)
+ self.line_mode_min_aspect_ratio = float(line_mode_min_aspect_ratio)
+ self.table_recognition_mode = normalized_table_mode
+ self._image_module = Image
+ self._layout_box_cls = LayoutBox
+ self._layout_result_cls = LayoutResult
+ self._manager = SuryaInferenceManager()
+ self._predictor = RecognitionPredictor(self._manager)
+ self._table_predictor = TableRecPredictor(self._manager)
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ if input_path.is_dir():
+ outputs: list[EngineOutput] = []
+ for page_index, page_path in enumerate(_bundle_page_paths(input_path)):
+ outputs.append(self._recognize_image(page_path, page_index=page_index))
+ return _merge_engine_outputs(outputs, engine_name=self.name)
+ return self._recognize_image(input_path, page_index=0)
+
+ def _recognize_image(self, input_path: Path, *, page_index: int) -> EngineOutput:
+ image = self._image_module.open(input_path).convert("RGB")
+ page_width, page_height = image.size
+ selected_mode = self._select_mode(page_width, page_height)
+ if selected_mode == "block":
+ page_result = self._predict_block(image)
+ table_results: dict[int, object] = {}
+ else:
+ page_result = self._predictor([image], full_page=True)[0]
+ table_results = self._predict_tables(image, page_result)
+ return self._convert_page_result(
+ page_result,
+ page_width,
+ page_height,
+ selected_mode,
+ page_index=page_index,
+ table_results=table_results,
+ )
+
+ def _select_mode(self, width: int, height: int) -> str:
+ if self.mode != "auto":
+ return self.mode
+ if height <= max(1, self.line_mode_max_height):
+ return "block"
+ aspect_ratio = float(width) / float(max(height, 1))
+ if aspect_ratio >= self.line_mode_min_aspect_ratio:
+ return "block"
+ return "full_page"
+
+ def _predict_block(self, image: object) -> object:
+ width, height = image.size
+ layout = self._layout_result_cls(
+ bboxes=[
+ self._layout_box_cls(
+ polygon=[[0, 0], [width, 0], [width, height], [0, height]],
+ label="Text",
+ raw_label="Text",
+ position=0,
+ count=50,
+ )
+ ],
+ image_bbox=[0, 0, float(width), float(height)],
+ )
+ return self._predictor([image], [layout], full_page=False)[0]
+
+ def _predict_tables(self, image: object, page_result: object) -> dict[int, object]:
+ raw_blocks = getattr(page_result, "blocks", None)
+ if not isinstance(raw_blocks, list):
+ return {}
+ crops: list[object] = []
+ indices: list[int] = []
+ for index, block in enumerate(raw_blocks):
+ label = str(getattr(block, "label", "") or "")
+ if label != "Table":
+ continue
+ bbox = _bbox_from_surya_polygon(getattr(block, "polygon", None))
+ crop = _crop_image_to_bbox(image, bbox)
+ if crop is None:
+ continue
+ crops.append(crop)
+ indices.append(index)
+ if not crops:
+ return {}
+ predictions = self._table_predictor(crops, mode=self.table_recognition_mode)
+ return {index: prediction for index, prediction in zip(indices, predictions, strict=False)}
+
+ def _convert_page_result(
+ self,
+ page_result: object,
+ page_width: int,
+ page_height: int,
+ selected_mode: str,
+ page_index: int,
+ *,
+ table_results: dict[int, object] | None = None,
+ ) -> EngineOutput:
+ raw_blocks = getattr(page_result, "blocks", None)
+ if not isinstance(raw_blocks, list):
+ raise ParseError("surya output is missing blocks")
+ text_lines: list[TextLine] = []
+ tables: list[Table] = []
+ figures: list[Figure] = []
+ table_results = table_results or {}
+ ordered_blocks = sorted(enumerate(raw_blocks), key=lambda item: int(getattr(item[1], "reading_order", 0) or 0))
+ for line_index, (block_index, block) in enumerate(ordered_blocks):
+ label = str(getattr(block, "label", "") or "")
+ polygon = getattr(block, "polygon", None)
+ bbox = _bbox_from_surya_polygon(polygon)
+ confidence = validate_confidence(getattr(block, "confidence", None), "surya confidence")
+ plain_text = _surya_html_to_text(str(getattr(block, "html", "") or ""))
+ metadata = {
+ "surya_label": label,
+ "surya_raw_label": str(getattr(block, "raw_label", "") or ""),
+ "surya_reading_order": int(getattr(block, "reading_order", line_index) or line_index),
+ "surya_html": str(getattr(block, "html", "") or ""),
+ "surya_skipped": bool(getattr(block, "skipped", False)),
+ "surya_error": bool(getattr(block, "error", False)),
+ }
+ if label == "Table":
+ table = _table_from_surya_block(
+ block_index=block_index,
+ table_id=f"p{page_index}-t{len(tables)}",
+ bbox=bbox,
+ confidence=confidence,
+ page_index=page_index,
+ metadata=metadata,
+ block_html=str(getattr(block, "html", "") or ""),
+ table_result=table_results.get(block_index),
+ )
+ tables.append(table)
+ elif label in {"Picture", "Image", "Figure", "Chart"}:
+ figures.append(
+ Figure(
+ figure_id=f"p{page_index}-f{len(figures)}",
+ page_index=page_index,
+ bbox=bbox,
+ summary=plain_text or None,
+ confidence=confidence,
+ metadata=metadata,
+ )
+ )
+ if plain_text:
+ text_lines.append(
+ TextLine(
+ text=plain_text,
+ bbox=bbox,
+ confidence=confidence,
+ page_index=page_index,
+ line_id=f"p{page_index}-l{line_index}",
+ metadata=metadata,
+ )
+ )
+ page = Page(
+ page_index=page_index,
+ width=float(page_width),
+ height=float(page_height),
+ text_lines=text_lines,
+ metadata={"engine": self.name, "surya_mode": selected_mode},
+ )
+ return EngineOutput(
+ pages=[page],
+ tables=tables,
+ figures=figures,
+ metadata={"engine": self.name, "surya_mode": selected_mode},
+ )
+
+
+def _crop_image_to_bbox(image: object, bbox: BBox) -> object | None:
+ left = max(0, int(bbox.x))
+ top = max(0, int(bbox.y))
+ right = max(left + 1, int(bbox.right))
+ bottom = max(top + 1, int(bbox.bottom))
+ if right <= left or bottom <= top:
+ return None
+ return image.crop((left, top, right, bottom))
+
+
+def _table_from_surya_block(
+ *,
+ block_index: int,
+ table_id: str,
+ bbox: BBox,
+ confidence: float | None,
+ page_index: int,
+ metadata: dict[str, object],
+ block_html: str,
+ table_result: object | None,
+) -> Table:
+ html_value = ""
+ if table_result is not None and isinstance(getattr(table_result, "html", None), str):
+ html_value = str(getattr(table_result, "html", "") or "")
+ elif block_html:
+ html_value = block_html
+ cells = _table_cells_from_html(html_value)
+ table_metadata = dict(metadata)
+ if table_result is not None:
+ table_metadata["surya_table_mode"] = str(getattr(table_result, "mode", "") or "")
+ table_metadata["surya_table_error"] = bool(getattr(table_result, "error", False))
+ if hasattr(table_result, "rows"):
+ table_metadata["surya_table_row_count"] = len(getattr(table_result, "rows", []) or [])
+ if hasattr(table_result, "cols"):
+ table_metadata["surya_table_col_count"] = len(getattr(table_result, "cols", []) or [])
+ table_metadata["surya_block_index"] = block_index
+ return Table(
+ table_id=table_id,
+ page_index=page_index,
+ bbox=bbox,
+ cells=cells,
+ html=html_value or None,
+ confidence=confidence,
+ metadata=table_metadata,
+ )
+
+
+def _bbox_from_surya_polygon(value: object) -> BBox:
+ if isinstance(value, list | tuple):
+ points: list[tuple[float, float]] = []
+ for point in value:
+ if isinstance(point, list | tuple) and len(point) >= 2:
+ points.append((float(point[0]), float(point[1])))
+ if points:
+ left = min(point[0] for point in points)
+ top = min(point[1] for point in points)
+ right = max(point[0] for point in points)
+ bottom = max(point[1] for point in points)
+ return BBox(left, top, right - left, bottom - top)
+ return BBox(0, 0, 0, 0)
+
+
+class _SuryaHtmlTextExtractor(HTMLParser):
+ def __init__(self) -> None:
+ super().__init__()
+ self.parts: list[str] = []
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ if tag in {"br", "tr"}:
+ self.parts.append("\n")
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag in {"p", "div", "tr", "li", "table"}:
+ self.parts.append("\n")
+
+ def handle_data(self, data: str) -> None:
+ self.parts.append(data)
+
+ def get_text(self) -> str:
+ joined = "".join(self.parts)
+ collapsed = re.sub(r"\n{3,}", "\n\n", joined)
+ collapsed = re.sub(r"[ \t]+", " ", collapsed)
+ return normalize_ocr_text(html.unescape(collapsed).strip())
+
+
+def _surya_html_to_text(value: str) -> str:
+ if not value:
+ return ""
+ parser = _SuryaHtmlTextExtractor()
+ parser.feed(value)
+ parser.close()
+ return parser.get_text()
+
+
+class _SuryaTableHtmlExtractor(HTMLParser):
+ def __init__(self) -> None:
+ super().__init__()
+ self.cells: list[TableCell] = []
+ self._in_row = False
+ self._cell_text: list[str] | None = None
+ self._current_row = 0
+ self._current_col = 0
+ self._cell_rowspan = 1
+ self._cell_colspan = 1
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ if tag == "tr":
+ self._in_row = True
+ self._current_col = 0
+ return
+ if tag in {"td", "th"} and self._in_row:
+ attrs_dict = {key: value for key, value in attrs}
+ self._cell_text = []
+ self._cell_rowspan = _safe_positive_int(attrs_dict.get("rowspan"), default=1)
+ self._cell_colspan = _safe_positive_int(attrs_dict.get("colspan"), default=1)
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag in {"td", "th"} and self._cell_text is not None:
+ text = normalize_ocr_text(html.unescape("".join(self._cell_text)).strip())
+ self.cells.append(
+ TableCell(
+ row=self._current_row,
+ col=self._current_col,
+ text=text,
+ rowspan=self._cell_rowspan,
+ colspan=self._cell_colspan,
+ bbox=None,
+ confidence=None,
+ )
+ )
+ self._current_col += self._cell_colspan
+ self._cell_text = None
+ self._cell_rowspan = 1
+ self._cell_colspan = 1
+ return
+ if tag == "tr" and self._in_row:
+ self._current_row += 1
+ self._current_col = 0
+ self._in_row = False
+
+ def handle_data(self, data: str) -> None:
+ if self._cell_text is not None:
+ self._cell_text.append(data)
+
+
+def _safe_positive_int(value: str | None, *, default: int) -> int:
+ if value is None:
+ return default
+ try:
+ parsed = int(value)
+ except (TypeError, ValueError):
+ return default
+ return parsed if parsed >= 1 else default
+
+
+def _table_cells_from_html(value: str) -> list[TableCell]:
+ if not value:
+ return []
+ parser = _SuryaTableHtmlExtractor()
+ parser.feed(value)
+ parser.close()
+ return parser.cells
+
+
+class CandidateEngine:
+ name = "candidate"
+
+ def __init__(self, *, model_config: str | Path | None = None) -> None:
+ if model_config is None:
+ raise EngineUnavailableError("candidate engine requires a model_config path")
+ audit = audit_model_card(model_config)
+ if not audit.passed:
+ raise EngineUnavailableError("candidate model audit failed: " + "; ".join(audit.issues))
+ self.model_config = Path(model_config)
+ self.card = ModelCard.from_path(self.model_config)
+ if self.card.backend == "sidecar":
+ self.engine: OcrEngine = SidecarEngine()
+ elif self.card.backend == "tesseract":
+ self.engine = TesseractEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "paddleocr":
+ self.engine = PaddleOcrEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "surya":
+ self.engine = SuryaEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "hf_vision_encoder_decoder":
+ self.engine = HuggingFaceVisionTextEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "text_correction_composite":
+ self.engine = TextCorrectionCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "quality_select_composite":
+ self.engine = QualitySelectCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "quality_ranked_ensemble":
+ self.engine = QualityRankedEnsembleEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "script_select_composite":
+ self.engine = ScriptSelectCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "line_align_composite":
+ self.engine = LineAlignCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "table_cell_refine_composite":
+ self.engine = TableCellRefineCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ elif self.card.backend == "figure_caption_refine_composite":
+ self.engine = FigureCaptionRefineCompositeEngine(**_resolve_model_kwargs(self.card, self.model_config))
+ else:
+ raise EngineUnavailableError(f"unsupported candidate backend: {self.card.backend}")
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ output = self.engine.recognize(input_path)
+ output.metadata["engine"] = self.name
+ output.metadata["candidate_model"] = {
+ "model_id": self.card.model_id,
+ "backend": self.card.backend,
+ "model_config": str(self.model_config),
+ "base_model": self.card.base_model,
+ }
+ return output
+
+
+def _bbox_from_paddle_box(value: object) -> BBox:
+ if hasattr(value, "tolist"):
+ value = value.tolist() # type: ignore[assignment, attr-defined]
+ if isinstance(value, list | tuple):
+ if len(value) == 4 and all(isinstance(item, int | float) for item in value):
+ return BBox.from_any(value)
+ points = []
+ for point in value:
+ if isinstance(point, list | tuple) and len(point) >= 2:
+ points.append((float(point[0]), float(point[1])))
+ if points:
+ left = min(point[0] for point in points)
+ top = min(point[1] for point in points)
+ right = max(point[0] for point in points)
+ bottom = max(point[1] for point in points)
+ return BBox(left, top, right - left, bottom - top)
+ return BBox(0, 0, 0, 0)
+
+
+def create_engine(name: str, **kwargs: object) -> OcrEngine:
+ engine_name = name.lower().strip()
+ if engine_name == "sidecar":
+ return SidecarEngine()
+ if engine_name in {"tesseract", "tess"}:
+ return TesseractEngine(**kwargs)
+ if engine_name in {"paddleocr", "paddle", "stock-paddle"}:
+ return PaddleOcrEngine(**kwargs)
+ if engine_name == "surya":
+ return SuryaEngine(**kwargs)
+ if engine_name in {"candidate", "ours"}:
+ return CandidateEngine(**kwargs)
+ if engine_name == "auto":
+ return AutoEngine()
+ raise EngineUnavailableError(f"Unknown OCR engine: {name}")
+
+
+class AutoEngine:
+ name = "auto"
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ if has_sidecar(input_path):
+ output = SidecarEngine().recognize(input_path)
+ output.metadata["auto_selected_engine"] = "sidecar"
+ return output
+ errors: list[str] = []
+ for factory_name in ("paddleocr", "tesseract"):
+ try:
+ engine = create_engine(factory_name)
+ output = engine.recognize(input_path)
+ output.metadata["auto_selected_engine"] = factory_name
+ return output
+ except EngineUnavailableError as exc:
+ errors.append(f"{factory_name}: {exc}")
+ raise EngineUnavailableError("No OCR engine available. " + " | ".join(errors))
+
+
+def _resolve_model_kwargs(card: ModelCard, config_path: Path) -> dict[str, object]:
+ return {
+ key: _resolve_model_kwarg_value(key, value, config_path.parent)
+ for key, value in card.backend_kwargs.items()
+ }
+
+
+def _resolve_model_kwarg_value(key: str, value: object, base_dir: Path) -> object:
+ if isinstance(value, str) and key.endswith(("_dir", "_path", "_file", "_config")):
+ path = Path(value)
+ return str(path if path.is_absolute() else base_dir / path)
+ if isinstance(value, dict):
+ return {
+ str(nested_key): _resolve_model_kwarg_value(str(nested_key), nested_value, base_dir)
+ for nested_key, nested_value in value.items()
+ }
+ if isinstance(value, list):
+ return [_resolve_model_kwarg_value(key, item, base_dir) for item in value]
+ return value
+
+
+class HuggingFaceVisionTextEngine:
+ name = "hf_vision_encoder_decoder"
+
+ def __init__(self, *, model_dir: str, processor_dir: str | None = None, max_new_tokens: int = 128, device: str | None = None) -> None:
+ try:
+ import torch
+ except ImportError as exc:
+ raise EngineUnavailableError("torch is not installed. Install ocr-tech[hf-recognizer].") from exc
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise EngineUnavailableError("Pillow is not installed. Install ocr-tech[hf-recognizer].") from exc
+ try:
+ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
+ except ImportError as exc:
+ raise EngineUnavailableError("transformers is not installed. Install ocr-tech[hf-recognizer].") from exc
+
+ self._torch = torch
+ self._image_module = Image
+ self.max_new_tokens = int(max_new_tokens)
+ self.model_dir = Path(model_dir)
+ self.processor_dir = Path(processor_dir) if processor_dir is not None else self.model_dir
+ if not self.model_dir.exists():
+ raise EngineUnavailableError(f"hf model_dir does not exist: {self.model_dir}")
+ if not self.processor_dir.exists():
+ raise EngineUnavailableError(f"hf processor_dir does not exist: {self.processor_dir}")
+ self.processor = _load_trocr_processor(TrOCRProcessor, self.processor_dir)
+ self.model = VisionEncoderDecoderModel.from_pretrained(str(self.model_dir))
+ self.device = device or _default_torch_device(torch)
+ generation_config = getattr(self.model, "generation_config", None)
+ if generation_config is not None and getattr(generation_config, "max_length", None) is not None:
+ try:
+ generation_config.max_length = None
+ except AttributeError:
+ pass
+ self.model.to(self.device)
+ self.model.eval()
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ if input_path.is_dir():
+ outputs: list[EngineOutput] = []
+ for page_index, page_path in enumerate(_bundle_page_paths(input_path)):
+ outputs.append(self._recognize_page(page_path, page_index=page_index))
+ merged = _merge_engine_outputs(outputs, engine_name=self.name)
+ merged.metadata.update(
+ {
+ "hf_model_dir": str(self.model_dir),
+ "hf_processor_dir": str(self.processor_dir),
+ "hf_device": self.device,
+ }
+ )
+ return merged
+ return self._recognize_page(input_path, page_index=0)
+
+ def _recognize_page(self, input_path: Path, *, page_index: int) -> EngineOutput:
+ image = self._image_module.open(input_path).convert("RGB")
+ pixel_values = self.processor(image, return_tensors="pt").pixel_values.to(self.device)
+ with self._torch.no_grad():
+ generated_ids = self.model.generate(pixel_values, max_new_tokens=self.max_new_tokens)
+ text = normalize_ocr_text(self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0])
+ line = TextLine(
+ text=text,
+ bbox=BBox(0, 0, 0, 0),
+ confidence=None,
+ page_index=page_index,
+ line_id=f"p{page_index}-l0",
+ )
+ page = Page(page_index=page_index, text_lines=[line], metadata={"engine": self.name})
+ return EngineOutput(
+ pages=[page],
+ metadata={
+ "engine": self.name,
+ "hf_model_dir": str(self.model_dir),
+ "hf_processor_dir": str(self.processor_dir),
+ "hf_device": self.device,
+ },
+ )
+
+
+def _default_torch_device(torch: object) -> str:
+ if getattr(torch, "cuda", None) is not None and torch.cuda.is_available():
+ return "cuda"
+ backends = getattr(torch, "backends", None)
+ mps = getattr(backends, "mps", None)
+ if mps is not None and mps.is_available():
+ return "mps"
+ return "cpu"
+
+
+def _load_trocr_processor(processor_cls: type[object], source: str | Path) -> object:
+ attempts = ({"backend": "pil"}, {"use_fast": False})
+ for kwargs in attempts:
+ try:
+ return processor_cls.from_pretrained(str(source), **kwargs)
+ except TypeError as exc:
+ if any(key in str(exc) for key in kwargs):
+ continue
+ raise
+ except ImportError as exc:
+ raise EngineUnavailableError("TrOCR processor loading requires sentencepiece and protobuf. Install ocr-tech[hf-recognizer].") from exc
+ except ValueError as exc:
+ message = str(exc)
+ if "SentencePiece" in message or "sentencepiece" in message or "tiktoken" in message or "protobuf" in message:
+ raise EngineUnavailableError("TrOCR processor loading requires sentencepiece and protobuf. Install ocr-tech[hf-recognizer].") from exc
+ raise
+ except AttributeError as exc:
+ if "'list' object has no attribute 'keys'" in str(exc):
+ return _load_trocr_processor_with_sanitized_tokenizer_config(processor_cls, source, kwargs)
+ raise
+ return processor_cls.from_pretrained(str(source))
+
+
+def _load_trocr_processor_with_sanitized_tokenizer_config(
+ processor_cls: type[object],
+ source: str | Path,
+ kwargs: dict[str, object],
+) -> object:
+ source_path = Path(source)
+ tokenizer_config_path = source_path / "tokenizer_config.json"
+ if not tokenizer_config_path.exists():
+ raise EngineUnavailableError(f"HF processor tokenizer_config.json does not exist: {tokenizer_config_path}")
+ try:
+ tokenizer_config = json.loads(tokenizer_config_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid tokenizer_config.json in HF processor directory {source_path}: {exc}") from exc
+ extra_special_tokens = tokenizer_config.get("extra_special_tokens")
+ if not isinstance(extra_special_tokens, list):
+ raise EngineUnavailableError(
+ "HF processor loading failed with extra_special_tokens compatibility error, "
+ "but tokenizer_config.json did not contain a list to sanitize"
+ )
+ sanitized_config = dict(tokenizer_config)
+ sanitized_config["extra_special_tokens"] = {}
+ with tempfile.TemporaryDirectory(prefix="ocrtech-trocr-processor-") as tmp_dir:
+ tmp_path = Path(tmp_dir)
+ shutil.copytree(source_path, tmp_path, dirs_exist_ok=True)
+ (tmp_path / "tokenizer_config.json").write_text(
+ json.dumps(sanitized_config, ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+ return processor_cls.from_pretrained(str(tmp_path), **kwargs)
+
+
+class TextCorrectionCompositeEngine:
+ name = "text_correction_composite"
+
+ def __init__(
+ self,
+ *,
+ model_dir: str,
+ tokenizer_dir: str | None = None,
+ base_engine: str = "tesseract",
+ base_engine_kwargs: dict[str, object] | None = None,
+ max_new_tokens: int = 256,
+ device: str | None = None,
+ ) -> None:
+ try:
+ import torch
+ except ImportError as exc:
+ raise EngineUnavailableError("torch is not installed. Install ocr-tech[hf-recognizer].") from exc
+ try:
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
+ except ImportError as exc:
+ raise EngineUnavailableError("transformers is not installed. Install ocr-tech[hf-recognizer].") from exc
+
+ if base_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"text correction composite does not support base_engine={base_engine!r}")
+ self.base_engine = create_engine(base_engine, **(base_engine_kwargs or {}))
+ self._torch = torch
+ self.max_new_tokens = int(max_new_tokens)
+ self.model_dir = Path(model_dir)
+ self.tokenizer_dir = Path(tokenizer_dir) if tokenizer_dir is not None else self.model_dir
+ if not self.model_dir.exists():
+ raise EngineUnavailableError(f"text corrector model_dir does not exist: {self.model_dir}")
+ if not self.tokenizer_dir.exists():
+ raise EngineUnavailableError(f"text corrector tokenizer_dir does not exist: {self.tokenizer_dir}")
+ self.tokenizer = AutoTokenizer.from_pretrained(str(self.tokenizer_dir), use_fast=False)
+ self.model = AutoModelForSeq2SeqLM.from_pretrained(str(self.model_dir))
+ self.device = device or _default_torch_device(torch)
+ generation_config = getattr(self.model, "generation_config", None)
+ if generation_config is not None and getattr(generation_config, "max_length", None) is not None:
+ try:
+ generation_config.max_length = None
+ except AttributeError:
+ pass
+ self.model.to(self.device)
+ self.model.eval()
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ base_output = self.base_engine.recognize(input_path)
+ all_lines = [line for page in base_output.pages for line in page.text_lines]
+ corrected = self._correct_lines([line.text for line in all_lines])
+ index = 0
+ corrected_pages: list[Page] = []
+ for page in base_output.pages:
+ text_lines: list[TextLine] = []
+ for line in page.text_lines:
+ text_lines.append(replace(line, text=corrected[index]))
+ index += 1
+ corrected_pages.append(replace(page, text_lines=text_lines))
+ metadata = dict(base_output.metadata)
+ metadata.update(
+ {
+ "engine": self.name,
+ "correction_base_engine": getattr(self.base_engine, "name", type(self.base_engine).__name__),
+ "correction_model_dir": str(self.model_dir),
+ "correction_tokenizer_dir": str(self.tokenizer_dir),
+ "correction_device": self.device,
+ }
+ )
+ return EngineOutput(pages=corrected_pages, tables=base_output.tables, figures=base_output.figures, metadata=metadata)
+
+ def _correct_lines(self, texts: list[str]) -> list[str]:
+ if not texts:
+ return []
+ tokenized = self.tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
+ batch = {key: value.to(self.device) for key, value in tokenized.items()}
+ with self._torch.no_grad():
+ generated_ids = self.model.generate(**batch, max_new_tokens=self.max_new_tokens)
+ decoded = self.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
+ return [normalize_ocr_text(text) for text in decoded]
+
+
+class QualitySelectCompositeEngine:
+ name = "quality_select_composite"
+
+ def __init__(
+ self,
+ *,
+ primary_engine: str,
+ secondary_engine: str,
+ primary_engine_kwargs: dict[str, object] | None = None,
+ secondary_engine_kwargs: dict[str, object] | None = None,
+ secondary_quality_margin: float = 0.0,
+ ) -> None:
+ if primary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"quality_select_composite does not support primary_engine={primary_engine!r}")
+ if secondary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"quality_select_composite does not support secondary_engine={secondary_engine!r}")
+ self.primary_engine = create_engine(primary_engine, **(primary_engine_kwargs or {}))
+ self.secondary_engine = create_engine(secondary_engine, **(secondary_engine_kwargs or {}))
+ self.secondary_quality_margin = float(secondary_quality_margin)
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ primary_output, primary_error = self._try_recognize(self.primary_engine, input_path)
+ secondary_output, secondary_error = self._try_recognize(self.secondary_engine, input_path)
+ if primary_output is None and secondary_output is None:
+ raise ParseError(
+ "quality_select_composite failed: "
+ + "; ".join(
+ [
+ f"primary={type(primary_error).__name__}: {primary_error}",
+ f"secondary={type(secondary_error).__name__}: {secondary_error}",
+ ]
+ )
+ )
+ if primary_output is None:
+ assert secondary_output is not None
+ return self._finalize_output(
+ secondary_output,
+ chosen_engine=getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ primary_quality=None,
+ secondary_quality=_score_engine_output_quality(input_path, secondary_output),
+ primary_error=primary_error,
+ secondary_error=secondary_error,
+ )
+ if secondary_output is None:
+ return self._finalize_output(
+ primary_output,
+ chosen_engine=getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ primary_quality=_score_engine_output_quality(input_path, primary_output),
+ secondary_quality=None,
+ primary_error=primary_error,
+ secondary_error=secondary_error,
+ )
+ primary_quality = _score_engine_output_quality(input_path, primary_output)
+ secondary_quality = _score_engine_output_quality(input_path, secondary_output)
+ quality_delta = secondary_quality.quality_score - primary_quality.quality_score
+ if quality_delta > self.secondary_quality_margin:
+ return self._finalize_output(
+ secondary_output,
+ chosen_engine=getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ primary_quality=primary_quality,
+ secondary_quality=secondary_quality,
+ primary_error=primary_error,
+ secondary_error=secondary_error,
+ )
+ return self._finalize_output(
+ primary_output,
+ chosen_engine=getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ primary_quality=primary_quality,
+ secondary_quality=secondary_quality,
+ primary_error=primary_error,
+ secondary_error=secondary_error,
+ )
+
+ def _try_recognize(self, engine: OcrEngine, input_path: Path) -> tuple[EngineOutput | None, Exception | None]:
+ try:
+ return engine.recognize(input_path), None
+ except Exception as exc:
+ return None, exc
+
+ def _finalize_output(
+ self,
+ output: EngineOutput,
+ *,
+ chosen_engine: str,
+ primary_quality: object | None,
+ secondary_quality: object | None,
+ primary_error: Exception | None,
+ secondary_error: Exception | None,
+ ) -> EngineOutput:
+ metadata = dict(output.metadata)
+ metadata.update(
+ {
+ "engine": self.name,
+ "quality_select_composite": {
+ "primary_engine": getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ "secondary_engine": getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ "chosen_engine": chosen_engine,
+ "secondary_quality_margin": self.secondary_quality_margin,
+ "primary_quality_score": getattr(primary_quality, "quality_score", None),
+ "secondary_quality_score": getattr(secondary_quality, "quality_score", None),
+ "primary_error": f"{type(primary_error).__name__}: {primary_error}" if primary_error is not None else None,
+ "secondary_error": f"{type(secondary_error).__name__}: {secondary_error}" if secondary_error is not None else None,
+ },
+ }
+ )
+ return EngineOutput(pages=output.pages, tables=output.tables, figures=output.figures, metadata=metadata)
+
+
+def _score_engine_output_quality(input_path: Path, output: EngineOutput) -> object:
+ from .quality import evaluate_document_quality
+ from .structure import build_document
+
+ document = build_document(str(input_path), output)
+ return evaluate_document_quality(document)
+
+
+class QualityRankedEnsembleEngine:
+ name = "quality_ranked_ensemble"
+
+ def __init__(
+ self,
+ *,
+ primary_engine: str,
+ primary_engine_kwargs: dict[str, object] | None = None,
+ alternative_engines: list[dict[str, object]],
+ selection_margin: float = 0.0,
+ ) -> None:
+ if primary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"quality_ranked_ensemble does not support primary_engine={primary_engine!r}")
+ if not alternative_engines:
+ raise EngineUnavailableError("quality_ranked_ensemble requires at least one alternative engine")
+ self.primary = _RankedEngineSpec(
+ label=str(primary_engine),
+ engine=create_engine(primary_engine, **(primary_engine_kwargs or {})),
+ quality_bias=0.0,
+ )
+ self.alternatives: list[_RankedEngineSpec] = []
+ for index, item in enumerate(alternative_engines):
+ if not isinstance(item, dict):
+ raise EngineUnavailableError(f"quality_ranked_ensemble alternative {index} must be an object")
+ engine_name = str(item.get("engine") or "")
+ if not engine_name:
+ raise EngineUnavailableError(f"quality_ranked_ensemble alternative {index} is missing engine")
+ if engine_name in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"quality_ranked_ensemble does not support alternative engine={engine_name!r}")
+ self.alternatives.append(
+ _RankedEngineSpec(
+ label=str(item.get("label") or engine_name),
+ engine=create_engine(engine_name, **dict(item.get("engine_kwargs") or {})),
+ quality_bias=float(item.get("quality_bias", 0.0)),
+ )
+ )
+ self.selection_margin = float(selection_margin)
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ scored_specs: list[tuple[_RankedEngineSpec, EngineOutput, object, float]] = []
+ errors: list[str] = []
+ for spec in [self.primary, *self.alternatives]:
+ try:
+ output = spec.engine.recognize(input_path)
+ quality = _score_engine_output_quality(input_path, output)
+ adjusted_quality = float(getattr(quality, "quality_score", 0.0)) + spec.quality_bias
+ scored_specs.append((spec, output, quality, adjusted_quality))
+ except Exception as exc:
+ errors.append(f"{spec.label}: {type(exc).__name__}: {exc}")
+ if not scored_specs:
+ raise ParseError("quality_ranked_ensemble failed: " + "; ".join(errors))
+ primary_scored = next(item for item in scored_specs if item[0] is self.primary)
+ chosen = max(scored_specs, key=lambda item: item[3])
+ if chosen is not primary_scored and chosen[3] <= primary_scored[3] + self.selection_margin:
+ chosen = primary_scored
+ spec, output, quality, adjusted_quality = chosen
+ metadata = dict(output.metadata)
+ metadata.update(
+ {
+ "engine": self.name,
+ "quality_ranked_ensemble": {
+ "primary_engine": self.primary.label,
+ "chosen_engine": spec.label,
+ "selection_margin": self.selection_margin,
+ "adjusted_quality_score": adjusted_quality,
+ "quality_score": getattr(quality, "quality_score", None),
+ "alternatives": [
+ {
+ "label": item_spec.label,
+ "quality_score": getattr(item_quality, "quality_score", None),
+ "adjusted_quality_score": item_adjusted,
+ "quality_bias": item_spec.quality_bias,
+ }
+ for item_spec, _item_output, item_quality, item_adjusted in scored_specs
+ ],
+ "errors": errors,
+ },
+ }
+ )
+ return EngineOutput(pages=output.pages, tables=output.tables, figures=output.figures, metadata=metadata)
+
+
+@dataclass(slots=True)
+class _RankedEngineSpec:
+ label: str
+ engine: OcrEngine
+ quality_bias: float
+
+
+class ScriptSelectCompositeEngine:
+ name = "script_select_composite"
+
+ def __init__(
+ self,
+ *,
+ primary_engine: str,
+ secondary_engine: str,
+ primary_engine_kwargs: dict[str, object] | None = None,
+ secondary_engine_kwargs: dict[str, object] | None = None,
+ script: str = "devanagari",
+ primary_script_threshold: float = 0.2,
+ routing_granularity: str = "document",
+ secondary_structure_backfill: bool = False,
+ ) -> None:
+ if primary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"script_select_composite does not support primary_engine={primary_engine!r}")
+ if secondary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"script_select_composite does not support secondary_engine={secondary_engine!r}")
+ self.primary_engine = create_engine(primary_engine, **(primary_engine_kwargs or {}))
+ self.secondary_engine = create_engine(secondary_engine, **(secondary_engine_kwargs or {}))
+ self.script = script.strip().lower()
+ self.primary_script_threshold = float(primary_script_threshold)
+ self.routing_granularity = routing_granularity.strip().lower()
+ self.secondary_structure_backfill = bool(secondary_structure_backfill)
+ if self.routing_granularity not in {"document", "page", "line"}:
+ raise EngineUnavailableError(f"unsupported script routing granularity: {routing_granularity!r}")
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ primary_output = self.primary_engine.recognize(input_path)
+ primary_text = _engine_output_text(primary_output)
+ primary_ratio = _script_ratio(primary_text, self.script)
+ if self.routing_granularity == "page":
+ secondary_output = self.secondary_engine.recognize(input_path)
+ return self._route_pages(
+ primary_output,
+ secondary_output,
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+ if self.routing_granularity == "line":
+ secondary_output = self.secondary_engine.recognize(input_path)
+ return self._route_lines(
+ primary_output,
+ secondary_output,
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+ if primary_ratio > self.primary_script_threshold:
+ secondary_output = self.secondary_engine.recognize(input_path)
+ return self._finalize_output(
+ secondary_output,
+ chosen_engine=getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+ if self.secondary_structure_backfill:
+ secondary_output = self.secondary_engine.recognize(input_path)
+ backfilled_output, structure_metadata = _backfill_structure_from_secondary(
+ primary_output,
+ secondary_output,
+ page_indexes={page.page_index for page in primary_output.pages},
+ )
+ backfilled_output.metadata.update(structure_metadata)
+ return self._finalize_output(
+ backfilled_output,
+ chosen_engine=getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+ return self._finalize_output(
+ primary_output,
+ chosen_engine=getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+
+ def _route_pages(
+ self,
+ primary_output: EngineOutput,
+ secondary_output: EngineOutput,
+ *,
+ primary_ratio: float,
+ primary_text: str,
+ ) -> EngineOutput:
+ primary_pages = {page.page_index: page for page in primary_output.pages}
+ secondary_pages = {page.page_index: page for page in secondary_output.pages}
+ page_indexes = sorted(set(primary_pages) | set(secondary_pages))
+ selected_pages: list[Page] = []
+ page_decisions: list[dict[str, object]] = []
+ secondary_page_count = 0
+ for page_index in page_indexes:
+ primary_page = primary_pages.get(page_index)
+ secondary_page = secondary_pages.get(page_index)
+ page_text = _page_text(primary_page)
+ page_ratio = _script_ratio(page_text, self.script)
+ choose_secondary = (
+ primary_page is not None
+ and secondary_page is not None
+ and page_ratio > self.primary_script_threshold
+ )
+ if choose_secondary:
+ selected_pages.append(secondary_page)
+ chosen_engine = getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__)
+ secondary_page_count += 1
+ elif primary_page is not None:
+ selected_pages.append(primary_page)
+ chosen_engine = getattr(self.primary_engine, "name", type(self.primary_engine).__name__)
+ elif secondary_page is not None:
+ selected_pages.append(secondary_page)
+ chosen_engine = getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__)
+ secondary_page_count += 1
+ else:
+ continue
+ page_decisions.append(
+ {
+ "page_index": page_index,
+ "chosen_engine": chosen_engine,
+ "primary_script_ratio": page_ratio,
+ "primary_text_preview": page_text[:120],
+ }
+ )
+ selected_page_indexes = {page.page_index for page in selected_pages}
+ secondary_engine_name = getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__)
+ chosen_engine = (
+ "mixed"
+ if secondary_page_count and secondary_page_count != len(selected_pages)
+ else secondary_engine_name
+ if secondary_page_count
+ else getattr(self.primary_engine, "name", type(self.primary_engine).__name__)
+ )
+ metadata = {
+ "page_routing": page_decisions,
+ "selected_page_indexes": sorted(selected_page_indexes),
+ }
+ if self.secondary_structure_backfill:
+ primary_page_indexes = {
+ int(item["page_index"])
+ for item in page_decisions
+ if item.get("chosen_engine") == getattr(self.primary_engine, "name", type(self.primary_engine).__name__)
+ }
+ merged_output, structure_metadata = _backfill_structure_from_secondary(
+ EngineOutput(
+ pages=selected_pages,
+ tables=_select_page_items(primary_output.tables, secondary_output.tables, page_decisions, secondary_engine_name),
+ figures=_select_page_items(primary_output.figures, secondary_output.figures, page_decisions, secondary_engine_name),
+ metadata=metadata,
+ ),
+ secondary_output,
+ page_indexes=primary_page_indexes,
+ )
+ merged_output.metadata.update(structure_metadata)
+ return self._finalize_output(
+ merged_output,
+ chosen_engine=chosen_engine,
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+ return self._finalize_output(
+ EngineOutput(
+ pages=selected_pages,
+ tables=_select_page_items(primary_output.tables, secondary_output.tables, page_decisions, secondary_engine_name),
+ figures=_select_page_items(primary_output.figures, secondary_output.figures, page_decisions, secondary_engine_name),
+ metadata=metadata,
+ ),
+ chosen_engine=chosen_engine,
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+
+ def _route_lines(
+ self,
+ primary_output: EngineOutput,
+ secondary_output: EngineOutput,
+ *,
+ primary_ratio: float,
+ primary_text: str,
+ ) -> EngineOutput:
+ primary_pages = {page.page_index: page for page in primary_output.pages}
+ secondary_pages = {page.page_index: page for page in secondary_output.pages}
+ page_indexes = sorted(set(primary_pages) | set(secondary_pages))
+ selected_pages: list[Page] = []
+ line_decisions: list[dict[str, object]] = []
+ secondary_line_count = 0
+ primary_engine_name = getattr(self.primary_engine, "name", type(self.primary_engine).__name__)
+ secondary_engine_name = getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__)
+ for page_index in page_indexes:
+ primary_page = primary_pages.get(page_index)
+ secondary_page = secondary_pages.get(page_index)
+ if primary_page is None and secondary_page is not None:
+ selected_pages.append(secondary_page)
+ secondary_line_count += len(secondary_page.text_lines)
+ for line in secondary_page.text_lines:
+ line_decisions.append(
+ {
+ "page_index": page_index,
+ "line_id": line.line_id,
+ "chosen_engine": secondary_engine_name,
+ "primary_script_ratio": None,
+ "reason": "missing_primary_page",
+ }
+ )
+ continue
+ if primary_page is None:
+ continue
+ secondary_lines = list(secondary_page.text_lines) if secondary_page is not None else []
+ unmatched_secondary = set(range(len(secondary_lines)))
+ routed_lines: list[TextLine] = []
+ for line in primary_page.text_lines:
+ line_ratio = _script_ratio(line.text, self.script)
+ matched_index, alignment_iou, alignment_distance = _best_line_match(line, secondary_lines, unmatched_secondary)
+ choose_secondary = (
+ line_ratio > self.primary_script_threshold
+ and matched_index is not None
+ )
+ if choose_secondary:
+ matched_line = secondary_lines[matched_index]
+ unmatched_secondary.discard(matched_index)
+ metadata = dict(line.metadata)
+ metadata.update(
+ {
+ "script_select_composite": {
+ "chosen_engine": secondary_engine_name,
+ "primary_text": line.text,
+ "secondary_line_id": matched_line.line_id,
+ "primary_script_ratio": line_ratio,
+ "alignment_iou": alignment_iou,
+ "alignment_center_distance": alignment_distance,
+ }
+ }
+ )
+ routed_lines.append(
+ replace(
+ line,
+ text=matched_line.text,
+ confidence=matched_line.confidence,
+ metadata=metadata,
+ )
+ )
+ chosen_engine = secondary_engine_name
+ secondary_line_count += 1
+ else:
+ routed_lines.append(line)
+ chosen_engine = primary_engine_name
+ line_decisions.append(
+ {
+ "page_index": page_index,
+ "line_id": line.line_id,
+ "chosen_engine": chosen_engine,
+ "primary_script_ratio": line_ratio,
+ "matched_secondary_line_id": secondary_lines[matched_index].line_id if matched_index is not None else None,
+ "alignment_iou": alignment_iou if matched_index is not None else None,
+ "alignment_center_distance": alignment_distance if matched_index is not None else None,
+ }
+ )
+ selected_pages.append(replace(primary_page, text_lines=routed_lines))
+ selected_page_indexes = {page.page_index for page in selected_pages}
+ chosen_engine = "mixed" if secondary_line_count else primary_engine_name
+ output = EngineOutput(
+ pages=selected_pages,
+ tables=list(primary_output.tables),
+ figures=list(primary_output.figures),
+ metadata={
+ "line_routing": line_decisions,
+ "selected_page_indexes": sorted(selected_page_indexes),
+ "secondary_line_count": secondary_line_count,
+ },
+ )
+ if self.secondary_structure_backfill:
+ output, structure_metadata = _backfill_structure_from_secondary(
+ output,
+ secondary_output,
+ page_indexes=selected_page_indexes,
+ )
+ output.metadata.update(structure_metadata)
+ return self._finalize_output(
+ output,
+ chosen_engine=chosen_engine,
+ primary_ratio=primary_ratio,
+ primary_text=primary_text,
+ )
+
+ def _finalize_output(
+ self,
+ output: EngineOutput,
+ *,
+ chosen_engine: str,
+ primary_ratio: float,
+ primary_text: str,
+ ) -> EngineOutput:
+ metadata = dict(output.metadata)
+ routing_metadata = {}
+ for key in ("page_routing", "line_routing", "selected_page_indexes", "secondary_line_count"):
+ if key in metadata:
+ routing_metadata[key] = metadata.pop(key)
+ metadata.update(
+ {
+ "engine": self.name,
+ "script_select_composite": {
+ "primary_engine": getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ "secondary_engine": getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ "chosen_engine": chosen_engine,
+ "script": self.script,
+ "primary_script_threshold": self.primary_script_threshold,
+ "routing_granularity": self.routing_granularity,
+ "secondary_structure_backfill": self.secondary_structure_backfill,
+ "primary_script_ratio": primary_ratio,
+ "primary_text_preview": primary_text[:120],
+ **routing_metadata,
+ },
+ }
+ )
+ return EngineOutput(pages=output.pages, tables=output.tables, figures=output.figures, metadata=metadata)
+
+
+_DEVANAGARI_RE = re.compile(r"[\u0900-\u097F]")
+_LATIN_RE = re.compile(r"[A-Za-z]")
+
+
+def _engine_output_text(output: EngineOutput) -> str:
+ return "\n".join(line.text for page in output.pages for line in page.text_lines if line.text.strip())
+
+
+def _page_text(page: Page | None) -> str:
+ if page is None:
+ return ""
+ return "\n".join(line.text for line in page.text_lines if line.text.strip())
+
+
+def _select_page_items(
+ primary_items: list[Table] | list[Figure],
+ secondary_items: list[Table] | list[Figure],
+ page_decisions: list[dict[str, object]],
+ secondary_engine_name: str,
+) -> list[Table] | list[Figure]:
+ primary_by_page: dict[int, list[Table] | list[Figure]] = {}
+ secondary_by_page: dict[int, list[Table] | list[Figure]] = {}
+ for item in primary_items:
+ primary_by_page.setdefault(item.page_index, []).append(item)
+ for item in secondary_items:
+ secondary_by_page.setdefault(item.page_index, []).append(item)
+ selected: list[Table] | list[Figure] = []
+ for decision in page_decisions:
+ page_index = decision.get("page_index")
+ if not isinstance(page_index, int):
+ continue
+ chosen_engine = decision.get("chosen_engine")
+ if chosen_engine == secondary_engine_name:
+ selected.extend(secondary_by_page.get(page_index, []))
+ else:
+ selected.extend(primary_by_page.get(page_index, []))
+ return selected
+
+
+def _backfill_structure_from_secondary(
+ primary_output: EngineOutput,
+ secondary_output: EngineOutput,
+ *,
+ page_indexes: set[int],
+) -> tuple[EngineOutput, dict[str, object]]:
+ page_indexes = {int(page_index) for page_index in page_indexes}
+ primary_tables_by_page: dict[int, list[Table]] = {}
+ secondary_tables_by_page: dict[int, list[Table]] = {}
+ primary_figures_by_page: dict[int, list[Figure]] = {}
+ secondary_figures_by_page: dict[int, list[Figure]] = {}
+ for table in primary_output.tables:
+ primary_tables_by_page.setdefault(table.page_index, []).append(table)
+ for table in secondary_output.tables:
+ secondary_tables_by_page.setdefault(table.page_index, []).append(table)
+ for figure in primary_output.figures:
+ primary_figures_by_page.setdefault(figure.page_index, []).append(figure)
+ for figure in secondary_output.figures:
+ secondary_figures_by_page.setdefault(figure.page_index, []).append(figure)
+
+ tables = list(primary_output.tables)
+ figures = list(primary_output.figures)
+ backfilled_table_pages: list[int] = []
+ backfilled_figure_pages: list[int] = []
+ for page_index in sorted(page_indexes):
+ if not primary_tables_by_page.get(page_index) and secondary_tables_by_page.get(page_index):
+ tables.extend(secondary_tables_by_page[page_index])
+ backfilled_table_pages.append(page_index)
+ if not primary_figures_by_page.get(page_index) and secondary_figures_by_page.get(page_index):
+ figures.extend(secondary_figures_by_page[page_index])
+ backfilled_figure_pages.append(page_index)
+ metadata = {
+ "structure_backfill": {
+ "secondary_tables_pages": backfilled_table_pages,
+ "secondary_figures_pages": backfilled_figure_pages,
+ }
+ }
+ return EngineOutput(pages=primary_output.pages, tables=tables, figures=figures, metadata=dict(primary_output.metadata)), metadata
+
+
+def _script_ratio(text: str, script: str) -> float:
+ non_space = [char for char in text if not char.isspace()]
+ if not non_space:
+ return 0.0
+ normalized = script.strip().lower()
+ if normalized == "devanagari":
+ matches = sum(1 for char in non_space if _DEVANAGARI_RE.match(char))
+ return matches / len(non_space)
+ if normalized in {"latin", "english"}:
+ matches = sum(1 for char in non_space if _LATIN_RE.match(char))
+ return matches / len(non_space)
+ raise EngineUnavailableError(f"unsupported script routing target: {script!r}")
+
+
+class LineAlignCompositeEngine:
+ name = "line_align_composite"
+
+ def __init__(
+ self,
+ *,
+ primary_engine: str,
+ secondary_engine: str,
+ primary_engine_kwargs: dict[str, object] | None = None,
+ secondary_engine_kwargs: dict[str, object] | None = None,
+ append_unmatched_primary: bool = True,
+ secondary_structure_backfill: bool = False,
+ ) -> None:
+ if primary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"line_align_composite does not support primary_engine={primary_engine!r}")
+ if secondary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"line_align_composite does not support secondary_engine={secondary_engine!r}")
+ self.primary_engine = create_engine(primary_engine, **(primary_engine_kwargs or {}))
+ self.secondary_engine = create_engine(secondary_engine, **(secondary_engine_kwargs or {}))
+ self.append_unmatched_primary = bool(append_unmatched_primary)
+ self.secondary_structure_backfill = bool(secondary_structure_backfill)
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ primary_output = self.primary_engine.recognize(input_path)
+ secondary_output = self.secondary_engine.recognize(input_path)
+ primary_pages = {page.page_index: page for page in primary_output.pages}
+ secondary_pages = {page.page_index: page for page in secondary_output.pages}
+ page_indexes = sorted(set(primary_pages) | set(secondary_pages))
+ aligned_pages: list[Page] = []
+ page_alignment: list[dict[str, object]] = []
+ total_matches = 0
+ for page_index in page_indexes:
+ primary_page = primary_pages.get(page_index)
+ secondary_page = secondary_pages.get(page_index)
+ aligned_page, alignment_meta = _align_page_lines(
+ primary_page,
+ secondary_page,
+ append_unmatched_primary=self.append_unmatched_primary,
+ )
+ total_matches += int(alignment_meta.get("matched_line_count", 0))
+ page_alignment.append({"page_index": page_index, **alignment_meta})
+ aligned_pages.append(aligned_page)
+ output = EngineOutput(
+ pages=aligned_pages,
+ tables=list(primary_output.tables),
+ figures=list(primary_output.figures),
+ metadata={
+ "engine": self.name,
+ "line_align_composite": {
+ "primary_engine": getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ "secondary_engine": getattr(self.secondary_engine, "name", type(self.secondary_engine).__name__),
+ "append_unmatched_primary": self.append_unmatched_primary,
+ "secondary_structure_backfill": self.secondary_structure_backfill,
+ "matched_line_count": total_matches,
+ "page_alignment": page_alignment,
+ },
+ },
+ )
+ if self.secondary_structure_backfill:
+ output, structure_metadata = _backfill_structure_from_secondary(
+ output,
+ secondary_output,
+ page_indexes={page.page_index for page in aligned_pages},
+ )
+ output.metadata.update(structure_metadata)
+ return output
+
+
+def _align_page_lines(
+ primary_page: Page | None,
+ secondary_page: Page | None,
+ *,
+ append_unmatched_primary: bool,
+) -> tuple[Page, dict[str, object]]:
+ if primary_page is None and secondary_page is None:
+ return Page(page_index=0, text_lines=[], metadata={}), {"matched_line_count": 0, "unmatched_primary_count": 0, "used_secondary_scaffold": False}
+ if secondary_page is None and primary_page is not None:
+ return primary_page, {"matched_line_count": len(primary_page.text_lines), "unmatched_primary_count": 0, "used_secondary_scaffold": False}
+ if primary_page is None and secondary_page is not None:
+ return secondary_page, {"matched_line_count": 0, "unmatched_primary_count": 0, "used_secondary_scaffold": True}
+
+ assert primary_page is not None
+ assert secondary_page is not None
+ unmatched_primary = set(range(len(primary_page.text_lines)))
+ aligned_lines: list[TextLine] = []
+ matched_count = 0
+ for secondary_line in secondary_page.text_lines:
+ matched_index, alignment_iou, alignment_distance = _best_line_match(secondary_line, primary_page.text_lines, unmatched_primary)
+ if matched_index is None:
+ aligned_lines.append(secondary_line)
+ continue
+ matched_primary = primary_page.text_lines[matched_index]
+ unmatched_primary.discard(matched_index)
+ matched_count += 1
+ metadata = dict(secondary_line.metadata)
+ metadata.update(
+ {
+ "aligned_primary_line_id": matched_primary.line_id,
+ "alignment_iou": alignment_iou,
+ "alignment_center_distance": alignment_distance,
+ }
+ )
+ aligned_lines.append(
+ TextLine(
+ text=matched_primary.text,
+ bbox=secondary_line.bbox,
+ confidence=matched_primary.confidence,
+ page_index=secondary_line.page_index,
+ line_id=secondary_line.line_id,
+ metadata=metadata,
+ )
+ )
+ if append_unmatched_primary:
+ for primary_index in sorted(unmatched_primary):
+ aligned_lines.append(primary_page.text_lines[primary_index])
+ aligned_page = Page(
+ page_index=secondary_page.page_index,
+ width=secondary_page.width,
+ height=secondary_page.height,
+ text_lines=aligned_lines,
+ metadata=dict(secondary_page.metadata),
+ )
+ return aligned_page, {
+ "matched_line_count": matched_count,
+ "unmatched_primary_count": len(unmatched_primary),
+ "used_secondary_scaffold": True,
+ }
+
+
+def _best_line_match(
+ target_line: TextLine,
+ candidate_lines: list[TextLine],
+ unmatched_indexes: set[int],
+) -> tuple[int | None, float, float]:
+ best_index: int | None = None
+ best_iou = -1.0
+ best_distance = float("inf")
+ for index in unmatched_indexes:
+ candidate = candidate_lines[index]
+ overlap = bbox_iou(target_line.bbox, candidate.bbox)
+ distance = _bbox_center_distance(target_line.bbox, candidate.bbox)
+ if overlap > best_iou or (overlap == best_iou and distance < best_distance):
+ best_index = index
+ best_iou = overlap
+ best_distance = distance
+ if best_index is None:
+ return None, 0.0, float("inf")
+ return best_index, best_iou, best_distance
+
+
+def _bbox_center_distance(left: BBox, right: BBox) -> float:
+ left_center_x = left.x + left.w / 2.0
+ left_center_y = left.y + left.h / 2.0
+ right_center_x = right.x + right.w / 2.0
+ right_center_y = right.y + right.h / 2.0
+ return ((left_center_x - right_center_x) ** 2 + (left_center_y - right_center_y) ** 2) ** 0.5
+
+
+class TableCellRefineCompositeEngine:
+ name = "table_cell_refine_composite"
+
+ def __init__(
+ self,
+ *,
+ structure_engine: str = "surya",
+ crop_engine: str = "tesseract",
+ structure_engine_kwargs: dict[str, object] | None = None,
+ crop_engine_kwargs: dict[str, object] | None = None,
+ crop_padding: int = 4,
+ min_replacement_chars: int = 1,
+ replacement_policy: str = "empty",
+ min_replacement_confidence_delta: float = 0.05,
+ deduplicate_tables: bool = False,
+ duplicate_iou_threshold: float = 0.9,
+ ) -> None:
+ if structure_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"table_cell_refine_composite does not support structure_engine={structure_engine!r}")
+ if crop_engine in {"ours", "auto"}:
+ raise EngineUnavailableError(f"table_cell_refine_composite does not support crop_engine={crop_engine!r}")
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise EngineUnavailableError("table cell refinement requires Pillow. Install ocr-tech[eval].") from exc
+ self.structure_engine = create_engine(structure_engine, **(structure_engine_kwargs or {}))
+ self.crop_engine = create_engine(crop_engine, **(crop_engine_kwargs or {}))
+ self.crop_padding = int(crop_padding)
+ self.min_replacement_chars = int(min_replacement_chars)
+ self.replacement_policy = replacement_policy.strip().lower()
+ self.min_replacement_confidence_delta = float(min_replacement_confidence_delta)
+ self.deduplicate_tables = bool(deduplicate_tables)
+ self.duplicate_iou_threshold = float(duplicate_iou_threshold)
+ if self.crop_padding < 0:
+ raise EngineUnavailableError("table_cell_refine_composite crop_padding must be non-negative")
+ if self.min_replacement_chars < 1:
+ raise EngineUnavailableError("table_cell_refine_composite min_replacement_chars must be at least 1")
+ if self.replacement_policy not in {"empty", "always", "guarded"}:
+ raise EngineUnavailableError("table_cell_refine_composite replacement_policy must be empty, guarded, or always")
+ if self.min_replacement_confidence_delta < 0:
+ raise EngineUnavailableError("table_cell_refine_composite min_replacement_confidence_delta must be non-negative")
+ if not 0.0 <= self.duplicate_iou_threshold <= 1.0:
+ raise EngineUnavailableError("table_cell_refine_composite duplicate_iou_threshold must be between 0 and 1")
+ self._image_module = Image
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ structure_output = self.structure_engine.recognize(input_path)
+ page_paths = _input_page_paths(input_path)
+ refined_tables: list[Table] = []
+ refined_count = 0
+ attempted_count = 0
+ error_count = 0
+ dropped_duplicate_tables = 0
+ with tempfile.TemporaryDirectory(prefix="ocrtech-cell-refine-") as tmp_dir:
+ tmp_path = Path(tmp_dir)
+ for table in structure_output.tables:
+ page_path = page_paths.get(table.page_index)
+ if page_path is None:
+ refined_tables.append(table)
+ continue
+ try:
+ with self._image_module.open(page_path).convert("RGB") as page_image:
+ refined_table, table_meta = self._refine_table(table, page_image, tmp_path)
+ except Exception as exc:
+ metadata = dict(table.metadata)
+ metadata["table_cell_refine_error"] = f"{type(exc).__name__}: {exc}"
+ refined_tables.append(replace(table, metadata=metadata))
+ error_count += 1
+ continue
+ refined_tables.append(refined_table)
+ refined_count += int(table_meta["replaced_cells"])
+ attempted_count += int(table_meta["attempted_cells"])
+ error_count += int(table_meta["error_cells"])
+ if self.deduplicate_tables:
+ refined_tables, dropped_duplicate_tables = _deduplicate_overlapping_tables(refined_tables, iou_threshold=self.duplicate_iou_threshold)
+ metadata = dict(structure_output.metadata)
+ metadata.update(
+ {
+ "engine": self.name,
+ "table_cell_refine_composite": {
+ "structure_engine": getattr(self.structure_engine, "name", type(self.structure_engine).__name__),
+ "crop_engine": getattr(self.crop_engine, "name", type(self.crop_engine).__name__),
+ "crop_padding": self.crop_padding,
+ "min_replacement_chars": self.min_replacement_chars,
+ "replacement_policy": self.replacement_policy,
+ "min_replacement_confidence_delta": self.min_replacement_confidence_delta,
+ "deduplicate_tables": self.deduplicate_tables,
+ "duplicate_iou_threshold": self.duplicate_iou_threshold,
+ "dropped_duplicate_tables": dropped_duplicate_tables,
+ "attempted_cells": attempted_count,
+ "replaced_cells": refined_count,
+ "error_cells": error_count,
+ },
+ }
+ )
+ return EngineOutput(
+ pages=structure_output.pages,
+ tables=refined_tables,
+ figures=structure_output.figures,
+ metadata=metadata,
+ )
+
+ def _refine_table(self, table: Table, page_image: object, tmp_dir: Path) -> tuple[Table, dict[str, int]]:
+ cells = list(table.cells)
+ if not cells:
+ return table, {"attempted_cells": 0, "replaced_cells": 0, "error_cells": 0}
+ rows = max(cell.row + cell.rowspan for cell in cells)
+ cols = max(cell.col + cell.colspan for cell in cells)
+ refined_cells: list[TableCell] = []
+ attempted = 0
+ replaced = 0
+ errors = 0
+ skipped_non_empty = 0
+ skipped_guarded = 0
+ for cell_index, cell in enumerate(cells):
+ if self.replacement_policy == "empty" and cell.text.strip():
+ refined_cells.append(_replace_cell(cell, bbox=cell.bbox if cell.bbox is not None else _infer_cell_bbox(table.bbox, cell, rows=rows, cols=cols)))
+ skipped_non_empty += 1
+ continue
+ bbox = cell.bbox if cell.bbox is not None and cell.bbox.w > 0 and cell.bbox.h > 0 else _infer_cell_bbox(table.bbox, cell, rows=rows, cols=cols)
+ crop = _crop_pil_image(page_image, _expand_bbox(bbox, self.crop_padding), self._image_module)
+ crop_path = tmp_dir / f"{table.table_id}-r{cell.row:03d}-c{cell.col:03d}-{cell_index:04d}.png"
+ crop.save(crop_path)
+ attempted += 1
+ try:
+ crop_output = self.crop_engine.recognize(crop_path)
+ crop_text = _engine_output_text(crop_output).strip()
+ crop_confidence = crop_output.average_confidence
+ except Exception as exc:
+ metadata = {"cell_refine_error": f"{type(exc).__name__}: {exc}"}
+ refined_cells.append(_replace_cell(cell, bbox=bbox, metadata=metadata))
+ errors += 1
+ continue
+ normalized = normalize_ocr_text(crop_text)
+ if len(normalized) >= self.min_replacement_chars:
+ should_replace, guard_reason = self._should_replace_cell(cell, normalized, crop_confidence)
+ if not should_replace:
+ metadata = {"cell_refine_guard": guard_reason} if guard_reason else None
+ refined_cells.append(_replace_cell(cell, bbox=bbox, metadata=metadata))
+ skipped_guarded += 1
+ continue
+ refined_cells.append(_replace_cell(cell, text=normalized, bbox=bbox, confidence=crop_confidence))
+ if normalized != cell.text:
+ replaced += 1
+ else:
+ refined_cells.append(_replace_cell(cell, bbox=bbox))
+ from .tables import cells_to_html
+
+ metadata = dict(table.metadata)
+ metadata["table_cell_refine"] = {
+ "attempted_cells": attempted,
+ "replaced_cells": replaced,
+ "error_cells": errors,
+ "skipped_non_empty_cells": skipped_non_empty,
+ "skipped_guarded_cells": skipped_guarded,
+ "crop_engine": getattr(self.crop_engine, "name", type(self.crop_engine).__name__),
+ }
+ refined_table = replace(table, cells=refined_cells, html=cells_to_html(refined_cells), metadata=metadata)
+ return refined_table, {"attempted_cells": attempted, "replaced_cells": replaced, "error_cells": errors}
+
+ def _should_replace_cell(self, cell: TableCell, replacement_text: str, replacement_confidence: float | None) -> tuple[bool, str | None]:
+ if self.replacement_policy == "always":
+ return True, None
+ if not cell.text.strip():
+ return True, None
+ if self.replacement_policy == "empty":
+ return False, "non_empty_cell"
+ if replacement_text == cell.text:
+ return False, "same_text"
+ if replacement_confidence is None:
+ return False, "missing_replacement_confidence"
+ if cell.confidence is None:
+ return False, "missing_existing_confidence"
+ if replacement_confidence < cell.confidence + self.min_replacement_confidence_delta:
+ return False, "replacement_confidence_not_higher"
+ return True, None
+
+
+def _deduplicate_overlapping_tables(tables: list[Table], *, iou_threshold: float) -> tuple[list[Table], int]:
+ kept: list[Table] = []
+ dropped = 0
+ for table in sorted(tables, key=_table_dedup_sort_key):
+ duplicate_index = None
+ for index, existing in enumerate(kept):
+ if table.page_index != existing.page_index:
+ continue
+ if bbox_iou(table.bbox, existing.bbox) >= iou_threshold:
+ duplicate_index = index
+ break
+ if duplicate_index is None:
+ kept.append(table)
+ continue
+ existing = kept[duplicate_index]
+ if _table_quality_score(table) > _table_quality_score(existing):
+ kept[duplicate_index] = table
+ dropped += 1
+ return sorted(kept, key=lambda item: (item.page_index, item.bbox.y, item.bbox.x)), dropped
+
+
+def _table_dedup_sort_key(table: Table) -> tuple[float, float, float, int, int, float]:
+ structure_score, non_empty, confidence = _table_quality_score(table)
+ return (table.page_index, table.bbox.y, table.bbox.x, -structure_score, -non_empty, -confidence)
+
+
+def _table_quality_score(table: Table) -> tuple[int, int, float]:
+ if not table.cells:
+ return (0, 0, float(table.confidence or 0.0))
+ rows = max(cell.row + cell.rowspan for cell in table.cells)
+ cols = max(cell.col + cell.colspan for cell in table.cells)
+ non_empty = sum(1 for cell in table.cells if cell.text.strip())
+ rectangular_cells = rows * cols
+ structure_score = min(len(table.cells), rectangular_cells)
+ return (structure_score, non_empty, float(table.confidence or 0.0))
+
+
+def _input_page_paths(input_path: Path) -> dict[int, Path]:
+ if input_path.is_dir():
+ return {index: page_path for index, page_path in enumerate(_bundle_page_paths(input_path))}
+ return {0: input_path}
+
+
+def _infer_cell_bbox(table_bbox: BBox, cell: TableCell, *, rows: int, cols: int) -> BBox:
+ col_width = table_bbox.w / max(cols, 1)
+ row_height = table_bbox.h / max(rows, 1)
+ return BBox(
+ table_bbox.x + col_width * cell.col,
+ table_bbox.y + row_height * cell.row,
+ col_width * cell.colspan,
+ row_height * cell.rowspan,
+ )
+
+
+def _expand_bbox(bbox: BBox, padding: int) -> BBox:
+ return BBox(bbox.x - padding, bbox.y - padding, bbox.w + padding * 2, bbox.h + padding * 2)
+
+
+def _crop_pil_image(image: object, bbox: BBox, image_module: object) -> object:
+ width, height = image.size
+ left = max(0, int(bbox.x))
+ top = max(0, int(bbox.y))
+ right = min(width, max(left + 1, int(bbox.right)))
+ bottom = min(height, max(top + 1, int(bbox.bottom)))
+ if right <= left or bottom <= top:
+ return image_module.new("RGB", (1, 1), "white")
+ return image.crop((left, top, right, bottom))
+
+
+def _replace_cell(
+ cell: TableCell,
+ *,
+ text: str | None = None,
+ bbox: BBox | None = None,
+ confidence: float | None = None,
+ metadata: dict[str, object] | None = None,
+) -> TableCell:
+ cell_metadata = dict(cell.metadata)
+ if metadata:
+ cell_metadata.update(metadata)
+ return TableCell(
+ row=cell.row,
+ col=cell.col,
+ text=cell.text if text is None else text,
+ rowspan=cell.rowspan,
+ colspan=cell.colspan,
+ bbox=bbox if bbox is not None else cell.bbox,
+ confidence=confidence if confidence is not None else cell.confidence,
+ metadata=cell_metadata,
+ )
+
+
+FIGURE_MARKER_LINE_RE = re.compile(r"^\s*(?:\[(?:figure|chart|image|चित्र)[^\]]*\]|(?:figure|fig\.?|chart|चित्र)\s*[::]?)", re.IGNORECASE)
+CAPTION_PREFIX_SPLIT_RE = re.compile(r"[\s\d०-९IVXivx.:-]+", re.UNICODE)
+
+
+class FigureCaptionRefineCompositeEngine:
+ name = "figure_caption_refine_composite"
+
+ def __init__(
+ self,
+ *,
+ primary_engine: str = "surya",
+ caption_engine: str = "tesseract",
+ primary_engine_kwargs: dict[str, object] | None = None,
+ caption_engine_kwargs: dict[str, object] | None = None,
+ min_caption_iou: float = 0.5,
+ min_score_delta: int = 1,
+ max_gap_multiplier: float = 1.5,
+ correct_structural_labels: bool = False,
+ table_name_lexicon_path: str | Path | None = None,
+ table_name_lexicon: list[str] | None = None,
+ table_name_max_distance: int = 2,
+ infer_table_header_colspans: bool = True,
+ normalize_table_grids: bool = True,
+ ) -> None:
+ if primary_engine in {"candidate", "ours", "auto"}:
+ raise EngineUnavailableError(f"figure_caption_refine_composite does not support primary_engine={primary_engine!r}")
+ if caption_engine in {"ours", "auto"}:
+ raise EngineUnavailableError(f"figure_caption_refine_composite does not support caption_engine={caption_engine!r}")
+ self.primary_engine = create_engine(primary_engine, **(primary_engine_kwargs or {}))
+ self.caption_engine = create_engine(caption_engine, **(caption_engine_kwargs or {}))
+ self.min_caption_iou = float(min_caption_iou)
+ self.min_score_delta = int(min_score_delta)
+ self.max_gap_multiplier = float(max_gap_multiplier)
+ self.correct_structural_labels = bool(correct_structural_labels)
+ self.table_name_lexicon = _load_table_name_lexicon(table_name_lexicon_path, table_name_lexicon)
+ self.table_name_max_distance = int(table_name_max_distance)
+ self.infer_table_header_colspans = bool(infer_table_header_colspans)
+ self.normalize_table_grids = bool(normalize_table_grids)
+ if not 0.0 <= self.min_caption_iou <= 1.0:
+ raise EngineUnavailableError("figure_caption_refine_composite min_caption_iou must be between 0 and 1")
+ if self.min_score_delta < 0:
+ raise EngineUnavailableError("figure_caption_refine_composite min_score_delta must be non-negative")
+ if self.max_gap_multiplier <= 0:
+ raise EngineUnavailableError("figure_caption_refine_composite max_gap_multiplier must be positive")
+ if self.table_name_max_distance < 0:
+ raise EngineUnavailableError("figure_caption_refine_composite table_name_max_distance must be non-negative")
+
+ def recognize(self, input_path: Path) -> EngineOutput:
+ primary_output = self.primary_engine.recognize(input_path)
+ caption_output = self.caption_engine.recognize(input_path)
+ secondary_by_page: dict[int, list[TextLine]] = {}
+ for page in caption_output.pages:
+ secondary_by_page.setdefault(page.page_index, []).extend(page.text_lines)
+
+ refined_pages: list[Page] = []
+ attempted = 0
+ replaced_count = 0
+ for page in primary_output.pages:
+ lines = list(page.text_lines)
+ refined_lines = list(lines)
+ index = 0
+ while index + 1 < len(lines):
+ marker = lines[index]
+ caption = lines[index + 1]
+ if not _line_looks_like_figure_marker(marker.text) or not _line_can_be_caption_after_marker(marker, caption, self.max_gap_multiplier):
+ index += 1
+ continue
+ attempted += 1
+ replacement = _best_caption_replacement(
+ caption,
+ secondary_by_page.get(caption.page_index, []),
+ min_iou=self.min_caption_iou,
+ min_score_delta=self.min_score_delta,
+ )
+ if replacement is not None:
+ metadata = dict(caption.metadata)
+ metadata["figure_caption_refine"] = {
+ "original_text": caption.text,
+ "replacement_engine": getattr(self.caption_engine, "name", type(self.caption_engine).__name__),
+ "replacement_text": replacement.text,
+ }
+ refined_lines[index + 1] = replace(
+ caption,
+ text=normalize_ocr_text(replacement.text),
+ confidence=replacement.confidence,
+ metadata=metadata,
+ )
+ replaced_count += 1
+ index += 1
+ if self.correct_structural_labels:
+ refined_lines = [_correct_structural_label_line(line) for line in refined_lines]
+ refined_pages.append(replace(page, text_lines=refined_lines))
+
+ refined_tables, inferred_colspans = _infer_table_header_colspans(primary_output.tables, enabled=self.infer_table_header_colspans)
+ refined_tables, normalized_table_columns, normalized_table_rows = _normalize_table_grids(
+ refined_tables,
+ enabled=self.normalize_table_grids,
+ )
+ refined_tables, table_name_corrections = _correct_table_name_cells(
+ refined_tables,
+ lexicon=self.table_name_lexicon,
+ max_distance=self.table_name_max_distance,
+ )
+ metadata = dict(primary_output.metadata)
+ metadata.update(
+ {
+ "engine": self.name,
+ "figure_caption_refine_composite": {
+ "primary_engine": getattr(self.primary_engine, "name", type(self.primary_engine).__name__),
+ "caption_engine": getattr(self.caption_engine, "name", type(self.caption_engine).__name__),
+ "min_caption_iou": self.min_caption_iou,
+ "min_score_delta": self.min_score_delta,
+ "max_gap_multiplier": self.max_gap_multiplier,
+ "correct_structural_labels": self.correct_structural_labels,
+ "table_name_lexicon_size": len(self.table_name_lexicon),
+ "table_name_max_distance": self.table_name_max_distance,
+ "table_name_corrections": table_name_corrections,
+ "infer_table_header_colspans": self.infer_table_header_colspans,
+ "inferred_table_header_colspans": inferred_colspans,
+ "normalize_table_grids": self.normalize_table_grids,
+ "normalized_table_grid_dropped_columns": normalized_table_columns,
+ "normalized_table_grid_merged_rows": normalized_table_rows,
+ "attempted_captions": attempted,
+ "replaced_captions": replaced_count,
+ },
+ }
+ )
+ return EngineOutput(pages=refined_pages, tables=refined_tables, figures=primary_output.figures, metadata=metadata)
+
+
+def _line_looks_like_figure_marker(text: str) -> bool:
+ return bool(FIGURE_MARKER_LINE_RE.match(text.strip()))
+
+
+def _line_can_be_caption_after_marker(marker: TextLine, candidate: TextLine, max_gap_multiplier: float) -> bool:
+ if _line_looks_like_figure_marker(candidate.text):
+ return False
+ if not candidate.text.strip():
+ return False
+ if "\t" in candidate.text or "|" in candidate.text:
+ return False
+ vertical_gap = candidate.bbox.y - marker.bbox.bottom
+ max_gap = max(marker.bbox.h, candidate.bbox.h, 24) * max_gap_multiplier
+ return 0 <= vertical_gap <= max_gap
+
+
+def _best_caption_replacement(
+ caption: TextLine,
+ candidates: list[TextLine],
+ *,
+ min_iou: float,
+ min_score_delta: int,
+) -> TextLine | None:
+ original_score = _caption_prefix_score(caption.text)
+ best: tuple[int, float, TextLine] | None = None
+ for candidate in candidates:
+ overlap = bbox_iou(caption.bbox, candidate.bbox)
+ if overlap < min_iou:
+ continue
+ candidate_score = _caption_prefix_score(candidate.text)
+ if original_score - candidate_score < min_score_delta:
+ continue
+ if best is None or candidate_score < best[0] or (candidate_score == best[0] and overlap > best[1]):
+ best = (candidate_score, overlap, candidate)
+ return best[2] if best is not None else None
+
+
+def _caption_prefix_score(text: str) -> int:
+ stripped = normalize_ocr_text(text).strip()
+ if not stripped:
+ return 99
+ prefix = CAPTION_PREFIX_SPLIT_RE.split(stripped, maxsplit=1)[0]
+ if not prefix:
+ return 99
+ lowered = prefix.lower()
+ if lowered in {"caption", "figure", "fig", "fig."}:
+ return 0
+ return min(edit_distance(prefix, target) for target in ("चित्र", "तालिका"))
+
+
+def _correct_structural_label_line(line: TextLine) -> TextLine:
+ corrected = _correct_structural_label_text(line.text)
+ if corrected == line.text:
+ return line
+ metadata = dict(line.metadata)
+ metadata["structural_label_correction"] = {"original_text": line.text, "corrected_text": corrected}
+ return replace(line, text=corrected, metadata=metadata)
+
+
+def _correct_structural_label_text(text: str) -> str:
+ normalized = normalize_ocr_text(text)
+ corrected = _correct_annual_report_title(normalized)
+ corrected = _correct_daily_ledger_title(corrected)
+ corrected = _correct_prefixed_label(corrected, target="चित्र", max_distance=2, require_separator=True)
+ corrected = _correct_prefixed_label(corrected, target="निष्कर्ष", max_distance=2, require_separator=True)
+ return corrected
+
+
+def _correct_annual_report_title(text: str) -> str:
+ match = re.match(r"^\s*(?P\S+)\s+(?P\S+)(?P.*)$", text)
+ if match is None:
+ return text
+ first = match.group("first").rstrip(":ः")
+ second = match.group("second").rstrip(":ः")
+ if edit_distance(first, "वार्षिक") <= 1 and edit_distance(second, "प्रतिवेदन") <= 3:
+ return f"वार्षिक प्रतिवेदन{match.group('rest')}"
+ return text
+
+
+def _correct_daily_ledger_title(text: str) -> str:
+ match = re.match(r"^\s*(?P\S+)\s+(?P\S+)(?P.*)$", text)
+ if match is None:
+ return text
+ first = match.group("first").rstrip(":ः")
+ second = match.group("second").rstrip(":ः")
+ if edit_distance(first, "दैनिक") <= 2 and edit_distance(second, "हिसाब") <= 2:
+ return f"दैनिक हिसाब{match.group('rest')}"
+ return text
+
+
+def _correct_prefixed_label(text: str, *, target: str, max_distance: int, require_separator: bool) -> str:
+ match = re.match(r"^(?P[^\s:ः]+)(?P[:ः]?)(?P.*)$", text)
+ if match is None:
+ return text
+ prefix = match.group("prefix")
+ sep = match.group("sep")
+ rest = match.group("rest")
+ if require_separator and not (sep or re.match(r"^\s*[०-९0-9IVXivx.:-]", rest)):
+ return text
+ if edit_distance(prefix, target) <= max_distance:
+ separator = ":" if sep else ""
+ return f"{target}{separator}{rest}"
+ return text
+
+
+def _load_table_name_lexicon(path: str | Path | None, inline_values: list[str] | None) -> list[str]:
+ values: list[str] = []
+ if inline_values:
+ values.extend(str(item) for item in inline_values)
+ if path is not None:
+ lexicon_path = Path(path)
+ if not lexicon_path.exists():
+ raise EngineUnavailableError(f"figure_caption_refine_composite table_name_lexicon_path does not exist: {lexicon_path}")
+ values.extend(lexicon_path.read_text(encoding="utf-8").splitlines())
+ cleaned: list[str] = []
+ seen: set[str] = set()
+ for value in values:
+ item = normalize_ocr_text(value).strip()
+ if not item or item.startswith("#") or item in seen:
+ continue
+ seen.add(item)
+ cleaned.append(item)
+ return cleaned
+
+
+def _infer_table_header_colspans(tables: list[Table], *, enabled: bool) -> tuple[list[Table], int]:
+ if not enabled:
+ return tables, 0
+ from .tables import infer_repeated_header_colspans
+
+ inferred_tables: list[Table] = []
+ total_inferred = 0
+ for table in tables:
+ inferred_table, count = infer_repeated_header_colspans(table)
+ inferred_tables.append(inferred_table)
+ total_inferred += count
+ return inferred_tables, total_inferred
+
+
+def _normalize_table_grids(tables: list[Table], *, enabled: bool) -> tuple[list[Table], int, int]:
+ if not enabled:
+ return tables, 0, 0
+ from .tables import normalize_table_grid_structure
+
+ normalized_tables: list[Table] = []
+ total_dropped_columns = 0
+ total_merged_rows = 0
+ for table in tables:
+ normalized_table, _changes = normalize_table_grid_structure(table)
+ normalized_tables.append(normalized_table)
+ total_dropped_columns += int(normalized_table.metadata.get("normalized_table_grid_dropped_columns") or 0)
+ total_merged_rows += int(normalized_table.metadata.get("normalized_table_grid_merged_rows") or 0)
+ return normalized_tables, total_dropped_columns, total_merged_rows
+
+
+def _correct_table_name_cells(tables: list[Table], *, lexicon: list[str], max_distance: int) -> tuple[list[Table], int]:
+ if not lexicon:
+ return tables, 0
+ corrected_tables: list[Table] = []
+ total_corrections = 0
+ for table in tables:
+ name_headers = _table_name_headers(table)
+ if not name_headers:
+ corrected_tables.append(table)
+ continue
+ corrected_cells: list[TableCell] = []
+ table_corrections = 0
+ for cell in table.cells:
+ header_row = name_headers.get(cell.col)
+ if header_row is None or cell.row <= header_row:
+ corrected_cells.append(cell)
+ continue
+ replacement_text = _nearest_unique_lexicon_match(cell.text, lexicon=lexicon, max_distance=max_distance)
+ if replacement_text is None:
+ corrected_cells.append(cell)
+ continue
+ corrected_cells.append(_replace_cell(cell, text=replacement_text))
+ table_corrections += 1
+ if table_corrections:
+ from .tables import cells_to_html
+
+ metadata = dict(table.metadata)
+ metadata["table_name_lexicon_corrections"] = table_corrections
+ corrected_table = replace(
+ table,
+ cells=corrected_cells,
+ html=cells_to_html(corrected_cells),
+ metadata=metadata,
+ )
+ corrected_tables.append(corrected_table)
+ total_corrections += table_corrections
+ else:
+ corrected_tables.append(table)
+ return corrected_tables, total_corrections
+
+
+def _table_name_headers(table: Table) -> dict[int, int]:
+ headers: dict[int, int] = {}
+ for cell in table.cells:
+ header = normalize_ocr_text(cell.text).strip().rstrip(":ः")
+ if edit_distance(header, "नाम") <= 1 and (cell.col not in headers or cell.row < headers[cell.col]):
+ headers[cell.col] = cell.row
+ return headers
+
+
+def _nearest_unique_lexicon_match(text: str, *, lexicon: list[str], max_distance: int) -> str | None:
+ normalized = normalize_ocr_text(text).strip()
+ if not normalized:
+ return None
+ if normalized in lexicon:
+ return None
+ suffix = ""
+ match = re.match(r"^(?P[^-\s]+)(?P-[A-Za-z0-9०-९]+)$", normalized)
+ if match is not None:
+ normalized = match.group("base")
+ suffix = match.group("suffix")
+ if normalized in lexicon:
+ return None
+ scores = sorted((edit_distance(normalized, item), item) for item in lexicon)
+ if not scores or scores[0][0] > max_distance:
+ return None
+ if len(scores) > 1 and scores[1][0] == scores[0][0]:
+ return None
+ return f"{scores[0][1]}{suffix}"
diff --git a/src/ocrtech/error_analysis.py b/src/ocrtech/error_analysis.py
new file mode 100644
index 0000000000000000000000000000000000000000..42b626c8ba6ba2748eafb5c713934e2a88672214
--- /dev/null
+++ b/src/ocrtech/error_analysis.py
@@ -0,0 +1,478 @@
+"""Error analysis utilities for benchmark reports."""
+
+from __future__ import annotations
+
+import json
+import math
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Any
+
+from .benchmark import _load_benchmark_rows
+from .errors import BenchmarkError
+from .manifest import ManifestEntry, load_manifest, write_manifest
+from .validation import metric_direction, sample_key
+
+
+@dataclass(slots=True)
+class BenchmarkErrorAnalysis:
+ benchmark_report: str
+ system: str
+ metric: str
+ direction: str
+ baselines: list[str]
+ sample_count: int
+ top_failures_path: str
+ analysis_path: str
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "benchmark_report": self.benchmark_report,
+ "system": self.system,
+ "metric": self.metric,
+ "direction": self.direction,
+ "baselines": self.baselines,
+ "sample_count": self.sample_count,
+ "top_failures_path": self.top_failures_path,
+ "analysis_path": self.analysis_path,
+ }
+
+
+@dataclass(slots=True)
+class FailureManifestExport:
+ source_manifest: str
+ top_failures_path: str
+ output_manifest: str
+ selected_count: int
+ split: str | None
+ summary_path: str
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "source_manifest": self.source_manifest,
+ "top_failures_path": self.top_failures_path,
+ "output_manifest": self.output_manifest,
+ "selected_count": self.selected_count,
+ "split": self.split,
+ "summary_path": self.summary_path,
+ }
+
+
+def analyze_benchmark_errors(
+ report_path: str | Path,
+ output_dir: str | Path,
+ *,
+ system: str,
+ baselines: list[str] | None = None,
+ metric: str = "cer",
+ direction: str | None = None,
+ top_n: int = 20,
+) -> BenchmarkErrorAnalysis:
+ if top_n < 1:
+ raise BenchmarkError("top_n must be at least 1")
+ rows = _load_benchmark_rows(report_path)
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ target_direction = direction or metric_direction(metric)
+ available_systems = sorted({str(row.get("baseline") or "") for row in rows if str(row.get("baseline") or "")})
+ if system not in available_systems:
+ raise BenchmarkError(f"system {system!r} is not present in benchmark report")
+ compare_baselines = baselines or []
+ missing = [name for name in compare_baselines if name not in available_systems]
+ if missing:
+ raise BenchmarkError(f"requested baselines missing from benchmark report: {', '.join(missing)}")
+
+ rows_by_system = _metric_rows_by_system(rows, metric)
+ system_rows = rows_by_system.get(system, {})
+ if not system_rows:
+ raise BenchmarkError(f"system {system!r} has no ok rows with metric {metric!r}")
+
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ top_failures = _top_failures(system_rows, rows_by_system, compare_baselines, metric, target_direction, top_n)
+ slice_summary = _slice_summary(system_rows, rows_by_system, compare_baselines, metric, target_direction)
+ baseline_summary = _baseline_summary(system_rows, rows_by_system, compare_baselines, metric, target_direction)
+ top_failure_slice_counts = _top_failure_slice_counts(top_failures)
+
+ top_failures_path = out / "top-failures.json"
+ top_failures_path.write_text(json.dumps(top_failures, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ payload = {
+ "benchmark_report": str(Path(report_path)),
+ "system": system,
+ "metric": metric,
+ "direction": target_direction,
+ "baselines": compare_baselines,
+ "sample_count": len(system_rows),
+ "baseline_summary": baseline_summary,
+ "slice_summary": slice_summary,
+ "top_failure_slice_counts": top_failure_slice_counts,
+ "top_failures_path": str(top_failures_path),
+ }
+ analysis_path = out / "error-analysis.json"
+ analysis_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_markdown(out / "error-analysis.md", payload, top_failures)
+ return BenchmarkErrorAnalysis(
+ benchmark_report=str(Path(report_path)),
+ system=system,
+ metric=metric,
+ direction=target_direction,
+ baselines=compare_baselines,
+ sample_count=len(system_rows),
+ top_failures_path=str(top_failures_path),
+ analysis_path=str(analysis_path),
+ )
+
+
+def export_failure_manifest(
+ source_manifest: str | Path,
+ top_failures_path: str | Path,
+ output_manifest: str | Path,
+ *,
+ split: str | None = None,
+) -> FailureManifestExport:
+ entries = load_manifest(source_manifest)
+ entries_by_sample = {entry.sample_id: entry for entry in entries}
+ try:
+ failure_rows = json.loads(Path(top_failures_path).read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise BenchmarkError(f"invalid top failures JSON {top_failures_path}: {exc}") from exc
+ if not isinstance(failure_rows, list):
+ raise BenchmarkError("top failures file must contain a JSON list")
+ selected: list[ManifestEntry] = []
+ missing: list[str] = []
+ seen: set[str] = set()
+ for rank, item in enumerate(failure_rows, start=1):
+ if not isinstance(item, dict):
+ raise BenchmarkError(f"top failure row {rank} must be an object")
+ sample_id = str(item.get("sample_id") or item.get("sample_key") or "")
+ if not sample_id:
+ raise BenchmarkError(f"top failure row {rank} missing sample_id/sample_key")
+ if sample_id in seen:
+ continue
+ seen.add(sample_id)
+ source = entries_by_sample.get(sample_id)
+ if source is None:
+ missing.append(sample_id)
+ continue
+ selected.append(_failure_entry(source, failure=item, rank=rank, split=split))
+ if missing:
+ raise BenchmarkError(f"top failure samples missing from source manifest: {', '.join(missing)}")
+ if not selected:
+ raise BenchmarkError("failure manifest export selected zero samples")
+ out_path = Path(output_manifest)
+ write_manifest(selected, out_path)
+ summary_path = out_path.with_name(f"{out_path.stem}-failure-manifest.json")
+ export = FailureManifestExport(
+ source_manifest=str(Path(source_manifest)),
+ top_failures_path=str(Path(top_failures_path)),
+ output_manifest=str(out_path),
+ selected_count=len(selected),
+ split=split,
+ summary_path=str(summary_path),
+ )
+ summary_path.write_text(json.dumps(export.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_failure_manifest_markdown(out_path.with_name(f"{out_path.stem}-failure-manifest.md"), export, selected)
+ return export
+
+
+def _metric_rows_by_system(rows: list[dict[str, Any]], metric: str) -> dict[str, dict[str, dict[str, Any]]]:
+ by_system: dict[str, dict[str, dict[str, Any]]] = {}
+ for row in rows:
+ if row.get("status") != "ok":
+ continue
+ baseline = str(row.get("baseline") or "")
+ if not baseline:
+ continue
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ value = metrics.get(metric)
+ if not isinstance(value, int | float) or not math.isfinite(float(value)):
+ continue
+ by_system.setdefault(baseline, {})[sample_key(row)] = row
+ return by_system
+
+
+def _failure_entry(source: ManifestEntry, *, failure: dict[str, Any], rank: int, split: str | None) -> ManifestEntry:
+ metadata = dict(source.metadata or {})
+ if split:
+ existing_slices = metadata.get("slices")
+ slice_values = list(existing_slices) if isinstance(existing_slices, list) else []
+ if split not in {str(item) for item in slice_values}:
+ slice_values.append(split)
+ metadata["slices"] = slice_values
+ metric_name, metric_value = _failure_metric(failure)
+ metadata["failure_analysis"] = {
+ "rank": rank,
+ "metric": metric_name,
+ "metric_value": metric_value,
+ "worst_gap": failure.get("worst_gap"),
+ "comparisons": failure.get("comparisons") if isinstance(failure.get("comparisons"), dict) else {},
+ }
+ return ManifestEntry(
+ sample_id=source.sample_id,
+ dataset=source.dataset,
+ split=split or source.split,
+ image_path=source.image_path,
+ text=source.text,
+ sha256=source.sha256,
+ metadata=metadata,
+ )
+
+
+def _failure_metric(failure: dict[str, Any]) -> tuple[str, float]:
+ for key, value in failure.items():
+ if key in {"badness", "worst_gap"}:
+ continue
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ return key, float(value)
+ raise BenchmarkError("top failure row has no finite metric value")
+
+
+def _write_failure_manifest_markdown(path: Path, export: FailureManifestExport, selected: list[ManifestEntry]) -> None:
+ lines = [
+ "# Failure Manifest Export",
+ "",
+ f"Source manifest: `{export.source_manifest}`",
+ f"Top failures: `{export.top_failures_path}`",
+ f"Output manifest: `{export.output_manifest}`",
+ f"Selected samples: `{export.selected_count}`",
+ f"Split override: `{export.split or ''}`",
+ "",
+ "| rank | sample_id | metric | value | image_path |",
+ "| ---: | --- | --- | ---: | --- |",
+ ]
+ for entry in selected:
+ failure = (entry.metadata or {}).get("failure_analysis") or {}
+ lines.append(
+ "| {rank} | {sample_id} | {metric} | {value:.6f} | {image_path} |".format(
+ rank=int(failure.get("rank") or 0),
+ sample_id=entry.sample_id,
+ metric=str(failure.get("metric") or ""),
+ value=float(failure.get("metric_value") or 0.0),
+ image_path=entry.image_path,
+ )
+ )
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _top_failures(
+ system_rows: dict[str, dict[str, Any]],
+ rows_by_system: dict[str, dict[str, dict[str, Any]]],
+ baselines: list[str],
+ metric: str,
+ direction: str,
+ top_n: int,
+) -> list[dict[str, Any]]:
+ ranked = [_failure_record(sample, row, rows_by_system, baselines, metric, direction) for sample, row in system_rows.items()]
+ ranked.sort(key=_failure_sort_key, reverse=True)
+ return ranked[:top_n]
+
+
+def _top_failure_slice_counts(top_failures: list[dict[str, Any]]) -> list[dict[str, object]]:
+ counts: dict[str, int] = {}
+ for item in top_failures:
+ slices = item.get("slices")
+ if not isinstance(slices, list):
+ continue
+ for slice_name in slices:
+ text = str(slice_name)
+ if text:
+ counts[text] = counts.get(text, 0) + 1
+ return [{"slice": slice_name, "count": count} for slice_name, count in sorted(counts.items(), key=lambda pair: (-pair[1], pair[0]))]
+
+
+def _failure_sort_key(item: dict[str, Any]) -> tuple[float, float, float]:
+ worst_gap = item.get("worst_gap")
+ badness = float(item["badness"])
+ if isinstance(worst_gap, int | float) and math.isfinite(float(worst_gap)):
+ gap = float(worst_gap)
+ return (1.0 if gap > 0 else 0.0, gap if gap > 0 else badness, badness)
+ return (0.0, badness, badness)
+
+
+def _failure_record(
+ sample: str,
+ row: dict[str, Any],
+ rows_by_system: dict[str, dict[str, dict[str, Any]]],
+ baselines: list[str],
+ metric: str,
+ direction: str,
+) -> dict[str, Any]:
+ metrics = row.get("metrics") or {}
+ value = float(metrics[metric])
+ comparisons: dict[str, dict[str, float]] = {}
+ gaps: list[float] = []
+ for baseline in baselines:
+ baseline_row = rows_by_system.get(baseline, {}).get(sample)
+ if baseline_row is None:
+ continue
+ baseline_value = float((baseline_row.get("metrics") or {})[metric])
+ gap = _worse_than_baseline(value, baseline_value, direction)
+ gaps.append(gap)
+ comparisons[baseline] = {
+ "baseline_value": baseline_value,
+ "worse_than_baseline": gap,
+ }
+ return {
+ "sample_key": sample,
+ "sample_id": row.get("sample_id"),
+ "input_path": row.get("input_path"),
+ "slices": sorted({str(item) for item in row.get("slices") or []}),
+ metric: value,
+ "badness": _badness(value, direction),
+ "worst_gap": max(gaps) if gaps else None,
+ "comparisons": comparisons,
+ }
+
+
+def _slice_summary(
+ system_rows: dict[str, dict[str, Any]],
+ rows_by_system: dict[str, dict[str, dict[str, Any]]],
+ baselines: list[str],
+ metric: str,
+ direction: str,
+) -> list[dict[str, Any]]:
+ slices = sorted({slice_name for row in system_rows.values() for slice_name in _row_slices(row)})
+ summaries = []
+ for slice_name in slices:
+ keys = sorted(sample for sample, row in system_rows.items() if slice_name in _row_slices(row))
+ system_values = [float((system_rows[key].get("metrics") or {})[metric]) for key in keys]
+ item: dict[str, Any] = {
+ "slice": slice_name,
+ "sample_count": len(system_values),
+ "system_mean": _mean(system_values),
+ "system_max": max(system_values) if system_values else None,
+ }
+ baseline_items = {}
+ for baseline in baselines:
+ shared = [key for key in keys if key in rows_by_system.get(baseline, {})]
+ if not shared:
+ continue
+ baseline_values = [float((rows_by_system[baseline][key].get("metrics") or {})[metric]) for key in shared]
+ shared_system_values = [float((system_rows[key].get("metrics") or {})[metric]) for key in shared]
+ baseline_items[baseline] = {
+ "pairs": len(shared),
+ "baseline_mean": _mean(baseline_values),
+ "mean_worse_than_baseline": _worse_than_baseline(_mean(shared_system_values), _mean(baseline_values), direction),
+ }
+ item["baselines"] = baseline_items
+ summaries.append(item)
+ summaries.sort(key=lambda item: _badness(float(item["system_mean"]), direction), reverse=True)
+ return summaries
+
+
+def _baseline_summary(
+ system_rows: dict[str, dict[str, Any]],
+ rows_by_system: dict[str, dict[str, dict[str, Any]]],
+ baselines: list[str],
+ metric: str,
+ direction: str,
+) -> dict[str, dict[str, float | int]]:
+ summary: dict[str, dict[str, float | int]] = {}
+ for baseline in baselines:
+ shared = sorted(set(system_rows) & set(rows_by_system.get(baseline, {})))
+ if not shared:
+ continue
+ system_values = [float((system_rows[key].get("metrics") or {})[metric]) for key in shared]
+ baseline_values = [float((rows_by_system[baseline][key].get("metrics") or {})[metric]) for key in shared]
+ gaps = [_worse_than_baseline(system_value, baseline_value, direction) for system_value, baseline_value in zip(system_values, baseline_values, strict=True)]
+ summary[baseline] = {
+ "pairs": len(shared),
+ "system_mean": _mean(system_values),
+ "baseline_mean": _mean(baseline_values),
+ "mean_worse_than_baseline": _mean(gaps),
+ "system_worse_count": sum(1 for gap in gaps if gap > 0),
+ "system_better_count": sum(1 for gap in gaps if gap < 0),
+ "tie_count": sum(1 for gap in gaps if gap == 0),
+ }
+ return summary
+
+
+def _row_slices(row: dict[str, Any]) -> set[str]:
+ values = {str(item) for item in row.get("slices") or [] if str(item)}
+ values.add("all")
+ return values
+
+
+def _badness(value: float, direction: str) -> float:
+ if direction == "lower":
+ return value
+ return -value
+
+
+def _worse_than_baseline(system_value: float, baseline_value: float, direction: str) -> float:
+ if direction == "lower":
+ return system_value - baseline_value
+ return baseline_value - system_value
+
+
+def _mean(values: list[float]) -> float:
+ if not values:
+ raise BenchmarkError("cannot average an empty metric series")
+ return sum(values) / len(values)
+
+
+def _write_markdown(path: Path, payload: dict[str, Any], top_failures: list[dict[str, Any]]) -> None:
+ metric = str(payload["metric"])
+ lines = [
+ "# Benchmark Error Analysis",
+ "",
+ f"Report: `{payload['benchmark_report']}`",
+ f"System: `{payload['system']}`",
+ f"Metric: `{metric}`",
+ f"Direction: `{payload['direction']}`",
+ f"Samples: `{payload['sample_count']}`",
+ "",
+ "## Baseline Summary",
+ "",
+ "| baseline | pairs | system_mean | baseline_mean | mean_worse_than_baseline | system_worse | system_better | ties |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ baseline_summary = payload.get("baseline_summary")
+ if isinstance(baseline_summary, dict) and baseline_summary:
+ for baseline, item in sorted(baseline_summary.items()):
+ lines.append(
+ "| {baseline} | {pairs} | {system_mean:.6f} | {baseline_mean:.6f} | {gap:.6f} | {worse} | {better} | {ties} |".format(
+ baseline=baseline,
+ pairs=int(item["pairs"]),
+ system_mean=float(item["system_mean"]),
+ baseline_mean=float(item["baseline_mean"]),
+ gap=float(item["mean_worse_than_baseline"]),
+ worse=int(item["system_worse_count"]),
+ better=int(item["system_better_count"]),
+ ties=int(item["tie_count"]),
+ )
+ )
+ else:
+ lines.append("| none | 0 | | | | | | |")
+ lines.extend(
+ [
+ "",
+ "## Hardest Samples",
+ "",
+ f"| sample | slices | {metric} | worst_gap | input |",
+ "| --- | --- | ---: | ---: | --- |",
+ ]
+ )
+ for item in top_failures:
+ gap = item["worst_gap"]
+ lines.append(
+ "| {sample} | {slices} | {value:.6f} | {gap} | {input_path} |".format(
+ sample=item.get("sample_id") or item["sample_key"],
+ slices=",".join(item.get("slices") or []),
+ value=float(item[metric]),
+ gap=f"{float(gap):.6f}" if gap is not None else "",
+ input_path=item.get("input_path") or "",
+ )
+ )
+ top_failure_counts = payload.get("top_failure_slice_counts")
+ lines.extend(["", "## Top Failure Slice Counts", "", "| slice | count |", "| --- | ---: |"])
+ if isinstance(top_failure_counts, list) and top_failure_counts:
+ for item in top_failure_counts:
+ if isinstance(item, dict):
+ lines.append(f"| {item.get('slice', '')} | {int(item.get('count') or 0)} |")
+ else:
+ lines.append("| none | 0 |")
+ lines.extend(["", f"Top failures JSON: `{payload['top_failures_path']}`"])
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/errors.py b/src/ocrtech/errors.py
new file mode 100644
index 0000000000000000000000000000000000000000..8451a50f941d429a91ada26870a90bd9f5d42340
--- /dev/null
+++ b/src/ocrtech/errors.py
@@ -0,0 +1,39 @@
+"""Project-specific exceptions."""
+
+from __future__ import annotations
+
+
+class OcrTechError(Exception):
+ """Base class for all expected ocrtech failures."""
+
+
+class DataValidationError(OcrTechError):
+ """Raised when a dataset row, manifest, or schema is invalid."""
+
+
+class EngineUnavailableError(OcrTechError):
+ """Raised when an optional OCR engine is requested but unavailable."""
+
+
+class ParseError(OcrTechError):
+ """Raised when document parsing cannot complete."""
+
+
+class BenchmarkError(OcrTechError):
+ """Raised when a benchmark configuration is invalid."""
+
+
+class ValidationError(OcrTechError):
+ """Raised when a SOTA validation configuration is invalid."""
+
+
+class PreflightError(OcrTechError):
+ """Raised when a claim preflight configuration is invalid."""
+
+
+class ClaimReviewError(OcrTechError):
+ """Raised when a claim review bundle is invalid."""
+
+
+class RemoteAuditError(OcrTechError):
+ """Raised when a remote host audit cannot run or is misconfigured."""
diff --git a/src/ocrtech/evalpack.py b/src/ocrtech/evalpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..40861bed6bc2852f39a12087ff835a5e44aa5087
--- /dev/null
+++ b/src/ocrtech/evalpack.py
@@ -0,0 +1,880 @@
+"""Generate and audit held-out evaluation packs."""
+
+from __future__ import annotations
+
+import json
+import random
+from dataclasses import dataclass, field, replace
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, sha256_path, sha256_text, write_manifest
+
+
+CLAIM_REQUIRED_SLICES = {
+ "nepali",
+ "english",
+ "mixed_script",
+ "multi_page",
+ "table",
+ "complex_table",
+ "reading_order",
+ "form",
+ "figure",
+ "scan",
+ "blur",
+ "low_contrast",
+ "skew",
+}
+
+
+@dataclass(slots=True)
+class PageTemplate:
+ name: str
+ pages: list[list[str]]
+ reference_text: str
+ reading_order: list[str]
+ tables: list[list[list[str]]]
+ figures: list[dict[str, Any]]
+ slices: list[str]
+ document_type: str
+ reference_tables: list[Any] = field(default_factory=list)
+
+
+@dataclass(slots=True)
+class RenderedInput:
+ path: Path
+ layout: dict[str, Any] | None
+
+
+@dataclass(slots=True)
+class EvalPackSummary:
+ manifest_path: str
+ sample_count: int
+ input_format: str
+ slices: dict[str, int]
+ claim_ready: bool
+ warnings: list[str]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "sample_count": self.sample_count,
+ "input_format": self.input_format,
+ "slices": self.slices,
+ "claim_ready": self.claim_ready,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class EvalPackAudit:
+ passed: bool
+ claim_ready: bool
+ sample_count: int
+ slices: dict[str, int]
+ issues: list[str]
+ warnings: list[str]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "claim_ready": self.claim_ready,
+ "sample_count": self.sample_count,
+ "slices": self.slices,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ }
+
+
+def create_eval_pack(
+ output_dir: str | Path,
+ *,
+ count_per_template: int = 1,
+ input_format: str = "text",
+ degradations: list[str] | None = None,
+ seed: int = 13,
+ font_path: str | Path | None = None,
+ templates: list[str] | None = None,
+ variant_offset: int = 0,
+) -> EvalPackSummary:
+ if count_per_template < 1:
+ raise DataValidationError("count_per_template must be at least 1")
+ if variant_offset < 0:
+ raise DataValidationError("variant_offset must be non-negative")
+ if input_format not in {"text", "image"}:
+ raise DataValidationError("input_format must be text or image")
+ degradation_names = degradations or ["clean"]
+ unknown = sorted(set(degradation_names) - {"clean", "scan", "blur", "low_contrast", "skew"})
+ if unknown:
+ raise DataValidationError(f"unsupported degradations: {unknown}")
+ out = Path(output_dir)
+ inputs_dir = out / "inputs"
+ refs_dir = out / "references"
+ manifests_dir = out / "manifests"
+ inputs_dir.mkdir(parents=True, exist_ok=True)
+ refs_dir.mkdir(parents=True, exist_ok=True)
+ manifests_dir.mkdir(parents=True, exist_ok=True)
+
+ rng = random.Random(seed)
+ entries: list[ManifestEntry] = []
+ selected_templates = _select_templates(templates)
+ for template in selected_templates:
+ for copy_index in range(count_per_template):
+ variant_index = variant_offset + copy_index
+ materialized = _materialize_template(template, variant_index)
+ for degradation in degradation_names:
+ sample_id = f"eval-{template.name}-{variant_index:03d}-{degradation}"
+ rendered_input = _write_input(
+ inputs_dir,
+ sample_id,
+ materialized,
+ input_format=input_format,
+ degradation=degradation,
+ rng=rng,
+ font_path=Path(font_path) if font_path else None,
+ )
+ input_path = rendered_input.path
+ reference_path = refs_dir / f"{sample_id}.json"
+ _write_reference(reference_path, materialized, layout=rendered_input.layout)
+ image_sha256 = sha256_path(input_path)
+ text_sha256 = sha256_text(materialized.reference_text)
+ slices = sorted({*materialized.slices, degradation, input_format})
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset="ocrtech-eval-pack",
+ split="eval",
+ image_path=str(input_path),
+ text=materialized.reference_text,
+ sha256=image_sha256,
+ metadata={
+ "slices": slices,
+ "script": "mixed_script" if "mixed_script" in slices else materialized.slices[0],
+ "document_type": materialized.document_type,
+ "degradation": degradation,
+ "input_format": input_format,
+ "reference_path": str(reference_path),
+ "text_sha256": text_sha256,
+ "sample_sha256": sha256_text(f"{image_sha256}\n{text_sha256}"),
+ "claim_evidence_eligible": input_format == "image",
+ },
+ )
+ )
+ manifest_path = manifests_dir / "ocrtech-eval-pack.jsonl"
+ write_manifest(entries, manifest_path)
+ summary = _summary(manifest_path, entries, input_format)
+ (out / "eval-pack.json").write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_summary_markdown(summary, out / "eval-pack.md")
+ return summary
+
+
+def audit_eval_pack(manifest_path: str | Path, output_dir: str | Path | None = None) -> EvalPackAudit:
+ entries = load_manifest(manifest_path)
+ issues: list[str] = []
+ warnings: list[str] = []
+ if not entries:
+ issues.append("manifest has no entries")
+ sample_ids: set[str] = set()
+ image_hashes: set[str] = set()
+ slices: dict[str, int] = {}
+ input_formats: set[str] = set()
+ for entry in entries:
+ if entry.sample_id in sample_ids:
+ issues.append(f"duplicate sample_id: {entry.sample_id}")
+ sample_ids.add(entry.sample_id)
+ if entry.sha256:
+ if entry.sha256 in image_hashes:
+ warnings.append(f"duplicate input sha256: {entry.sha256}")
+ image_hashes.add(entry.sha256)
+ input_path = Path(entry.image_path)
+ if not input_path.exists():
+ issues.append(f"missing input file for {entry.sample_id}: {input_path}")
+ reference_path = entry.metadata.get("reference_path") if entry.metadata else None
+ if not reference_path:
+ issues.append(f"missing reference_path metadata for {entry.sample_id}")
+ elif not Path(str(reference_path)).exists():
+ issues.append(f"missing reference file for {entry.sample_id}: {reference_path}")
+ input_format = str(entry.metadata.get("input_format", "")) if entry.metadata else ""
+ if input_format:
+ input_formats.add(input_format)
+ for slice_name in _entry_slices(entry):
+ slices[slice_name] = slices.get(slice_name, 0) + 1
+ missing_slices = sorted(CLAIM_REQUIRED_SLICES - set(slices))
+ if missing_slices:
+ warnings.append(f"missing claim slices: {', '.join(missing_slices)}")
+ if input_formats != {"image"}:
+ warnings.append("pack is not claim-ready for OCR SOTA unless every input is a rendered image")
+ claim_ready = not issues and not missing_slices and input_formats == {"image"}
+ audit = EvalPackAudit(
+ passed=not issues,
+ claim_ready=claim_ready,
+ sample_count=len(entries),
+ slices=dict(sorted(slices.items())),
+ issues=issues,
+ warnings=warnings,
+ )
+ if output_dir is not None:
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "eval-pack-audit.json").write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_audit_markdown(audit, out / "eval-pack-audit.md")
+ return audit
+
+
+def _summary(manifest_path: Path, entries: list[ManifestEntry], input_format: str) -> EvalPackSummary:
+ slices: dict[str, int] = {}
+ for entry in entries:
+ for slice_name in _entry_slices(entry):
+ slices[slice_name] = slices.get(slice_name, 0) + 1
+ missing = sorted(CLAIM_REQUIRED_SLICES - set(slices))
+ warnings: list[str] = []
+ if input_format != "image":
+ warnings.append("text input packs are for pipeline smoke tests, not OCR SOTA evidence")
+ if missing:
+ warnings.append(f"missing claim slices: {', '.join(missing)}")
+ return EvalPackSummary(
+ manifest_path=str(manifest_path),
+ sample_count=len(entries),
+ input_format=input_format,
+ slices=dict(sorted(slices.items())),
+ claim_ready=input_format == "image" and not missing,
+ warnings=warnings,
+ )
+
+
+def _write_reference(path: Path, template: PageTemplate, *, layout: dict[str, Any] | None = None) -> None:
+ payload = {
+ "text": template.reference_text,
+ "reading_order": template.reading_order,
+ "tables": template.reference_tables or template.tables,
+ "figures": template.figures,
+ "metadata": {
+ "template": template.name,
+ "document_type": template.document_type,
+ "slices": template.slices,
+ "page_count": len(template.pages),
+ },
+ }
+ if layout is not None:
+ payload["metadata"]["layout"] = layout
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+
+
+def _write_input(
+ inputs_dir: Path,
+ sample_id: str,
+ template: PageTemplate,
+ *,
+ input_format: str,
+ degradation: str,
+ rng: random.Random,
+ font_path: Path | None,
+) -> RenderedInput:
+ if input_format == "text":
+ return RenderedInput(path=_write_text_sidecar(inputs_dir, sample_id, template), layout=None)
+ if len(template.pages) == 1:
+ path = inputs_dir / f"{sample_id}.png"
+ page_layout = _render_page_image(path, template, page_index=0, degradation=degradation, rng=rng, font_path=font_path)
+ layout = _render_layout([page_layout], degradation=degradation)
+ return RenderedInput(path=path, layout=layout)
+ bundle_dir = inputs_dir / sample_id
+ bundle_dir.mkdir(parents=True, exist_ok=True)
+ page_layouts: list[dict[str, Any] | None] = []
+ for page_index, _lines in enumerate(template.pages):
+ page_path = bundle_dir / f"page-{page_index + 1:04d}.png"
+ page_layouts.append(_render_page_image(page_path, template, page_index=page_index, degradation=degradation, rng=rng, font_path=font_path))
+ return RenderedInput(path=bundle_dir, layout=_render_layout(page_layouts, degradation=degradation))
+
+
+def _write_text_sidecar(inputs_dir: Path, sample_id: str, template: PageTemplate) -> Path:
+ if len(template.pages) == 1:
+ path = inputs_dir / f"{sample_id}.txt"
+ path.write_text("\n".join(template.pages[0]) + "\n", encoding="utf-8")
+ return path
+ bundle_dir = inputs_dir / sample_id
+ bundle_dir.mkdir(parents=True, exist_ok=True)
+ payload = {
+ "pages": [
+ {
+ "lines": [
+ {"text": line, "bbox": [0, 40 * line_index, max(50, len(line) * 9), 24], "line_id": f"p{page_index}-l{line_index}"}
+ for line_index, line in enumerate(lines)
+ ],
+ "metadata": {"template": template.name, "page_index": page_index},
+ }
+ for page_index, lines in enumerate(template.pages)
+ ],
+ "tables": [],
+ "figures": [],
+ "metadata": {"template": template.name, "document_type": template.document_type},
+ }
+ (bundle_dir / "document.ocr.json").write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ return bundle_dir
+
+
+def _render_page_image(
+ path: Path,
+ template: PageTemplate,
+ *,
+ page_index: int,
+ degradation: str,
+ rng: random.Random,
+ font_path: Path | None,
+) -> dict[str, Any] | None:
+ try:
+ from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont
+ except ImportError as exc:
+ raise DataValidationError("image eval packs require Pillow. Install ocr-tech[eval].") from exc
+ width = 1240
+ line_height = 42
+ margin = 72
+ lines = template.pages[page_index]
+ table_grid = _page_table_grid(template, page_index) or []
+ prose_lines = list(lines)
+ if table_grid:
+ prose_lines = lines[: max(0, len(lines) - len(table_grid))]
+ height = max(900, margin * 2 + line_height * (len(prose_lines) + len(table_grid) + 5))
+ image = Image.new("RGB", (width, height), "white")
+ draw = ImageDraw.Draw(image)
+ font = _load_font(ImageFont, font_path, size=28)
+ caption_font = _load_font(ImageFont, font_path, size=24)
+ line_layout: list[dict[str, Any]] = []
+ table_cell_layout: list[dict[str, Any]] = []
+ y = margin
+ for line_index, line in enumerate(prose_lines):
+ draw.text((margin, y), line, fill=(20, 20, 20), font=font)
+ line_layout.append(
+ {
+ "line_id": f"p{page_index}-l{line_index}",
+ "text": line,
+ "bbox": _padded_text_bbox(draw, (margin, y), line, font, image_size=(width, height)),
+ }
+ )
+ y += line_height
+ if table_grid:
+ y += 12
+ y, table_cell_layout = _draw_table_grid(draw, table_grid, x=margin, y=y, font=caption_font, page_width=width - margin * 2)
+ layout: dict[str, Any] | None = {
+ "page_index": page_index,
+ "width": width,
+ "height": height,
+ "lines": line_layout,
+ "table_cells": table_cell_layout,
+ }
+ if degradation == "scan":
+ image = ImageEnhance.Contrast(image).enhance(0.82)
+ image = image.filter(ImageFilter.GaussianBlur(radius=0.35))
+ elif degradation == "blur":
+ image = image.filter(ImageFilter.GaussianBlur(radius=1.1))
+ elif degradation == "low_contrast":
+ image = ImageEnhance.Contrast(image).enhance(0.55)
+ elif degradation == "skew":
+ image = image.rotate(rng.uniform(-2.0, 2.0), expand=True, fillcolor="white")
+ layout = None
+ image.save(path)
+ return layout
+
+
+def _render_layout(page_layouts: list[dict[str, Any] | None], *, degradation: str) -> dict[str, Any]:
+ pages = [page_layout for page_layout in page_layouts if page_layout is not None]
+ payload: dict[str, Any] = {
+ "schema_version": 1,
+ "source": "ocrtech.evalpack",
+ "degradation": degradation,
+ "pages": pages,
+ }
+ if len(pages) != len(page_layouts):
+ payload["unavailable_pages"] = [
+ index for index, page_layout in enumerate(page_layouts) if page_layout is None
+ ]
+ payload["unavailable_reason"] = "skew degradation rotates rendered pixels; pre-rotation bboxes are not valid"
+ return payload
+
+
+def _page_table_grid(template: PageTemplate, page_index: int) -> list[list[str]] | None:
+ if not template.tables:
+ return None
+ if template.document_type == "table" and page_index == 0:
+ return template.tables[0]
+ if template.document_type == "multi_page_report" and page_index == 0:
+ return template.tables[0]
+ return None
+
+
+def _draw_table_grid(draw: Any, grid: list[list[str]], *, x: int, y: int, font: Any, page_width: int) -> tuple[int, list[dict[str, Any]]]:
+ row_count = len(grid)
+ col_count = max((len(row) for row in grid), default=0)
+ if row_count == 0 or col_count == 0:
+ return y, []
+ row_height = 56
+ col_width = max(160, page_width // col_count)
+ table_width = col_width * col_count
+ table_height = row_height * row_count
+ cells: list[dict[str, Any]] = []
+ for row_index in range(row_count + 1):
+ line_y = y + row_index * row_height
+ draw.line((x, line_y, x + table_width, line_y), fill=(80, 80, 80), width=2 if row_index in {0, 1, row_count} else 1)
+ for col_index in range(col_count + 1):
+ line_x = x + col_index * col_width
+ draw.line((line_x, y, line_x, y + table_height), fill=(80, 80, 80), width=2 if col_index in {0, col_count} else 1)
+ for row_index, row in enumerate(grid):
+ for col_index in range(col_count):
+ value = row[col_index] if col_index < len(row) else ""
+ cell_x1 = x + col_index * col_width
+ cell_y1 = y + row_index * row_height
+ cell_x2 = cell_x1 + col_width
+ cell_y2 = cell_y1 + row_height
+ text_xy = (cell_x1 + 12, cell_y1 + 12)
+ draw.text(text_xy, value, fill=(20, 20, 20), font=font)
+ cells.append(
+ {
+ "row": row_index,
+ "col": col_index,
+ "text": value,
+ "bbox": [cell_x1 + 2, cell_y1 + 2, cell_x2 - 2, cell_y2 - 2],
+ "text_bbox": _padded_text_bbox(draw, text_xy, value, font, image_size=(x + page_width, y + table_height)),
+ }
+ )
+ return y + table_height, cells
+
+
+def _padded_text_bbox(draw: Any, xy: tuple[int, int], text: str, font: Any, *, image_size: tuple[int, int]) -> list[int]:
+ if text:
+ bbox = draw.textbbox(xy, text, font=font)
+ else:
+ x, y = xy
+ bbox = (x, y, x + 1, y + 1)
+ x1, y1, x2, y2 = bbox
+ width, height = image_size
+ padding = 6
+ return [
+ max(0, int(x1) - padding),
+ max(0, int(y1) - padding),
+ min(width, int(x2) + padding),
+ min(height, int(y2) + padding),
+ ]
+
+
+def _load_font(ImageFont: Any, font_path: Path | None, *, size: int) -> Any:
+ candidates: list[Path] = []
+ if font_path:
+ candidates.append(font_path)
+ candidates.extend(
+ [
+ Path("/System/Library/Fonts/Supplemental/Devanagari Sangam MN.ttc"),
+ Path("/System/Library/Fonts/Supplemental/Kohinoor Devanagari.ttc"),
+ Path("/usr/share/fonts/truetype/noto/NotoSansDevanagari-Regular.ttf"),
+ Path("/usr/share/fonts/opentype/noto/NotoSansDevanagari-Regular.ttf"),
+ Path("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"),
+ ]
+ )
+ for candidate in candidates:
+ if candidate.exists():
+ return ImageFont.truetype(str(candidate), size=size)
+ return ImageFont.load_default()
+
+
+def _entry_slices(entry: ManifestEntry) -> list[str]:
+ value = entry.metadata.get("slices") if entry.metadata else []
+ if isinstance(value, list):
+ return sorted(str(item) for item in value if str(item))
+ if isinstance(value, str) and value:
+ return [value]
+ return []
+
+
+def _write_summary_markdown(summary: EvalPackSummary, path: Path) -> None:
+ lines = [
+ "# OCR Eval Pack",
+ "",
+ f"Manifest: `{summary.manifest_path}`",
+ f"Samples: `{summary.sample_count}`",
+ f"Input format: `{summary.input_format}`",
+ f"Claim ready: `{'yes' if summary.claim_ready else 'no'}`",
+ "",
+ "## Slices",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.slices.items())
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in summary.warnings) if summary.warnings else lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_audit_markdown(audit: EvalPackAudit, path: Path) -> None:
+ lines = [
+ "# Eval Pack Audit",
+ "",
+ f"Passed: `{'yes' if audit.passed else 'no'}`",
+ f"Claim ready: `{'yes' if audit.claim_ready else 'no'}`",
+ f"Samples: `{audit.sample_count}`",
+ "",
+ "## Issues",
+ "",
+ ]
+ lines.extend(f"- {issue}" for issue in audit.issues) if audit.issues else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings) if audit.warnings else lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _materialize_template(template: PageTemplate, copy_index: int) -> PageTemplate:
+ if copy_index == 0:
+ return template
+ pools = _variant_values(copy_index)
+ text = _render_variant_text(template.reference_text, pools)
+ pages = [[_render_variant_text(line, pools) for line in page] for page in template.pages]
+ tables = [[[_render_variant_text(cell, pools) for cell in row] for row in table] for table in template.tables]
+ reference_tables = _render_reference_tables(template.reference_tables, pools)
+ figures = [
+ {
+ **figure,
+ "caption": _render_variant_text(str(figure.get("caption") or ""), pools),
+ }
+ for figure in template.figures
+ ]
+ return replace(template, pages=pages, reference_text=text, tables=tables, reference_tables=reference_tables, figures=figures)
+
+
+def _render_variant_text(text: str, pools: dict[str, str]) -> str:
+ rendered = text
+ for key, value in pools.items():
+ rendered = rendered.replace(f"{{{key}}}", value)
+ return rendered
+
+
+def _render_reference_tables(value: Any, pools: dict[str, str]) -> Any:
+ if isinstance(value, str):
+ return _render_variant_text(value, pools)
+ if isinstance(value, list):
+ return [_render_reference_tables(item, pools) for item in value]
+ if isinstance(value, dict):
+ return {key: _render_reference_tables(item, pools) for key, item in value.items()}
+ return value
+
+
+def _variant_values(copy_index: int) -> dict[str, str]:
+ departments = ["Department of Records", "Department of Revenue", "Central Archives Office", "Land Survey Office"]
+ english_lines = [
+ "The quick brown fox jumps over the lazy dog.",
+ "Please verify the attached procurement details.",
+ "This report mixes structured fields with running text.",
+ "Payment clearance requires dual-language review.",
+ ]
+ nepali_lines = [
+ "यो कागजात नेपाली र English दुबै भाषामा लेखिएको छ।",
+ "यो प्रतिवेदनमा मिश्रित लिपि र तालिका दुबै समावेश छन्।",
+ "दुवै भाषाको शुद्धता छुट्टै जाँच गर्नुपर्ने छ।",
+ "यो सूचना प्रणालीले पढ्ने क्रममा स्थिरता देखाउनुपर्छ।",
+ ]
+ amounts = ["१२,५००.००", "१८,७५०.००", "९,४००.००", "२२,१००.००"]
+ iso_dates = ["2026-06-14", "2026-07-01", "2026-07-15", "2026-08-03"]
+ nepali_dates = ["२०८३-०२-०१", "२०८३-०२-१५", "२०८३-०३-०५", "२०८३-०३-२०"]
+ form_names = ["आशा गुरुङ", "नवीन श्रेष्ठ", "सविता केसी", "रमेश अधिकारी"]
+ addresses = ["Pokhara-08", "Kathmandu-11", "Lalitpur-05", "Biratnagar-03"]
+ vendors_a = ["Himalayan Trade", "Everest Supply", "Kathmandu Medical", "Janaki Logistics"]
+ vendors_b = ["Pokhara Supply", "Bharatpur Health", "Mithila Pharma", "Seti Traders"]
+ approvers = ["Sita Rana", "Nabin Karki", "Asha Shrestha", "Ramesh Thapa"]
+ ministries = ["Ministry of Health", "Ministry of Education", "Ministry of Finance", "Ministry of Agriculture"]
+ fiscal_years = ["FY 2025/26", "FY 2026/27", "FY 2024/25", "FY 2023/24"]
+ figure_year_ranges = ["2022 to 2026", "2021 to 2025", "2020 to 2024", "2019 to 2023"]
+ figure_summaries = [
+ "राजस्व क्रमशः बढेको छ।",
+ "अन्तिम दुई वर्षमा वृद्धिदर तीव्र भएको छ।",
+ "मध्यम अवधिमा स्थिर वृद्धि देखिएको छ।",
+ "समीक्षा अवधिमा उतारचढाव भए पनि समग्र प्रवृत्ति सकारात्मक छ।",
+ ]
+ qty_masks = ["५००", "६५०", "७२०", "८००"]
+ qty_gloves = ["८००", "९५०", "११००", "१२५०"]
+ ledger_name_a = ["राम", "हरी", "किरण", "सोम"]
+ ledger_name_b = ["सीता", "गीता", "माया", "रीता"]
+ ledger_amount_a = ["१५००", "१८००", "२१००", "२४००"]
+ ledger_amount_b = ["२३००", "२६००", "२९००", "३२००"]
+ pending_words = ["Pending", "Cleared", "Review", "Approved"]
+ variant = copy_index % 4
+ generation = copy_index // 4
+ amount_delta = generation * 137
+ ledger_a_value = int(ledger_amount_a[variant]) + amount_delta
+ ledger_b_value = int(ledger_amount_b[variant]) + amount_delta
+ total_amount = str(ledger_a_value + ledger_b_value)
+ return {
+ "department": f"{departments[variant]} Unit {copy_index:03d}",
+ "english_line": english_lines[variant],
+ "nepali_line": nepali_lines[variant],
+ "amount": _amount_variant(amounts[variant], amount_delta),
+ "iso_date": _date_variant(iso_dates[variant], generation),
+ "nepali_date": _nepali_date_variant(nepali_dates[variant], generation),
+ "form_name": f"{form_names[variant]} {copy_index:03d}",
+ "address": addresses[variant],
+ "vendor_a": f"{vendors_a[variant]}-{copy_index:03d}",
+ "vendor_b": f"{vendors_b[variant]}-{copy_index:03d}",
+ "approver": approvers[variant],
+ "ministry": ministries[variant],
+ "fiscal_year": f"{fiscal_years[variant]} Batch {copy_index:03d}",
+ "figure_year_range": f"{figure_year_ranges[variant]} batch {copy_index:03d}",
+ "figure_summary": f"{figure_summaries[variant]} Batch {copy_index:03d}.",
+ "qty_masks": _nepali_digits(int(qty_masks[variant]) + amount_delta),
+ "qty_gloves": _nepali_digits(int(qty_gloves[variant]) + amount_delta),
+ "ledger_name_a": f"{ledger_name_a[variant]}-{copy_index:03d}",
+ "ledger_name_b": f"{ledger_name_b[variant]}-{copy_index:03d}",
+ "ledger_amount_a": _nepali_digits(ledger_a_value),
+ "ledger_amount_b": _nepali_digits(ledger_b_value),
+ "ledger_total": total_amount,
+ "pending_word": pending_words[variant],
+ "phone": f"98{variant + 1}000000{variant}",
+ }
+
+
+def _amount_variant(amount: str, delta: int) -> str:
+ if not delta:
+ return amount
+ normalized = amount.replace(",", "").replace("०", "0").replace("१", "1").replace("२", "2").replace("३", "3").replace("४", "4").replace("५", "5").replace("६", "6").replace("७", "7").replace("८", "8").replace("९", "9")
+ integer_part, _, decimal_part = normalized.partition(".")
+ value = int(integer_part) + delta
+ return f"{_nepali_digits(value)}.{decimal_part or '००'}"
+
+
+def _date_variant(date_text: str, generation: int) -> str:
+ if not generation:
+ return date_text
+ year, month, day = date_text.split("-")
+ day_value = ((int(day) + generation - 1) % 28) + 1
+ return f"{year}-{month}-{day_value:02d}"
+
+
+def _nepali_date_variant(date_text: str, generation: int) -> str:
+ if not generation:
+ return date_text
+ year, month, day = date_text.split("-")
+ day_ascii = int(_ascii_digits(day))
+ day_value = ((day_ascii + generation - 1) % 28) + 1
+ return f"{year}-{month}-{_nepali_digits_text(f'{day_value:02d}')}"
+
+
+def _ascii_digits(text: str) -> str:
+ return text.translate(str.maketrans("०१२३४५६७८९", "0123456789"))
+
+
+def _nepali_digits(value: int) -> str:
+ return str(value).translate(str.maketrans("0123456789", "०१२३४५६७८९"))
+
+
+def _nepali_digits_text(value: str) -> str:
+ return value.translate(str.maketrans("0123456789", "०१२३४५६७८९"))
+
+
+def _templates() -> list[PageTemplate]:
+ return [
+ PageTemplate(
+ name="mixed-paragraph",
+ pages=[[
+ "नेपाल सरकार",
+ "{department}",
+ "{nepali_line}",
+ "{english_line}",
+ "रकम रु. {amount} paid on {iso_date}.",
+ ]],
+ reference_text="नेपाल सरकार\n{department}\n{nepali_line}\n{english_line}\nरकम रु. {amount} paid on {iso_date}.",
+ reading_order=["p0-l0", "p0-l1", "p0-l2", "p0-l3", "p0-l4"],
+ tables=[],
+ figures=[],
+ slices=["nepali", "english", "mixed_script", "reading_order"],
+ document_type="paragraph",
+ ),
+ PageTemplate(
+ name="table-ledger",
+ pages=[[
+ "दैनिक हिसाब",
+ "नाम रकम Remarks",
+ "{ledger_name_a} {ledger_amount_a} Paid",
+ "{ledger_name_b} {ledger_amount_b} {pending_word}",
+ "Total {ledger_total} Verified",
+ ]],
+ reference_text=(
+ "दैनिक हिसाब\n"
+ "नाम रकम Remarks\n"
+ "{ledger_name_a} {ledger_amount_a} Paid\n"
+ "{ledger_name_b} {ledger_amount_b} {pending_word}\n"
+ "Total {ledger_total} Verified"
+ ),
+ reading_order=["p0-l0", "p0-l1", "p0-l2", "p0-l3", "p0-l4"],
+ tables=[
+ [
+ ["नाम", "रकम", "Remarks"],
+ ["{ledger_name_a}", "{ledger_amount_a}", "Paid"],
+ ["{ledger_name_b}", "{ledger_amount_b}", "{pending_word}"],
+ ["Total", "{ledger_total}", "Verified"],
+ ]
+ ],
+ figures=[],
+ slices=["nepali", "english", "mixed_script", "table", "reading_order"],
+ document_type="table",
+ ),
+ PageTemplate(
+ name="complex-table-ledger",
+ pages=[[
+ "समेकित हिसाब",
+ "Ledger Summary Ledger Summary Status",
+ "नाम रकम Remarks",
+ "{ledger_name_a} {ledger_amount_a} Paid",
+ "{ledger_name_b} {ledger_amount_b} {pending_word}",
+ "Total {ledger_total} Verified",
+ ]],
+ reference_text=(
+ "समेकित हिसाब\n"
+ "Ledger Summary Status\n"
+ "नाम रकम Remarks\n"
+ "{ledger_name_a} {ledger_amount_a} Paid\n"
+ "{ledger_name_b} {ledger_amount_b} {pending_word}\n"
+ "Total {ledger_total} Verified"
+ ),
+ reading_order=["p0-l0", "p0-l1", "p0-l2", "p0-l3", "p0-l4", "p0-l5"],
+ tables=[
+ [
+ ["Ledger Summary", "Ledger Summary", "Status"],
+ ["नाम", "रकम", "Remarks"],
+ ["{ledger_name_a}", "{ledger_amount_a}", "Paid"],
+ ["{ledger_name_b}", "{ledger_amount_b}", "{pending_word}"],
+ ["Total", "{ledger_total}", "Verified"],
+ ]
+ ],
+ reference_tables=[
+ {
+ "cells": [
+ {"row": 0, "col": 0, "text": "Ledger Summary", "rowspan": 1, "colspan": 2},
+ {"row": 0, "col": 2, "text": "Status", "rowspan": 1, "colspan": 1},
+ {"row": 1, "col": 0, "text": "नाम", "rowspan": 1, "colspan": 1},
+ {"row": 1, "col": 1, "text": "रकम", "rowspan": 1, "colspan": 1},
+ {"row": 1, "col": 2, "text": "Remarks", "rowspan": 1, "colspan": 1},
+ {"row": 2, "col": 0, "text": "{ledger_name_a}", "rowspan": 1, "colspan": 1},
+ {"row": 2, "col": 1, "text": "{ledger_amount_a}", "rowspan": 1, "colspan": 1},
+ {"row": 2, "col": 2, "text": "Paid", "rowspan": 1, "colspan": 1},
+ {"row": 3, "col": 0, "text": "{ledger_name_b}", "rowspan": 1, "colspan": 1},
+ {"row": 3, "col": 1, "text": "{ledger_amount_b}", "rowspan": 1, "colspan": 1},
+ {"row": 3, "col": 2, "text": "{pending_word}", "rowspan": 1, "colspan": 1},
+ {"row": 4, "col": 0, "text": "Total", "rowspan": 1, "colspan": 1},
+ {"row": 4, "col": 1, "text": "{ledger_total}", "rowspan": 1, "colspan": 1},
+ {"row": 4, "col": 2, "text": "Verified", "rowspan": 1, "colspan": 1},
+ ]
+ }
+ ],
+ figures=[],
+ slices=["nepali", "english", "mixed_script", "table", "complex_table", "reading_order"],
+ document_type="table",
+ ),
+ PageTemplate(
+ name="form-notice",
+ pages=[[
+ "निवेदन फाराम",
+ "नाम: {form_name}",
+ "Address: {address}",
+ "मिति: {nepali_date}",
+ "Phone: {phone}",
+ "हस्ताक्षर: __________",
+ ]],
+ reference_text="निवेदन फाराम\nनाम: {form_name}\nAddress: {address}\nमिति: {nepali_date}\nPhone: {phone}\nहस्ताक्षर: __________",
+ reading_order=["p0-l0", "p0-l1", "p0-l2", "p0-l3", "p0-l4", "p0-l5"],
+ tables=[],
+ figures=[],
+ slices=["nepali", "english", "mixed_script", "form", "reading_order"],
+ document_type="form",
+ ),
+ PageTemplate(
+ name="figure-caption",
+ pages=[[
+ "वार्षिक प्रतिवेदन",
+ "[Figure: revenue chart]",
+ "चित्र १: Revenue growth from {figure_year_range}.",
+ "निष्कर्ष: {figure_summary}",
+ ]],
+ reference_text="वार्षिक प्रतिवेदन\nचित्र १: Revenue growth from {figure_year_range}.\nनिष्कर्ष: {figure_summary}",
+ reading_order=["p0-l0", "p0-l1", "p0-l2", "p0-l3"],
+ tables=[],
+ figures=[
+ {
+ "figure_id": "fig-revenue-chart",
+ "page_index": 0,
+ "caption": "चित्र १: Revenue growth from {figure_year_range}.",
+ "line_ids": ["p0-l1", "p0-l2"],
+ }
+ ],
+ slices=["nepali", "english", "mixed_script", "figure", "reading_order"],
+ document_type="figure",
+ ),
+ PageTemplate(
+ name="multi-page-brief",
+ pages=[
+ [
+ "Procurement Status Report",
+ "नेपाल सरकार - {ministry}",
+ "{fiscal_year} mixed-script status summary.",
+ "Item Qty Vendor",
+ "Masks {qty_masks} {vendor_a}",
+ "Gloves {qty_gloves} {vendor_b}",
+ ],
+ [
+ "[Figure: monthly delivery chart]",
+ "चित्र २: Delivery trend by month.",
+ "निष्कर्ष: April पछि आपूर्ति बढेको छ।",
+ "Approved by: {approver}",
+ "मिति: {nepali_date}",
+ ],
+ ],
+ reference_text=(
+ "Procurement Status Report\n"
+ "नेपाल सरकार - {ministry}\n"
+ "{fiscal_year} mixed-script status summary.\n"
+ "Item Qty Vendor\n"
+ "Masks {qty_masks} {vendor_a}\n"
+ "Gloves {qty_gloves} {vendor_b}\n"
+ "चित्र २: Delivery trend by month.\n"
+ "निष्कर्ष: April पछि आपूर्ति बढेको छ।\n"
+ "Approved by: {approver}\n"
+ "मिति: {nepali_date}"
+ ),
+ reading_order=[
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3",
+ "p0-l4",
+ "p0-l5",
+ "p1-l0",
+ "p1-l1",
+ "p1-l2",
+ "p1-l3",
+ "p1-l4",
+ ],
+ tables=[
+ [
+ ["Item", "Qty", "Vendor"],
+ ["Masks", "{qty_masks}", "{vendor_a}"],
+ ["Gloves", "{qty_gloves}", "{vendor_b}"],
+ ]
+ ],
+ figures=[
+ {
+ "figure_id": "fig-delivery-trend",
+ "page_index": 1,
+ "caption": "चित्र २: Delivery trend by month.",
+ "line_ids": ["p1-l0", "p1-l1"],
+ }
+ ],
+ slices=["nepali", "english", "mixed_script", "multi_page", "table", "figure", "form", "reading_order"],
+ document_type="multi_page_report",
+ ),
+ ]
+
+
+def _select_templates(names: list[str] | None) -> list[PageTemplate]:
+ templates = _templates()
+ requested = [name for name in (names or []) if name]
+ if not requested:
+ return templates
+ by_name = {template.name: template for template in templates}
+ missing = sorted(set(requested) - set(by_name))
+ if missing:
+ raise DataValidationError(f"unknown eval-pack templates: {', '.join(missing)}")
+ return [by_name[name] for name in requested]
diff --git a/src/ocrtech/experiments.py b/src/ocrtech/experiments.py
new file mode 100644
index 0000000000000000000000000000000000000000..d260588a540b88842a7c31e4a145ee6c8c19f4c3
--- /dev/null
+++ b/src/ocrtech/experiments.py
@@ -0,0 +1,264 @@
+"""Reproducible experiment runner for benchmark and validation jobs."""
+
+from __future__ import annotations
+
+import json
+import platform
+from dataclasses import dataclass, field
+from datetime import UTC, datetime
+from pathlib import Path
+from typing import Any
+
+from . import __version__
+from .benchmark import BenchmarkResult, run_benchmark
+from .errors import BenchmarkError
+from .manifest import ManifestEntry, load_manifest, sha256_file
+from .preflight import run_claim_preflight
+from .validation import ValidationReport, validate_claim
+
+
+@dataclass(slots=True)
+class ExperimentReport:
+ experiment_id: str
+ output_dir: str
+ eval_manifest: str
+ references_dir: str | None
+ baselines: list[str]
+ input_count: int
+ datasets: list[str]
+ slice_counts: dict[str, int]
+ benchmark_report: str
+ benchmark_status_counts: dict[str, int]
+ preflight_report: str | None = None
+ preflight_passed: bool | None = None
+ validation_report: str | None = None
+ validation_status: str | None = None
+ environment: dict[str, Any] = field(default_factory=dict)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "experiment_id": self.experiment_id,
+ "output_dir": self.output_dir,
+ "eval_manifest": self.eval_manifest,
+ "references_dir": self.references_dir,
+ "baselines": self.baselines,
+ "input_count": self.input_count,
+ "datasets": self.datasets,
+ "slice_counts": self.slice_counts,
+ "benchmark_report": self.benchmark_report,
+ "benchmark_status_counts": self.benchmark_status_counts,
+ "preflight_report": self.preflight_report,
+ "preflight_passed": self.preflight_passed,
+ "validation_report": self.validation_report,
+ "validation_status": self.validation_status,
+ "environment": self.environment,
+ }
+
+
+def run_experiment(
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ baselines: list[str],
+ references_dir: str | Path | None = None,
+ validation_config: str | Path | None = None,
+ train_manifests: list[str | Path] | None = None,
+ candidate_model_config: str | Path | None = None,
+ fallback_engine: str | None = None,
+ fallback_model_config: str | Path | None = None,
+ low_confidence_threshold: float = 0.80,
+ run_validation: bool = True,
+ run_preflight: bool = False,
+ require_claim_ready_eval_pack: bool = True,
+ require_trained_recognizer: bool = False,
+ require_model_admission: bool = False,
+) -> ExperimentReport:
+ if not baselines:
+ raise BenchmarkError("run-experiment requires at least one baseline")
+ eval_path = Path(eval_manifest)
+ entries = load_manifest(eval_path)
+ if not entries:
+ raise BenchmarkError("eval manifest contains no inputs")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ refs = Path(references_dir) if references_dir else _infer_references_dir(eval_path)
+ inputs = [entry.image_path for entry in entries]
+ datasets = sorted({entry.dataset for entry in entries})
+ slice_counts = _slice_counts(entries)
+
+ preflight_report_path: str | None = None
+ preflight_passed: bool | None = None
+ if run_preflight:
+ preflight_dir = out / "preflight"
+ preflight = run_claim_preflight(
+ eval_path,
+ preflight_dir,
+ baselines=baselines,
+ references_dir=refs,
+ candidate_model_config=candidate_model_config,
+ fallback_model_config=fallback_model_config,
+ train_manifests=train_manifests or [],
+ validation_config=validation_config,
+ require_claim_ready_eval_pack=require_claim_ready_eval_pack,
+ require_trained_recognizer=require_trained_recognizer,
+ require_model_admission=require_model_admission,
+ )
+ preflight_report_path = str(preflight_dir / "preflight.json")
+ preflight_passed = preflight.passed
+ if not preflight.passed:
+ raise BenchmarkError(f"preflight failed; see {preflight_report_path}")
+
+ benchmark_dir = out / "benchmark"
+ results = run_benchmark(
+ inputs,
+ benchmark_dir,
+ baselines=baselines,
+ references_dir=refs,
+ eval_manifest=eval_path,
+ candidate_model_config=candidate_model_config,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ low_confidence_threshold=low_confidence_threshold,
+ )
+ status_counts = _status_counts(results)
+ validation_status = None
+ validation_report_path: str | None = None
+ if run_validation:
+ validation_dir = out / "validation"
+ validation = validate_claim(
+ benchmark_dir / "report.json",
+ validation_dir,
+ config_path=validation_config,
+ eval_manifest=eval_path,
+ train_manifests=train_manifests or [],
+ candidate_model_config=candidate_model_config,
+ fallback_model_config=fallback_model_config,
+ )
+ validation_status = validation.claim_status
+ validation_report_path = str(validation_dir / "validation.json")
+ report = ExperimentReport(
+ experiment_id=out.name or "experiment",
+ output_dir=str(out),
+ eval_manifest=str(eval_path),
+ references_dir=str(refs) if refs else None,
+ baselines=baselines,
+ input_count=len(inputs),
+ datasets=datasets,
+ slice_counts=slice_counts,
+ benchmark_report=str(benchmark_dir / "report.json"),
+ benchmark_status_counts=status_counts,
+ preflight_report=preflight_report_path,
+ preflight_passed=preflight_passed,
+ validation_report=validation_report_path,
+ validation_status=validation_status,
+ environment=_environment(
+ eval_path,
+ refs,
+ validation_config,
+ train_manifests or [],
+ candidate_model_config,
+ fallback_engine,
+ fallback_model_config,
+ low_confidence_threshold,
+ ),
+ )
+ _write_experiment_report(report, out)
+ return report
+
+
+def _infer_references_dir(eval_manifest: Path) -> Path | None:
+ candidate = eval_manifest.parent.parent / "references"
+ return candidate if candidate.exists() else None
+
+
+def _status_counts(results: list[BenchmarkResult]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ for result in results:
+ counts[result.status] = counts.get(result.status, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _slice_counts(entries: list[ManifestEntry]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ seen: set[tuple[str, str]] = set()
+ for entry in entries:
+ metadata = entry.metadata or {}
+ values: set[str] = set()
+ for key in ("slice", "script", "document_type", "degradation", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ for slice_name in sorted(values):
+ pair = (entry.sample_id, slice_name)
+ if pair in seen:
+ continue
+ seen.add(pair)
+ counts[slice_name] = counts.get(slice_name, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _environment(
+ eval_manifest: Path,
+ references_dir: Path | None,
+ validation_config: str | Path | None,
+ train_manifests: list[str | Path],
+ candidate_model_config: str | Path | None,
+ fallback_engine: str | None,
+ fallback_model_config: str | Path | None,
+ low_confidence_threshold: float,
+) -> dict[str, Any]:
+ payload: dict[str, Any] = {
+ "created_at_utc": datetime.now(UTC).isoformat(),
+ "ocrtech_version": __version__,
+ "python": platform.python_version(),
+ "platform": platform.platform(),
+ "eval_manifest_sha256": sha256_file(eval_manifest) if eval_manifest.exists() else None,
+ "references_dir": str(references_dir) if references_dir else None,
+ "validation_config": str(validation_config) if validation_config else None,
+ "validation_config_sha256": sha256_file(Path(validation_config)) if validation_config and Path(validation_config).exists() else None,
+ "candidate_model_config": str(candidate_model_config) if candidate_model_config else None,
+ "candidate_model_config_sha256": sha256_file(Path(candidate_model_config)) if candidate_model_config and Path(candidate_model_config).exists() else None,
+ "fallback_engine": fallback_engine,
+ "fallback_model_config": str(fallback_model_config) if fallback_model_config else None,
+ "fallback_model_config_sha256": sha256_file(Path(fallback_model_config)) if fallback_model_config and Path(fallback_model_config).exists() else None,
+ "low_confidence_threshold": low_confidence_threshold,
+ "train_manifests": [],
+ }
+ for manifest in train_manifests:
+ path = Path(manifest)
+ payload["train_manifests"].append({"path": str(path), "sha256": sha256_file(path) if path.exists() else None})
+ return payload
+
+
+def _write_experiment_report(report: ExperimentReport, output_dir: Path) -> None:
+ (output_dir / "experiment.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# OCR Experiment",
+ "",
+ f"Experiment: `{report.experiment_id}`",
+ f"Eval manifest: `{report.eval_manifest}`",
+ f"References: `{report.references_dir or ''}`",
+ f"Inputs: `{report.input_count}`",
+ f"Datasets: `{', '.join(report.datasets)}`",
+ f"Baselines: `{', '.join(report.baselines)}`",
+ f"Preflight: `{report.preflight_passed if report.preflight_passed is not None else 'not_run'}`",
+ f"Benchmark report: `{report.benchmark_report}`",
+ f"Validation status: `{report.validation_status or 'not_run'}`",
+ "",
+ "## Benchmark Status",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in report.benchmark_status_counts.items())
+ if not report.benchmark_status_counts:
+ lines.append("- none")
+ lines.extend(["", "## Slice Coverage", ""])
+ lines.extend(f"- `{key}`: {value}" for key, value in report.slice_counts.items())
+ if not report.slice_counts:
+ lines.append("- none")
+ (output_dir / "experiment.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/external_outputs.py b/src/ocrtech/external_outputs.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d57e63ca2544f77167a1c4dbf8079371486fe1d
--- /dev/null
+++ b/src/ocrtech/external_outputs.py
@@ -0,0 +1,195 @@
+"""Helpers for normalizing external OCR baseline outputs."""
+
+from __future__ import annotations
+
+import json
+import re
+from pathlib import Path
+from typing import Any
+
+from .schemas import BBox, Block, Document, Page, Table, TableCell, TextLine
+
+
+_PAGE_BREAK_PATTERN = re.compile(r"(?:\n\s*\s*\n)|\f", re.IGNORECASE)
+_TABLE_SEPARATOR_PATTERN = re.compile(r"^\s*\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$")
+
+
+def bundle_page_paths(input_path: Path) -> list[Path]:
+ """Return page image paths for a directory bundle or the single input path."""
+ if not input_path.is_dir():
+ return [input_path]
+ allowed_suffixes = {".png", ".jpg", ".jpeg", ".tif", ".tiff", ".bmp", ".webp"}
+ page_paths = [path for path in sorted(input_path.iterdir()) if path.is_file() and path.suffix.lower() in allowed_suffixes]
+ if not page_paths:
+ raise ValueError(f"page bundle directory has no supported image files: {input_path}")
+ return page_paths
+
+
+def materialize_external_markdown(
+ source_path: Path,
+ output_dir: Path,
+ markdown_text: str,
+ *,
+ metadata: dict[str, Any] | None = None,
+ raw_payload: Any | None = None,
+) -> Document:
+ """Write normalized markdown and document JSON for an external OCR result."""
+ output_dir.mkdir(parents=True, exist_ok=True)
+ cleaned = _clean_markdown(markdown_text)
+ document = document_from_markdown(source_path, cleaned, metadata=metadata)
+ (output_dir / "document.md").write_text(cleaned + ("\n" if cleaned and not cleaned.endswith("\n") else ""), encoding="utf-8")
+ (output_dir / "document.json").write_text(
+ json.dumps(document.to_dict(), ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+ if raw_payload is not None:
+ (output_dir / "raw-output.json").write_text(
+ json.dumps(raw_payload, ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+ return document
+
+
+def document_from_markdown(source_path: Path, markdown_text: str, *, metadata: dict[str, Any] | None = None) -> Document:
+ """Build a minimal structured document from markdown output."""
+ pages: list[Page] = []
+ tables: list[Table] = []
+ markdown_pages = [part.strip("\n") for part in _PAGE_BREAK_PATTERN.split(markdown_text)] or [markdown_text]
+ for page_index, page_markdown in enumerate(markdown_pages):
+ page = _page_from_markdown(page_markdown, page_index=page_index, global_tables=tables)
+ pages.append(page)
+ return Document(source_path=str(source_path), pages=pages, tables=tables, figures=[], metadata=dict(metadata or {}))
+
+
+def _clean_markdown(value: str) -> str:
+ text = value.replace("\r\n", "\n").replace("\r", "\n").strip()
+ if text.startswith("```") and text.endswith("```"):
+ lines = text.splitlines()
+ if len(lines) >= 2:
+ text = "\n".join(lines[1:-1]).strip()
+ return text
+
+
+def _page_from_markdown(markdown_text: str, *, page_index: int, global_tables: list[Table]) -> Page:
+ text_lines: list[TextLine] = []
+ blocks: list[Block] = []
+ lines = markdown_text.splitlines()
+ order = 0
+ y = 0.0
+ index = 0
+ while index < len(lines):
+ line = lines[index]
+ stripped = line.strip()
+ if not stripped:
+ index += 1
+ y += 20
+ continue
+ table_result = _parse_markdown_table(lines, start=index)
+ if table_result is not None:
+ table, consumed, table_text = table_result
+ table.page_index = page_index
+ global_tables.append(table)
+ blocks.append(
+ Block(
+ block_id=f"p{page_index}-b{order}",
+ block_type="table",
+ page_index=page_index,
+ bbox=table.bbox,
+ order=order,
+ text=table_text,
+ table_id=table.table_id,
+ )
+ )
+ order += 1
+ y = table.bbox.bottom + 24
+ index += consumed
+ continue
+ text = _strip_markdown_prefix(stripped)
+ bbox = BBox(0, y, max(50, len(text) * 9), 22)
+ line_id = f"p{page_index}-l{len(text_lines)}"
+ text_lines.append(TextLine(text=text, bbox=bbox, confidence=None, page_index=page_index, line_id=line_id))
+ block_type = "title" if stripped.startswith("#") else "caption" if _looks_like_caption(text) else "text"
+ blocks.append(
+ Block(
+ block_id=f"p{page_index}-b{order}",
+ block_type=block_type,
+ page_index=page_index,
+ bbox=bbox,
+ order=order,
+ text=text,
+ line_ids=[line_id],
+ )
+ )
+ order += 1
+ y += 28
+ index += 1
+ return Page(page_index=page_index, text_lines=text_lines, blocks=blocks, metadata={"source": "external-markdown"})
+
+
+def _parse_markdown_table(lines: list[str], *, start: int) -> tuple[Table, int, str] | None:
+ if start + 1 >= len(lines):
+ return None
+ header_line = lines[start].strip()
+ separator_line = lines[start + 1].strip()
+ if "|" not in header_line or not _TABLE_SEPARATOR_PATTERN.match(separator_line):
+ return None
+ data_lines: list[str] = [lines[start], lines[start + 1]]
+ index = start + 2
+ while index < len(lines):
+ candidate = lines[index].strip()
+ if not candidate or "|" not in candidate:
+ break
+ data_lines.append(lines[index])
+ index += 1
+ rows = [_split_markdown_row(item) for item in data_lines if "|" in item]
+ if len(rows) < 2:
+ return None
+ header = rows[0]
+ body = rows[2:] if len(rows) > 2 else []
+ cells: list[TableCell] = []
+ row_count = 0
+ if header:
+ for col_index, value in enumerate(header):
+ cells.append(TableCell(row=0, col=col_index, text=value))
+ row_count = 1
+ for body_row in body:
+ for col_index, value in enumerate(body_row):
+ cells.append(TableCell(row=row_count, col=col_index, text=value))
+ row_count += 1
+ col_count = max((len(row) for row in [header, *body]), default=1)
+ table_height = max(32.0, 28.0 * max(1, row_count))
+ table_width = max(120.0, 120.0 * col_count)
+ table_text = "\n".join(line.rstrip() for line in data_lines)
+ table = Table(
+ table_id=f"table-{start}",
+ page_index=0,
+ bbox=BBox(0, start * 28.0, table_width, table_height),
+ cells=cells,
+ html=None,
+ caption=None,
+ metadata={"source": "external-markdown"},
+ )
+ return table, len(data_lines), table_text
+
+
+def _split_markdown_row(line: str) -> list[str]:
+ trimmed = line.strip()
+ if trimmed.startswith("|"):
+ trimmed = trimmed[1:]
+ if trimmed.endswith("|"):
+ trimmed = trimmed[:-1]
+ return [part.strip() for part in trimmed.split("|")]
+
+
+def _strip_markdown_prefix(text: str) -> str:
+ value = text.lstrip("#").strip() if text.startswith("#") else text
+ if value.startswith("- "):
+ return value[2:].strip()
+ if value.startswith("* "):
+ return value[2:].strip()
+ return value
+
+
+def _looks_like_caption(text: str) -> bool:
+ lowered = text.casefold()
+ return lowered.startswith("figure ") or lowered.startswith("fig. ") or lowered.startswith("चित्र ")
diff --git a/src/ocrtech/language_registry.py b/src/ocrtech/language_registry.py
new file mode 100644
index 0000000000000000000000000000000000000000..721d125eb949dc26052db0767a3f0d3c5faa15de
--- /dev/null
+++ b/src/ocrtech/language_registry.py
@@ -0,0 +1,811 @@
+"""Audits for multilingual OCR language registries."""
+
+from __future__ import annotations
+
+import getpass
+import json
+import re
+import struct
+import unicodedata
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+
+
+UNICODE_RANGE_RE = re.compile(r"^U\+[0-9A-F]{4,6}(?:\.\.U\+[0-9A-F]{4,6})?$")
+
+LANGUAGE_REQUIRED_FIELDS = (
+ "id",
+ "name",
+ "priority",
+ "counts_toward_nepal_language_target",
+ "first_target",
+ "scripts",
+ "font_candidates",
+ "paddle_dictionary",
+ "normalization",
+ "corpora",
+ "validation_sources",
+ "gorkhapatra_language_labels",
+)
+
+SCRIPT_REQUIRED_FIELDS = ("script", "primary", "status", "unicode_ranges")
+FONT_PATH_STATUSES = {"pending_render_audit", "exists_local", "schema_audit_pending"}
+
+
+@dataclass(slots=True)
+class FontCandidateAudit:
+ language_id: str
+ script: str
+ font_name: str
+ font_path: str
+ status: str
+ path_exists: bool
+ supported_font_file: bool
+ required_codepoints: int
+ covered_codepoints: int
+ coverage_ratio: float
+ missing_sample: list[str] = field(default_factory=list)
+ render_sample_path: str | None = None
+ render_status: str = "not_requested"
+ error: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "language_id": self.language_id,
+ "script": self.script,
+ "font_name": self.font_name,
+ "font_path": self.font_path,
+ "status": self.status,
+ "path_exists": self.path_exists,
+ "supported_font_file": self.supported_font_file,
+ "required_codepoints": self.required_codepoints,
+ "covered_codepoints": self.covered_codepoints,
+ "coverage_ratio": self.coverage_ratio,
+ "missing_sample": self.missing_sample,
+ "render_sample_path": self.render_sample_path,
+ "render_status": self.render_status,
+ "error": self.error,
+ }
+
+
+@dataclass(slots=True)
+class FontRenderabilityAudit:
+ registry_path: str
+ passed: bool
+ language_count: int
+ script_count: int
+ candidate_count: int
+ render_requested: bool
+ pillow_available: bool
+ passing_scripts: list[str] = field(default_factory=list)
+ failing_scripts: list[str] = field(default_factory=list)
+ candidates: list[FontCandidateAudit] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+ errors: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "registry_path": self.registry_path,
+ "passed": self.passed,
+ "language_count": self.language_count,
+ "script_count": self.script_count,
+ "candidate_count": self.candidate_count,
+ "render_requested": self.render_requested,
+ "pillow_available": self.pillow_available,
+ "passing_scripts": self.passing_scripts,
+ "failing_scripts": self.failing_scripts,
+ "warnings": self.warnings,
+ "errors": self.errors,
+ "candidates": [candidate.to_dict() for candidate in self.candidates],
+ }
+
+
+@dataclass(slots=True)
+class LanguageRegistryAudit:
+ registry_path: str
+ registry_id: str
+ passed: bool
+ language_count: int
+ counted_nepal_language_count: int
+ first_target_ids: list[str]
+ primary_scripts: dict[str, list[str]]
+ missing_local_paths: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+ errors: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "registry_path": self.registry_path,
+ "registry_id": self.registry_id,
+ "passed": self.passed,
+ "language_count": self.language_count,
+ "counted_nepal_language_count": self.counted_nepal_language_count,
+ "first_target_ids": self.first_target_ids,
+ "primary_scripts": self.primary_scripts,
+ "missing_local_paths": self.missing_local_paths,
+ "warnings": self.warnings,
+ "errors": self.errors,
+ }
+
+
+def audit_language_registry(
+ registry_path: str | Path,
+ out_dir: str | Path | None = None,
+ *,
+ min_nepal_languages: int = 10,
+ require_limbu_first: bool = True,
+ verify_local_paths: bool = True,
+) -> LanguageRegistryAudit:
+ path = Path(registry_path)
+ payload = _load_json_object(path)
+ languages = payload.get("languages")
+ if not isinstance(languages, list) or not languages:
+ raise DataValidationError(f"language registry must contain a non-empty languages list: {path}")
+
+ errors: list[str] = []
+ warnings: list[str] = []
+ missing_local_paths: list[str] = []
+ ids: set[str] = set()
+ priorities: set[int] = set()
+ counted_ids: list[str] = []
+ first_target_ids: list[str] = []
+ primary_scripts: dict[str, list[str]] = {}
+
+ for index, language in enumerate(languages):
+ prefix = f"languages[{index}]"
+ if not isinstance(language, dict):
+ errors.append(f"{prefix}: entry must be an object")
+ continue
+ _validate_language_entry(prefix, language, errors, warnings)
+
+ language_id = language.get("id")
+ if isinstance(language_id, str):
+ if language_id in ids:
+ errors.append(f"{prefix}: duplicate id {language_id!r}")
+ ids.add(language_id)
+
+ priority = language.get("priority")
+ if isinstance(priority, int):
+ if priority in priorities:
+ errors.append(f"{prefix}: duplicate priority {priority}")
+ priorities.add(priority)
+
+ if language.get("counts_toward_nepal_language_target") is True:
+ if isinstance(language_id, str):
+ counted_ids.append(language_id)
+ elif language_id == "english":
+ pass
+ elif language.get("counts_toward_nepal_language_target") is False:
+ warnings.append(f"{prefix}: non-English language is not counted toward Nepal target")
+
+ if language.get("first_target") is True and isinstance(language_id, str):
+ first_target_ids.append(language_id)
+
+ scripts = language.get("scripts")
+ if isinstance(language_id, str) and isinstance(scripts, list):
+ primary_scripts[language_id] = [
+ str(script.get("script")) for script in scripts if isinstance(script, dict) and script.get("primary") is True
+ ]
+ if not primary_scripts[language_id]:
+ errors.append(f"{prefix}: at least one script must be primary")
+
+ if verify_local_paths:
+ missing_local_paths.extend(_collect_missing_local_paths(prefix, language))
+
+ if len(counted_ids) < min_nepal_languages:
+ errors.append(f"registry counts {len(counted_ids)} Nepal languages; minimum is {min_nepal_languages}")
+
+ if "english" in counted_ids:
+ errors.append("english must not count toward the Nepal-language target")
+
+ if require_limbu_first:
+ _validate_limbu_first(languages, errors)
+
+ errors.extend(f"missing local path: {path_value}" for path_value in missing_local_paths)
+
+ audit = LanguageRegistryAudit(
+ registry_path=str(path),
+ registry_id=str(payload.get("registry_id", "")),
+ passed=not errors,
+ language_count=len(languages),
+ counted_nepal_language_count=len(counted_ids),
+ first_target_ids=first_target_ids,
+ primary_scripts=primary_scripts,
+ missing_local_paths=missing_local_paths,
+ warnings=warnings,
+ errors=errors,
+ )
+
+ if out_dir is not None:
+ out = Path(out_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ json_path = out / "language-registry-audit.json"
+ md_path = out / "language-registry-audit.md"
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_language_registry_markdown(md_path, audit, languages)
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+
+ return audit
+
+
+def audit_font_renderability(
+ registry_path: str | Path,
+ out_dir: str | Path | None = None,
+ *,
+ primary_only: bool = True,
+ min_coverage_ratio: float = 0.95,
+ render_samples: bool = False,
+) -> FontRenderabilityAudit:
+ path = Path(registry_path)
+ payload = _load_json_object(path)
+ languages = payload.get("languages")
+ if not isinstance(languages, list) or not languages:
+ raise DataValidationError(f"language registry must contain a non-empty languages list: {path}")
+ if min_coverage_ratio < 0 or min_coverage_ratio > 1:
+ raise DataValidationError("min_coverage_ratio must be between 0 and 1")
+
+ out = Path(out_dir) if out_dir is not None else None
+ sample_dir = out / "font-samples" if out is not None else None
+ if out is not None:
+ out.mkdir(parents=True, exist_ok=True)
+ if sample_dir is not None and render_samples:
+ sample_dir.mkdir(parents=True, exist_ok=True)
+
+ pillow_available = _pillow_available()
+ warnings: list[str] = []
+ errors: list[str] = []
+ candidates: list[FontCandidateAudit] = []
+ script_keys: set[str] = set()
+ passing_scripts: list[str] = []
+ failing_scripts: list[str] = []
+
+ if render_samples and not pillow_available:
+ warnings.append("Pillow is not installed; sample rendering was requested but skipped")
+
+ for language in languages:
+ if not isinstance(language, dict):
+ continue
+ language_id = str(language.get("id", ""))
+ font_candidates = [item for item in language.get("font_candidates", []) if isinstance(item, dict)]
+ scripts = [item for item in language.get("scripts", []) if isinstance(item, dict)]
+ for script in scripts:
+ if primary_only and script.get("primary") is not True:
+ continue
+ script_name = str(script.get("script", ""))
+ unicode_ranges = script.get("unicode_ranges", [])
+ if not isinstance(unicode_ranges, list):
+ unicode_ranges = []
+ required = _expand_unicode_ranges(unicode_ranges)
+ script_key = f"{language_id}:{script_name}"
+ script_keys.add(script_key)
+ script_candidates = [
+ _audit_font_candidate(
+ language_id,
+ script_name,
+ required,
+ candidate,
+ sample_dir=sample_dir,
+ render_sample=render_samples and pillow_available,
+ )
+ for candidate in font_candidates
+ ]
+ candidates.extend(script_candidates)
+ if any(candidate.coverage_ratio >= min_coverage_ratio for candidate in script_candidates):
+ passing_scripts.append(script_key)
+ else:
+ failing_scripts.append(script_key)
+ errors.append(f"{script_key}: no font candidate covers at least {min_coverage_ratio:.2%} of required codepoints")
+
+ audit = FontRenderabilityAudit(
+ registry_path=str(path),
+ passed=not errors,
+ language_count=len(languages),
+ script_count=len(script_keys),
+ candidate_count=len(candidates),
+ render_requested=render_samples,
+ pillow_available=pillow_available,
+ passing_scripts=passing_scripts,
+ failing_scripts=failing_scripts,
+ candidates=candidates,
+ warnings=warnings,
+ errors=errors,
+ )
+
+ if out is not None:
+ json_path = out / "font-renderability-audit.json"
+ md_path = out / "font-renderability-audit.md"
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_font_renderability_markdown(md_path, audit)
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+
+ return audit
+
+
+def _load_json_object(path: Path) -> dict[str, Any]:
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except FileNotFoundError as exc:
+ raise DataValidationError(f"language registry does not exist: {path}") from exc
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"language registry is invalid JSON: {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"language registry must be a JSON object: {path}")
+ return payload
+
+
+def _validate_language_entry(prefix: str, language: dict[str, Any], errors: list[str], warnings: list[str]) -> None:
+ for field_name in LANGUAGE_REQUIRED_FIELDS:
+ if field_name not in language:
+ errors.append(f"{prefix}: missing required field {field_name!r}")
+
+ if "iso_639_3" not in language:
+ warnings.append(f"{prefix}: iso_639_3 missing; set null only after confirming no code exists")
+ elif language["iso_639_3"] is not None and not _is_non_empty_string(language["iso_639_3"]):
+ errors.append(f"{prefix}: iso_639_3 must be a non-empty string or null")
+
+ if not _is_non_empty_string(language.get("id")):
+ errors.append(f"{prefix}: id must be a non-empty string")
+ if not _is_non_empty_string(language.get("name")):
+ errors.append(f"{prefix}: name must be a non-empty string")
+ if not isinstance(language.get("priority"), int):
+ errors.append(f"{prefix}: priority must be an integer")
+ if not isinstance(language.get("counts_toward_nepal_language_target"), bool):
+ errors.append(f"{prefix}: counts_toward_nepal_language_target must be boolean")
+ if not isinstance(language.get("first_target"), bool):
+ errors.append(f"{prefix}: first_target must be boolean")
+ if not _is_non_empty_string(language.get("paddle_dictionary")):
+ errors.append(f"{prefix}: paddle_dictionary must be a non-empty string")
+ if not isinstance(language.get("gorkhapatra_language_labels"), list):
+ errors.append(f"{prefix}: gorkhapatra_language_labels must be a list")
+
+ _validate_scripts(prefix, language.get("scripts"), errors)
+ _validate_non_empty_list_of_objects(prefix, "font_candidates", language.get("font_candidates"), errors)
+ _validate_non_empty_list_of_objects(prefix, "corpora", language.get("corpora"), errors)
+ _validate_non_empty_list_of_objects(prefix, "validation_sources", language.get("validation_sources"), errors)
+ _validate_normalization(prefix, language.get("normalization"), errors)
+
+
+def _validate_scripts(prefix: str, scripts: Any, errors: list[str]) -> None:
+ if not isinstance(scripts, list) or not scripts:
+ errors.append(f"{prefix}: scripts must be a non-empty list")
+ return
+ for script_index, script in enumerate(scripts):
+ script_prefix = f"{prefix}.scripts[{script_index}]"
+ if not isinstance(script, dict):
+ errors.append(f"{script_prefix}: script entry must be an object")
+ continue
+ for field_name in SCRIPT_REQUIRED_FIELDS:
+ if field_name not in script:
+ errors.append(f"{script_prefix}: missing required field {field_name!r}")
+ if not _is_non_empty_string(script.get("script")):
+ errors.append(f"{script_prefix}: script must be a non-empty string")
+ if not isinstance(script.get("primary"), bool):
+ errors.append(f"{script_prefix}: primary must be boolean")
+ if not _is_non_empty_string(script.get("status")):
+ errors.append(f"{script_prefix}: status must be a non-empty string")
+ ranges = script.get("unicode_ranges")
+ if not isinstance(ranges, list) or not ranges:
+ errors.append(f"{script_prefix}: unicode_ranges must be a non-empty list")
+ continue
+ for range_index, value in enumerate(ranges):
+ if not isinstance(value, str) or not UNICODE_RANGE_RE.match(value):
+ errors.append(f"{script_prefix}.unicode_ranges[{range_index}]: invalid Unicode range {value!r}")
+
+
+def _validate_non_empty_list_of_objects(prefix: str, field_name: str, value: Any, errors: list[str]) -> None:
+ if not isinstance(value, list) or not value:
+ errors.append(f"{prefix}: {field_name} must be a non-empty list")
+ return
+ for index, item in enumerate(value):
+ if not isinstance(item, dict):
+ errors.append(f"{prefix}.{field_name}[{index}]: entry must be an object")
+
+
+def _validate_normalization(prefix: str, value: Any, errors: list[str]) -> None:
+ if not isinstance(value, dict):
+ errors.append(f"{prefix}: normalization must be an object")
+ return
+ if value.get("unicode_form") not in {"NFC", "NFKC", "none"}:
+ errors.append(f"{prefix}: normalization.unicode_form must be NFC, NFKC, or none")
+ if not _is_non_empty_string(value.get("policy")):
+ errors.append(f"{prefix}: normalization.policy must be a non-empty string")
+
+
+def _validate_limbu_first(languages: list[Any], errors: list[str]) -> None:
+ first = languages[0] if languages else {}
+ if not isinstance(first, dict):
+ errors.append("first language entry must be Limbu")
+ return
+ if first.get("id") != "limbu":
+ errors.append("first language entry must have id 'limbu'")
+ if first.get("priority") != 1:
+ errors.append("Limbu must have priority 1")
+ if first.get("first_target") is not True:
+ errors.append("Limbu must be marked first_target=true")
+ scripts = first.get("scripts")
+ if isinstance(scripts, list):
+ primary_scripts = [script.get("script") for script in scripts if isinstance(script, dict) and script.get("primary") is True]
+ if "Limbu / Sirijonga" not in primary_scripts:
+ errors.append("Limbu must have primary script 'Limbu / Sirijonga'")
+
+
+def _collect_missing_local_paths(prefix: str, language: dict[str, Any]) -> list[str]:
+ missing: list[str] = []
+ for field_name in ("corpora", "validation_sources", "font_candidates"):
+ values = language.get(field_name)
+ if not isinstance(values, list):
+ continue
+ for index, item in enumerate(values):
+ if not isinstance(item, dict):
+ continue
+ path_value = item.get("path")
+ status = item.get("status")
+ if not _should_verify_local_path(path_value, status, item.get("host")):
+ continue
+ candidate = Path(path_value)
+ if not candidate.exists():
+ missing.append(f"{prefix}.{field_name}[{index}].path={path_value}")
+ return missing
+
+
+def _audit_font_candidate(
+ language_id: str,
+ script_name: str,
+ required: set[int],
+ candidate: dict[str, Any],
+ *,
+ sample_dir: Path | None,
+ render_sample: bool,
+) -> FontCandidateAudit:
+ font_name = str(candidate.get("name", ""))
+ font_path = str(candidate.get("path", ""))
+ status = str(candidate.get("status", ""))
+ path = Path(font_path) if font_path and not font_path.startswith(("TBD", "system_or_installable_font")) else None
+ path_exists = path.exists() if path is not None else False
+ supported_font_file = path is not None and path.suffix.lower() in {".ttf", ".otf", ".ttc"}
+ covered: set[int] = set()
+ error: str | None = None
+ if path_exists and supported_font_file and path is not None:
+ try:
+ covered = _read_font_codepoints(path)
+ except (OSError, ValueError, struct.error) as exc:
+ error = str(exc)
+ elif font_path == "TBD":
+ error = "font path is TBD"
+ elif not path_exists:
+ error = "font path does not exist"
+ elif not supported_font_file:
+ error = "unsupported font file type"
+
+ covered_required = required.intersection(covered)
+ missing = sorted(required.difference(covered))[:20]
+ coverage_ratio = len(covered_required) / len(required) if required else 0.0
+ audit = FontCandidateAudit(
+ language_id=language_id,
+ script=script_name,
+ font_name=font_name,
+ font_path=font_path,
+ status=status,
+ path_exists=path_exists,
+ supported_font_file=bool(supported_font_file),
+ required_codepoints=len(required),
+ covered_codepoints=len(covered_required),
+ coverage_ratio=coverage_ratio,
+ missing_sample=[_format_codepoint(codepoint) for codepoint in missing],
+ error=error,
+ )
+ if render_sample:
+ _render_font_sample(audit, required, path, sample_dir)
+ return audit
+
+
+def _expand_unicode_ranges(values: list[Any]) -> set[int]:
+ codepoints: set[int] = set()
+ for value in values:
+ if not isinstance(value, str) or not UNICODE_RANGE_RE.match(value):
+ continue
+ if ".." in value:
+ start_text, end_text = value.split("..", 1)
+ start = int(start_text.removeprefix("U+"), 16)
+ end = int(end_text.removeprefix("U+"), 16)
+ codepoints.update(range(start, end + 1))
+ else:
+ codepoints.add(int(value.removeprefix("U+"), 16))
+ return {codepoint for codepoint in codepoints if not unicodedata.category(chr(codepoint)).startswith("C")}
+
+
+def _read_font_codepoints(path: Path) -> set[int]:
+ data = path.read_bytes()
+ offsets = _font_face_offsets(data)
+ codepoints: set[int] = set()
+ for offset in offsets:
+ codepoints.update(_read_face_codepoints(data, offset))
+ return codepoints
+
+
+def _font_face_offsets(data: bytes) -> list[int]:
+ if len(data) < 12:
+ raise ValueError("font file is too small")
+ if data[:4] == b"ttcf":
+ if len(data) < 12:
+ raise ValueError("TTC header is truncated")
+ count = struct.unpack_from(">L", data, 8)[0]
+ offsets_end = 12 + count * 4
+ if len(data) < offsets_end:
+ raise ValueError("TTC face offset table is truncated")
+ return [struct.unpack_from(">L", data, 12 + index * 4)[0] for index in range(count)]
+ return [0]
+
+
+def _read_face_codepoints(data: bytes, face_offset: int) -> set[int]:
+ if face_offset + 12 > len(data):
+ raise ValueError("font face offset is outside file")
+ table_count = struct.unpack_from(">H", data, face_offset + 4)[0]
+ table_dir = face_offset + 12
+ cmap_offset: int | None = None
+ cmap_length: int | None = None
+ for index in range(table_count):
+ record = table_dir + index * 16
+ if record + 16 > len(data):
+ raise ValueError("font table directory is truncated")
+ tag = data[record : record + 4]
+ if tag == b"cmap":
+ cmap_offset = struct.unpack_from(">L", data, record + 8)[0]
+ cmap_length = struct.unpack_from(">L", data, record + 12)[0]
+ break
+ if cmap_offset is None or cmap_length is None:
+ return set()
+ if cmap_offset + cmap_length > len(data):
+ raise ValueError("cmap table is outside file")
+ return _read_cmap_codepoints(data, cmap_offset)
+
+
+def _read_cmap_codepoints(data: bytes, cmap_offset: int) -> set[int]:
+ if cmap_offset + 4 > len(data):
+ raise ValueError("cmap header is truncated")
+ subtable_count = struct.unpack_from(">H", data, cmap_offset + 2)[0]
+ subtables: list[tuple[int, int, int]] = []
+ for index in range(subtable_count):
+ record = cmap_offset + 4 + index * 8
+ if record + 8 > len(data):
+ raise ValueError("cmap encoding records are truncated")
+ platform_id, encoding_id, sub_offset = struct.unpack_from(">HHL", data, record)
+ subtables.append((platform_id, encoding_id, cmap_offset + sub_offset))
+ preferred = sorted(subtables, key=lambda item: _cmap_preference(item[0], item[1]))
+ all_codepoints: set[int] = set()
+ for _, _, subtable_offset in preferred:
+ if subtable_offset + 2 > len(data):
+ continue
+ fmt = struct.unpack_from(">H", data, subtable_offset)[0]
+ try:
+ if fmt == 12:
+ all_codepoints.update(_read_cmap_format_12(data, subtable_offset))
+ elif fmt == 4:
+ all_codepoints.update(_read_cmap_format_4(data, subtable_offset))
+ except (ValueError, struct.error):
+ continue
+ if all_codepoints:
+ return all_codepoints
+ return all_codepoints
+
+
+def _cmap_preference(platform_id: int, encoding_id: int) -> int:
+ if platform_id == 3 and encoding_id == 10:
+ return 0
+ if platform_id == 0:
+ return 1
+ if platform_id == 3 and encoding_id in {1, 0}:
+ return 2
+ return 3
+
+
+def _read_cmap_format_12(data: bytes, offset: int) -> set[int]:
+ if offset + 16 > len(data):
+ raise ValueError("cmap format 12 header is truncated")
+ group_count = struct.unpack_from(">L", data, offset + 12)[0]
+ codepoints: set[int] = set()
+ for index in range(group_count):
+ record = offset + 16 + index * 12
+ if record + 12 > len(data):
+ raise ValueError("cmap format 12 groups are truncated")
+ start, end, _glyph = struct.unpack_from(">LLL", data, record)
+ if start <= end:
+ codepoints.update(range(start, end + 1))
+ return codepoints
+
+
+def _read_cmap_format_4(data: bytes, offset: int) -> set[int]:
+ if offset + 14 > len(data):
+ raise ValueError("cmap format 4 header is truncated")
+ length = struct.unpack_from(">H", data, offset + 2)[0]
+ if offset + length > len(data):
+ raise ValueError("cmap format 4 table is truncated")
+ seg_count_x2 = struct.unpack_from(">H", data, offset + 6)[0]
+ seg_count = seg_count_x2 // 2
+ end_codes_offset = offset + 14
+ start_codes_offset = end_codes_offset + seg_count * 2 + 2
+ id_delta_offset = start_codes_offset + seg_count * 2
+ id_range_offset_offset = id_delta_offset + seg_count * 2
+ glyph_array_offset = id_range_offset_offset + seg_count * 2
+ if glyph_array_offset > offset + length:
+ raise ValueError("cmap format 4 arrays are truncated")
+
+ codepoints: set[int] = set()
+ for index in range(seg_count):
+ end_code = struct.unpack_from(">H", data, end_codes_offset + index * 2)[0]
+ start_code = struct.unpack_from(">H", data, start_codes_offset + index * 2)[0]
+ id_delta = struct.unpack_from(">h", data, id_delta_offset + index * 2)[0]
+ id_range_offset = struct.unpack_from(">H", data, id_range_offset_offset + index * 2)[0]
+ if start_code == 0xFFFF and end_code == 0xFFFF:
+ continue
+ for codepoint in range(start_code, end_code + 1):
+ if id_range_offset == 0:
+ glyph_id = (codepoint + id_delta) & 0xFFFF
+ else:
+ glyph_offset = id_range_offset_offset + index * 2 + id_range_offset + (codepoint - start_code) * 2
+ if glyph_offset + 2 > offset + length:
+ glyph_id = 0
+ else:
+ glyph_id = struct.unpack_from(">H", data, glyph_offset)[0]
+ if glyph_id:
+ glyph_id = (glyph_id + id_delta) & 0xFFFF
+ if glyph_id:
+ codepoints.add(codepoint)
+ return codepoints
+
+
+def _render_font_sample(audit: FontCandidateAudit, required: set[int], path: Path | None, sample_dir: Path | None) -> None:
+ if path is None or sample_dir is None or not path.exists():
+ audit.render_status = "skipped_missing_font"
+ return
+ try:
+ from PIL import Image, ImageDraw, ImageFont
+ except ImportError:
+ audit.render_status = "skipped_pillow_missing"
+ return
+ sample_text = _sample_text(required)
+ if not sample_text:
+ audit.render_status = "skipped_empty_sample"
+ return
+ try:
+ font = ImageFont.truetype(str(path), 48)
+ image = Image.new("RGB", (1200, 160), "white")
+ draw = ImageDraw.Draw(image)
+ draw.text((24, 42), sample_text, fill="black", font=font)
+ filename = f"{_slug(audit.language_id)}-{_slug(audit.script)}-{_slug(audit.font_name)}.png"
+ output = sample_dir / filename
+ image.save(output)
+ audit.render_sample_path = str(output)
+ audit.render_status = "rendered"
+ except (OSError, ValueError) as exc:
+ audit.render_status = "failed"
+ audit.error = f"{audit.error}; render failed: {exc}" if audit.error else f"render failed: {exc}"
+
+
+def _sample_text(required: set[int]) -> str:
+ chars = [chr(codepoint) for codepoint in sorted(required) if unicodedata.category(chr(codepoint))[0] in {"L", "M", "N"}]
+ return "".join(chars[:24])
+
+
+def _pillow_available() -> bool:
+ try:
+ import PIL # noqa: F401
+ except ImportError:
+ return False
+ return True
+
+
+def _format_codepoint(codepoint: int) -> str:
+ return f"U+{codepoint:04X}"
+
+
+def _slug(value: str) -> str:
+ slug = re.sub(r"[^A-Za-z0-9]+", "-", value).strip("-").lower()
+ return slug or "sample"
+
+
+def _should_verify_local_path(path_value: Any, status: Any, host: Any = None) -> bool:
+ if not isinstance(path_value, str) or not path_value:
+ return False
+ if isinstance(host, str) and host and host != getpass.getuser():
+ return False
+ if status not in {"exists_local", "local_verified_directory", "schema_audit_pending"}:
+ return False
+ if path_value.startswith(("TBD", "huggingface:", "system_or_installable_font")):
+ return False
+ return path_value.startswith("/")
+
+
+def _write_language_registry_markdown(path: Path, audit: LanguageRegistryAudit, languages: list[Any]) -> None:
+ lines = [
+ "# Language Registry Audit",
+ "",
+ f"- Registry: `{audit.registry_id}`",
+ f"- Passed: `{audit.passed}`",
+ f"- Languages: `{audit.language_count}`",
+ f"- Nepal-language targets counted: `{audit.counted_nepal_language_count}`",
+ f"- First targets: `{', '.join(audit.first_target_ids) or 'none'}`",
+ "",
+ "## Languages",
+ "",
+ "| Priority | ID | Name | Counted | Primary scripts | Validation labels |",
+ "| ---: | --- | --- | --- | --- | --- |",
+ ]
+ sorted_languages = sorted(
+ [language for language in languages if isinstance(language, dict)],
+ key=lambda language: language.get("priority") if isinstance(language.get("priority"), int) else 9999,
+ )
+ for language in sorted_languages:
+ language_id = str(language.get("id", ""))
+ primary_scripts = ", ".join(audit.primary_scripts.get(language_id, []))
+ labels = ", ".join(str(label) for label in language.get("gorkhapatra_language_labels", []))
+ lines.append(
+ "| "
+ f"{language.get('priority', '')} | "
+ f"`{language_id}` | "
+ f"{language.get('name', '')} | "
+ f"`{language.get('counts_toward_nepal_language_target', '')}` | "
+ f"{primary_scripts} | "
+ f"{labels} |"
+ )
+
+ if audit.errors:
+ lines.extend(["", "## Errors", ""])
+ lines.extend(f"- {error}" for error in audit.errors)
+ if audit.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings)
+ if audit.missing_local_paths:
+ lines.extend(["", "## Missing Local Paths", ""])
+ lines.extend(f"- `{missing}`" for missing in audit.missing_local_paths)
+
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_font_renderability_markdown(path: Path, audit: FontRenderabilityAudit) -> None:
+ lines = [
+ "# Font Renderability Audit",
+ "",
+ f"- Passed: `{audit.passed}`",
+ f"- Scripts checked: `{audit.script_count}`",
+ f"- Font candidates checked: `{audit.candidate_count}`",
+ f"- Render requested: `{audit.render_requested}`",
+ f"- Pillow available: `{audit.pillow_available}`",
+ "",
+ "## Candidate Coverage",
+ "",
+ "| Language | Script | Font | Exists | Coverage | Render | Error |",
+ "| --- | --- | --- | --- | ---: | --- | --- |",
+ ]
+ for candidate in audit.candidates:
+ error = candidate.error or ""
+ lines.append(
+ "| "
+ f"`{candidate.language_id}` | "
+ f"{candidate.script} | "
+ f"{candidate.font_name} | "
+ f"`{candidate.path_exists}` | "
+ f"{candidate.coverage_ratio:.1%} | "
+ f"`{candidate.render_status}` | "
+ f"{error} |"
+ )
+ if audit.errors:
+ lines.extend(["", "## Errors", ""])
+ lines.extend(f"- {error}" for error in audit.errors)
+ if audit.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings)
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _is_non_empty_string(value: Any) -> bool:
+ return isinstance(value, str) and bool(value.strip())
diff --git a/src/ocrtech/manifest.py b/src/ocrtech/manifest.py
new file mode 100644
index 0000000000000000000000000000000000000000..71929674b45bde2581b708a5a4678a54ee12e422
--- /dev/null
+++ b/src/ocrtech/manifest.py
@@ -0,0 +1,1333 @@
+"""Dataset verification and manifest conversion."""
+
+from __future__ import annotations
+
+import csv
+import hashlib
+import io
+import json
+import shutil
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any, Iterable, Iterator
+
+from .errors import DataValidationError
+from .normalization import normalize_ocr_text, unsupported_characters
+
+
+IMAGE_FIELD_CANDIDATES = ("image", "image_path", "path", "file", "filename", "img")
+TEXT_FIELD_CANDIDATES = ("text", "label", "transcription", "ground_truth", "gt", "clean_text")
+SUPPORTED_OCR_IMAGE_SUFFIXES = frozenset({".bmp", ".dib", ".jpeg", ".jpg", ".png", ".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".sr", ".ras", ".tiff", ".tif"})
+
+
+@dataclass(slots=True)
+class ManifestEntry:
+ sample_id: str
+ dataset: str
+ split: str
+ image_path: str
+ text: str
+ sha256: str | None = None
+ metadata: dict[str, Any] = field(default_factory=dict)
+
+ def __post_init__(self) -> None:
+ if not self.sample_id:
+ raise DataValidationError("manifest entry sample_id is required")
+ if not self.dataset:
+ raise DataValidationError("manifest entry dataset is required")
+ if not self.split:
+ raise DataValidationError("manifest entry split is required")
+ if not self.image_path:
+ raise DataValidationError(f"manifest entry {self.sample_id} image_path is required")
+ if not isinstance(self.text, str):
+ raise DataValidationError(f"manifest entry {self.sample_id} text must be a string")
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "sample_id": self.sample_id,
+ "dataset": self.dataset,
+ "split": self.split,
+ "image_path": self.image_path,
+ "text": self.text,
+ "sha256": self.sha256,
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any]) -> "ManifestEntry":
+ return cls(
+ sample_id=str(data.get("sample_id") or data.get("id") or ""),
+ dataset=str(data.get("dataset") or ""),
+ split=str(data.get("split") or ""),
+ image_path=str(data.get("image_path") or data.get("image") or ""),
+ text=str(data.get("text") if data.get("text") is not None else ""),
+ sha256=data.get("sha256"),
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class PrepareReject:
+ row_index: int
+ reason: str
+ row: dict[str, Any]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "row_index": self.row_index,
+ "reason": self.reason,
+ "row": self.row,
+ }
+
+
+@dataclass(slots=True)
+class PrepareReport:
+ manifest_path: str
+ sample_count: int
+ rejected_count: int
+ rejects_path: str | None
+ summary_json_path: str
+ summary_md_path: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "sample_count": self.sample_count,
+ "rejected_count": self.rejected_count,
+ "rejects_path": self.rejects_path,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class HfDatasetInspection:
+ dataset_id: str
+ split: str
+ subset: str | None
+ inspection_mode: str
+ fields: list[str]
+ inferred_image_field: str | None
+ inferred_text_field: str | None
+ inspected_count: int
+ samples: list[dict[str, Any]]
+ issues: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+ output_json_path: str | None = None
+ output_md_path: str | None = None
+
+ @property
+ def passed(self) -> bool:
+ return not self.issues
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "dataset_id": self.dataset_id,
+ "split": self.split,
+ "subset": self.subset,
+ "inspection_mode": self.inspection_mode,
+ "passed": self.passed,
+ "fields": self.fields,
+ "inferred_image_field": self.inferred_image_field,
+ "inferred_text_field": self.inferred_text_field,
+ "inspected_count": self.inspected_count,
+ "samples": self.samples,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ "output_json_path": self.output_json_path,
+ "output_md_path": self.output_md_path,
+ }
+
+
+@dataclass(slots=True)
+class ManifestImageNormalizationReport:
+ source_manifest: str
+ manifest_path: str
+ image_dir: str
+ sample_count: int
+ copied_count: int
+ converted_count: int
+ unsupported_suffixes: dict[str, int]
+ summary_json_path: str
+ summary_md_path: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "source_manifest": self.source_manifest,
+ "manifest_path": self.manifest_path,
+ "image_dir": self.image_dir,
+ "sample_count": self.sample_count,
+ "copied_count": self.copied_count,
+ "converted_count": self.converted_count,
+ "unsupported_suffixes": self.unsupported_suffixes,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+def sha256_text(text: str) -> str:
+ return hashlib.sha256(text.encode("utf-8")).hexdigest()
+
+
+def sha256_file(path: Path) -> str:
+ digest = hashlib.sha256()
+ with path.open("rb") as handle:
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
+ digest.update(chunk)
+ return digest.hexdigest()
+
+
+def sha256_path(path: Path) -> str:
+ if path.is_file():
+ return sha256_file(path)
+ if not path.is_dir():
+ raise DataValidationError(f"cannot hash missing or unsupported path: {path}")
+ digest = hashlib.sha256()
+ file_paths = sorted(item for item in path.rglob("*") if item.is_file())
+ for file_path in file_paths:
+ digest.update(str(file_path.relative_to(path)).encode("utf-8"))
+ digest.update(b"\0")
+ with file_path.open("rb") as handle:
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
+ digest.update(chunk)
+ digest.update(b"\0")
+ return digest.hexdigest()
+
+
+def read_jsonl(path: Path) -> Iterator[dict[str, Any]]:
+ with path.open("r", encoding="utf-8") as handle:
+ for line_number, line in enumerate(handle, start=1):
+ if not line.strip():
+ continue
+ try:
+ value = json.loads(line)
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid JSONL at {path}:{line_number}: {exc}") from exc
+ if not isinstance(value, dict):
+ raise DataValidationError(f"JSONL row at {path}:{line_number} must be an object")
+ yield value
+
+
+def read_csv_rows(path: Path) -> Iterator[dict[str, Any]]:
+ with path.open("r", encoding="utf-8", newline="") as handle:
+ reader = csv.DictReader(handle)
+ if not reader.fieldnames:
+ raise DataValidationError(f"CSV has no header: {path}")
+ for row in reader:
+ yield dict(row)
+
+
+def load_manifest(path: str | Path) -> list[ManifestEntry]:
+ manifest_path = Path(path)
+ entries = [ManifestEntry.from_dict(row) for row in read_jsonl(manifest_path)]
+ seen: set[str] = set()
+ for entry in entries:
+ if entry.sample_id in seen:
+ raise DataValidationError(f"duplicate sample_id in manifest {manifest_path}: {entry.sample_id}")
+ seen.add(entry.sample_id)
+ return entries
+
+
+def write_manifest(entries: Iterable[ManifestEntry], path: Path) -> None:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ with path.open("w", encoding="utf-8") as handle:
+ for entry in entries:
+ handle.write(json.dumps(entry.to_dict(), ensure_ascii=False) + "\n")
+
+
+def normalize_manifest_images(
+ manifest_path: str | Path,
+ output_dir: str | Path,
+ *,
+ image_dir_name: str = "images",
+ output_manifest_name: str = "manifest-images-normalized.jsonl",
+) -> ManifestImageNormalizationReport:
+ source_manifest = Path(manifest_path)
+ entries = load_manifest(source_manifest)
+ if not entries:
+ raise DataValidationError("image normalization requires a non-empty manifest")
+ out = Path(output_dir)
+ image_dir = out / image_dir_name
+ image_dir.mkdir(parents=True, exist_ok=True)
+ rewritten: list[ManifestEntry] = []
+ copied_count = 0
+ converted_count = 0
+ unsupported_suffixes: dict[str, int] = {}
+ targets: set[Path] = set()
+ for entry in entries:
+ source_image = _resolve_manifest_image_path(entry.image_path, source_manifest.parent)
+ if not source_image.exists():
+ raise DataValidationError(f"manifest image_path does not exist for {entry.sample_id}: {source_image}")
+ if not source_image.is_file():
+ raise DataValidationError(f"image normalization only supports file image_path entries: {entry.sample_id}: {source_image}")
+ source_suffix = source_image.suffix.lower()
+ target_suffix = source_suffix if source_suffix in SUPPORTED_OCR_IMAGE_SUFFIXES else ".png"
+ target = image_dir / f"{_safe_manifest_filename(entry.sample_id)}{target_suffix}"
+ if target in targets:
+ raise DataValidationError(f"duplicate normalized image target for sample_id {entry.sample_id}: {target}")
+ targets.add(target)
+ metadata = dict(entry.metadata or {})
+ metadata["source_image_path"] = entry.image_path
+ metadata["source_image_sha256"] = sha256_file(source_image)
+ metadata["normalized_image_suffix"] = target_suffix
+ if source_suffix in SUPPORTED_OCR_IMAGE_SUFFIXES:
+ shutil.copy2(source_image, target)
+ copied_count += 1
+ metadata["image_normalization"] = "copied"
+ else:
+ unsupported_suffix = source_suffix or ""
+ unsupported_suffixes[unsupported_suffix] = unsupported_suffixes.get(unsupported_suffix, 0) + 1
+ _convert_image_to_png(source_image, target, sample_id=entry.sample_id)
+ converted_count += 1
+ metadata["image_normalization"] = "converted_to_png"
+ metadata["original_image_suffix"] = unsupported_suffix
+ rewritten.append(
+ ManifestEntry(
+ sample_id=entry.sample_id,
+ dataset=entry.dataset,
+ split=entry.split,
+ image_path=str(target),
+ text=entry.text,
+ sha256=sha256_file(target),
+ metadata=metadata,
+ )
+ )
+ manifest_out = out / output_manifest_name
+ write_manifest(rewritten, manifest_out)
+ summary_json = out / "image-normalization.json"
+ summary_md = out / "image-normalization.md"
+ report = ManifestImageNormalizationReport(
+ source_manifest=str(source_manifest),
+ manifest_path=str(manifest_out),
+ image_dir=str(image_dir),
+ sample_count=len(rewritten),
+ copied_count=copied_count,
+ converted_count=converted_count,
+ unsupported_suffixes=dict(sorted(unsupported_suffixes.items())),
+ summary_json_path=str(summary_json),
+ summary_md_path=str(summary_md),
+ )
+ summary_json.write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_image_normalization_markdown(summary_md, report)
+ return report
+
+
+def _resolve_manifest_image_path(path_value: str, manifest_dir: Path) -> Path:
+ raw = Path(path_value)
+ if raw.exists() or raw.is_absolute():
+ return raw
+ return manifest_dir / raw
+
+
+def infer_field(row: dict[str, Any], explicit: str | None, candidates: tuple[str, ...], role: str) -> str:
+ if explicit:
+ if explicit not in row:
+ raise DataValidationError(f"Requested {role} field {explicit!r} is missing. Available fields: {sorted(row)}")
+ return explicit
+ present = [field for field in candidates if field in row]
+ matches = [field for field in present if _has_field_value(row[field])]
+ if len(matches) == 1:
+ return matches[0]
+ if len(matches) > 1:
+ return matches[0]
+ if len(present) == 1:
+ return present[0]
+ if len(present) > 1:
+ return present[0]
+ raise DataValidationError(
+ f"Could not infer {role} field. Available fields: {sorted(row)}. "
+ f"Pass --{role.replace('_', '-')}-field explicitly."
+ )
+
+
+def _has_field_value(value: Any) -> bool:
+ if value is None:
+ return False
+ if isinstance(value, str):
+ return value != ""
+ return True
+
+
+def _safe_manifest_filename(value: str) -> str:
+ safe = "".join(char if char.isalnum() or char in {"-", "_", "."} else "_" for char in value.strip())
+ return safe or "sample"
+
+
+def _convert_image_to_png(source: Path, target: Path, *, sample_id: str) -> None:
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise DataValidationError("Pillow is required to convert unsupported manifest image suffixes") from exc
+ try:
+ with Image.open(source) as image:
+ image.save(target, format="PNG")
+ except Exception as exc:
+ raise DataValidationError(f"failed to convert image for {sample_id} to PNG: {source}: {exc}") from exc
+
+
+def _write_image_normalization_markdown(path: Path, report: ManifestImageNormalizationReport) -> None:
+ unsupported = ", ".join(f"`{suffix}`={count}" for suffix, count in report.unsupported_suffixes.items()) or "none"
+ path.write_text(
+ "\n".join(
+ [
+ "# Manifest Image Normalization",
+ "",
+ f"Source manifest: `{report.source_manifest}`",
+ f"Rewritten manifest: `{report.manifest_path}`",
+ f"Image directory: `{report.image_dir}`",
+ f"Samples: `{report.sample_count}`",
+ f"Copied images: `{report.copied_count}`",
+ f"Converted images: `{report.converted_count}`",
+ f"Unsupported suffixes converted: {unsupported}",
+ "",
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+
+def local_rows(source: Path) -> Iterator[dict[str, Any]]:
+ if source.is_dir():
+ for candidate in (source / "labels.jsonl", source / "manifest.jsonl", source / "labels.csv", source / "metadata.csv"):
+ if candidate.exists():
+ yield from local_rows(candidate)
+ return
+ raise DataValidationError(f"Directory source {source} must contain labels.jsonl, manifest.jsonl, labels.csv, or metadata.csv")
+ suffix = source.suffix.lower()
+ if suffix == ".jsonl":
+ yield from read_jsonl(source)
+ elif suffix == ".csv":
+ yield from read_csv_rows(source)
+ else:
+ raise DataValidationError(f"Unsupported local source format {source}. Use JSONL, CSV, or a labeled directory.")
+
+
+def rows_to_manifest(
+ rows: Iterable[dict[str, Any]],
+ *,
+ dataset: str,
+ split: str,
+ base_dir: Path | None,
+ image_field: str | None = None,
+ text_field: str | None = None,
+ limit: int | None = None,
+ strict_chars: bool = False,
+ ) -> list[ManifestEntry]:
+ entries, rejects = convert_rows_to_manifest(
+ rows,
+ dataset=dataset,
+ split=split,
+ base_dir=base_dir,
+ image_field=image_field,
+ text_field=text_field,
+ limit=limit,
+ strict_chars=strict_chars,
+ skip_invalid=False,
+ )
+ if rejects:
+ raise DataValidationError(f"Unexpected rejected rows while preparing {dataset} {split}")
+ if not entries:
+ raise DataValidationError("No rows converted into manifest entries")
+ return entries
+
+
+def convert_rows_to_manifest(
+ rows: Iterable[dict[str, Any]],
+ *,
+ dataset: str,
+ split: str,
+ base_dir: Path | None,
+ image_field: str | None = None,
+ text_field: str | None = None,
+ limit: int | None = None,
+ strict_chars: bool = False,
+ skip_invalid: bool = False,
+) -> tuple[list[ManifestEntry], list[PrepareReject]]:
+ entries: list[ManifestEntry] = []
+ rejects: list[PrepareReject] = []
+ for index, row in enumerate(rows):
+ if limit is not None and index >= limit:
+ break
+ if not isinstance(row, dict):
+ error = DataValidationError(f"Row {index} must be an object")
+ if not skip_invalid:
+ raise error
+ rejects.append(PrepareReject(row_index=index, reason=str(error), row={"_raw": repr(row)}))
+ continue
+ try:
+ entries.append(
+ _manifest_entry_from_row(
+ row,
+ row_index=index,
+ dataset=dataset,
+ split=split,
+ base_dir=base_dir,
+ image_field=image_field,
+ text_field=text_field,
+ strict_chars=strict_chars,
+ )
+ )
+ except DataValidationError as exc:
+ if not skip_invalid:
+ raise
+ rejects.append(PrepareReject(row_index=index, reason=str(exc), row=dict(row)))
+ return entries, rejects
+
+
+def _manifest_entry_from_row(
+ row: dict[str, Any],
+ *,
+ row_index: int,
+ dataset: str,
+ split: str,
+ base_dir: Path | None,
+ image_field: str | None,
+ text_field: str | None,
+ strict_chars: bool,
+) -> ManifestEntry:
+ image_key = infer_field(row, image_field, IMAGE_FIELD_CANDIDATES, "image")
+ text_key = infer_field(row, text_field, TEXT_FIELD_CANDIDATES, "text")
+ image_value = row[image_key]
+ if not _has_field_value(image_value):
+ raise DataValidationError(f"Row {row_index} image field {image_key!r} is empty")
+ raw_text = row[text_key]
+ if not _has_field_value(raw_text):
+ raise DataValidationError(f"Row {row_index} text field {text_key!r} is empty")
+ text = normalize_ocr_text(str(raw_text))
+ if not text:
+ raise DataValidationError(f"Row {row_index} normalized text is empty")
+ if strict_chars:
+ unsupported = unsupported_characters(text)
+ if unsupported:
+ raise DataValidationError(f"Row {row_index} contains unsupported characters: {unsupported}")
+ image_path = Path(str(image_value))
+ if base_dir is not None and not image_path.is_absolute():
+ image_path = base_dir / image_path
+ if not image_path.exists():
+ raise DataValidationError(f"Row {row_index} image does not exist: {image_path}")
+ explicit_sample_id = row.get("sample_id")
+ if _has_field_value(explicit_sample_id):
+ sample_id = str(explicit_sample_id)
+ elif _has_field_value(row.get("id")):
+ sample_id = f"{dataset}-{split}-{row['id']}"
+ else:
+ sample_id = f"{dataset}-{split}-{row_index:08d}"
+ image_sha256 = sha256_file(image_path)
+ text_sha256 = sha256_text(text)
+ return ManifestEntry(
+ sample_id=sample_id,
+ dataset=dataset,
+ split=split,
+ image_path=str(image_path),
+ text=text,
+ sha256=image_sha256,
+ metadata={
+ "source_row": row_index,
+ "image_field": image_key,
+ "text_field": text_key,
+ "text_sha256": text_sha256,
+ "sample_sha256": sha256_text(f"{image_sha256}\n{text_sha256}"),
+ },
+ )
+
+
+def prepare_local_dataset(
+ source: str | Path,
+ output_dir: str | Path,
+ *,
+ dataset: str | None = None,
+ split: str = "train",
+ image_field: str | None = None,
+ text_field: str | None = None,
+ limit: int | None = None,
+ strict_chars: bool = False,
+ skip_invalid: bool = False,
+ slices: list[str] | None = None,
+) -> PrepareReport:
+ source_path = Path(source)
+ if not source_path.exists():
+ raise DataValidationError(f"Local source does not exist: {source_path}")
+ dataset_name = dataset or source_path.stem or source_path.name
+ rows = local_rows(source_path)
+ base_dir = source_path if source_path.is_dir() else source_path.parent
+ entries, rejects = convert_rows_to_manifest(
+ rows,
+ dataset=dataset_name,
+ split=split,
+ base_dir=base_dir,
+ image_field=image_field,
+ text_field=text_field,
+ limit=limit,
+ strict_chars=strict_chars,
+ skip_invalid=skip_invalid,
+ )
+ entries = _stamp_slices(entries, slices or [])
+ return _finalize_prepare_report(output_dir, dataset_name, split, entries, rejects)
+
+
+def prepare_hf_dataset(
+ dataset_id: str,
+ output_dir: str | Path,
+ *,
+ dataset: str | None = None,
+ split: str = "train",
+ image_field: str | None = None,
+ text_field: str | None = None,
+ hf_subset: str | None = None,
+ limit: int | None = None,
+ strict_chars: bool = False,
+ skip_invalid: bool = False,
+ slices: list[str] | None = None,
+) -> PrepareReport:
+ if dataset_id == "prashant0919/nepali-synthetic-ocr-lines":
+ return _prepare_prashant_synthetic_dataset(
+ dataset_id,
+ output_dir,
+ dataset=dataset,
+ split=split,
+ limit=limit,
+ strict_chars=strict_chars,
+ skip_invalid=skip_invalid,
+ slices=slices,
+ )
+ if dataset_id == "nvidia/OCR-Synthetic-Multilingual-v1":
+ return _prepare_nvidia_hdf5_dataset(
+ dataset_id,
+ output_dir,
+ dataset=dataset,
+ split=split,
+ subset=hf_subset or "en",
+ limit=limit,
+ strict_chars=strict_chars,
+ slices=slices,
+ )
+ try:
+ from datasets import load_dataset
+ except ImportError as exc:
+ raise DataValidationError("Hugging Face dataset support requires installing ocr-tech[datasets].") from exc
+ try:
+ hf_dataset = load_dataset(dataset_id, split=split, streaming=False)
+ except Exception as exc:
+ raise DataValidationError(f"Failed to load Hugging Face dataset {dataset_id!r} split {split!r}: {exc}") from exc
+
+ output_root = Path(output_dir)
+ image_dir = output_root / "images" / (dataset or dataset_id.replace("/", "__")) / split
+ image_dir.mkdir(parents=True, exist_ok=True)
+
+ rows: list[dict[str, Any]] = []
+ for index, row in enumerate(hf_dataset):
+ if limit is not None and index >= limit:
+ break
+ if not isinstance(row, dict):
+ raise DataValidationError(f"HF row {index} is not an object")
+ image_key = infer_field(row, image_field, IMAGE_FIELD_CANDIDATES, "image")
+ text_key = infer_field(row, text_field, TEXT_FIELD_CANDIDATES, "text")
+ image_value = row[image_key]
+ image_path = image_dir / f"{index:08d}.png"
+ if isinstance(image_value, str):
+ candidate = Path(image_value)
+ if not candidate.exists():
+ raise DataValidationError(f"HF row {index} image path does not exist locally: {candidate}")
+ image_path = candidate
+ elif hasattr(image_value, "save"):
+ image_value.save(image_path)
+ elif isinstance(image_value, dict) and image_value.get("path"):
+ candidate = Path(str(image_value["path"]))
+ if not candidate.exists():
+ raise DataValidationError(f"HF row {index} image path does not exist locally: {candidate}")
+ image_path = candidate
+ else:
+ raise DataValidationError(f"HF row {index} has unsupported image field type: {type(image_value).__name__}")
+ rows.append({"image_path": str(image_path), "text": row[text_key], "id": row.get("id", index)})
+ dataset_name = dataset or dataset_id.replace("/", "__")
+ entries, rejects = convert_rows_to_manifest(
+ rows,
+ dataset=dataset_name,
+ split=split,
+ base_dir=None,
+ image_field="image_path",
+ text_field="text",
+ limit=None,
+ strict_chars=strict_chars,
+ skip_invalid=skip_invalid,
+ )
+ entries = _stamp_slices(entries, _default_hf_slices(dataset_id, subset=hf_subset) + (slices or []))
+ return _finalize_prepare_report(output_dir, dataset_name, split, entries, rejects)
+
+
+def inspect_hf_dataset(
+ dataset_id: str,
+ output_dir: str | Path,
+ *,
+ split: str = "train",
+ hf_subset: str | None = None,
+ image_field: str | None = None,
+ text_field: str | None = None,
+ limit: int = 3,
+) -> HfDatasetInspection:
+ if limit <= 0:
+ raise DataValidationError("inspect-hf-dataset limit must be positive")
+ if dataset_id == "prashant0919/nepali-synthetic-ocr-lines":
+ report = _inspect_prashant_synthetic_dataset(dataset_id, split=split, limit=limit)
+ elif dataset_id == "nvidia/OCR-Synthetic-Multilingual-v1":
+ report = _inspect_nvidia_hdf5_dataset(dataset_id, split=split, subset=hf_subset or "en", limit=limit)
+ else:
+ report = _inspect_generic_hf_dataset(
+ dataset_id,
+ split=split,
+ hf_subset=hf_subset,
+ image_field=image_field,
+ text_field=text_field,
+ limit=limit,
+ )
+ return _write_hf_inspection(report, Path(output_dir))
+
+
+def prepare_hf_correction_pairs(
+ dataset_id: str,
+ output_path: str | Path,
+ *,
+ split: str = "train",
+ limit: int | None = None,
+) -> Path:
+ if dataset_id != "cfilt/RoundTripOCR-nepali":
+ raise DataValidationError(f"unsupported correction dataset: {dataset_id}")
+ try:
+ from datasets import load_dataset
+ except ImportError as exc:
+ raise DataValidationError("Hugging Face correction dataset support requires installing ocr-tech[datasets].") from exc
+ try:
+ hf_dataset = load_dataset(dataset_id, split=split, streaming=False)
+ except Exception as exc:
+ raise DataValidationError(f"Failed to load Hugging Face dataset {dataset_id!r} split {split!r}: {exc}") from exc
+ out = Path(output_path)
+ out.parent.mkdir(parents=True, exist_ok=True)
+ count = 0
+ with out.open("w", encoding="utf-8") as handle:
+ for index, row in enumerate(hf_dataset):
+ if limit is not None and index >= limit:
+ break
+ if not isinstance(row, dict):
+ raise DataValidationError(f"HF correction row {index} is not an object")
+ noisy = row.get("ocr")
+ clean = row.get("correct")
+ if not isinstance(noisy, str) or not isinstance(clean, str):
+ raise DataValidationError(f"HF correction row {index} requires string ocr and correct fields")
+ handle.write(
+ json.dumps(
+ {
+ "noisy_text": normalize_ocr_text(noisy),
+ "clean_text": normalize_ocr_text(clean),
+ "font": row.get("font"),
+ "dataset": dataset_id,
+ "split": split,
+ },
+ ensure_ascii=False,
+ )
+ + "\n"
+ )
+ count += 1
+ if count == 0:
+ raise DataValidationError(f"No correction pairs written for {dataset_id} split {split}")
+ return out
+
+
+def _inspect_generic_hf_dataset(
+ dataset_id: str,
+ *,
+ split: str,
+ hf_subset: str | None,
+ image_field: str | None,
+ text_field: str | None,
+ limit: int,
+) -> HfDatasetInspection:
+ try:
+ from datasets import load_dataset
+ except ImportError as exc:
+ raise DataValidationError("Hugging Face dataset support requires installing ocr-tech[datasets].") from exc
+ try:
+ if hf_subset:
+ hf_dataset = load_dataset(dataset_id, hf_subset, split=split, streaming=False)
+ else:
+ hf_dataset = load_dataset(dataset_id, split=split, streaming=False)
+ except Exception as exc:
+ raise DataValidationError(f"Failed to load Hugging Face dataset {dataset_id!r} split {split!r}: {exc}") from exc
+
+ rows: list[dict[str, Any]] = []
+ for index, row in enumerate(hf_dataset):
+ if index >= limit:
+ break
+ if not isinstance(row, dict):
+ raise DataValidationError(f"HF row {index} is not an object")
+ rows.append(row)
+ if not rows:
+ raise DataValidationError(f"No rows available for Hugging Face dataset {dataset_id!r} split {split!r}")
+
+ fields = sorted(rows[0])
+ issues: list[str] = []
+ warnings: list[str] = []
+ inferred_image = _try_infer_field(rows[0], image_field, IMAGE_FIELD_CANDIDATES, "image", issues)
+ inferred_text = _try_infer_field(rows[0], text_field, TEXT_FIELD_CANDIDATES, "text", issues)
+ samples = [
+ _summarize_hf_row(row, row_index=index, image_field=inferred_image, text_field=inferred_text)
+ for index, row in enumerate(rows)
+ ]
+ for sample in samples:
+ if inferred_image and not sample.get("image_supported_by_prepare", False):
+ warnings.append(f"row {sample['row_index']} image field {inferred_image!r} may need a dataset-specific converter")
+ if inferred_text and sample.get("text_length", 0) == 0:
+ issues.append(f"row {sample['row_index']} text field {inferred_text!r} is empty after string conversion")
+ return HfDatasetInspection(
+ dataset_id=dataset_id,
+ split=split,
+ subset=hf_subset,
+ inspection_mode="datasets.load_dataset",
+ fields=fields,
+ inferred_image_field=inferred_image,
+ inferred_text_field=inferred_text,
+ inspected_count=len(samples),
+ samples=samples,
+ issues=issues,
+ warnings=warnings,
+ )
+
+
+def _inspect_prashant_synthetic_dataset(dataset_id: str, *, split: str, limit: int) -> HfDatasetInspection:
+ prefix = f"{split}/"
+ files = set(_list_dataset_files(dataset_id, prefix=prefix, suffix=""))
+ metadata_file = f"{prefix}metadata.jsonl"
+ issues: list[str] = []
+ if metadata_file not in files:
+ issues.append(f"metadata.jsonl is missing: {metadata_file}")
+ return HfDatasetInspection(dataset_id, split, None, "huggingface_hub files", [], None, None, 0, [], issues)
+ metadata_path = _download_dataset_file(dataset_id, metadata_file)
+ samples: list[dict[str, Any]] = []
+ fields: set[str] = set()
+ for index, row in enumerate(read_jsonl(metadata_path)):
+ if index >= limit:
+ break
+ fields.update(row)
+ file_name = row.get("file_name")
+ dataset_file = file_name if isinstance(file_name, str) and file_name.startswith(prefix) else f"{prefix}{file_name}"
+ samples.append(
+ {
+ "row_index": index,
+ "fields": sorted(row),
+ "image_type": "repo_file",
+ "image_path": dataset_file,
+ "image_exists_in_repo": dataset_file in files,
+ "image_supported_by_prepare": dataset_file in files,
+ "text_type": type(row.get("text")).__name__,
+ "text_length": len(str(row.get("text") or "")),
+ "text_preview": _preview_text(row.get("text")),
+ }
+ )
+ if dataset_file not in files:
+ issues.append(f"row {index} image file missing from dataset repo: {dataset_file}")
+ return HfDatasetInspection(
+ dataset_id=dataset_id,
+ split=split,
+ subset=None,
+ inspection_mode="huggingface_hub metadata.jsonl",
+ fields=sorted(fields),
+ inferred_image_field="file_name",
+ inferred_text_field="text",
+ inspected_count=len(samples),
+ samples=samples,
+ issues=issues,
+ )
+
+
+def _inspect_nvidia_hdf5_dataset(dataset_id: str, *, split: str, subset: str, limit: int) -> HfDatasetInspection:
+ try:
+ import h5py
+ except ImportError as exc:
+ raise DataValidationError("NVIDIA HDF5 dataset inspection requires installing ocr-tech[datasets].") from exc
+ shard_files = _list_dataset_files(dataset_id, prefix=f"{subset}/{split}/", suffix=".h5")
+ if not shard_files:
+ return HfDatasetInspection(
+ dataset_id,
+ split,
+ subset,
+ "hdf5 line_bboxes",
+ [],
+ None,
+ None,
+ 0,
+ [],
+ [f"No HDF5 shards found for subset={subset!r} split={split!r}"],
+ )
+ samples: list[dict[str, Any]] = []
+ shard_path = _download_dataset_file(dataset_id, shard_files[0])
+ with h5py.File(shard_path, "r") as handle:
+ fields = sorted(handle.keys())
+ for required_key in ("images", "annotations"):
+ if required_key not in handle:
+ return HfDatasetInspection(
+ dataset_id,
+ split,
+ subset,
+ "hdf5 line_bboxes",
+ fields,
+ None,
+ None,
+ 0,
+ [],
+ [f"HDF5 shard {shard_path} is missing dataset {required_key!r}"],
+ )
+ image_dataset = handle["images"]
+ annotation_dataset = handle["annotations"]
+ page_count = min(len(image_dataset), len(annotation_dataset))
+ for page_index in range(page_count):
+ if len(samples) >= limit:
+ break
+ annotation = _coerce_annotation_json(annotation_dataset[page_index], shard_path, page_index)
+ line_boxes = annotation.get("line_bboxes")
+ if not isinstance(line_boxes, list):
+ samples.append(
+ {
+ "row_index": page_index,
+ "shard_file": shard_files[0],
+ "annotation_keys": sorted(annotation),
+ "line_bbox_count": None,
+ "image_supported_by_prepare": False,
+ "text_length": 0,
+ "text_preview": "",
+ }
+ )
+ continue
+ for line_index, line_box in enumerate(line_boxes):
+ if len(samples) >= limit:
+ break
+ text = line_box.get("text") if isinstance(line_box, dict) else None
+ samples.append(
+ {
+ "row_index": len(samples),
+ "shard_file": shard_files[0],
+ "page_index": page_index,
+ "line_index": line_index,
+ "annotation_keys": sorted(annotation),
+ "line_bbox_count": len(line_boxes),
+ "bbox": line_box.get("bbox") if isinstance(line_box, dict) else None,
+ "image_type": "hdf5_page_crop",
+ "image_supported_by_prepare": isinstance(line_box, dict) and isinstance(line_box.get("bbox"), list),
+ "text_type": type(text).__name__,
+ "text_length": len(str(text or "")),
+ "text_preview": _preview_text(text),
+ }
+ )
+ return HfDatasetInspection(
+ dataset_id=dataset_id,
+ split=split,
+ subset=subset,
+ inspection_mode="hdf5 line_bboxes",
+ fields=["images", "annotations"],
+ inferred_image_field="images + annotations.line_bboxes[].bbox",
+ inferred_text_field="annotations.line_bboxes[].text",
+ inspected_count=len(samples),
+ samples=samples,
+ issues=[] if samples else [f"No line boxes found in first shard: {shard_files[0]}"],
+ warnings=[f"inspected first shard only: {shard_files[0]}"],
+ )
+
+
+def _try_infer_field(
+ row: dict[str, Any],
+ explicit: str | None,
+ candidates: tuple[str, ...],
+ role: str,
+ issues: list[str],
+) -> str | None:
+ try:
+ return infer_field(row, explicit, candidates, role)
+ except DataValidationError as exc:
+ issues.append(str(exc))
+ return None
+
+
+def _summarize_hf_row(
+ row: dict[str, Any],
+ *,
+ row_index: int,
+ image_field: str | None,
+ text_field: str | None,
+) -> dict[str, Any]:
+ image_value = row.get(image_field) if image_field else None
+ text_value = row.get(text_field) if text_field else None
+ return {
+ "row_index": row_index,
+ "fields": sorted(row),
+ "image_field": image_field,
+ "image_type": type(image_value).__name__,
+ "image_supported_by_prepare": _is_supported_hf_image_value(image_value),
+ "image_summary": _summarize_value(image_value),
+ "text_field": text_field,
+ "text_type": type(text_value).__name__,
+ "text_length": len(str(text_value or "")),
+ "text_preview": _preview_text(text_value),
+ }
+
+
+def _is_supported_hf_image_value(value: Any) -> bool:
+ if isinstance(value, str):
+ return True
+ if hasattr(value, "save"):
+ return True
+ return isinstance(value, dict) and bool(value.get("path"))
+
+
+def _summarize_value(value: Any) -> Any:
+ if isinstance(value, (str, int, float, bool)) or value is None:
+ text = str(value)
+ return text[:160] + ("..." if len(text) > 160 else "")
+ if isinstance(value, dict):
+ return {str(key): _summarize_value(item) for key, item in list(value.items())[:10]}
+ if hasattr(value, "size"):
+ return {"type": type(value).__name__, "size": getattr(value, "size", None), "mode": getattr(value, "mode", None)}
+ return {"type": type(value).__name__}
+
+
+def _preview_text(value: Any, limit: int = 120) -> str:
+ text = normalize_ocr_text(str(value or ""))
+ return text[:limit] + ("..." if len(text) > limit else "")
+
+
+def _write_hf_inspection(report: HfDatasetInspection, output_dir: Path) -> HfDatasetInspection:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ stem = report.dataset_id.replace("/", "__")
+ if report.subset:
+ stem = f"{stem}__{report.subset}"
+ stem = f"{stem}-{report.split}-inspect"
+ json_path = output_dir / f"{stem}.json"
+ md_path = output_dir / f"{stem}.md"
+ report.output_json_path = str(json_path)
+ report.output_md_path = str(md_path)
+ json_path.write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Hugging Face Dataset Inspection",
+ "",
+ f"Dataset: `{report.dataset_id}`",
+ f"Split: `{report.split}`",
+ f"Subset: `{report.subset or ''}`",
+ f"Mode: `{report.inspection_mode}`",
+ f"Passed: `{report.passed}`",
+ f"Fields: `{', '.join(report.fields)}`",
+ f"Inferred image field: `{report.inferred_image_field or ''}`",
+ f"Inferred text field: `{report.inferred_text_field or ''}`",
+ f"Inspected samples: `{report.inspected_count}`",
+ "",
+ "## Issues",
+ "",
+ ]
+ lines.extend([f"- {issue}" for issue in report.issues] or ["- none"])
+ lines.extend(["", "## Warnings", ""])
+ lines.extend([f"- {warning}" for warning in report.warnings] or ["- none"])
+ lines.extend(["", "## Samples", ""])
+ for sample in report.samples:
+ lines.append(f"- row `{sample.get('row_index')}`: text_len=`{sample.get('text_length')}` preview=`{sample.get('text_preview')}`")
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+ return report
+
+
+def _prepare_prashant_synthetic_dataset(
+ dataset_id: str,
+ output_dir: str | Path,
+ *,
+ dataset: str | None,
+ split: str,
+ limit: int | None,
+ strict_chars: bool,
+ skip_invalid: bool,
+ slices: list[str] | None,
+) -> PrepareReport:
+ prefix = f"{split}/"
+ files = set(_list_dataset_files(dataset_id, prefix=prefix, suffix=""))
+ metadata_file = f"{prefix}metadata.jsonl"
+ if metadata_file not in files:
+ raise DataValidationError(f"metadata.jsonl is missing for {dataset_id} split {split}: {metadata_file}")
+ metadata_path = _download_dataset_file(dataset_id, metadata_file)
+ rows: list[dict[str, Any]] = []
+ for index, row in enumerate(read_jsonl(metadata_path)):
+ if limit is not None and index >= limit:
+ break
+ file_name = row.get("file_name")
+ if not isinstance(file_name, str) or not file_name:
+ raise DataValidationError(f"HF row {index} in {metadata_file} requires a non-empty file_name")
+ dataset_file = file_name if file_name.startswith(prefix) else f"{prefix}{file_name}"
+ if dataset_file not in files:
+ raise DataValidationError(f"HF row {index} image file is missing from dataset repo: {dataset_file}")
+ image_path = _download_dataset_file(dataset_id, dataset_file)
+ rows.append(
+ {
+ "image_path": str(image_path),
+ "text": row.get("text"),
+ "id": row.get("id", index),
+ }
+ )
+ dataset_name = dataset or dataset_id.replace("/", "__")
+ entries, rejects = convert_rows_to_manifest(
+ rows,
+ dataset=dataset_name,
+ split=split,
+ base_dir=None,
+ image_field="image_path",
+ text_field="text",
+ limit=limit,
+ strict_chars=strict_chars,
+ skip_invalid=skip_invalid,
+ )
+ entries = _stamp_slices(entries, _default_hf_slices(dataset_id, subset=None) + (slices or []))
+ return _finalize_prepare_report(output_dir, dataset_name, split, entries, rejects)
+
+
+def _prepare_nvidia_hdf5_dataset(
+ dataset_id: str,
+ output_dir: str | Path,
+ *,
+ dataset: str | None,
+ split: str,
+ subset: str,
+ limit: int | None,
+ strict_chars: bool,
+ slices: list[str] | None,
+) -> PrepareReport:
+ try:
+ import h5py
+ except ImportError as exc:
+ raise DataValidationError("NVIDIA HDF5 dataset support requires installing ocr-tech[datasets].") from exc
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise DataValidationError("NVIDIA HDF5 dataset support requires Pillow. Install ocr-tech[datasets].") from exc
+
+ shard_files = _list_dataset_files(dataset_id, prefix=f"{subset}/{split}/", suffix=".h5")
+ if not shard_files:
+ raise DataValidationError(f"No HDF5 shards found for {dataset_id} subset {subset!r} split {split!r}")
+ dataset_name = dataset or f"{dataset_id.replace('/', '__')}__{subset}"
+ output_root = Path(output_dir)
+ image_dir = output_root / "images" / dataset_name / split
+ image_dir.mkdir(parents=True, exist_ok=True)
+ entries: list[ManifestEntry] = []
+
+ for shard_index, shard_file in enumerate(shard_files):
+ shard_path = _download_dataset_file(dataset_id, shard_file)
+ with h5py.File(shard_path, "r") as handle:
+ for required_key in ("images", "annotations"):
+ if required_key not in handle:
+ raise DataValidationError(f"HDF5 shard {shard_path} is missing dataset {required_key!r}")
+ image_dataset = handle["images"]
+ annotation_dataset = handle["annotations"]
+ if len(image_dataset) != len(annotation_dataset):
+ raise DataValidationError(f"HDF5 shard {shard_path} has mismatched images and annotations lengths")
+ for page_index in range(len(image_dataset)):
+ if limit is not None and len(entries) >= limit:
+ break
+ image_bytes = _coerce_hdf5_bytes(image_dataset[page_index])
+ annotation = _coerce_annotation_json(annotation_dataset[page_index], shard_path, page_index)
+ line_boxes = annotation.get("line_bboxes")
+ if not isinstance(line_boxes, list):
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} annotation is missing line_bboxes")
+ page_image = Image.open(io.BytesIO(image_bytes)).convert("RGB")
+ for line_index, line_box in enumerate(line_boxes):
+ if limit is not None and len(entries) >= limit:
+ break
+ if not isinstance(line_box, dict):
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} line {line_index} is not an object")
+ text = normalize_ocr_text(str(line_box.get("text") or ""))
+ if not text:
+ continue
+ if strict_chars:
+ unsupported = unsupported_characters(text)
+ if unsupported:
+ raise DataValidationError(
+ f"HDF5 shard {shard_path} page {page_index} line {line_index} contains unsupported characters: {unsupported}"
+ )
+ bbox = _coerce_bbox(line_box.get("bbox"), shard_path, page_index, line_index)
+ crop = page_image.crop((bbox[0], bbox[1], bbox[0] + bbox[2], bbox[1] + bbox[3]))
+ if crop.width <= 0 or crop.height <= 0:
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} line {line_index} produced an empty crop")
+ file_name = f"{shard_path.stem}-p{page_index:06d}-l{line_index:04d}.png"
+ crop_path = image_dir / file_name
+ crop.save(crop_path)
+ image_sha256 = sha256_file(crop_path)
+ text_sha256 = sha256_text(text)
+ sample_id = f"{dataset_name}-{split}-{shard_index:03d}-{page_index:06d}-{line_index:04d}"
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset=dataset_name,
+ split=split,
+ image_path=str(crop_path),
+ text=text,
+ sha256=image_sha256,
+ metadata={
+ "source_dataset": dataset_id,
+ "subset": subset,
+ "shard_path": str(shard_path),
+ "page_index": page_index,
+ "line_index": line_index,
+ "bbox": bbox,
+ "text_sha256": text_sha256,
+ "sample_sha256": sha256_text(f"{image_sha256}\n{text_sha256}"),
+ "slices": ["english", subset, "synthetic", "line_crop"],
+ },
+ )
+ )
+ if limit is not None and len(entries) >= limit:
+ break
+ if not entries:
+ raise DataValidationError(f"No line crops were prepared for {dataset_id} subset {subset!r} split {split!r}")
+ entries = _stamp_slices(entries, slices or [])
+ return _finalize_prepare_report(output_root, dataset_name, split, entries, [])
+
+
+def _stamp_slices(entries: list[ManifestEntry], slices: list[str]) -> list[ManifestEntry]:
+ normalized = [str(item).strip() for item in slices if str(item).strip()]
+ if not normalized:
+ return entries
+ for entry in entries:
+ metadata = dict(entry.metadata or {})
+ existing = metadata.get("slices")
+ combined: list[str] = []
+ if isinstance(existing, list):
+ combined.extend(str(item).strip() for item in existing if str(item).strip())
+ elif isinstance(existing, str) and existing.strip():
+ combined.append(existing.strip())
+ combined.extend(normalized)
+ metadata["slices"] = sorted(set(combined))
+ entry.metadata = metadata
+ return entries
+
+
+def _default_hf_slices(dataset_id: str, *, subset: str | None) -> list[str]:
+ if dataset_id == "gauravgiri/nepali-ocr-dataset":
+ return ["nepali", "real"]
+ if dataset_id == "prashant0919/nepali-synthetic-ocr-lines":
+ return ["nepali", "synthetic"]
+ if dataset_id == "nvidia/OCR-Synthetic-Multilingual-v1":
+ values = ["english", "synthetic", "line_crop"]
+ if subset:
+ values.append(subset)
+ return values
+ return []
+
+
+def _finalize_prepare_report(
+ output_dir: str | Path,
+ dataset_name: str,
+ split: str,
+ entries: list[ManifestEntry],
+ rejects: list[PrepareReject],
+) -> PrepareReport:
+ if not entries:
+ if rejects:
+ raise DataValidationError(f"No rows converted into manifest entries; rejected rows={len(rejects)}")
+ raise DataValidationError("No rows converted into manifest entries")
+ output_root = Path(output_dir)
+ output_root.mkdir(parents=True, exist_ok=True)
+ stem = f"{dataset_name}-{split}"
+ manifest_path = output_root / f"{stem}.jsonl"
+ rejects_path = output_root / f"{stem}-rejects.jsonl"
+ summary_json_path = output_root / f"{stem}-prepare.json"
+ summary_md_path = output_root / f"{stem}-prepare.md"
+ write_manifest(entries, manifest_path)
+ if rejects:
+ with rejects_path.open("w", encoding="utf-8") as handle:
+ for reject in rejects:
+ handle.write(json.dumps(reject.to_dict(), ensure_ascii=False) + "\n")
+ elif rejects_path.exists():
+ rejects_path.unlink()
+ report = PrepareReport(
+ manifest_path=str(manifest_path),
+ sample_count=len(entries),
+ rejected_count=len(rejects),
+ rejects_path=str(rejects_path) if rejects else None,
+ summary_json_path=str(summary_json_path),
+ summary_md_path=str(summary_md_path),
+ )
+ _write_prepare_report(report, summary_json_path, summary_md_path)
+ return report
+
+
+def _write_prepare_report(report: PrepareReport, summary_json_path: Path, summary_md_path: Path) -> None:
+ summary_json_path.write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Dataset Prepare",
+ "",
+ f"Manifest: `{report.manifest_path}`",
+ f"Prepared samples: `{report.sample_count}`",
+ f"Rejected rows: `{report.rejected_count}`",
+ f"Reject log: `{report.rejects_path or ''}`",
+ ]
+ summary_md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _snapshot_dataset(dataset_id: str, *, allow_patterns: list[str]) -> Path:
+ try:
+ from huggingface_hub import snapshot_download
+ except ImportError as exc:
+ raise DataValidationError("Snapshot download support requires installing ocr-tech[datasets].") from exc
+ try:
+ local_dir = snapshot_download(repo_id=dataset_id, repo_type="dataset", allow_patterns=allow_patterns)
+ except Exception as exc:
+ raise DataValidationError(f"Failed to snapshot dataset {dataset_id!r}: {exc}") from exc
+ return Path(local_dir)
+
+
+def _list_dataset_files(dataset_id: str, *, prefix: str, suffix: str) -> list[str]:
+ try:
+ from huggingface_hub import list_repo_files
+ except ImportError as exc:
+ raise DataValidationError("Dataset file listing requires installing ocr-tech[datasets].") from exc
+ try:
+ files = list_repo_files(repo_id=dataset_id, repo_type="dataset")
+ except Exception as exc:
+ raise DataValidationError(f"Failed to list dataset files for {dataset_id!r}: {exc}") from exc
+ return sorted(path for path in files if path.startswith(prefix) and path.endswith(suffix))
+
+
+def _download_dataset_file(dataset_id: str, dataset_file: str) -> Path:
+ try:
+ from huggingface_hub import hf_hub_download
+ except ImportError as exc:
+ raise DataValidationError("Dataset file download requires installing ocr-tech[datasets].") from exc
+ try:
+ local_path = hf_hub_download(repo_id=dataset_id, repo_type="dataset", filename=dataset_file)
+ except Exception as exc:
+ raise DataValidationError(f"Failed to download dataset file {dataset_file!r} from {dataset_id!r}: {exc}") from exc
+ return Path(local_path)
+
+
+def _coerce_hdf5_bytes(value: Any) -> bytes:
+ if isinstance(value, bytes):
+ return value
+ if hasattr(value, "tobytes"):
+ return value.tobytes()
+ raise DataValidationError(f"Unsupported HDF5 image payload type: {type(value).__name__}")
+
+
+def _coerce_annotation_json(value: Any, shard_path: Path, page_index: int) -> dict[str, Any]:
+ if isinstance(value, bytes):
+ raw = value.decode("utf-8")
+ elif isinstance(value, str):
+ raw = value
+ elif hasattr(value, "tobytes"):
+ raw = value.tobytes().decode("utf-8")
+ else:
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} annotation has unsupported type: {type(value).__name__}")
+ try:
+ payload = json.loads(raw)
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} annotation is not valid JSON: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} annotation must be a JSON object")
+ return payload
+
+
+def _coerce_bbox(value: Any, shard_path: Path, page_index: int, line_index: int) -> list[int]:
+ if not isinstance(value, list) or len(value) != 4:
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} line {line_index} bbox must be [x, y, w, h]")
+ bbox = [int(item) for item in value]
+ if bbox[2] <= 0 or bbox[3] <= 0:
+ raise DataValidationError(f"HDF5 shard {shard_path} page {page_index} line {line_index} bbox width/height must be positive")
+ return bbox
diff --git a/src/ocrtech/markdown.py b/src/ocrtech/markdown.py
new file mode 100644
index 0000000000000000000000000000000000000000..456d17a58dd07964434f650a61793a32e94114c0
--- /dev/null
+++ b/src/ocrtech/markdown.py
@@ -0,0 +1,34 @@
+"""Markdown rendering for parsed documents."""
+
+from __future__ import annotations
+
+from .schemas import Document
+from .tables import table_to_markdown
+
+
+def render_document_markdown(document: Document) -> str:
+ tables = {table.table_id: table for table in document.tables}
+ figures = {figure.figure_id: figure for figure in document.figures}
+ sections: list[str] = []
+ for page in sorted(document.pages, key=lambda item: item.page_index):
+ if len(document.pages) > 1:
+ sections.append(f"")
+ for block in sorted(page.blocks, key=lambda item: item.order):
+ if block.block_type == "title":
+ sections.append(f"# {block.text.strip()}")
+ elif block.block_type == "table" and block.table_id in tables:
+ table_md = table_to_markdown(tables[block.table_id])
+ if table_md:
+ sections.append(table_md)
+ elif block.block_type == "figure" and block.figure_id in figures:
+ figure = figures[block.figure_id]
+ alt = figure.caption or figure.summary or figure.figure_id
+ if figure.image_path:
+ sections.append(f"")
+ if figure.caption:
+ sections.append(figure.caption)
+ if figure.summary:
+ sections.append(figure.summary)
+ elif block.text.strip():
+ sections.append(block.text.strip())
+ return "\n\n".join(sections).strip() + "\n"
diff --git a/src/ocrtech/metrics.py b/src/ocrtech/metrics.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e551920eadf05b3d31ab71bcacbc3a1551bf9db
--- /dev/null
+++ b/src/ocrtech/metrics.py
@@ -0,0 +1,288 @@
+"""Deterministic OCR and document-structure metrics."""
+
+from __future__ import annotations
+
+from collections import Counter
+from dataclasses import dataclass, field
+from typing import Iterable
+
+from .normalization import normalize_ocr_text
+from .schemas import BBox, TableCell
+
+
+def edit_distance(left: list[str] | str, right: list[str] | str) -> int:
+ left_seq = list(left)
+ right_seq = list(right)
+ if not left_seq:
+ return len(right_seq)
+ if not right_seq:
+ return len(left_seq)
+ previous = list(range(len(right_seq) + 1))
+ for i, left_item in enumerate(left_seq, start=1):
+ current = [i]
+ for j, right_item in enumerate(right_seq, start=1):
+ cost = 0 if left_item == right_item else 1
+ current.append(min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + cost))
+ previous = current
+ return previous[-1]
+
+
+def cer(predicted: str, reference: str, *, normalized: bool = True) -> float:
+ pred = normalize_ocr_text(predicted) if normalized else predicted
+ ref = normalize_ocr_text(reference) if normalized else reference
+ if not ref:
+ return 0.0 if not pred else 1.0
+ return edit_distance(pred, ref) / len(ref)
+
+
+def wer(predicted: str, reference: str, *, normalized: bool = True) -> float:
+ pred = normalize_ocr_text(predicted, collapse_spaces=True) if normalized else predicted
+ ref = normalize_ocr_text(reference, collapse_spaces=True) if normalized else reference
+ pred_words = pred.split()
+ ref_words = ref.split()
+ if not ref_words:
+ return 0.0 if not pred_words else 1.0
+ return edit_distance(pred_words, ref_words) / len(ref_words)
+
+
+def exact_line_accuracy(predicted: Iterable[str], reference: Iterable[str], *, normalized: bool = True) -> float:
+ predicted_lines = list(predicted)
+ reference_lines = list(reference)
+ if not reference_lines:
+ return 1.0 if not predicted_lines else 0.0
+ matches = 0
+ for pred, ref in zip(predicted_lines, reference_lines, strict=False):
+ if normalized:
+ pred = normalize_ocr_text(pred, collapse_spaces=True)
+ ref = normalize_ocr_text(ref, collapse_spaces=True)
+ if pred == ref:
+ matches += 1
+ return matches / len(reference_lines)
+
+
+def reading_order_pair_accuracy(predicted_ids: list[str], reference_ids: list[str]) -> float:
+ if len(reference_ids) < 2:
+ return 1.0
+ pred_position = {item: index for index, item in enumerate(predicted_ids)}
+ correct = 0
+ total = 0
+ for i, left in enumerate(reference_ids):
+ for right in reference_ids[i + 1 :]:
+ if left not in pred_position or right not in pred_position:
+ total += 1
+ continue
+ total += 1
+ if pred_position[left] < pred_position[right]:
+ correct += 1
+ return correct / total if total else 1.0
+
+
+@dataclass(slots=True)
+class TableScore:
+ precision: float
+ recall: float
+ f1: float
+ exact_match: float
+ structure_similarity: float
+
+ def to_dict(self) -> dict[str, float]:
+ return {
+ "precision": self.precision,
+ "recall": self.recall,
+ "f1": self.f1,
+ "exact_match": self.exact_match,
+ "structure_similarity": self.structure_similarity,
+ }
+
+
+def table_cell_score(predicted: list[list[str]], reference: list[list[str]]) -> TableScore:
+ pred_counter = Counter((r, c, normalize_ocr_text(value, collapse_spaces=True)) for r, row in enumerate(predicted) for c, value in enumerate(row))
+ ref_counter = Counter((r, c, normalize_ocr_text(value, collapse_spaces=True)) for r, row in enumerate(reference) for c, value in enumerate(row))
+ overlap = sum((pred_counter & ref_counter).values())
+ predicted_total = sum(pred_counter.values())
+ reference_total = sum(ref_counter.values())
+ precision = overlap / predicted_total if predicted_total else (1.0 if reference_total == 0 else 0.0)
+ recall = overlap / reference_total if reference_total else (1.0 if predicted_total == 0 else 0.0)
+ f1 = 2 * precision * recall / (precision + recall) if precision + recall else 0.0
+ exact = 1.0 if predicted == reference else 0.0
+ return TableScore(
+ precision=precision,
+ recall=recall,
+ f1=f1,
+ exact_match=exact,
+ structure_similarity=table_structure_similarity(predicted, reference),
+ )
+
+
+TableLike = list[list[str]] | list[TableCell]
+
+
+@dataclass(slots=True)
+class _TableTreeNode:
+ label: str
+ children: list["_TableTreeNode"] = field(default_factory=list)
+
+
+def table_structure_similarity(predicted: TableLike, reference: TableLike) -> float:
+ """TEDS-style table-structure similarity over rows, columns, and occupied cells.
+
+ For rectangular grid inputs, this scores row count, per-row column count,
+ and non-empty cell coordinates. For TableCell inputs, it also scores
+ rowspans and colspans. Text content is ignored.
+ """
+
+ pred_tokens = _table_structure_tokens(predicted)
+ ref_tokens = _table_structure_tokens(reference)
+ if not ref_tokens:
+ return 1.0 if not pred_tokens else 0.0
+ distance = edit_distance(pred_tokens, ref_tokens)
+ return max(0.0, 1.0 - distance / len(ref_tokens))
+
+
+def table_tree_similarity(predicted: TableLike, reference: TableLike, *, include_text: bool = False) -> float:
+ """Ordered table-tree edit similarity over table/tr/td nodes.
+
+ This is a deterministic TEDS-style score. Structure mode compares the table
+ DOM shape and rowspan/colspan attributes. Text mode also compares normalized
+ cell text in td node labels.
+ """
+
+ pred_tree = _table_tree(predicted, include_text=include_text)
+ ref_tree = _table_tree(reference, include_text=include_text)
+ pred_size = _tree_size(pred_tree)
+ ref_size = _tree_size(ref_tree)
+ if ref_size == 0:
+ return 1.0 if pred_size == 0 else 0.0
+ distance = _tree_edit_distance(pred_tree, ref_tree)
+ return max(0.0, 1.0 - distance / max(pred_size, ref_size))
+
+
+def table_teds_structure(predicted: TableLike, reference: TableLike) -> float:
+ return table_tree_similarity(predicted, reference, include_text=False)
+
+
+def table_teds_text(predicted: TableLike, reference: TableLike) -> float:
+ return table_tree_similarity(predicted, reference, include_text=True)
+
+
+def _table_structure_tokens(table: TableLike) -> list[str]:
+ if _is_cell_list(table):
+ return _cell_structure_tokens(table)
+ grid = table
+ tokens: list[str] = [f"rows:{len(grid)}"]
+ for row_index, row in enumerate(grid):
+ tokens.append(f"row:{row_index}:cols:{len(row)}")
+ for col_index, value in enumerate(row):
+ if normalize_ocr_text(value, collapse_spaces=True):
+ tokens.append(f"cell:{row_index}:{col_index}:rs:1:cs:1")
+ return tokens
+
+
+def _cell_structure_tokens(cells: list[TableCell]) -> list[str]:
+ if not cells:
+ return []
+ rows = max(cell.row + cell.rowspan for cell in cells)
+ cols = max(cell.col + cell.colspan for cell in cells)
+ tokens = [f"rows:{rows}", f"cols:{cols}"]
+ for cell in sorted(cells, key=lambda item: (item.row, item.col, item.rowspan, item.colspan)):
+ if normalize_ocr_text(cell.text, collapse_spaces=True):
+ tokens.append(f"cell:{cell.row}:{cell.col}:rs:{cell.rowspan}:cs:{cell.colspan}")
+ return tokens
+
+
+def _is_cell_list(value: TableLike) -> bool:
+ return bool(value) and all(isinstance(item, TableCell) for item in value)
+
+
+def _table_tree(table: TableLike, *, include_text: bool) -> _TableTreeNode:
+ cells = _cells_from_table_like(table)
+ if not cells:
+ return _TableTreeNode("table")
+ rows = max(cell.row + cell.rowspan for cell in cells)
+ by_row: dict[int, list[TableCell]] = {}
+ for cell in cells:
+ by_row.setdefault(cell.row, []).append(cell)
+ row_nodes: list[_TableTreeNode] = []
+ for row_index in range(rows):
+ cell_nodes = []
+ for cell in sorted(by_row.get(row_index, []), key=lambda item: item.col):
+ label = f"td:rs:{cell.rowspan}:cs:{cell.colspan}"
+ if include_text:
+ text = normalize_ocr_text(cell.text, collapse_spaces=True)
+ label = f"{label}:text:{text}"
+ cell_nodes.append(_TableTreeNode(label))
+ row_nodes.append(_TableTreeNode("tr", cell_nodes))
+ return _TableTreeNode("table", row_nodes)
+
+
+def _cells_from_table_like(table: TableLike) -> list[TableCell]:
+ if _is_cell_list(table):
+ return list(table)
+ cells: list[TableCell] = []
+ for row_index, row in enumerate(table):
+ for col_index, value in enumerate(row):
+ cells.append(TableCell(row=row_index, col=col_index, text=str(value)))
+ return cells
+
+
+def _tree_size(node: _TableTreeNode) -> int:
+ return 1 + sum(_tree_size(child) for child in node.children)
+
+
+def _tree_edit_distance(left: _TableTreeNode, right: _TableTreeNode) -> int:
+ relabel_cost = 0 if left.label == right.label else 1
+ return relabel_cost + _forest_edit_distance(left.children, right.children)
+
+
+def _forest_edit_distance(left: list[_TableTreeNode], right: list[_TableTreeNode]) -> int:
+ previous = [0]
+ for node in right:
+ previous.append(previous[-1] + _tree_size(node))
+ for left_index, left_node in enumerate(left, start=1):
+ current = [previous[0] + _tree_size(left_node)]
+ for right_index, right_node in enumerate(right, start=1):
+ delete_cost = previous[right_index] + _tree_size(left_node)
+ insert_cost = current[right_index - 1] + _tree_size(right_node)
+ replace_cost = previous[right_index - 1] + _tree_edit_distance(left_node, right_node)
+ current.append(min(delete_cost, insert_cost, replace_cost))
+ previous = current
+ return previous[-1]
+
+
+def bbox_iou(left: BBox, right: BBox) -> float:
+ inter_left = max(left.x, right.x)
+ inter_top = max(left.y, right.y)
+ inter_right = min(left.right, right.right)
+ inter_bottom = min(left.bottom, right.bottom)
+ inter_w = max(0.0, inter_right - inter_left)
+ inter_h = max(0.0, inter_bottom - inter_top)
+ intersection = inter_w * inter_h
+ union = left.w * left.h + right.w * right.h - intersection
+ return intersection / union if union > 0 else 0.0
+
+
+@dataclass(slots=True)
+class DetectionScore:
+ precision: float
+ recall: float
+ f1: float
+ matches: int
+ predicted: int
+ reference: int
+
+ def to_dict(self) -> dict[str, float | int]:
+ return {
+ "precision": self.precision,
+ "recall": self.recall,
+ "f1": self.f1,
+ "matches": self.matches,
+ "predicted": self.predicted,
+ "reference": self.reference,
+ }
+
+
+def detection_score(predicted_count: int, reference_count: int, matches: int) -> DetectionScore:
+ precision = matches / predicted_count if predicted_count else (1.0 if reference_count == 0 else 0.0)
+ recall = matches / reference_count if reference_count else (1.0 if predicted_count == 0 else 0.0)
+ f1 = 2 * precision * recall / (precision + recall) if precision + recall else 0.0
+ return DetectionScore(precision=precision, recall=recall, f1=f1, matches=matches, predicted=predicted_count, reference=reference_count)
diff --git a/src/ocrtech/models.py b/src/ocrtech/models.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f07199c7c98740c67b17e1ea77553bf133c72fa
--- /dev/null
+++ b/src/ocrtech/models.py
@@ -0,0 +1,647 @@
+"""Model artifact cards and audit helpers."""
+
+from __future__ import annotations
+
+import json
+from dataclasses import dataclass, field
+from datetime import UTC, datetime
+import math
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+from .manifest import sha256_file
+from .validation import gate_has_quantitative_evidence
+
+
+@dataclass(slots=True)
+class ArtifactRef:
+ path: str
+ required: bool = True
+ sha256: str | None = None
+ kind: str = "file"
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any]) -> "ArtifactRef":
+ return cls(
+ path=str(data.get("path") or ""),
+ required=bool(data.get("required", True)),
+ sha256=data.get("sha256"),
+ kind=str(data.get("kind") or "file"),
+ )
+
+ def to_dict(self) -> dict[str, Any]:
+ return {"path": self.path, "required": self.required, "sha256": self.sha256, "kind": self.kind}
+
+
+@dataclass(slots=True)
+class ModelCard:
+ model_id: str
+ backend: str
+ base_model: str
+ created_at_utc: str
+ artifacts: list[ArtifactRef] = field(default_factory=list)
+ backend_kwargs: dict[str, Any] = field(default_factory=dict)
+ provenance: dict[str, Any] = field(default_factory=dict)
+ metrics: dict[str, Any] = field(default_factory=dict)
+ notes: str | None = None
+
+ @classmethod
+ def from_path(cls, path: str | Path) -> "ModelCard":
+ config_path = Path(path)
+ try:
+ payload = json.loads(config_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid model card JSON {config_path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"model card must be a JSON object: {config_path}")
+ artifacts_payload = payload.get("artifacts", [])
+ if not isinstance(artifacts_payload, list):
+ raise DataValidationError("model card artifacts must be a list")
+ card = cls(
+ model_id=str(payload.get("model_id") or ""),
+ backend=str(payload.get("backend") or "paddleocr"),
+ base_model=str(payload.get("base_model") or ""),
+ created_at_utc=str(payload.get("created_at_utc") or ""),
+ artifacts=[ArtifactRef.from_dict(item) for item in artifacts_payload],
+ backend_kwargs=dict(payload.get("backend_kwargs") or payload.get("paddleocr_kwargs") or {}),
+ provenance=dict(payload.get("provenance") or {}),
+ metrics=dict(payload.get("metrics") or {}),
+ notes=payload.get("notes"),
+ )
+ card.validate_shape()
+ return card
+
+ def validate_shape(self) -> None:
+ if not self.model_id:
+ raise DataValidationError("model card requires model_id")
+ if self.backend not in {"paddleocr", "sidecar", "tesseract", "surya", "hf_vision_encoder_decoder", "text_correction_composite", "quality_select_composite", "quality_ranked_ensemble", "script_select_composite", "line_align_composite", "table_cell_refine_composite", "figure_caption_refine_composite"}:
+ raise DataValidationError(f"unsupported model backend: {self.backend}")
+ if not isinstance(self.backend_kwargs, dict):
+ raise DataValidationError("backend_kwargs must be an object")
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "model_id": self.model_id,
+ "backend": self.backend,
+ "base_model": self.base_model,
+ "created_at_utc": self.created_at_utc,
+ "artifacts": [artifact.to_dict() for artifact in self.artifacts],
+ "backend_kwargs": self.backend_kwargs,
+ "provenance": self.provenance,
+ "metrics": self.metrics,
+ "notes": self.notes,
+ }
+
+
+@dataclass(slots=True)
+class ModelAudit:
+ model_config: str
+ model_id: str
+ backend: str
+ passed: bool
+ issues: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "model_config": self.model_config,
+ "model_id": self.model_id,
+ "backend": self.backend,
+ "passed": self.passed,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class TrainedRecognizerProvenance:
+ passed: bool
+ details: list[str] = field(default_factory=list)
+
+
+@dataclass(slots=True)
+class ModelAdmissionStatus:
+ passed: bool
+ details: list[str] = field(default_factory=list)
+
+
+def write_model_card(
+ output_path: str | Path,
+ *,
+ model_id: str,
+ backend: str = "paddleocr",
+ base_model: str = (
+ "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/"
+ "devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams"
+ ),
+ artifact_paths: list[str | Path] | None = None,
+ paddleocr_kwargs: dict[str, Any] | None = None,
+ backend_kwargs: dict[str, Any] | None = None,
+ train_manifest: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ training_summary: str | Path | None = None,
+ metrics_report: str | Path | None = None,
+ admission_validation_report: str | Path | None = None,
+ fallback_model_card: str | Path | None = None,
+ artifact_base_path: str | Path | None = None,
+ provenance: dict[str, Any] | None = None,
+ notes: str | None = None,
+) -> Path:
+ artifact_base = Path(artifact_base_path) if artifact_base_path is not None else None
+ artifacts = [_artifact_ref(Path(item), base_path=artifact_base) for item in artifact_paths or []]
+ provenance_payload: dict[str, Any] = dict(provenance or {})
+ if train_manifest:
+ train_path = Path(train_manifest)
+ provenance_payload["train_manifest"] = {"path": str(train_path), "sha256": sha256_file(train_path) if train_path.exists() else None}
+ if eval_manifest:
+ eval_path = Path(eval_manifest)
+ provenance_payload["eval_manifest"] = {"path": str(eval_path), "sha256": sha256_file(eval_path) if eval_path.exists() else None}
+ if training_summary:
+ summary_path = Path(training_summary)
+ provenance_payload["training_summary"] = {"path": str(summary_path), "sha256": sha256_file(summary_path) if summary_path.exists() else None}
+ metrics: dict[str, Any] = {}
+ if metrics_report:
+ metrics_path = Path(metrics_report)
+ metrics["report"] = {"path": str(metrics_path), "sha256": sha256_file(metrics_path) if metrics_path.exists() else None}
+ if admission_validation_report:
+ admission_path = Path(admission_validation_report)
+ metrics["admission_validation"] = {
+ "path": str(admission_path),
+ "sha256": sha256_file(admission_path) if admission_path.exists() else None,
+ "required_status": "validated",
+ }
+ if fallback_model_card:
+ fallback_path = Path(fallback_model_card)
+ provenance_payload["fallback_model_card"] = {
+ "path": str(fallback_path),
+ "sha256": sha256_file(fallback_path) if fallback_path.exists() else None,
+ }
+ card = ModelCard(
+ model_id=model_id,
+ backend=backend,
+ base_model=base_model,
+ created_at_utc=datetime.now(UTC).isoformat(),
+ artifacts=artifacts,
+ backend_kwargs=backend_kwargs or paddleocr_kwargs or {},
+ provenance=provenance_payload,
+ metrics=metrics,
+ notes=notes,
+ )
+ card.validate_shape()
+ out = Path(output_path)
+ out.parent.mkdir(parents=True, exist_ok=True)
+ out.write_text(json.dumps(card.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ return out
+
+
+def audit_model_card(model_config: str | Path, output_dir: str | Path | None = None) -> ModelAudit:
+ config_path = Path(model_config)
+ card = ModelCard.from_path(config_path)
+ issues: list[str] = []
+ warnings: list[str] = []
+ for artifact in card.artifacts:
+ path = _resolve_artifact_path(artifact.path, config_path)
+ if not artifact.path:
+ issues.append("artifact path is empty")
+ continue
+ if artifact.required and not path.exists():
+ issues.append(f"required artifact missing: {artifact.path}")
+ continue
+ if path.exists() and artifact.sha256 and path.is_file():
+ actual = sha256_file(path)
+ if actual != artifact.sha256:
+ issues.append(f"artifact sha256 mismatch for {artifact.path}: manifest={artifact.sha256} actual={actual}")
+ if path.exists() and artifact.kind == "directory" and not path.is_dir():
+ issues.append(f"artifact expected directory but is not: {artifact.path}")
+ if path.exists() and artifact.kind == "file" and not path.is_file():
+ issues.append(f"artifact expected file but is not: {artifact.path}")
+ if card.backend == "paddleocr" and not card.artifacts:
+ issues.append("paddleocr candidate requires at least one recorded artifact")
+ if card.backend == "paddleocr" and not card.backend_kwargs:
+ warnings.append("paddleocr backend has no backend_kwargs; installed PaddleOCR defaults will be used")
+ if card.backend == "tesseract" and not card.backend_kwargs:
+ warnings.append("tesseract backend has no backend_kwargs; installed Tesseract defaults will be used")
+ if card.backend == "surya" and not card.backend_kwargs:
+ warnings.append("surya backend has no backend_kwargs; installed Surya defaults will be used")
+ if card.backend == "hf_vision_encoder_decoder" and not card.artifacts:
+ issues.append("hf_vision_encoder_decoder candidate requires at least one recorded artifact")
+ if card.backend == "hf_vision_encoder_decoder" and not card.backend_kwargs:
+ warnings.append("hf_vision_encoder_decoder backend has no backend_kwargs; default generation settings will be used")
+ if card.backend == "text_correction_composite" and not card.artifacts:
+ issues.append("text_correction_composite candidate requires at least one recorded artifact")
+ if card.backend == "text_correction_composite":
+ if "base_engine" not in card.backend_kwargs:
+ warnings.append("text_correction_composite backend has no base_engine; default tesseract will be used")
+ if "model_dir" not in card.backend_kwargs:
+ issues.append("text_correction_composite candidate requires backend_kwargs.model_dir")
+ if card.backend == "quality_select_composite":
+ if "primary_engine" not in card.backend_kwargs:
+ issues.append("quality_select_composite candidate requires backend_kwargs.primary_engine")
+ if "secondary_engine" not in card.backend_kwargs:
+ issues.append("quality_select_composite candidate requires backend_kwargs.secondary_engine")
+ if "secondary_quality_margin" not in card.backend_kwargs:
+ warnings.append("quality_select_composite backend has no secondary_quality_margin; default 0.0 will be used")
+ if card.backend == "quality_ranked_ensemble":
+ if "primary_engine" not in card.backend_kwargs:
+ issues.append("quality_ranked_ensemble candidate requires backend_kwargs.primary_engine")
+ alternatives = card.backend_kwargs.get("alternative_engines")
+ if not isinstance(alternatives, list) or not alternatives:
+ issues.append("quality_ranked_ensemble candidate requires backend_kwargs.alternative_engines")
+ if card.backend == "script_select_composite":
+ if "primary_engine" not in card.backend_kwargs:
+ issues.append("script_select_composite candidate requires backend_kwargs.primary_engine")
+ if "secondary_engine" not in card.backend_kwargs:
+ issues.append("script_select_composite candidate requires backend_kwargs.secondary_engine")
+ if "primary_script_threshold" not in card.backend_kwargs:
+ warnings.append("script_select_composite backend has no primary_script_threshold; default 0.2 will be used")
+ if card.backend == "line_align_composite":
+ if "primary_engine" not in card.backend_kwargs:
+ issues.append("line_align_composite candidate requires backend_kwargs.primary_engine")
+ if "secondary_engine" not in card.backend_kwargs:
+ issues.append("line_align_composite candidate requires backend_kwargs.secondary_engine")
+ if "append_unmatched_primary" not in card.backend_kwargs:
+ warnings.append("line_align_composite backend has no append_unmatched_primary; default true will be used")
+ if card.backend == "table_cell_refine_composite":
+ if "structure_engine" not in card.backend_kwargs:
+ warnings.append("table_cell_refine_composite backend has no structure_engine; default surya will be used")
+ if "crop_engine" not in card.backend_kwargs:
+ warnings.append("table_cell_refine_composite backend has no crop_engine; default tesseract will be used")
+ elif card.backend_kwargs.get("crop_engine") == "candidate":
+ crop_kwargs = card.backend_kwargs.get("crop_engine_kwargs")
+ if not isinstance(crop_kwargs, dict) or not crop_kwargs.get("model_config"):
+ issues.append("table_cell_refine_composite crop_engine=candidate requires backend_kwargs.crop_engine_kwargs.model_config")
+ if card.backend == "figure_caption_refine_composite":
+ if "primary_engine" not in card.backend_kwargs:
+ warnings.append("figure_caption_refine_composite backend has no primary_engine; default surya will be used")
+ if "caption_engine" not in card.backend_kwargs:
+ warnings.append("figure_caption_refine_composite backend has no caption_engine; default tesseract will be used")
+ elif card.backend_kwargs.get("caption_engine") == "candidate":
+ caption_kwargs = card.backend_kwargs.get("caption_engine_kwargs")
+ if not isinstance(caption_kwargs, dict) or not caption_kwargs.get("model_config"):
+ issues.append("figure_caption_refine_composite caption_engine=candidate requires backend_kwargs.caption_engine_kwargs.model_config")
+ audit = ModelAudit(str(config_path), card.model_id, card.backend, not issues, issues, warnings)
+ if output_dir is not None:
+ _write_model_audit(audit, Path(output_dir))
+ return audit
+
+
+def _artifact_ref(path: Path, *, base_path: Path | None = None) -> ArtifactRef:
+ hash_path = path if path.is_absolute() or base_path is None else base_path / path
+ if hash_path.exists() and hash_path.is_file():
+ return ArtifactRef(path=str(path), required=True, sha256=sha256_file(hash_path), kind="file")
+ kind = "directory" if path.suffix == "" else "file"
+ return ArtifactRef(path=str(path), required=True, sha256=None, kind=kind)
+
+
+def _resolve_artifact_path(path: str, config_path: Path) -> Path:
+ candidate = Path(path)
+ if candidate.is_absolute():
+ return candidate
+ if candidate.exists():
+ return candidate
+ return config_path.parent / candidate
+
+
+def _write_model_audit(audit: ModelAudit, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ (output_dir / "model-audit.json").write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Model Audit",
+ "",
+ f"Model: `{audit.model_id}`",
+ f"Backend: `{audit.backend}`",
+ f"Passed: `{'yes' if audit.passed else 'no'}`",
+ "",
+ "## Issues",
+ "",
+ ]
+ lines.extend(f"- {issue}" for issue in audit.issues) if audit.issues else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings) if audit.warnings else lines.append("- none")
+ (output_dir / "model-audit.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def inspect_routed_calibration_collapse(card: ModelCard, model_config: str | Path) -> tuple[str | None, list[str]]:
+ if card.backend not in {"quality_select_composite", "script_select_composite"}:
+ return None, []
+ report_payload = card.metrics.get("report")
+ if not isinstance(report_payload, dict):
+ return "missing calibration metrics report reference", []
+ report_path_value = report_payload.get("path")
+ if not isinstance(report_path_value, str) or not report_path_value:
+ return "missing calibration metrics report path", []
+ report_path = _resolve_artifact_path(report_path_value, Path(model_config))
+ if not report_path.exists():
+ return f"calibration metrics report does not exist: {report_path}", []
+ try:
+ payload = json.loads(report_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ return f"invalid calibration metrics report JSON {report_path}: {exc}", []
+ if not isinstance(payload, dict):
+ return f"calibration metrics report must be a JSON object: {report_path}", []
+ trial = payload.get("selected_trial")
+ if not isinstance(trial, dict):
+ return f"calibration metrics report missing selected_trial: {report_path}", []
+ pairs = trial.get("pairs")
+ if isinstance(pairs, bool) or not isinstance(pairs, int | float) or int(pairs) <= 0:
+ return f"calibration selected_trial has invalid pairs value: {pairs!r}", []
+ pair_count = int(pairs)
+ if card.backend == "quality_select_composite":
+ picks = trial.get("candidate_picks")
+ if isinstance(picks, bool) or not isinstance(picks, int | float):
+ return f"quality_select_composite calibration missing candidate_picks: {report_path}", []
+ pick_count = int(picks)
+ details = _collapse_details(payload, report_path, pair_count, pick_count, "candidate_picks")
+ if pick_count == 0:
+ return "quality_select_composite collapses to the primary engine on every calibration sample", details
+ if pick_count == pair_count:
+ return "quality_select_composite collapses to the secondary/candidate engine on every calibration sample", details
+ return None, details
+ picks = trial.get("secondary_picks")
+ if isinstance(picks, bool) or not isinstance(picks, int | float):
+ return f"script_select_composite calibration missing secondary_picks: {report_path}", []
+ pick_count = int(picks)
+ details = _collapse_details(payload, report_path, pair_count, pick_count, "secondary_picks")
+ if pick_count == 0:
+ return "script_select_composite collapses to the primary engine on every calibration sample", details
+ if pick_count == pair_count:
+ return "script_select_composite collapses to the secondary engine on every calibration sample", details
+ return None, details
+
+
+def _collapse_details(payload: dict[str, Any], report_path: Path, pairs: int, picks: int, label: str) -> list[str]:
+ details = [f"report={report_path}", f"pairs={pairs}", f"{label}={picks}"]
+ threshold = payload.get("selected_threshold")
+ if isinstance(threshold, int | float) and math.isfinite(float(threshold)):
+ details.append(f"selected_threshold={float(threshold):.6f}")
+ metric = payload.get("metric")
+ if isinstance(metric, str) and metric:
+ details.append(f"metric={metric}")
+ return details
+
+
+def component_baseline_names(card: ModelCard) -> list[str]:
+ kwargs = card.backend_kwargs
+ engines: list[str] = []
+ if card.backend in {"quality_select_composite", "script_select_composite", "line_align_composite"}:
+ for key in ("primary_engine", "secondary_engine"):
+ value = kwargs.get(key)
+ if isinstance(value, str) and value:
+ engines.append(value)
+ elif card.backend == "table_cell_refine_composite":
+ for key in ("structure_engine", "crop_engine"):
+ value = kwargs.get(key)
+ if isinstance(value, str) and value:
+ engines.append(value)
+ elif card.backend == "figure_caption_refine_composite":
+ for key in ("primary_engine", "caption_engine"):
+ value = kwargs.get(key)
+ if isinstance(value, str) and value:
+ engines.append(value)
+ elif card.backend == "quality_ranked_ensemble":
+ primary = kwargs.get("primary_engine")
+ if isinstance(primary, str) and primary:
+ engines.append(primary)
+ alternatives = kwargs.get("alternative_engines")
+ if isinstance(alternatives, list):
+ for item in alternatives:
+ if isinstance(item, dict):
+ engine_name = item.get("engine")
+ if isinstance(engine_name, str) and engine_name:
+ engines.append(engine_name)
+ normalized = [_normalize_component_baseline_name(name) for name in engines]
+ return sorted({name for name in normalized if name})
+
+
+def _normalize_component_baseline_name(name: str) -> str:
+ value = name.strip().lower()
+ if value in {"paddleocr", "paddle"}:
+ return "stock-paddle"
+ return value
+
+
+TRAINED_RECOGNIZER_BACKENDS = {"paddleocr", "hf_vision_encoder_decoder"}
+
+
+def trained_recognizer_provenance_status(card: ModelCard, model_config: str | Path) -> TrainedRecognizerProvenance:
+ passed, details = _model_card_has_trained_recognizer(card, Path(model_config), seen=set())
+ return TrainedRecognizerProvenance(passed=passed, details=details)
+
+
+def model_admission_status(card: ModelCard, model_config: str | Path) -> ModelAdmissionStatus:
+ payload = card.metrics.get("admission_validation")
+ if not isinstance(payload, dict):
+ return ModelAdmissionStatus(False, ["missing metrics.admission_validation"])
+ path_value = payload.get("path")
+ if not isinstance(path_value, str) or not path_value:
+ return ModelAdmissionStatus(False, ["metrics.admission_validation.path is missing"])
+ report_path = _resolve_artifact_path(path_value, Path(model_config))
+ if not report_path.exists():
+ return ModelAdmissionStatus(False, [f"admission validation report does not exist: {report_path}"])
+ expected_sha = payload.get("sha256")
+ if isinstance(expected_sha, str) and expected_sha:
+ actual_sha = sha256_file(report_path)
+ if actual_sha != expected_sha:
+ return ModelAdmissionStatus(False, [f"admission validation sha256 mismatch: expected={expected_sha} actual={actual_sha}"])
+ try:
+ report = json.loads(report_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ return ModelAdmissionStatus(False, [f"invalid admission validation JSON {report_path}: {exc}"])
+ if not isinstance(report, dict):
+ return ModelAdmissionStatus(False, [f"admission validation report must be a JSON object: {report_path}"])
+ required_status = str(payload.get("required_status") or "validated")
+ claim_status = str(report.get("claim_status") or "")
+ passed = bool(report.get("passed"))
+ details = [f"report={report_path}", f"claim_status={claim_status or ''}", f"required_status={required_status}", f"passed={passed}"]
+ binding_passed, binding_details = _admission_validation_model_binding(card, report, report_path)
+ details.extend(binding_details)
+ gate_evidence_passed, gate_evidence_details = _admission_validation_gate_evidence(report)
+ details.extend(gate_evidence_details)
+ details.extend(_admission_validation_failure_details(report))
+ if claim_status == required_status and passed and binding_passed and gate_evidence_passed:
+ return ModelAdmissionStatus(True, details)
+ return ModelAdmissionStatus(False, details)
+
+
+def _admission_validation_model_binding(
+ card: ModelCard,
+ report: dict[str, Any],
+ report_path: Path,
+) -> tuple[bool, list[str]]:
+ provenance = report.get("provenance")
+ if not isinstance(provenance, dict):
+ return False, ["admission validation missing provenance"]
+ candidate_payload = provenance.get("candidate_model_config")
+ if not isinstance(candidate_payload, dict):
+ return False, ["admission validation missing provenance.candidate_model_config"]
+ path_value = candidate_payload.get("path")
+ if not isinstance(path_value, str) or not path_value:
+ return False, ["admission validation candidate_model_config.path is missing"]
+ candidate_path = _resolve_report_provenance_path(path_value, report_path)
+ details = [f"admission_candidate_model_config={candidate_path}"]
+ if not candidate_path.exists():
+ return False, [*details, f"admission candidate model config does not exist: {candidate_path}"]
+ try:
+ admitted_card = ModelCard.from_path(candidate_path)
+ except DataValidationError as exc:
+ return False, [*details, f"admission candidate model config is invalid: {exc}"]
+ mismatches = _stable_model_card_mismatches(card, admitted_card)
+ if mismatches:
+ return False, [*details, *mismatches]
+ return True, [*details, "admission candidate model identity matches current model card"]
+
+
+def _resolve_report_provenance_path(path_value: str, report_path: Path) -> Path:
+ path = Path(path_value)
+ if path.is_absolute() or path.exists():
+ return path
+ candidate = report_path.parent / path
+ if candidate.exists():
+ return candidate
+ return path
+
+
+def _stable_model_card_mismatches(current: ModelCard, admitted: ModelCard) -> list[str]:
+ mismatches: list[str] = []
+ for field_name in ("model_id", "backend", "base_model"):
+ if getattr(current, field_name) != getattr(admitted, field_name):
+ mismatches.append(
+ f"admission candidate model {field_name} mismatch: current={getattr(current, field_name)!r} "
+ f"admitted={getattr(admitted, field_name)!r}"
+ )
+ current_artifacts = _stable_artifact_identity(current)
+ admitted_artifacts = _stable_artifact_identity(admitted)
+ if current_artifacts != admitted_artifacts:
+ mismatches.append("admission candidate model artifacts do not match current model card")
+ return mismatches
+
+
+def _stable_artifact_identity(card: ModelCard) -> list[tuple[str, str | None, str, bool]]:
+ return sorted((artifact.path, artifact.sha256, artifact.kind, artifact.required) for artifact in card.artifacts)
+
+
+def _admission_validation_failure_details(report: dict[str, Any]) -> list[str]:
+ details: list[str] = []
+ missing = report.get("missing_requirements")
+ if isinstance(missing, list):
+ for item in missing[:10]:
+ if isinstance(item, str) and item:
+ details.append(f"missing_requirement={item}")
+ gates = report.get("gates")
+ if isinstance(gates, list):
+ failed_count = 0
+ for item in gates:
+ if not isinstance(item, dict) or bool(item.get("passed")):
+ continue
+ failed_count += 1
+ details.append(_admission_gate_detail(item))
+ if failed_count >= 10:
+ break
+ return details
+
+
+def _admission_validation_gate_evidence(report: dict[str, Any]) -> tuple[bool, list[str]]:
+ gates = report.get("gates")
+ if not isinstance(gates, list) or not gates:
+ return False, ["admission validation missing gates"]
+ details: list[str] = []
+ for index, item in enumerate(gates):
+ if not isinstance(item, dict):
+ return False, [f"admission validation gate {index} is not an object"]
+ if item.get("passed") is not True:
+ return False, [f"admission validation gate {index} is not passed"]
+ if not gate_has_quantitative_evidence(item):
+ return False, [f"admission validation gate {index} lacks quantitative passing evidence"]
+ details.append(f"admission_gate_{index}=quantitative_pass")
+ return True, details
+
+
+def _admission_gate_detail(gate_result: dict[str, Any]) -> str:
+ gate = gate_result.get("gate")
+ gate_payload = gate if isinstance(gate, dict) else {}
+ metric = str(gate_payload.get("metric") or "")
+ baseline = str(gate_payload.get("baseline") or "")
+ slices = gate_payload.get("slices")
+ if isinstance(slices, list) and slices:
+ slice_label = ",".join(str(item) for item in slices)
+ else:
+ slice_label = str(gate_payload.get("slice") or "all")
+ reason = gate_result.get("reason")
+ parts = [
+ f"failed_gate={metric}",
+ f"baseline={baseline}",
+ f"slice={slice_label}",
+ ]
+ for key in ("candidate_mean", "baseline_mean", "absolute_improvement", "relative_improvement", "pairs", "win_count", "loss_count", "tie_count"):
+ value = gate_result.get(key)
+ if value is not None:
+ parts.append(f"{key}={value}")
+ if isinstance(reason, str) and reason:
+ parts.append(f"reason={reason}")
+ return " ".join(parts)
+
+
+def _model_card_has_trained_recognizer(card: ModelCard, card_path: Path, *, seen: set[Path]) -> tuple[bool, list[str]]:
+ resolved_card_path = card_path.resolve()
+ if resolved_card_path in seen:
+ return False, [f"cycle in trained recognizer provenance at {card_path}"]
+ seen.add(resolved_card_path)
+ details = [f"model_id={card.model_id}", f"backend={card.backend}"]
+ if card.backend in TRAINED_RECOGNIZER_BACKENDS:
+ missing = _trained_recognizer_missing_fields(card, card_path)
+ if missing:
+ return False, [*details, *missing]
+ return True, [
+ *details,
+ "train_manifest provenance hash verified",
+ "eval_manifest provenance hash verified",
+ "training_summary provenance hash verified",
+ "artifacts present",
+ ]
+ nested = card.provenance.get("trained_recognizer_model_card")
+ if not isinstance(nested, dict):
+ return False, [*details, "missing provenance.trained_recognizer_model_card"]
+ nested_path_value = nested.get("path")
+ nested_sha = nested.get("sha256")
+ if not isinstance(nested_path_value, str) or not nested_path_value:
+ return False, [*details, "trained_recognizer_model_card.path is missing"]
+ nested_path = Path(nested_path_value)
+ if not nested_path.is_absolute():
+ nested_path = card_path.parent / nested_path
+ if not nested_path.exists():
+ return False, [*details, f"trained recognizer model card does not exist: {nested_path}"]
+ if isinstance(nested_sha, str) and nested_sha:
+ actual_sha = sha256_file(nested_path)
+ if actual_sha != nested_sha:
+ return False, [*details, f"trained recognizer model card sha256 mismatch: expected={nested_sha} actual={actual_sha}"]
+ nested_card = ModelCard.from_path(nested_path)
+ nested_passed, nested_details = _model_card_has_trained_recognizer(nested_card, nested_path, seen=seen)
+ return nested_passed, [*details, f"trained_recognizer_model_card={nested_path}", *nested_details]
+
+
+def _trained_recognizer_missing_fields(card: ModelCard, card_path: Path) -> list[str]:
+ missing: list[str] = []
+ if not card.artifacts:
+ missing.append("trained recognizer has no artifacts")
+ missing.extend(_trained_recognizer_provenance_file_issues(card, card_path, "train_manifest"))
+ missing.extend(_trained_recognizer_provenance_file_issues(card, card_path, "eval_manifest"))
+ missing.extend(_trained_recognizer_provenance_file_issues(card, card_path, "training_summary"))
+ return missing
+
+
+def _trained_recognizer_provenance_file_issues(card: ModelCard, card_path: Path, key: str) -> list[str]:
+ payload = card.provenance.get(key)
+ if not isinstance(payload, dict):
+ return [f"trained recognizer missing {key} path/sha256 provenance"]
+ path_value = payload.get("path")
+ expected_sha = payload.get("sha256")
+ if not isinstance(path_value, str) or not path_value or not isinstance(expected_sha, str) or not expected_sha:
+ return [f"trained recognizer missing {key} path/sha256 provenance"]
+ path = _resolve_artifact_path(path_value, card_path)
+ if not path.is_file():
+ return [f"trained recognizer {key} does not exist: {path}"]
+ actual_sha = sha256_file(path)
+ if actual_sha != expected_sha:
+ return [f"trained recognizer {key} sha256 mismatch: expected={expected_sha} actual={actual_sha}"]
+ return []
diff --git a/src/ocrtech/normalization.py b/src/ocrtech/normalization.py
new file mode 100644
index 0000000000000000000000000000000000000000..41b20e6472d9a53f289d6613e75e414949e2349d
--- /dev/null
+++ b/src/ocrtech/normalization.py
@@ -0,0 +1,83 @@
+"""Unicode normalization and dictionary coverage helpers."""
+
+from __future__ import annotations
+
+import string
+import unicodedata
+
+
+DEVANAGARI_START = "\u0900"
+DEVANAGARI_END = "\u097f"
+DEVANAGARI_EXTENDED_START = "\ua8e0"
+DEVANAGARI_EXTENDED_END = "\ua8ff"
+PRESERVED_FORMAT_CHARS = {"\u200c", "\u200d"}
+ASCII_PRINTABLE = set(string.printable)
+
+
+def is_devanagari(char: str) -> bool:
+ return DEVANAGARI_START <= char <= DEVANAGARI_END or DEVANAGARI_EXTENDED_START <= char <= DEVANAGARI_EXTENDED_END
+
+
+def normalize_ocr_text(text: str, *, collapse_spaces: bool = False) -> str:
+ """Normalize OCR text while preserving Devanagari combining marks."""
+
+ normalized = unicodedata.normalize("NFC", text.replace("\u00a0", " "))
+ kept: list[str] = []
+ previous_space = False
+ for char in normalized:
+ category = unicodedata.category(char)
+ if category in {"Cc", "Cf"} and char not in {"\n", "\t", "\r"} | PRESERVED_FORMAT_CHARS:
+ continue
+ if collapse_spaces and char in {" ", "\t"}:
+ if previous_space:
+ continue
+ char = " "
+ previous_space = True
+ else:
+ previous_space = char == " "
+ kept.append(char)
+ return "".join(kept)
+
+
+def script_counts(text: str) -> dict[str, int]:
+ counts = {"devanagari": 0, "latin": 0, "digit": 0, "punctuation": 0, "other": 0}
+ for char in normalize_ocr_text(text):
+ if char.isspace():
+ continue
+ if is_devanagari(char):
+ counts["devanagari"] += 1
+ elif "LATIN" in unicodedata.name(char, ""):
+ counts["latin"] += 1
+ elif char.isdigit():
+ counts["digit"] += 1
+ elif unicodedata.category(char).startswith("P") or char in string.punctuation:
+ counts["punctuation"] += 1
+ else:
+ counts["other"] += 1
+ return counts
+
+
+def default_allowed_characters() -> set[str]:
+ chars = set(ASCII_PRINTABLE)
+ for codepoint in range(ord(DEVANAGARI_START), ord(DEVANAGARI_END) + 1):
+ chars.add(chr(codepoint))
+ for codepoint in range(ord(DEVANAGARI_EXTENDED_START), ord(DEVANAGARI_EXTENDED_END) + 1):
+ chars.add(chr(codepoint))
+ chars.update(PRESERVED_FORMAT_CHARS)
+ chars.update({"।", "॥", "–", "—", "‘", "’", "“", "”", "…", "₹", "₨"})
+ return chars
+
+
+def unsupported_characters(text: str, allowed: set[str] | None = None) -> list[str]:
+ allowed_chars = allowed or default_allowed_characters()
+ unsupported = sorted({char for char in normalize_ocr_text(text) if char not in allowed_chars and not char.isspace()})
+ return unsupported
+
+
+def dictionary_from_texts(texts: list[str], *, include_ascii: bool = True) -> list[str]:
+ chars: set[str] = set()
+ if include_ascii:
+ chars.update(ch for ch in string.printable if ch not in {"\x0b", "\x0c", "\r"})
+ for text in texts:
+ chars.update(char for char in normalize_ocr_text(text) if char not in {"\n", "\r", "\t"})
+ return sorted(chars)
diff --git a/src/ocrtech/oracle.py b/src/ocrtech/oracle.py
new file mode 100644
index 0000000000000000000000000000000000000000..b0b743804d80d5995de49a25731364772b33962e
--- /dev/null
+++ b/src/ocrtech/oracle.py
@@ -0,0 +1,228 @@
+"""Oracle analysis over benchmark reports."""
+
+from __future__ import annotations
+
+import json
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Any
+
+from .benchmark import (
+ BenchmarkResult,
+ BenchmarkSummary,
+ _load_benchmark_rows,
+ summarize_benchmark_report,
+)
+from .errors import BenchmarkError
+from .validation import metric_direction, sample_key
+
+
+@dataclass(slots=True)
+class OracleReport:
+ benchmark_report: str
+ oracle_name: str
+ metric: str
+ direction: str
+ systems: list[str]
+ sample_count: int
+ chosen_counts: dict[str, int]
+ oracle_report_path: str
+ oracle_summary_path: str
+ oracle_choices_path: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "benchmark_report": self.benchmark_report,
+ "oracle_name": self.oracle_name,
+ "metric": self.metric,
+ "direction": self.direction,
+ "systems": self.systems,
+ "sample_count": self.sample_count,
+ "chosen_counts": self.chosen_counts,
+ "oracle_report_path": self.oracle_report_path,
+ "oracle_summary_path": self.oracle_summary_path,
+ "oracle_choices_path": self.oracle_choices_path,
+ }
+
+
+def build_benchmark_oracle(
+ report_path: str | Path,
+ output_dir: str | Path,
+ *,
+ metric: str = "cer",
+ systems: list[str] | None = None,
+ direction: str | None = None,
+ oracle_name: str = "oracle",
+) -> tuple[OracleReport, BenchmarkSummary]:
+ rows = _load_benchmark_rows(report_path)
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ compare_systems = systems or sorted({str(row.get("baseline") or "") for row in rows if str(row.get("baseline") or "")})
+ compare_systems = [name for name in compare_systems if name]
+ if len(compare_systems) < 2:
+ raise BenchmarkError("benchmark oracle requires at least two systems")
+ missing = [name for name in compare_systems if not any(row.get("baseline") == name for row in rows)]
+ if missing:
+ raise BenchmarkError(f"requested systems missing from benchmark report: {', '.join(missing)}")
+ target_direction = direction or metric_direction(metric)
+ oracle_rows, chosen_counts, choices = _select_oracle_rows(rows, compare_systems, metric, target_direction, oracle_name)
+ if not oracle_rows:
+ raise BenchmarkError(f"benchmark oracle found no shared comparable rows for metric {metric!r}")
+
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ combined_rows = [dict(row) for row in rows] + [result.to_dict() for result in oracle_rows]
+ oracle_report_path = out / "oracle-report.json"
+ oracle_report_path.write_text(json.dumps(combined_rows, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ oracle_choices_path = out / "oracle-choices.json"
+ oracle_choices_path.write_text(json.dumps(choices, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ summary = summarize_benchmark_report(
+ oracle_report_path,
+ out / "oracle-summary",
+ candidate=oracle_name,
+ baselines=compare_systems,
+ metrics=[metric],
+ )
+ report = OracleReport(
+ benchmark_report=str(Path(report_path)),
+ oracle_name=oracle_name,
+ metric=metric,
+ direction=target_direction,
+ systems=compare_systems,
+ sample_count=len(oracle_rows),
+ chosen_counts=chosen_counts,
+ oracle_report_path=str(oracle_report_path),
+ oracle_summary_path=str(out / "oracle-summary" / "summary.json"),
+ oracle_choices_path=str(oracle_choices_path),
+ )
+ (out / "oracle-analysis.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Benchmark Oracle",
+ "",
+ f"Source report: `{report_path}`",
+ f"Oracle: `{oracle_name}`",
+ f"Metric: `{metric}`",
+ f"Direction: `{target_direction}`",
+ f"Samples: `{len(oracle_rows)}`",
+ "",
+ "## Chosen Counts",
+ "",
+ "| system | chosen |",
+ "| --- | ---: |",
+ ]
+ for system, count in sorted(chosen_counts.items()):
+ lines.append(f"| {system} | {count} |")
+ lines.extend(
+ [
+ "",
+ f"Oracle report: `{oracle_report_path}`",
+ f"Oracle choices: `{oracle_choices_path}`",
+ f"Oracle summary: `{out / 'oracle-summary' / 'summary.json'}`",
+ ]
+ )
+ (out / "oracle-analysis.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+ return report, summary
+
+
+def _select_oracle_rows(
+ rows: list[dict[str, Any]],
+ systems: list[str],
+ metric: str,
+ direction: str,
+ oracle_name: str,
+) -> tuple[list[BenchmarkResult], dict[str, int], list[dict[str, Any]]]:
+ rows_by_sample: dict[str, dict[str, dict[str, Any]]] = {}
+ for row in rows:
+ if row.get("status") != "ok":
+ continue
+ baseline = str(row.get("baseline") or "")
+ if baseline not in systems:
+ continue
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict) or metric not in metrics:
+ continue
+ sample = sample_key(row)
+ rows_by_sample.setdefault(sample, {})[baseline] = row
+ oracle_rows: list[BenchmarkResult] = []
+ chosen_counts = {system: 0 for system in systems}
+ choices: list[dict[str, Any]] = []
+ for sample, sample_rows in sorted(rows_by_sample.items()):
+ if any(system not in sample_rows for system in systems):
+ continue
+ chosen_system, chosen_row = _best_row(sample_rows, systems, metric, direction)
+ chosen_counts[chosen_system] += 1
+ oracle_row = dict(chosen_row)
+ oracle_row["baseline"] = oracle_name
+ oracle_row["error"] = None
+ metrics = dict(chosen_row.get("metrics") or {})
+ oracle_row["metrics"] = metrics
+ choices.append(
+ {
+ "sample_key": sample,
+ "sample_id": chosen_row.get("sample_id"),
+ "input_path": chosen_row.get("input_path"),
+ "chosen_system": chosen_system,
+ "metric": metric,
+ "metric_value": float(metrics[metric]),
+ "direction": direction,
+ }
+ )
+ oracle_result = BenchmarkResult(
+ baseline=str(oracle_row["baseline"]),
+ input_path=str(oracle_row.get("input_path") or ""),
+ status=str(oracle_row.get("status") or "ok"),
+ latency_seconds=float(oracle_row.get("latency_seconds") or 0.0),
+ sample_id=oracle_row.get("sample_id"),
+ slices=list(oracle_row.get("slices") or []),
+ metrics=metrics,
+ error=None,
+ )
+ oracle_result.slices = list(oracle_row.get("slices") or [])
+ oracle_rows.append(oracle_result)
+ return oracle_rows, {system: count for system, count in chosen_counts.items() if count}, choices
+
+
+def _best_row(
+ sample_rows: dict[str, dict[str, Any]],
+ systems: list[str],
+ metric: str,
+ direction: str,
+) -> tuple[str, dict[str, Any]]:
+ best_system = systems[0]
+ best_row = sample_rows[best_system]
+ best_value = float((best_row.get("metrics") or {})[metric])
+ for system in systems[1:]:
+ row = sample_rows[system]
+ value = float((row.get("metrics") or {})[metric])
+ if _is_better(value, best_value, direction):
+ best_system = system
+ best_row = row
+ best_value = value
+ continue
+ if value == best_value:
+ if _tie_break_quality(row) > _tie_break_quality(best_row):
+ best_system = system
+ best_row = row
+ best_value = value
+ elif _tie_break_quality(row) == _tie_break_quality(best_row):
+ row_latency = float(row.get("latency_seconds") or 0.0)
+ best_latency = float(best_row.get("latency_seconds") or 0.0)
+ if row_latency < best_latency:
+ best_system = system
+ best_row = row
+ best_value = value
+ return best_system, best_row
+
+
+def _is_better(candidate: float, incumbent: float, direction: str) -> bool:
+ if direction == "lower":
+ return candidate < incumbent
+ return candidate > incumbent
+
+
+def _tie_break_quality(row: dict[str, Any]) -> float:
+ metrics = row.get("metrics") or {}
+ value = metrics.get("quality_score")
+ if isinstance(value, int | float):
+ return float(value)
+ return float("-inf")
diff --git a/src/ocrtech/paper.py b/src/ocrtech/paper.py
new file mode 100644
index 0000000000000000000000000000000000000000..4db2b2d5d3a07a5ac326f50b925b33de2eac1b5d
--- /dev/null
+++ b/src/ocrtech/paper.py
@@ -0,0 +1,212 @@
+"""Paper-oriented exports from benchmark summary artifacts."""
+
+from __future__ import annotations
+
+import json
+import math
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Any
+
+from .errors import BenchmarkError
+
+
+DEFAULT_PAPER_METRICS = ["cer", "table_cell_f1", "reading_order_pair_accuracy"]
+
+
+@dataclass(slots=True)
+class PaperTableRow:
+ system: str
+ display_name: str
+ sample_count: int | None
+ metrics: dict[str, float]
+ sources: list[str]
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "system": self.system,
+ "display_name": self.display_name,
+ "sample_count": self.sample_count,
+ "metrics": self.metrics,
+ "sources": self.sources,
+ }
+
+
+@dataclass(slots=True)
+class PaperBenchmarkTable:
+ title: str
+ slice_name: str
+ metrics: list[str]
+ rows: list[PaperTableRow]
+ source_summaries: list[str]
+
+ def to_dict(self) -> dict[str, object]:
+ return {
+ "title": self.title,
+ "slice": self.slice_name,
+ "metrics": self.metrics,
+ "rows": [row.to_dict() for row in self.rows],
+ "source_summaries": self.source_summaries,
+ }
+
+
+def export_paper_benchmark_table(
+ summary_paths: list[str | Path],
+ output_dir: str | Path,
+ *,
+ slice_name: str = "all",
+ metrics: list[str] | None = None,
+ systems: list[str] | None = None,
+ display_names: dict[str, str] | None = None,
+ source_preferences: dict[str, str] | None = None,
+ title: str | None = None,
+) -> PaperBenchmarkTable:
+ if not summary_paths:
+ raise BenchmarkError("paper benchmark table requires at least one summary artifact")
+ selected_metrics = metrics or list(DEFAULT_PAPER_METRICS)
+ ordered_systems = list(dict.fromkeys(systems or []))
+ filter_systems = set(ordered_systems)
+ labels = dict(display_names or {})
+ preferred_sources = {
+ system: str(Path(path))
+ for system, path in dict(source_preferences or {}).items()
+ }
+
+ rows_by_system: dict[str, PaperTableRow] = {}
+ seen_order: list[str] = []
+ source_summaries: list[str] = []
+ for summary_path in summary_paths:
+ payload = _load_summary_json(summary_path)
+ normalized_summary_path = str(Path(summary_path))
+ source_summaries.append(normalized_summary_path)
+ aggregate_metrics = payload.get("aggregate_metrics")
+ if not isinstance(aggregate_metrics, dict):
+ raise BenchmarkError(f"summary {summary_path} missing aggregate_metrics object")
+ for system_name, slice_map in aggregate_metrics.items():
+ system = str(system_name)
+ if filter_systems and system not in filter_systems:
+ continue
+ preferred_source = preferred_sources.get(system)
+ if preferred_source and preferred_source != normalized_summary_path:
+ continue
+ if not isinstance(slice_map, dict):
+ continue
+ slice_metrics = slice_map.get(slice_name)
+ if not isinstance(slice_metrics, dict):
+ continue
+ row = rows_by_system.get(system)
+ sample_count = _optional_int(slice_metrics.get("sample_count"), field_name=f"{system}.{slice_name}.sample_count")
+ if row is None:
+ row = PaperTableRow(
+ system=system,
+ display_name=labels.get(system, system),
+ sample_count=sample_count,
+ metrics={},
+ sources=[],
+ )
+ rows_by_system[system] = row
+ seen_order.append(system)
+ elif sample_count is not None:
+ _merge_sample_count(row, sample_count, summary_path, slice_name)
+ for metric in selected_metrics:
+ value = slice_metrics.get(metric)
+ if value is None:
+ continue
+ if isinstance(value, bool) or not isinstance(value, int | float) or not math.isfinite(float(value)):
+ raise BenchmarkError(
+ f"summary {summary_path} has non-finite {metric!r} for system {system!r} slice {slice_name!r}"
+ )
+ _merge_metric(row, metric, float(value), summary_path, slice_name)
+ row.sources.append(str(Path(summary_path)))
+
+ if not rows_by_system:
+ raise BenchmarkError(f"no systems found for slice {slice_name!r} in the provided summaries")
+ if ordered_systems:
+ missing = [system for system in ordered_systems if system not in rows_by_system]
+ if missing:
+ raise BenchmarkError(f"requested systems missing from provided summaries: {', '.join(missing)}")
+ final_systems = ordered_systems
+ else:
+ final_systems = seen_order
+ table = PaperBenchmarkTable(
+ title=title or f"Benchmark Comparison ({slice_name})",
+ slice_name=slice_name,
+ metrics=selected_metrics,
+ rows=[rows_by_system[system] for system in final_systems],
+ source_summaries=source_summaries,
+ )
+ _write_paper_benchmark_table(table, Path(output_dir))
+ return table
+
+
+def _load_summary_json(path: str | Path) -> dict[str, Any]:
+ raw_path = Path(path)
+ try:
+ payload = json.loads(raw_path.read_text(encoding="utf-8"))
+ except FileNotFoundError as exc:
+ raise BenchmarkError(f"summary artifact not found: {raw_path}") from exc
+ except json.JSONDecodeError as exc:
+ raise BenchmarkError(f"invalid summary JSON {raw_path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise BenchmarkError(f"summary artifact must be a JSON object: {raw_path}")
+ return payload
+
+
+def _optional_int(value: Any, *, field_name: str) -> int | None:
+ if value is None:
+ return None
+ if isinstance(value, bool) or not isinstance(value, int | float):
+ raise BenchmarkError(f"{field_name} must be numeric, got {type(value).__name__}")
+ return int(value)
+
+
+def _merge_sample_count(row: PaperTableRow, sample_count: int, source_path: str | Path, slice_name: str) -> None:
+ if row.sample_count is None:
+ row.sample_count = sample_count
+ return
+ if row.sample_count != sample_count:
+ raise BenchmarkError(
+ f"conflicting sample_count for system {row.system!r} slice {slice_name!r}: "
+ f"{row.sample_count} vs {sample_count} in {source_path}"
+ )
+
+
+def _merge_metric(row: PaperTableRow, metric: str, value: float, source_path: str | Path, slice_name: str) -> None:
+ previous = row.metrics.get(metric)
+ if previous is None:
+ row.metrics[metric] = value
+ return
+ if not math.isclose(previous, value, rel_tol=1e-9, abs_tol=1e-9):
+ raise BenchmarkError(
+ f"conflicting aggregate value for system {row.system!r} slice {slice_name!r} metric {metric!r}: "
+ f"{previous} vs {value} in {source_path}"
+ )
+
+
+def _write_paper_benchmark_table(table: PaperBenchmarkTable, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ (output_dir / "paper-table.json").write_text(
+ json.dumps(table.to_dict(), ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+
+ columns = ["system", "sample_count", *table.metrics]
+ lines = [
+ "# Paper Benchmark Table",
+ "",
+ f"Title: {table.title}",
+ f"Slice: `{table.slice_name}`",
+ "",
+ "| " + " | ".join(columns) + " |",
+ "| " + " | ".join("---:" if index > 0 else "---" for index, _ in enumerate(columns)) + " |",
+ ]
+ for row in table.rows:
+ values = [row.display_name, "" if row.sample_count is None else str(row.sample_count)]
+ for metric in table.metrics:
+ metric_value = row.metrics.get(metric)
+ values.append("" if metric_value is None else f"{metric_value:.6f}")
+ lines.append("| " + " | ".join(values) + " |")
+ lines.extend(["", "## Source Summaries", ""])
+ for source in table.source_summaries:
+ lines.append(f"- `{source}`")
+ (output_dir / "paper-table.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/pipeline.py b/src/ocrtech/pipeline.py
new file mode 100644
index 0000000000000000000000000000000000000000..626d9e8109545f338e36f7068adc68ddf2b7c473
--- /dev/null
+++ b/src/ocrtech/pipeline.py
@@ -0,0 +1,206 @@
+"""End-to-end parsing pipeline and file exports."""
+
+from __future__ import annotations
+
+import json
+import shutil
+from pathlib import Path
+
+from .engines import create_engine
+from .errors import EngineUnavailableError, ParseError
+from .markdown import render_document_markdown
+from .quality import evaluate_document_quality
+from .schemas import Document
+from .structure import build_document
+from .tables import write_table_files
+
+_CROPPABLE_IMAGE_SUFFIXES = {".png", ".jpg", ".jpeg", ".webp", ".bmp", ".tif", ".tiff"}
+
+
+def parse_document(
+ input_path: str | Path,
+ output_dir: str | Path,
+ *,
+ engine_name: str = "auto",
+ model_config: str | Path | None = None,
+ fallback_engine: str | None = None,
+ fallback_model_config: str | Path | None = None,
+ low_confidence_threshold: float = 0.80,
+) -> Document:
+ source = Path(input_path)
+ out = Path(output_dir)
+ if not source.exists():
+ raise ParseError(f"Input does not exist: {source}")
+ out.mkdir(parents=True, exist_ok=True)
+
+ engine_kwargs = {"model_config": model_config} if engine_name in {"candidate", "ours"} else {}
+ engine = create_engine(engine_name, **engine_kwargs)
+ engine_output = engine.recognize(source)
+ avg_confidence = engine_output.average_confidence
+ fallback_decision = _fallback_decision(
+ primary_engine=engine_name,
+ fallback_engine=fallback_engine,
+ fallback_model_config=fallback_model_config,
+ primary_average_confidence=avg_confidence,
+ low_confidence_threshold=low_confidence_threshold,
+ )
+ if fallback_decision is not None:
+ engine_output.metadata["fallback"] = fallback_decision
+ if fallback_decision is not None and fallback_decision["triggered"]:
+ try:
+ fallback_kwargs = {"model_config": fallback_model_config} if fallback_model_config is not None else {}
+ fallback = create_engine(str(fallback_decision["fallback_engine"]), **fallback_kwargs)
+ fallback_output = fallback.recognize(source)
+ fallback_decision["outcome"] = "success"
+ fallback_output.metadata["fallback"] = fallback_decision
+ engine_output = fallback_output
+ except EngineUnavailableError as exc:
+ fallback_decision["outcome"] = "error"
+ fallback_decision["error"] = str(exc)
+ engine_output.metadata["fallback"] = fallback_decision
+ engine_output.metadata["fallback_error"] = str(exc)
+ except Exception as exc:
+ fallback_decision["outcome"] = "error"
+ fallback_decision["error"] = f"{type(exc).__name__}: {exc}"
+ engine_output.metadata["fallback"] = fallback_decision
+ engine_output.metadata["fallback_error"] = f"{type(exc).__name__}: {exc}"
+
+ document = build_document(str(source), engine_output)
+ quality = evaluate_document_quality(document)
+ document.metadata["quality"] = quality.to_dict()
+ export_document(document, out, source)
+ return document
+
+
+def _fallback_decision(
+ *,
+ primary_engine: str,
+ fallback_engine: str | None,
+ fallback_model_config: str | Path | None,
+ primary_average_confidence: float | None,
+ low_confidence_threshold: float,
+) -> dict[str, object] | None:
+ if not fallback_engine and fallback_model_config is None:
+ return None
+ resolved_fallback_engine = fallback_engine or "candidate"
+ decision: dict[str, object] = {
+ "configured": True,
+ "triggered": False,
+ "outcome": "not_triggered",
+ "primary_engine": primary_engine,
+ "fallback_engine": resolved_fallback_engine,
+ "fallback_model_config": str(fallback_model_config) if fallback_model_config is not None else None,
+ "primary_average_confidence": primary_average_confidence,
+ "threshold": low_confidence_threshold,
+ }
+ if fallback_model_config is None and resolved_fallback_engine.lower() == primary_engine.lower():
+ decision["reason"] = "same_engine"
+ return decision
+ if primary_average_confidence is None:
+ decision["reason"] = "confidence_not_available"
+ return decision
+ if primary_average_confidence >= low_confidence_threshold:
+ decision["reason"] = "confidence_above_threshold"
+ return decision
+ decision["triggered"] = True
+ decision["outcome"] = "triggered"
+ decision["reason"] = "average_confidence_below_threshold"
+ return decision
+
+
+def export_document(document: Document, output_dir: Path, source_path: Path) -> None:
+ tables_dir = output_dir / "tables"
+ figures_dir = output_dir / "figures"
+ for table in document.tables:
+ write_table_files(table, tables_dir)
+ figures_dir.mkdir(parents=True, exist_ok=True)
+ for figure in document.figures:
+ _export_figure_image(figure, figures_dir, source_path)
+ (figures_dir / "metadata.json").write_text(
+ json.dumps([figure.to_dict() for figure in document.figures], ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+ quality = document.metadata.get("quality")
+ if isinstance(quality, dict):
+ (output_dir / "quality.json").write_text(json.dumps(quality, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (output_dir / "document.json").write_text(
+ json.dumps(document.to_dict(), ensure_ascii=False, indent=2) + "\n",
+ encoding="utf-8",
+ )
+ (output_dir / "document.md").write_text(render_document_markdown(document), encoding="utf-8")
+
+
+def _export_figure_image(figure: object, figures_dir: Path, source_path: Path) -> None:
+ image_path = getattr(figure, "image_path", None)
+ if image_path:
+ source_figure = Path(str(image_path))
+ if not source_figure.is_absolute():
+ source_base = source_path if source_path.is_dir() else source_path.parent
+ source_figure = source_base / source_figure
+ if source_figure.exists():
+ target = figures_dir / source_figure.name
+ shutil.copy2(source_figure, target)
+ setattr(figure, "image_path", str(target))
+ return
+ _record_figure_export_warning(figure, f"figure image_path does not exist: {source_figure}")
+ _crop_figure_from_source(figure, figures_dir, source_path)
+
+
+def _crop_figure_from_source(figure: object, figures_dir: Path, source_path: Path) -> None:
+ source_image = _source_image_for_figure(figure, source_path)
+ if source_image is None:
+ return
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ _record_figure_export_warning(figure, f"Pillow is required to crop figure image: {exc}")
+ return
+ try:
+ bbox = getattr(figure, "bbox")
+ left = max(0, int(round(bbox.x)))
+ top = max(0, int(round(bbox.y)))
+ right = max(left, int(round(bbox.right)))
+ bottom = max(top, int(round(bbox.bottom)))
+ with Image.open(source_image) as image:
+ right = min(right, image.width)
+ bottom = min(bottom, image.height)
+ if right <= left or bottom <= top:
+ _record_figure_export_warning(figure, f"figure bbox is outside source image bounds: {bbox.to_list()}")
+ return
+ target = figures_dir / f"{getattr(figure, 'figure_id', 'figure')}.png"
+ image.crop((left, top, right, bottom)).save(target)
+ setattr(figure, "image_path", str(target))
+ metadata = getattr(figure, "metadata")
+ if isinstance(metadata, dict):
+ metadata["export_source"] = "source_crop"
+ except Exception as exc:
+ _record_figure_export_warning(figure, f"{type(exc).__name__}: {exc}")
+
+
+def _source_image_for_figure(figure: object, source_path: Path) -> Path | None:
+ if source_path.is_dir():
+ page_paths = [
+ path
+ for path in sorted(source_path.iterdir())
+ if path.is_file() and path.suffix.lower() in _CROPPABLE_IMAGE_SUFFIXES
+ ]
+ if not page_paths:
+ _record_figure_export_warning(figure, f"page bundle has no croppable image files: {source_path}")
+ return None
+ page_index = getattr(figure, "page_index", 0)
+ if not isinstance(page_index, int) or page_index < 0 or page_index >= len(page_paths):
+ _record_figure_export_warning(figure, f"figure page_index is outside page bundle bounds: {page_index}")
+ return None
+ return page_paths[page_index]
+ if source_path.suffix.lower() not in _CROPPABLE_IMAGE_SUFFIXES:
+ _record_figure_export_warning(figure, f"source image format cannot be cropped: {source_path.suffix or ''}")
+ return None
+ return source_path
+
+
+def _record_figure_export_warning(figure: object, message: str) -> None:
+ metadata = getattr(figure, "metadata", None)
+ if isinstance(metadata, dict):
+ warnings = metadata.setdefault("export_warnings", [])
+ if isinstance(warnings, list):
+ warnings.append(message)
diff --git a/src/ocrtech/preflight.py b/src/ocrtech/preflight.py
new file mode 100644
index 0000000000000000000000000000000000000000..7a141c2b70efc78a302baeab6cdd9b6d002c767d
--- /dev/null
+++ b/src/ocrtech/preflight.py
@@ -0,0 +1,733 @@
+"""Preflight checks for claim-grade benchmark runs."""
+
+from __future__ import annotations
+
+import importlib.util
+import json
+import os
+import shlex
+import shutil
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError, PreflightError
+from .evalpack import audit_eval_pack
+from .manifest import ManifestEntry, SUPPORTED_OCR_IMAGE_SUFFIXES, load_manifest, sha256_file
+from .models import ModelCard, audit_model_card, component_baseline_names, inspect_routed_calibration_collapse, model_admission_status, trained_recognizer_provenance_status
+from .validation import ValidationConfig, check_leakage
+
+
+_CANDIDATE_BASELINES = {"ours", "ocrtech", "candidate"}
+_TESSERACT_BASELINES = {"tesseract"}
+_PADDLE_BASELINES = {"stock-paddle", "paddleocr", "paddle"}
+_SURYA_BASELINES = {"surya"}
+_GLM_BASELINES = {"glm-ocr"}
+_PADDLE_VL_BASELINES = {"paddleocr-vl"}
+_KNOWN_BASELINES = _CANDIDATE_BASELINES | _TESSERACT_BASELINES | _PADDLE_BASELINES | _SURYA_BASELINES | _GLM_BASELINES | _PADDLE_VL_BASELINES
+
+
+@dataclass(slots=True)
+class PreflightCheck:
+ name: str
+ status: str
+ summary: str
+ details: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "name": self.name,
+ "status": self.status,
+ "summary": self.summary,
+ "details": self.details,
+ }
+
+
+@dataclass(slots=True)
+class PreflightReport:
+ passed: bool
+ eval_manifest: str
+ output_dir: str
+ baselines: list[str]
+ sample_count: int
+ checks: list[PreflightCheck]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "eval_manifest": self.eval_manifest,
+ "output_dir": self.output_dir,
+ "baselines": self.baselines,
+ "sample_count": self.sample_count,
+ "checks": [check.to_dict() for check in self.checks],
+ }
+
+
+def run_claim_preflight(
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ baselines: list[str],
+ references_dir: str | Path | None = None,
+ candidate_model_config: str | Path | None = None,
+ fallback_model_config: str | Path | None = None,
+ train_manifests: list[str | Path] | None = None,
+ validation_config: str | Path | None = None,
+ require_claim_ready_eval_pack: bool = True,
+ require_trained_recognizer: bool = False,
+ require_model_admission: bool = False,
+) -> PreflightReport:
+ normalized = [_normalize_baseline(baseline) for baseline in baselines]
+ if not normalized:
+ raise PreflightError("preflight requires at least one baseline")
+ unknown = sorted({baseline for baseline in normalized if baseline not in _KNOWN_BASELINES})
+ if unknown:
+ raise PreflightError(f"unknown baselines for preflight: {', '.join(unknown)}")
+
+ eval_path = Path(eval_manifest)
+ manifest_dir = eval_path.parent
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ checks: list[PreflightCheck] = []
+
+ entries: list[ManifestEntry] | None = None
+ references_root = Path(references_dir) if references_dir else None
+
+ manifest_check, entries = _manifest_check(eval_path)
+ checks.append(manifest_check)
+ checks.append(_ocr_input_suffix_check(entries, eval_path.parent))
+
+ checks.append(_reference_check(entries, manifest_dir, references_root))
+ checks.append(_eval_pack_check(eval_path, entries, out / "eval-pack-audit", require_claim_ready_eval_pack))
+ checks.extend(_baseline_checks(normalized, candidate_model_config))
+ checks.append(_fallback_model_check(fallback_model_config))
+ checks.append(_candidate_fallback_provenance_check(candidate_model_config, fallback_model_config))
+ checks.append(_trained_recognizer_check(candidate_model_config, require_trained_recognizer))
+ checks.append(_model_admission_check(candidate_model_config, require_model_admission))
+ checks.append(_candidate_calibration_check(eval_path, candidate_model_config))
+ checks.append(_candidate_component_baseline_check(normalized, candidate_model_config))
+ checks.append(_validation_config_check(validation_config, normalized, entries))
+ checks.append(_leakage_check(train_manifests or [], eval_path if entries is not None else None))
+
+ report = PreflightReport(
+ passed=all(check.status != "fail" for check in checks),
+ eval_manifest=str(eval_path),
+ output_dir=str(out),
+ baselines=normalized,
+ sample_count=len(entries or []),
+ checks=checks,
+ )
+ _write_preflight_report(report, out)
+ return report
+
+
+def _fallback_model_check(fallback_model_config: str | Path | None) -> PreflightCheck:
+ if fallback_model_config is None:
+ return PreflightCheck("fallback-model", "pass", "fallback model config is not configured for this preflight")
+ model_path = Path(fallback_model_config)
+ if not model_path.exists():
+ return PreflightCheck("fallback-model", "fail", f"fallback model config does not exist: {model_path}")
+ if not model_path.is_file():
+ return PreflightCheck("fallback-model", "fail", f"fallback model config is not a file: {model_path}")
+ try:
+ audit = audit_model_card(model_path)
+ except Exception as exc:
+ return PreflightCheck("fallback-model", "fail", f"fallback model card audit failed: {exc}")
+ if not audit.passed:
+ return PreflightCheck("fallback-model", "fail", "fallback model card failed audit", details=[*audit.issues, *audit.warnings])
+ return PreflightCheck("fallback-model", "pass", f"fallback model card is ready: {audit.model_id}", details=audit.warnings)
+
+
+def _candidate_fallback_provenance_check(
+ candidate_model_config: str | Path | None,
+ fallback_model_config: str | Path | None,
+) -> PreflightCheck:
+ if fallback_model_config is None:
+ return PreflightCheck("candidate-fallback-provenance", "pass", "no fallback model config supplied")
+ if candidate_model_config is None:
+ return PreflightCheck(
+ "candidate-fallback-provenance",
+ "warn",
+ "fallback model config supplied without candidate model config; candidate fallback provenance skipped",
+ )
+ candidate_path = Path(candidate_model_config)
+ fallback_path = Path(fallback_model_config)
+ if not candidate_path.exists():
+ return PreflightCheck("candidate-fallback-provenance", "fail", f"candidate model config does not exist: {candidate_path}")
+ if not fallback_path.exists() or not fallback_path.is_file():
+ return PreflightCheck("candidate-fallback-provenance", "fail", f"fallback model config is not an existing file: {fallback_path}")
+ try:
+ candidate = ModelCard.from_path(candidate_path)
+ except Exception as exc:
+ return PreflightCheck("candidate-fallback-provenance", "fail", f"candidate model card could not be loaded: {exc}")
+ payload = candidate.provenance.get("fallback_model_card")
+ if not isinstance(payload, dict):
+ return PreflightCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate model card missing provenance.fallback_model_card for configured fallback",
+ )
+ path_value = payload.get("path")
+ if not isinstance(path_value, str) or not path_value:
+ return PreflightCheck("candidate-fallback-provenance", "fail", "candidate fallback_model_card.path is missing")
+ declared_path = Path(path_value)
+ if not declared_path.is_absolute():
+ declared_path = candidate_path.parent / declared_path
+ if not declared_path.exists() or not declared_path.is_file():
+ return PreflightCheck("candidate-fallback-provenance", "fail", f"candidate fallback model card does not exist: {declared_path}")
+ actual_declared_sha = sha256_file(declared_path)
+ declared_sha = payload.get("sha256")
+ if isinstance(declared_sha, str) and declared_sha and declared_sha != actual_declared_sha:
+ return PreflightCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate fallback model card sha256 mismatch",
+ details=[f"expected={declared_sha}", f"actual={actual_declared_sha}", f"path={declared_path}"],
+ )
+ configured_sha = sha256_file(fallback_path)
+ if actual_declared_sha != configured_sha:
+ return PreflightCheck(
+ "candidate-fallback-provenance",
+ "fail",
+ "candidate fallback model card does not match configured fallback model",
+ details=[
+ f"candidate_fallback={declared_path}",
+ f"candidate_fallback_sha256={actual_declared_sha}",
+ f"configured_fallback={fallback_path}",
+ f"configured_fallback_sha256={configured_sha}",
+ ],
+ )
+ return PreflightCheck(
+ "candidate-fallback-provenance",
+ "pass",
+ "candidate fallback provenance matches configured fallback model",
+ details=[f"fallback_model_card={declared_path}", f"sha256={actual_declared_sha}"],
+ )
+
+
+def _manifest_check(eval_path: Path) -> tuple[PreflightCheck, list[ManifestEntry] | None]:
+ if not eval_path.exists():
+ return PreflightCheck("eval-manifest", "fail", f"eval manifest does not exist: {eval_path}"), None
+ try:
+ entries = load_manifest(eval_path)
+ except Exception as exc:
+ return PreflightCheck("eval-manifest", "fail", f"failed to load eval manifest: {exc}"), None
+ if not entries:
+ return PreflightCheck("eval-manifest", "fail", "eval manifest contains no samples"), entries
+
+ missing_inputs: list[str] = []
+ for entry in entries:
+ resolved = _resolve_existing_path(entry.image_path, eval_path.parent)
+ if resolved is None:
+ missing_inputs.append(f"{entry.sample_id}: {entry.image_path}")
+ if missing_inputs:
+ return PreflightCheck(
+ "eval-manifest",
+ "fail",
+ f"{len(missing_inputs)} eval inputs are missing",
+ details=missing_inputs[:25],
+ ), entries
+ return PreflightCheck("eval-manifest", "pass", f"{len(entries)} eval samples loaded"), entries
+
+
+def _ocr_input_suffix_check(entries: list[ManifestEntry] | None, manifest_dir: Path) -> PreflightCheck:
+ if entries is None:
+ return PreflightCheck("eval-input-suffixes", "fail", "cannot verify input suffixes because eval manifest did not load")
+ unsupported: list[str] = []
+ allowed = set(SUPPORTED_OCR_IMAGE_SUFFIXES) | {".pdf"}
+ for entry in entries:
+ if str(entry.metadata.get("input_format") or "").lower() == "text":
+ continue
+ resolved = _resolve_existing_path(entry.image_path, manifest_dir)
+ if resolved is None:
+ continue
+ if resolved.is_dir():
+ continue
+ suffix = resolved.suffix.lower()
+ if suffix not in allowed:
+ unsupported.append(f"{entry.sample_id}: {entry.image_path} ({suffix or ''})")
+ if unsupported:
+ return PreflightCheck(
+ "eval-input-suffixes",
+ "fail",
+ f"{len(unsupported)} eval inputs use unsupported OCR suffixes; run normalize-manifest-images first",
+ details=unsupported[:25],
+ )
+ return PreflightCheck("eval-input-suffixes", "pass", f"all {len(entries)} eval inputs have OCR-supported suffixes or text input_format")
+
+
+def _reference_check(
+ entries: list[ManifestEntry] | None,
+ manifest_dir: Path,
+ references_root: Path | None,
+) -> PreflightCheck:
+ if entries is None:
+ return PreflightCheck("references", "fail", "cannot verify references because eval manifest did not load")
+ if references_root is not None and not references_root.exists():
+ return PreflightCheck("references", "fail", f"references directory does not exist: {references_root}")
+
+ missing: list[str] = []
+ invalid: list[str] = []
+ for entry in entries:
+ input_path = _resolve_existing_path(entry.image_path, manifest_dir)
+ if input_path is None:
+ missing.append(f"{entry.sample_id}: input missing, reference lookup skipped")
+ continue
+ candidate = _resolve_reference_path(entry, input_path, manifest_dir, references_root)
+ if candidate is None:
+ missing.append(f"{entry.sample_id}: no reference found")
+ continue
+ try:
+ _validate_reference_path(candidate)
+ except Exception as exc:
+ invalid.append(f"{entry.sample_id}: {candidate} ({exc})")
+ if missing or invalid:
+ details = [*missing[:20], *invalid[:20]]
+ summary_parts: list[str] = []
+ if missing:
+ summary_parts.append(f"{len(missing)} missing")
+ if invalid:
+ summary_parts.append(f"{len(invalid)} invalid")
+ return PreflightCheck("references", "fail", f"reference coverage failed: {', '.join(summary_parts)}", details=details)
+ return PreflightCheck("references", "pass", f"references resolved for {len(entries)} samples")
+
+
+def _eval_pack_check(
+ eval_path: Path,
+ entries: list[ManifestEntry] | None,
+ audit_output_dir: Path,
+ require_claim_ready_eval_pack: bool,
+) -> PreflightCheck:
+ if entries is None:
+ return PreflightCheck("eval-pack", "fail", "cannot audit eval pack because eval manifest did not load")
+ if not _looks_like_eval_pack(eval_path, entries):
+ return PreflightCheck("eval-pack", "warn", "manifest is not recognized as an ocrtech eval pack; claim-ready slice audit skipped")
+ try:
+ audit = audit_eval_pack(eval_path, audit_output_dir)
+ except Exception as exc:
+ return PreflightCheck("eval-pack", "fail", f"eval-pack audit failed: {exc}")
+ details = [*audit.issues, *audit.warnings]
+ if not audit.passed:
+ return PreflightCheck("eval-pack", "fail", "eval-pack integrity audit failed", details=details)
+ if require_claim_ready_eval_pack and not audit.claim_ready:
+ return PreflightCheck("eval-pack", "fail", "eval pack is not claim-ready for OCR evidence", details=details)
+ if not audit.claim_ready:
+ return PreflightCheck("eval-pack", "warn", "eval pack is only smoke-ready; OCR claim evidence is disabled", details=details)
+ return PreflightCheck("eval-pack", "pass", "eval pack is claim-ready", details=details)
+
+
+def _baseline_checks(baselines: list[str], candidate_model_config: str | Path | None) -> list[PreflightCheck]:
+ checks: list[PreflightCheck] = []
+ if any(baseline in _CANDIDATE_BASELINES for baseline in baselines):
+ if candidate_model_config is None:
+ checks.append(PreflightCheck("baseline:candidate", "fail", "candidate baselines require --candidate-model-config"))
+ else:
+ try:
+ audit = audit_model_card(candidate_model_config)
+ except Exception as exc:
+ checks.append(PreflightCheck("baseline:candidate", "fail", f"candidate model card audit failed: {exc}"))
+ else:
+ if audit.passed:
+ checks.append(PreflightCheck("baseline:candidate", "pass", f"candidate model card is ready: {audit.model_id}", details=audit.warnings))
+ else:
+ checks.append(PreflightCheck("baseline:candidate", "fail", "candidate model card failed audit", details=[*audit.issues, *audit.warnings]))
+ elif candidate_model_config is not None:
+ try:
+ audit = audit_model_card(candidate_model_config)
+ except Exception as exc:
+ checks.append(PreflightCheck("candidate-model", "warn", f"candidate model card could not be audited: {exc}"))
+ else:
+ status = "pass" if audit.passed else "warn"
+ summary = f"candidate model card {'is ready' if audit.passed else 'has audit issues'}: {audit.model_id}"
+ checks.append(PreflightCheck("candidate-model", status, summary, details=[*audit.issues, *audit.warnings]))
+
+ if any(baseline in _TESSERACT_BASELINES for baseline in baselines):
+ checks.append(
+ PreflightCheck(
+ "baseline:tesseract",
+ "pass" if shutil.which("tesseract") else "fail",
+ "tesseract binary is available" if shutil.which("tesseract") else "tesseract binary is not available on PATH",
+ )
+ )
+ if any(baseline in _PADDLE_BASELINES for baseline in baselines):
+ paddleocr_available = importlib.util.find_spec("paddleocr") is not None
+ paddle_runtime_available = importlib.util.find_spec("paddle") is not None
+ paddle_available = paddleocr_available and paddle_runtime_available
+ details: list[str] = []
+ if not paddleocr_available:
+ details.append("python module missing: paddleocr")
+ if not paddle_runtime_available:
+ details.append("python module missing: paddle")
+ checks.append(
+ PreflightCheck(
+ "baseline:stock-paddle",
+ "pass" if paddle_available else "fail",
+ "paddleocr and paddle runtime are importable" if paddle_available else "paddle baseline dependencies are incomplete",
+ details=details,
+ )
+ )
+ if any(baseline in _SURYA_BASELINES for baseline in baselines):
+ surya_available = importlib.util.find_spec("surya") is not None
+ llama_available = shutil.which("llama-server") is not None or bool(os.environ.get("LLAMA_CPP_BINARY"))
+ details: list[str] = []
+ if not surya_available:
+ details.append("python module missing: surya")
+ if not llama_available:
+ details.append("llama-server is not on PATH and LLAMA_CPP_BINARY is unset")
+ checks.append(
+ PreflightCheck(
+ "baseline:surya",
+ "pass" if surya_available and llama_available else "fail",
+ "surya runtime is available" if surya_available and llama_available else "surya baseline dependencies are incomplete",
+ details=details,
+ )
+ )
+ if any(baseline in _GLM_BASELINES for baseline in baselines):
+ checks.append(_external_command_check("baseline:glm-ocr", "OCRTECH_GLM_OCR_CMD"))
+ if any(baseline in _PADDLE_VL_BASELINES for baseline in baselines):
+ checks.append(_external_command_check("baseline:paddleocr-vl", "OCRTECH_PADDLEOCR_VL_CMD"))
+ return checks
+
+
+def _trained_recognizer_check(candidate_model_config: str | Path | None, required: bool) -> PreflightCheck:
+ if not required:
+ return PreflightCheck("trained-recognizer", "pass", "trained recognizer provenance is not required for this preflight")
+ if candidate_model_config is None:
+ return PreflightCheck("trained-recognizer", "fail", "trained recognizer provenance requires --candidate-model-config")
+ try:
+ card = ModelCard.from_path(candidate_model_config)
+ status = trained_recognizer_provenance_status(card, candidate_model_config)
+ except Exception as exc:
+ return PreflightCheck("trained-recognizer", "fail", f"trained recognizer provenance check failed: {exc}")
+ if not status.passed:
+ return PreflightCheck("trained-recognizer", "fail", "candidate model lacks trained local recognizer provenance", details=status.details)
+ return PreflightCheck("trained-recognizer", "pass", "candidate includes trained local recognizer provenance", details=status.details)
+
+
+def _model_admission_check(candidate_model_config: str | Path | None, required: bool) -> PreflightCheck:
+ if not required:
+ return PreflightCheck("model-admission", "pass", "model admission validation is not required for this preflight")
+ if candidate_model_config is None:
+ return PreflightCheck("model-admission", "fail", "model admission validation requires --candidate-model-config")
+ try:
+ card = ModelCard.from_path(candidate_model_config)
+ status = model_admission_status(card, candidate_model_config)
+ except Exception as exc:
+ return PreflightCheck("model-admission", "fail", f"model admission validation check failed: {exc}")
+ if not status.passed:
+ return PreflightCheck("model-admission", "fail", "candidate model has not passed admission validation", details=status.details)
+ return PreflightCheck("model-admission", "pass", "candidate model passed admission validation", details=status.details)
+
+
+def _external_command_check(check_name: str, env_key: str) -> PreflightCheck:
+ command = os.environ.get(env_key)
+ if not command:
+ return PreflightCheck(check_name, "fail", f"{env_key} is not configured")
+ details: list[str] = []
+ if "{input}" not in command or "{out}" not in command:
+ details.append("command template must include both {input} and {out} placeholders")
+ try:
+ parts = shlex.split(command)
+ except ValueError as exc:
+ return PreflightCheck(check_name, "fail", f"{env_key} is not shell-parseable: {exc}")
+ if not parts:
+ return PreflightCheck(check_name, "fail", f"{env_key} is empty after shell parsing")
+ executable = parts[0]
+ if shutil.which(executable) is None:
+ details.append(f"executable not found on PATH: {executable}")
+ script_path = _command_script_path(parts)
+ if script_path is not None and not script_path.exists():
+ details.append(f"script path does not exist: {script_path}")
+ if details:
+ return PreflightCheck(check_name, "fail", f"{env_key} is configured but not runnable", details=details)
+ return PreflightCheck(check_name, "pass", f"{env_key} is configured and looks runnable")
+
+
+def _command_script_path(parts: list[str]) -> Path | None:
+ if len(parts) < 2:
+ return None
+ executable_name = Path(parts[0]).name
+ if executable_name not in {"python", "python3", "uv"}:
+ return None
+ for index, part in enumerate(parts[1:], start=1):
+ if executable_name == "uv" and part in {"run", "python"}:
+ continue
+ if part.startswith("-"):
+ continue
+ if executable_name == "uv" and part == "--":
+ continue
+ candidate = Path(part)
+ if candidate.suffix == ".py" or "/" in part:
+ return candidate
+ return None
+ return None
+
+
+def _candidate_calibration_check(eval_manifest: Path, candidate_model_config: str | Path | None) -> PreflightCheck:
+ if candidate_model_config is None:
+ return PreflightCheck("candidate-calibration", "warn", "no candidate model config supplied; calibration provenance check skipped")
+ try:
+ card = ModelCard.from_path(candidate_model_config)
+ except Exception as exc:
+ return PreflightCheck("candidate-calibration", "warn", f"candidate model card could not be loaded for calibration audit: {exc}")
+ if card.backend not in {"quality_select_composite", "quality_ranked_ensemble", "script_select_composite"}:
+ return PreflightCheck("candidate-calibration", "pass", "candidate backend does not require routed-threshold calibration provenance")
+ calibration = card.provenance.get("calibration")
+ if not isinstance(calibration, dict):
+ return PreflightCheck("candidate-calibration", "fail", f"{card.backend} candidate is missing provenance.calibration")
+ eval_payload = calibration.get("eval_manifest")
+ if not isinstance(eval_payload, dict):
+ return PreflightCheck("candidate-calibration", "fail", f"{card.backend} calibration is missing eval_manifest provenance")
+ calibration_sha = eval_payload.get("sha256")
+ if not isinstance(calibration_sha, str) or not calibration_sha:
+ return PreflightCheck("candidate-calibration", "fail", f"{card.backend} calibration eval_manifest is missing sha256")
+ current_sha = sha256_file(eval_manifest) if eval_manifest.exists() else None
+ if current_sha == calibration_sha:
+ return PreflightCheck(
+ "candidate-calibration",
+ "fail",
+ f"{card.backend} calibration eval manifest matches the claim eval manifest",
+ details=[str(eval_payload.get("path") or "")],
+ )
+ threshold = calibration.get("selected_threshold")
+ details = []
+ if isinstance(threshold, int | float):
+ details.append(f"selected_threshold={float(threshold):.6f}")
+ metric = calibration.get("metric")
+ if isinstance(metric, str) and metric:
+ details.append(f"metric={metric}")
+ collapse_reason, collapse_details = inspect_routed_calibration_collapse(card, candidate_model_config)
+ if collapse_reason is not None:
+ return PreflightCheck("candidate-calibration", "fail", collapse_reason, details=[*details, *collapse_details])
+ return PreflightCheck("candidate-calibration", "pass", f"{card.backend} calibration provenance is separate from claim eval", details=details)
+
+
+def _candidate_component_baseline_check(baselines: list[str], candidate_model_config: str | Path | None) -> PreflightCheck:
+ if candidate_model_config is None:
+ return PreflightCheck("candidate-components", "warn", "no candidate model config supplied; component-baseline coverage check skipped")
+ try:
+ card = ModelCard.from_path(candidate_model_config)
+ except Exception as exc:
+ return PreflightCheck("candidate-components", "warn", f"candidate model card could not be loaded for component-baseline audit: {exc}")
+ components = component_baseline_names(card)
+ if not components:
+ return PreflightCheck("candidate-components", "pass", "candidate backend does not require component-baseline coverage")
+ missing = [name for name in components if name not in baselines]
+ if missing:
+ return PreflightCheck(
+ "candidate-components",
+ "fail",
+ "claim-grade benchmark must include the candidate's component baselines",
+ details=[f"missing: {', '.join(missing)}", f"required: {', '.join(components)}", f"configured: {', '.join(baselines)}"],
+ )
+ return PreflightCheck(
+ "candidate-components",
+ "pass",
+ "claim-grade benchmark includes the candidate's component baselines",
+ details=components,
+ )
+
+
+def _validation_config_check(
+ validation_config: str | Path | None,
+ baselines: list[str],
+ entries: list[ManifestEntry] | None,
+) -> PreflightCheck:
+ if validation_config is None:
+ return PreflightCheck("validation-config", "warn", "validation config was not supplied; claim gates will not be preflighted")
+ try:
+ config = ValidationConfig.from_path(validation_config)
+ except Exception as exc:
+ return PreflightCheck("validation-config", "fail", f"validation config failed to load: {exc}")
+ if not config.gates:
+ return PreflightCheck("validation-config", "fail", "validation config has no gates; claim validation cannot pass")
+ issues: list[str] = []
+ baseline_set = set(baselines)
+ if not _baseline_is_configured(config.candidate, baseline_set):
+ issues.append(f"candidate baseline {config.candidate!r} is not included in preflight baselines")
+ missing_gate_baselines = sorted({gate.baseline for gate in config.gates if not _baseline_is_configured(gate.baseline, baseline_set)})
+ if missing_gate_baselines:
+ issues.append(f"gate baselines not included in preflight baselines: {', '.join(missing_gate_baselines)}")
+ if entries is not None:
+ sample_count = len(entries)
+ if config.min_samples > sample_count:
+ issues.append(f"validation min_samples {config.min_samples} exceeds eval manifest sample count {sample_count}")
+ slice_counts = _entry_slice_counts(entries)
+ for slice_name, required_count in config.required_slices.items():
+ actual = slice_counts.get(slice_name, 0)
+ if required_count > actual:
+ issues.append(f"required slice {slice_name!r} count {required_count} exceeds eval manifest count {actual}")
+ for gate in config.gates:
+ gate_slices = gate.slices or ([gate.slice] if gate.slice else [])
+ if gate_slices:
+ available_pairs = _entry_intersection_count(entries, [str(item) for item in gate_slices])
+ else:
+ available_pairs = sample_count
+ if gate.min_pairs > available_pairs:
+ suffix = f" on slices {','.join(gate_slices)}" if gate_slices else ""
+ issues.append(
+ f"gate {gate.baseline}:{gate.metric}{suffix} min_pairs {gate.min_pairs} exceeds eval manifest capacity {available_pairs}"
+ )
+ if issues:
+ return PreflightCheck("validation-config", "fail", "validation config cannot be satisfied by this preflight setup", details=issues)
+ return PreflightCheck(
+ "validation-config",
+ "pass",
+ f"validation config loaded with {len(config.gates)} gate(s)",
+ details=[f"candidate={config.candidate}", f"min_samples={config.min_samples}"],
+ )
+
+
+def _baseline_is_configured(name: str, configured: set[str]) -> bool:
+ normalized = _normalize_baseline(name)
+ if normalized in _CANDIDATE_BASELINES:
+ return bool(configured & _CANDIDATE_BASELINES)
+ return normalized in configured
+
+
+def _entry_slice_counts(entries: list[ManifestEntry]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ for entry in entries:
+ for slice_name in _entry_slices(entry):
+ counts[slice_name] = counts.get(slice_name, 0) + 1
+ return counts
+
+
+def _entry_intersection_count(entries: list[ManifestEntry], required_slices: list[str]) -> int:
+ required = {str(item) for item in required_slices if str(item)}
+ if not required:
+ return len(entries)
+ return sum(1 for entry in entries if required.issubset(set(_entry_slices(entry))))
+
+
+def _entry_slices(entry: ManifestEntry) -> list[str]:
+ metadata = entry.metadata or {}
+ values: set[str] = set()
+ for key in ("slice", "script", "document_type", "degradation", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _leakage_check(train_manifests: list[str | Path], eval_manifest: Path | None) -> PreflightCheck:
+ if not train_manifests:
+ return PreflightCheck("leakage", "warn", "train manifests were not provided; leakage audit skipped")
+ if eval_manifest is None:
+ return PreflightCheck("leakage", "fail", "eval manifest is unavailable; leakage audit cannot run")
+ try:
+ report = check_leakage(train_manifests, eval_manifest)
+ except Exception as exc:
+ return PreflightCheck("leakage", "fail", f"leakage audit failed: {exc}")
+ details: list[str] = []
+ for key, values in report.overlaps.items():
+ if values:
+ details.append(f"{key}: {', '.join(values[:10])}")
+ for key, values in report.warnings.items():
+ if values:
+ details.append(f"{key} warning: {', '.join(values[:10])}")
+ if not report.passed:
+ return PreflightCheck("leakage", "fail", "train/eval leakage detected", details=details)
+ if any(report.warnings.values()):
+ return PreflightCheck("leakage", "warn", "no fatal leakage detected; warning overlaps are present", details=details)
+ return PreflightCheck("leakage", "pass", "no train/eval leakage detected")
+
+
+def _looks_like_eval_pack(eval_path: Path, entries: list[ManifestEntry]) -> bool:
+ if "eval-pack" in eval_path.name:
+ return True
+ datasets = {entry.dataset for entry in entries}
+ if datasets == {"ocrtech-eval-pack"}:
+ return True
+ return any(isinstance(entry.metadata.get("reference_path"), str) and "references" in str(entry.metadata.get("reference_path")) for entry in entries)
+
+
+def _resolve_existing_path(path_value: str, manifest_dir: Path) -> Path | None:
+ raw = Path(path_value)
+ if raw.exists():
+ return raw
+ if not raw.is_absolute():
+ candidate = manifest_dir / raw
+ if candidate.exists():
+ return candidate
+ return None
+
+
+def _resolve_reference_path(
+ entry: ManifestEntry,
+ input_path: Path,
+ manifest_dir: Path,
+ references_root: Path | None,
+) -> Path | None:
+ explicit = entry.metadata.get("reference_path") if entry.metadata else None
+ if isinstance(explicit, str) and explicit:
+ resolved = _resolve_existing_path(explicit, manifest_dir)
+ if resolved is not None:
+ return resolved
+ return None
+ candidates: list[Path] = []
+ if references_root:
+ candidates.extend(
+ [
+ references_root / f"{input_path.stem}.json",
+ references_root / input_path.name / "reference.json",
+ references_root / input_path.stem / "reference.json",
+ references_root / f"{input_path.stem}.txt",
+ references_root / input_path.name / "document.md",
+ references_root / input_path.stem / "document.md",
+ ]
+ )
+ candidates.extend([input_path.with_suffix(input_path.suffix + ".ref.json"), input_path.with_suffix(".ref.json")])
+ candidates.extend([input_path.with_suffix(input_path.suffix + ".ref.txt"), input_path.with_suffix(".ref.txt")])
+ for candidate in candidates:
+ if candidate.exists():
+ return candidate
+ return None
+
+
+def _validate_reference_path(path: Path) -> None:
+ suffixes = path.suffixes
+ if suffixes[-2:] == [".ref", ".json"] or path.suffix == ".json":
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"invalid reference JSON: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError("reference JSON must be an object")
+ return
+ path.read_text(encoding="utf-8")
+
+
+def _normalize_baseline(baseline: str) -> str:
+ normalized = baseline.strip().lower()
+ if not normalized:
+ raise PreflightError("baseline name cannot be empty")
+ return normalized
+
+
+def _write_preflight_report(report: PreflightReport, output_dir: Path) -> None:
+ (output_dir / "preflight.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# OCR Claim Preflight",
+ "",
+ f"Passed: `{'yes' if report.passed else 'no'}`",
+ f"Eval manifest: `{report.eval_manifest}`",
+ f"Samples: `{report.sample_count}`",
+ f"Baselines: `{', '.join(report.baselines)}`",
+ "",
+ "| check | status | summary |",
+ "| --- | --- | --- |",
+ ]
+ for check in report.checks:
+ summary = check.summary.replace("|", "\\|")
+ lines.append(f"| {check.name} | {check.status} | {summary} |")
+ for detail in check.details:
+ escaped_detail = detail.replace("|", "\\|")
+ lines.append(f"| | | {escaped_detail} |")
+ (output_dir / "preflight.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/public_benchmarks.py b/src/ocrtech/public_benchmarks.py
new file mode 100644
index 0000000000000000000000000000000000000000..1cdc0053d3c60a78beead07e10bfb85d9ff0d550
--- /dev/null
+++ b/src/ocrtech/public_benchmarks.py
@@ -0,0 +1,584 @@
+"""Public benchmark manifest readiness checks."""
+
+from __future__ import annotations
+
+import html
+import json
+import re
+import shutil
+from dataclasses import dataclass, field
+from html.parser import HTMLParser
+from pathlib import Path
+from typing import Any
+
+from .datasets import entry_slices
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, sha256_file, sha256_text, write_manifest
+from .normalization import normalize_ocr_text
+from .schemas import TableCell
+
+
+@dataclass(frozen=True, slots=True)
+class PublicBenchmarkSpec:
+ dataset: str
+ title: str
+ url: str
+ min_samples: int
+ required_slices: tuple[str, ...] = ()
+ notes: str = ""
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "dataset": self.dataset,
+ "title": self.title,
+ "url": self.url,
+ "min_samples": self.min_samples,
+ "required_slices": list(self.required_slices),
+ "notes": self.notes,
+ }
+
+
+PUBLIC_BENCHMARKS: dict[str, PublicBenchmarkSpec] = {
+ "opendatalab/OmniDocBench": PublicBenchmarkSpec(
+ dataset="opendatalab/OmniDocBench",
+ title="OmniDocBench",
+ url="https://huggingface.co/datasets/opendatalab/OmniDocBench",
+ min_samples=100,
+ required_slices=("public", "document_parsing"),
+ notes="Real-world document parsing benchmark; use official annotations/scorer when available.",
+ ),
+ "allenai/olmOCR-bench": PublicBenchmarkSpec(
+ dataset="allenai/olmOCR-bench",
+ title="olmOCR-bench",
+ url="https://huggingface.co/datasets/allenai/olmOCR-bench",
+ min_samples=100,
+ required_slices=("public", "pdf", "markdown"),
+ notes="PDF-to-Markdown benchmark with unit-test style assertions.",
+ ),
+ "PaddlePaddle/Real5-OmniDocBench": PublicBenchmarkSpec(
+ dataset="PaddlePaddle/Real5-OmniDocBench",
+ title="Real5-OmniDocBench",
+ url="https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench",
+ min_samples=100,
+ required_slices=("public", "real_world", "document_parsing"),
+ notes="Physical reconstruction benchmark with scanning, warping, screen-photo, illumination, and skew scenarios.",
+ ),
+}
+
+
+@dataclass(slots=True)
+class PublicBenchmarkAudit:
+ manifest_path: str
+ passed: bool
+ benchmark: str
+ sample_count: int
+ dataset_counts: dict[str, int]
+ slice_counts: dict[str, int]
+ spec: dict[str, Any] | None = None
+ issues: list[str] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "passed": self.passed,
+ "benchmark": self.benchmark,
+ "sample_count": self.sample_count,
+ "dataset_counts": self.dataset_counts,
+ "slice_counts": self.slice_counts,
+ "spec": self.spec,
+ "issues": self.issues,
+ "warnings": self.warnings,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class PublicBenchmarkPrepareReport:
+ benchmark: str
+ manifest_path: str
+ references_dir: str
+ sample_count: int
+ filters: dict[str, str | int | bool | None]
+ summary_json_path: str
+ summary_md_path: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "benchmark": self.benchmark,
+ "manifest_path": self.manifest_path,
+ "references_dir": self.references_dir,
+ "sample_count": self.sample_count,
+ "filters": self.filters,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+def list_public_benchmarks() -> list[PublicBenchmarkSpec]:
+ return [PUBLIC_BENCHMARKS[key] for key in sorted(PUBLIC_BENCHMARKS)]
+
+
+def prepare_public_benchmark(
+ benchmark: str,
+ output_dir: str | Path,
+ *,
+ limit: int | None = None,
+ language: str | None = None,
+ subset: str | None = None,
+ data_source: str | None = None,
+ require_tables: bool = False,
+ annotation_path: str | Path | None = None,
+ local_image_root: str | Path | None = None,
+) -> PublicBenchmarkPrepareReport:
+ if benchmark != "opendatalab/OmniDocBench":
+ raise DataValidationError(f"unsupported public benchmark converter: {benchmark}")
+ return _prepare_omnidocbench(
+ output_dir,
+ limit=limit,
+ language=language,
+ subset=subset,
+ data_source=data_source,
+ require_tables=require_tables,
+ annotation_path=annotation_path,
+ local_image_root=local_image_root,
+ )
+
+
+def audit_public_benchmark_manifest(
+ manifest_path: str | Path,
+ output_dir: str | Path | None = None,
+ *,
+ benchmark: str | None = None,
+ min_samples: int | None = None,
+ require_reference_paths: bool = True,
+) -> PublicBenchmarkAudit:
+ path = Path(manifest_path)
+ entries = load_manifest(path)
+ if not entries:
+ raise DataValidationError("public benchmark audit requires a non-empty manifest")
+ benchmark_name = benchmark or _infer_benchmark_name(entries)
+ spec = PUBLIC_BENCHMARKS.get(benchmark_name)
+ required_count = min_samples if min_samples is not None else (spec.min_samples if spec else 1)
+ issues: list[str] = []
+ warnings: list[str] = []
+ dataset_counts: dict[str, int] = {}
+ slice_counts: dict[str, int] = {}
+ for entry in entries:
+ dataset_counts[entry.dataset] = dataset_counts.get(entry.dataset, 0) + 1
+ for slice_name in entry_slices(entry):
+ slice_counts[slice_name] = slice_counts.get(slice_name, 0) + 1
+ metadata = entry.metadata or {}
+ if metadata.get("public_benchmark") is not True:
+ issues.append(f"{entry.sample_id}: metadata.public_benchmark must be true")
+ if not metadata.get("source_url"):
+ issues.append(f"{entry.sample_id}: metadata.source_url is required")
+ if not metadata.get("benchmark_name"):
+ issues.append(f"{entry.sample_id}: metadata.benchmark_name is required")
+ if require_reference_paths:
+ reference_path = metadata.get("reference_path")
+ if not isinstance(reference_path, str) or not reference_path:
+ issues.append(f"{entry.sample_id}: metadata.reference_path is required")
+ elif not Path(reference_path).exists():
+ issues.append(f"{entry.sample_id}: reference_path does not exist: {reference_path}")
+ if len(entries) < required_count:
+ issues.append(f"sample_count {len(entries)} is below required minimum {required_count}")
+ if spec is None:
+ warnings.append(f"benchmark {benchmark_name!r} is not in the public benchmark registry")
+ else:
+ for required_slice in spec.required_slices:
+ if slice_counts.get(required_slice, 0) == 0:
+ issues.append(f"required public benchmark slice missing: {required_slice}")
+ audit = PublicBenchmarkAudit(
+ manifest_path=str(path),
+ passed=not issues,
+ benchmark=benchmark_name,
+ sample_count=len(entries),
+ dataset_counts=dict(sorted(dataset_counts.items())),
+ slice_counts=dict(sorted(slice_counts.items())),
+ spec=spec.to_dict() if spec else None,
+ issues=issues,
+ warnings=warnings,
+ )
+ if output_dir is not None:
+ _write_public_benchmark_audit(audit, Path(output_dir))
+ return audit
+
+
+def _prepare_omnidocbench(
+ output_dir: str | Path,
+ *,
+ limit: int | None,
+ language: str | None,
+ subset: str | None,
+ data_source: str | None,
+ require_tables: bool,
+ annotation_path: str | Path | None,
+ local_image_root: str | Path | None,
+) -> PublicBenchmarkPrepareReport:
+ if limit is not None and limit < 1:
+ raise DataValidationError("limit must be positive when provided")
+ benchmark = "opendatalab/OmniDocBench"
+ out = Path(output_dir)
+ manifest_dir = out / "manifests"
+ image_dir = out / "images"
+ reference_dir = out / "references"
+ manifest_dir.mkdir(parents=True, exist_ok=True)
+ image_dir.mkdir(parents=True, exist_ok=True)
+ reference_dir.mkdir(parents=True, exist_ok=True)
+ rows, repo_files, download_file = _load_omnidocbench_source(annotation_path, local_image_root)
+ entries: list[ManifestEntry] = []
+ for row_index, row in enumerate(rows):
+ if limit is not None and len(entries) >= limit:
+ break
+ if not isinstance(row, dict):
+ raise DataValidationError(f"OmniDocBench row {row_index} must be an object")
+ page_info = row.get("page_info")
+ if not isinstance(page_info, dict):
+ raise DataValidationError(f"OmniDocBench row {row_index} is missing page_info")
+ attributes = page_info.get("page_attribute")
+ if not isinstance(attributes, dict):
+ raise DataValidationError(f"OmniDocBench row {row_index} is missing page_info.page_attribute")
+ if language and str(attributes.get("language")) != language:
+ continue
+ if subset and str(attributes.get("subset")) != subset:
+ continue
+ if data_source and str(attributes.get("data_source")) != data_source:
+ continue
+ layout_dets = row.get("layout_dets")
+ if not isinstance(layout_dets, list):
+ raise DataValidationError(f"OmniDocBench row {row_index} is missing layout_dets")
+ tables = _omnidocbench_reference_tables(layout_dets)
+ if require_tables and not tables:
+ continue
+ image_name = page_info.get("image_path")
+ if not isinstance(image_name, str) or not image_name:
+ raise DataValidationError(f"OmniDocBench row {row_index} page_info.image_path must be a non-empty string")
+ dataset_image_path = image_name if image_name in repo_files else f"images/{image_name}"
+ if dataset_image_path not in repo_files:
+ raise DataValidationError(f"OmniDocBench row {row_index} image file is missing from dataset repo: {dataset_image_path}")
+ source_image = download_file(dataset_image_path)
+ target_image = image_dir / Path(dataset_image_path).name
+ if source_image.resolve() != target_image.resolve():
+ shutil.copy2(source_image, target_image)
+ sample_id = f"omnidocbench-{row_index:05d}-{Path(image_name).stem}"
+ reference_path = reference_dir / f"{sample_id}.ref.json"
+ reference_text = _omnidocbench_reference_text(layout_dets)
+ reference_payload = {
+ "text": reference_text,
+ "tables": tables,
+ "metadata": {
+ "benchmark_name": benchmark,
+ "source_image_path": dataset_image_path,
+ "page_info": page_info,
+ },
+ }
+ reference_path.write_text(json.dumps(reference_payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ image_hash = sha256_file(target_image)
+ text_hash = sha256_text(reference_text)
+ slices = _omnidocbench_slices(attributes, tables=tables, layout_dets=layout_dets)
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset=benchmark,
+ split="eval",
+ image_path=str(target_image),
+ text=reference_text,
+ sha256=image_hash,
+ metadata={
+ "benchmark_name": benchmark,
+ "public_benchmark": True,
+ "source_url": PUBLIC_BENCHMARKS[benchmark].url,
+ "source_image_path": dataset_image_path,
+ "reference_path": str(reference_path),
+ "slices": slices,
+ "text_sha256": text_hash,
+ "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}"),
+ "page_attribute": attributes,
+ "page_no": page_info.get("page_no"),
+ "width": page_info.get("width"),
+ "height": page_info.get("height"),
+ },
+ )
+ )
+ if not entries:
+ raise DataValidationError("No OmniDocBench rows matched the requested filters")
+ manifest_path = manifest_dir / "omnidocbench-eval.jsonl"
+ write_manifest(entries, manifest_path)
+ report = PublicBenchmarkPrepareReport(
+ benchmark=benchmark,
+ manifest_path=str(manifest_path),
+ references_dir=str(reference_dir),
+ sample_count=len(entries),
+ filters={
+ "limit": limit,
+ "language": language,
+ "subset": subset,
+ "data_source": data_source,
+ "require_tables": require_tables,
+ },
+ summary_json_path=str(out / "public-benchmark-prepare.json"),
+ summary_md_path=str(out / "public-benchmark-prepare.md"),
+ )
+ _write_public_benchmark_prepare_report(report)
+ return report
+
+
+def _load_omnidocbench_source(
+ annotation_path: str | Path | None,
+ local_image_root: str | Path | None,
+) -> tuple[list[dict[str, Any]], set[str], Any]:
+ if annotation_path is not None:
+ annotation = Path(annotation_path)
+ if not annotation.exists():
+ raise DataValidationError(f"OmniDocBench annotation path does not exist: {annotation}")
+ root = Path(local_image_root) if local_image_root is not None else annotation.parent
+ files = {str(path.relative_to(root)) for path in root.rglob("*") if path.is_file()}
+
+ def local_download(name: str) -> Path:
+ path = root / name
+ if not path.exists():
+ raise DataValidationError(f"OmniDocBench local image file missing: {path}")
+ return path
+
+ rows = json.loads(annotation.read_text(encoding="utf-8"))
+ if not isinstance(rows, list):
+ raise DataValidationError("OmniDocBench annotation JSON must be a list")
+ return rows, files, local_download
+ try:
+ from huggingface_hub import hf_hub_download, list_repo_files
+ except ImportError as exc:
+ raise DataValidationError("OmniDocBench preparation requires huggingface_hub. Install ocr-tech[datasets].") from exc
+ benchmark = "opendatalab/OmniDocBench"
+ try:
+ annotation = Path(hf_hub_download(repo_id=benchmark, repo_type="dataset", filename="OmniDocBench.json"))
+ files = set(list_repo_files(repo_id=benchmark, repo_type="dataset"))
+ except Exception as exc:
+ raise DataValidationError(f"Failed to inspect OmniDocBench dataset repo: {exc}") from exc
+
+ def hf_download(name: str) -> Path:
+ try:
+ return Path(hf_hub_download(repo_id=benchmark, repo_type="dataset", filename=name))
+ except Exception as exc:
+ raise DataValidationError(f"Failed to download OmniDocBench file {name!r}: {exc}") from exc
+
+ rows = json.loads(annotation.read_text(encoding="utf-8"))
+ if not isinstance(rows, list):
+ raise DataValidationError("OmniDocBench annotation JSON must be a list")
+ return rows, files, hf_download
+
+
+def _omnidocbench_reference_text(layout_dets: list[Any]) -> str:
+ parts: list[str] = []
+ for item in sorted(_valid_layout_items(layout_dets), key=lambda value: int(value.get("order", 0) or 0)):
+ category = str(item.get("category_type") or "")
+ if category == "table" and isinstance(item.get("html"), str):
+ text = _html_to_text(str(item["html"]))
+ else:
+ text = str(item.get("text") or "")
+ text = normalize_ocr_text(text, collapse_spaces=True).strip()
+ if text:
+ parts.append(text)
+ return "\n".join(parts)
+
+
+def _omnidocbench_reference_tables(layout_dets: list[Any]) -> list[dict[str, Any]]:
+ tables: list[dict[str, Any]] = []
+ for item in sorted(_valid_layout_items(layout_dets), key=lambda value: int(value.get("order", 0) or 0)):
+ if item.get("category_type") != "table" or not isinstance(item.get("html"), str):
+ continue
+ cells = _table_cells_from_html(str(item["html"]))
+ if cells:
+ tables.append(
+ {
+ "cells": [cell.to_dict() for cell in cells],
+ "metadata": {"anno_id": item.get("anno_id"), "order": item.get("order")},
+ }
+ )
+ return tables
+
+
+def _valid_layout_items(layout_dets: list[Any]) -> list[dict[str, Any]]:
+ return [item for item in layout_dets if isinstance(item, dict) and not bool(item.get("ignore", False))]
+
+
+def _omnidocbench_slices(attributes: dict[str, Any], *, tables: list[dict[str, Any]], layout_dets: list[Any]) -> list[str]:
+ slices = ["public", "document_parsing"]
+ language = str(attributes.get("language") or "")
+ if language:
+ slices.append(language)
+ if language == "english":
+ slices.append("english")
+ if "chinese" in language:
+ slices.append("chinese")
+ subset = str(attributes.get("subset") or "")
+ if subset:
+ slices.append(subset)
+ source = str(attributes.get("data_source") or "")
+ if source:
+ slices.append(source)
+ categories = {str(item.get("category_type") or "") for item in _valid_layout_items(layout_dets)}
+ if tables:
+ slices.append("table")
+ if any("figure" in category for category in categories):
+ slices.append("figure")
+ if any("equation" in category for category in categories):
+ slices.append("equation")
+ return sorted(set(slices))
+
+
+class _PlainHtmlTextExtractor(HTMLParser):
+ def __init__(self) -> None:
+ super().__init__()
+ self.parts: list[str] = []
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ if tag in {"tr", "br", "p", "div"}:
+ self.parts.append("\n")
+ if tag in {"td", "th"}:
+ self.parts.append(" ")
+
+ def handle_data(self, data: str) -> None:
+ self.parts.append(data)
+
+ def text(self) -> str:
+ value = re.sub(r"\n{3,}", "\n\n", re.sub(r"[ \t]+", " ", html.unescape("".join(self.parts)))).strip()
+ return "\n".join(line.strip() for line in value.splitlines() if line.strip())
+
+
+def _html_to_text(value: str) -> str:
+ parser = _PlainHtmlTextExtractor()
+ parser.feed(value)
+ parser.close()
+ return parser.text()
+
+
+class _TableHtmlParser(HTMLParser):
+ def __init__(self) -> None:
+ super().__init__()
+ self.cells: list[TableCell] = []
+ self._row = -1
+ self._col = 0
+ self._occupied: set[tuple[int, int]] = set()
+ self._cell_text: list[str] | None = None
+ self._rowspan = 1
+ self._colspan = 1
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ if tag == "tr":
+ self._row += 1
+ self._col = 0
+ return
+ if tag not in {"td", "th"} or self._row < 0:
+ return
+ while (self._row, self._col) in self._occupied:
+ self._col += 1
+ attrs_dict = {key.lower(): value for key, value in attrs}
+ self._rowspan = _positive_int(attrs_dict.get("rowspan"), default=1)
+ self._colspan = _positive_int(attrs_dict.get("colspan"), default=1)
+ self._cell_text = []
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag not in {"td", "th"} or self._cell_text is None:
+ return
+ text = normalize_ocr_text(html.unescape("".join(self._cell_text)), collapse_spaces=True).strip()
+ self.cells.append(TableCell(row=self._row, col=self._col, text=text, rowspan=self._rowspan, colspan=self._colspan))
+ for row_offset in range(self._rowspan):
+ for col_offset in range(self._colspan):
+ if row_offset or col_offset:
+ self._occupied.add((self._row + row_offset, self._col + col_offset))
+ self._col += self._colspan
+ self._cell_text = None
+ self._rowspan = 1
+ self._colspan = 1
+
+ def handle_data(self, data: str) -> None:
+ if self._cell_text is not None:
+ self._cell_text.append(data)
+
+
+def _positive_int(value: str | None, *, default: int) -> int:
+ if value is None:
+ return default
+ try:
+ parsed = int(value)
+ except ValueError:
+ return default
+ return parsed if parsed >= 1 else default
+
+
+def _table_cells_from_html(value: str) -> list[TableCell]:
+ parser = _TableHtmlParser()
+ parser.feed(value)
+ parser.close()
+ return parser.cells
+
+
+def _infer_benchmark_name(entries: list[ManifestEntry]) -> str:
+ names = sorted({str(entry.metadata.get("benchmark_name") or entry.dataset) for entry in entries})
+ if len(names) != 1:
+ raise DataValidationError(f"public benchmark manifest must contain exactly one benchmark, got: {names}")
+ return names[0]
+
+
+def _write_public_benchmark_audit(audit: PublicBenchmarkAudit, out: Path) -> None:
+ out.mkdir(parents=True, exist_ok=True)
+ json_path = out / "public-benchmark-audit.json"
+ md_path = out / "public-benchmark-audit.md"
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ md_path.write_text(_render_public_benchmark_audit(audit), encoding="utf-8")
+
+
+def _render_public_benchmark_audit(audit: PublicBenchmarkAudit) -> str:
+ lines = [
+ "# Public Benchmark Audit",
+ "",
+ f"Status: `{'pass' if audit.passed else 'fail'}`",
+ f"Benchmark: `{audit.benchmark}`",
+ f"Samples: `{audit.sample_count}`",
+ "",
+ "## Datasets",
+ "",
+ ]
+ for dataset, count in audit.dataset_counts.items():
+ lines.append(f"- `{dataset}`: `{count}`")
+ lines.extend(["", "## Slices", ""])
+ for slice_name, count in audit.slice_counts.items():
+ lines.append(f"- `{slice_name}`: `{count}`")
+ if audit.issues:
+ lines.extend(["", "## Issues", ""])
+ lines.extend(f"- {issue}" for issue in audit.issues)
+ if audit.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings)
+ return "\n".join(lines) + "\n"
+
+
+def _write_public_benchmark_prepare_report(report: PublicBenchmarkPrepareReport) -> None:
+ json_path = Path(report.summary_json_path)
+ md_path = Path(report.summary_md_path)
+ json_path.parent.mkdir(parents=True, exist_ok=True)
+ json_path.write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ md_path.write_text(_render_public_benchmark_prepare_report(report), encoding="utf-8")
+
+
+def _render_public_benchmark_prepare_report(report: PublicBenchmarkPrepareReport) -> str:
+ lines = [
+ "# Public Benchmark Prepare Report",
+ "",
+ f"Benchmark: `{report.benchmark}`",
+ f"Samples: `{report.sample_count}`",
+ f"Manifest: `{report.manifest_path}`",
+ f"References: `{report.references_dir}`",
+ "",
+ "## Filters",
+ "",
+ ]
+ for name, value in report.filters.items():
+ lines.append(f"- `{name}`: `{value}`")
+ return "\n".join(lines) + "\n"
diff --git a/src/ocrtech/quality.py b/src/ocrtech/quality.py
new file mode 100644
index 0000000000000000000000000000000000000000..078836204d8620d1e84c6fc95481501b956d33e7
--- /dev/null
+++ b/src/ocrtech/quality.py
@@ -0,0 +1,135 @@
+"""Quality and confidence reporting for parsed documents."""
+
+from __future__ import annotations
+
+from dataclasses import dataclass, field
+from typing import Any
+
+from .schemas import Document
+
+
+@dataclass(slots=True)
+class QualityIssue:
+ severity: str
+ code: str
+ message: str
+ sample: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {"severity": self.severity, "code": self.code, "message": self.message, "sample": self.sample}
+
+
+@dataclass(slots=True)
+class DocumentQuality:
+ passed: bool
+ quality_score: float
+ metrics: dict[str, float | int | None]
+ issues: list[QualityIssue] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "quality_score": self.quality_score,
+ "metrics": self.metrics,
+ "issues": [issue.to_dict() for issue in self.issues],
+ }
+
+
+def evaluate_document_quality(
+ document: Document,
+ *,
+ min_line_confidence: float = 0.80,
+ min_quality_score: float = 0.70,
+) -> DocumentQuality:
+ lines = [line for page in document.pages for line in page.text_lines]
+ blocks = [block for page in document.pages for block in page.blocks]
+ confidences = [line.confidence for line in lines if line.confidence is not None]
+ low_confidence = [line for line in lines if line.confidence is not None and line.confidence < min_line_confidence]
+ missing_confidence = [line for line in lines if line.confidence is None]
+ empty_lines = [line for line in lines if not line.text.strip()]
+ tables_without_cells = [table for table in document.tables if not table.cells]
+ blocks_without_lines = [block for block in blocks if block.block_type in {"text", "title", "table"} and not block.line_ids]
+
+ metrics: dict[str, float | int | None] = {
+ "page_count": len(document.pages),
+ "line_count": len(lines),
+ "block_count": len(blocks),
+ "table_count": len(document.tables),
+ "figure_count": len(document.figures),
+ "average_line_confidence": sum(confidences) / len(confidences) if confidences else None,
+ "minimum_line_confidence": min(confidences) if confidences else None,
+ "low_confidence_line_count": len(low_confidence),
+ "missing_confidence_line_count": len(missing_confidence),
+ "empty_text_line_count": len(empty_lines),
+ "tables_without_cells": len(tables_without_cells),
+ "blocks_without_lines": len(blocks_without_lines),
+ }
+ issues: list[QualityIssue] = []
+ if not document.pages:
+ issues.append(QualityIssue("error", "no_pages", "document contains no pages"))
+ if not lines:
+ issues.append(QualityIssue("error", "no_text_lines", "document contains no OCR text lines"))
+ if blocks and not document.text.strip():
+ issues.append(QualityIssue("error", "empty_document_text", "document blocks contain no text"))
+ if missing_confidence:
+ issues.append(
+ QualityIssue(
+ "warning",
+ "missing_line_confidence",
+ f"{len(missing_confidence)} text lines have no confidence score",
+ sample=missing_confidence[0].line_id,
+ )
+ )
+ if low_confidence:
+ issues.append(
+ QualityIssue(
+ "warning",
+ "low_line_confidence",
+ f"{len(low_confidence)} text lines are below confidence threshold {min_line_confidence}",
+ sample=low_confidence[0].line_id,
+ )
+ )
+ if tables_without_cells:
+ issues.append(
+ QualityIssue(
+ "warning",
+ "table_without_cells",
+ f"{len(tables_without_cells)} tables have no cells",
+ sample=tables_without_cells[0].table_id,
+ )
+ )
+ if blocks_without_lines:
+ issues.append(
+ QualityIssue(
+ "warning",
+ "block_without_lines",
+ f"{len(blocks_without_lines)} text/table blocks have no source line ids",
+ sample=blocks_without_lines[0].block_id,
+ )
+ )
+
+ score = _quality_score(metrics, len(lines))
+ if score < min_quality_score:
+ issues.append(QualityIssue("error", "quality_score_below_threshold", f"quality score {score:.4f} < required {min_quality_score:.4f}"))
+ passed = not any(issue.severity == "error" for issue in issues)
+ return DocumentQuality(passed=passed, quality_score=score, metrics=metrics, issues=issues)
+
+
+def _quality_score(metrics: dict[str, float | int | None], line_count: int) -> float:
+ if line_count <= 0:
+ return 0.0
+ penalty = 0.0
+ low = int(metrics["low_confidence_line_count"] or 0)
+ missing = int(metrics["missing_confidence_line_count"] or 0)
+ empty = int(metrics["empty_text_line_count"] or 0)
+ tables_without_cells = int(metrics["tables_without_cells"] or 0)
+ blocks_without_lines = int(metrics["blocks_without_lines"] or 0)
+ penalty += low / line_count * 0.35
+ penalty += missing / line_count * 0.20
+ penalty += empty / line_count * 0.20
+ penalty += min(0.15, tables_without_cells * 0.05)
+ penalty += min(0.10, blocks_without_lines * 0.02)
+ confidence = metrics.get("average_line_confidence")
+ if isinstance(confidence, int | float):
+ penalty += max(0.0, 0.95 - float(confidence)) * 0.20
+ return round(max(0.0, min(1.0, 1.0 - penalty)), 6)
diff --git a/src/ocrtech/references.py b/src/ocrtech/references.py
new file mode 100644
index 0000000000000000000000000000000000000000..da4236d1a4a8bd940d70c82441c6c2dcc945ba7e
--- /dev/null
+++ b/src/ocrtech/references.py
@@ -0,0 +1,465 @@
+"""Reference document loading and scoring helpers."""
+
+from __future__ import annotations
+
+import json
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, write_manifest
+from .markdown import render_document_markdown
+from .metrics import bbox_iou, cer, detection_score, reading_order_pair_accuracy, table_cell_score, table_structure_similarity, table_teds_structure, table_teds_text, wer
+from .normalization import normalize_ocr_text
+from .schemas import BBox, Document, Figure, TableCell
+from .tables import cells_to_grid, table_to_grid
+
+
+@dataclass(slots=True)
+class ReferenceTable:
+ cells: list[TableCell] = field(default_factory=list)
+
+ @property
+ def grid(self) -> list[list[str]]:
+ return cells_to_grid(self.cells)
+
+
+@dataclass(slots=True)
+class ReferenceFigure:
+ caption: str | None = None
+ bbox: BBox | None = None
+ page_index: int = 0
+ figure_id: str | None = None
+ line_ids: list[str] = field(default_factory=list)
+
+
+@dataclass(slots=True)
+class ReferenceDocument:
+ text: str | None = None
+ markdown: str | None = None
+ reading_order: list[str] | None = None
+ tables: list[ReferenceTable] = field(default_factory=list)
+ figures: list[ReferenceFigure] = field(default_factory=list)
+ metadata: dict[str, Any] = field(default_factory=dict)
+
+
+@dataclass(slots=True)
+class ReferencePackReport:
+ references_dir: str
+ source_manifest: str
+ rewritten_manifest: str | None
+ sample_count: int
+ summary_json_path: str
+ summary_md_path: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "references_dir": self.references_dir,
+ "source_manifest": self.source_manifest,
+ "rewritten_manifest": self.rewritten_manifest,
+ "sample_count": self.sample_count,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+def load_reference(input_path: Path, reference_root: Path | None = None, *, explicit_path: str | Path | None = None) -> ReferenceDocument | None:
+ if explicit_path is not None:
+ explicit_candidate = Path(explicit_path)
+ if _is_json_reference_path(explicit_candidate):
+ payload = _load_reference_json_candidates([explicit_candidate])
+ if payload is not None:
+ return _reference_from_payload(payload)
+ else:
+ text_reference = _load_reference_text_candidates([explicit_candidate])
+ if text_reference is not None:
+ return _reference_from_text_path(text_reference[0], text_reference[1])
+ payload = _load_reference_json(input_path, reference_root)
+ if payload is not None:
+ return _reference_from_payload(payload)
+ text_reference = _load_reference_text(input_path, reference_root)
+ if text_reference is not None:
+ return _reference_from_text_path(text_reference[0], text_reference[1])
+ return None
+
+
+def materialize_references(
+ manifest_path: str | Path,
+ output_dir: str | Path,
+ *,
+ rewritten_manifest_path: str | Path | None = None,
+) -> ReferencePackReport:
+ entries = load_manifest(manifest_path)
+ if not entries:
+ raise DataValidationError("reference materialization requires a non-empty manifest")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ rewritten_entries: list[ManifestEntry] = []
+ for entry in entries:
+ sample_dir = out / entry.sample_id
+ sample_dir.mkdir(parents=True, exist_ok=True)
+ reference_path = sample_dir / "document.md"
+ reference_path.write_text(_reference_text_from_manifest_entry(entry), encoding="utf-8")
+ metadata = dict(entry.metadata or {})
+ metadata["reference_path"] = str(reference_path)
+ rewritten_entries.append(
+ ManifestEntry(
+ sample_id=entry.sample_id,
+ dataset=entry.dataset,
+ split=entry.split,
+ image_path=entry.image_path,
+ text=entry.text,
+ sha256=entry.sha256,
+ metadata=metadata,
+ )
+ )
+ rewritten_manifest = Path(rewritten_manifest_path) if rewritten_manifest_path is not None else None
+ if rewritten_manifest is not None:
+ rewritten_manifest.parent.mkdir(parents=True, exist_ok=True)
+ write_manifest(rewritten_entries, rewritten_manifest)
+ summary_json = out / "reference-pack.json"
+ summary_md = out / "reference-pack.md"
+ report = ReferencePackReport(
+ references_dir=str(out),
+ source_manifest=str(Path(manifest_path)),
+ rewritten_manifest=str(rewritten_manifest) if rewritten_manifest is not None else None,
+ sample_count=len(entries),
+ summary_json_path=str(summary_json),
+ summary_md_path=str(summary_md),
+ )
+ summary_json.write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ summary_md.write_text(
+ "\n".join(
+ [
+ "# Reference Pack",
+ "",
+ f"Source manifest: `{manifest_path}`",
+ f"References dir: `{out}`",
+ f"Samples: `{len(entries)}`",
+ f"Rewritten manifest: `{rewritten_manifest or ''}`",
+ ]
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ return report
+
+
+def score_document(document: Document | None, text: str, reference: ReferenceDocument | None) -> dict[str, float]:
+ if reference is None:
+ return {}
+ metrics: dict[str, float] = {}
+ if reference.text is not None:
+ pred = text.strip()
+ ref = reference.text.strip()
+ metrics["cer"] = cer(pred, ref)
+ metrics["wer"] = wer(pred, ref)
+ metrics["text_cer"] = metrics["cer"]
+ metrics["text_wer"] = metrics["wer"]
+ if document is not None and reference.markdown is not None:
+ predicted_markdown = render_document_markdown(document).strip()
+ reference_markdown = reference.markdown.strip()
+ reconstruction_cer = cer(predicted_markdown, reference_markdown)
+ metrics["document_reconstruction_cer"] = reconstruction_cer
+ metrics["document_reconstruction_wer"] = wer(predicted_markdown, reference_markdown)
+ metrics["document_reconstruction_similarity"] = max(0.0, 1.0 - reconstruction_cer)
+ if document is not None and reference.reading_order:
+ predicted_order = _document_reading_order(document)
+ metrics["reading_order_pair_accuracy"] = reading_order_pair_accuracy(predicted_order, reference.reading_order)
+ if document is not None and reference.tables:
+ table_scores = []
+ structure_scores: list[float] = []
+ teds_structure_scores: list[float] = []
+ teds_text_scores: list[float] = []
+ exact_matches: list[float] = []
+ predicted_tables = sorted(document.tables, key=lambda item: (item.page_index, item.bbox.y, item.bbox.x))
+ table_matches = _match_tables(predicted_tables, reference.tables)
+ for reference_table, predicted_table in table_matches:
+ predicted_grid = table_to_grid(predicted_table) if predicted_table is not None else []
+ predicted_cells = predicted_table.cells if predicted_table is not None else []
+ table_scores.append(table_cell_score(predicted_grid, reference_table.grid))
+ structure_scores.append(table_structure_similarity(predicted_cells, reference_table.cells))
+ teds_structure_scores.append(table_teds_structure(predicted_cells, reference_table.cells))
+ teds_text_scores.append(table_teds_text(predicted_cells, reference_table.cells))
+ exact_matches.append(1.0 if _table_cells_exact(predicted_cells, reference_table.cells) else 0.0)
+ if table_scores:
+ metrics["table_cell_precision"] = sum(item.precision for item in table_scores) / len(table_scores)
+ metrics["table_cell_recall"] = sum(item.recall for item in table_scores) / len(table_scores)
+ metrics["table_cell_f1"] = sum(item.f1 for item in table_scores) / len(table_scores)
+ metrics["table_exact_match"] = sum(exact_matches) / len(exact_matches)
+ metrics["table_structure_similarity"] = sum(structure_scores) / len(structure_scores)
+ metrics["table_teds_structure"] = sum(teds_structure_scores) / len(teds_structure_scores)
+ metrics["table_teds_text"] = sum(teds_text_scores) / len(teds_text_scores)
+ if document is not None and reference.figures:
+ figure_metrics = _score_figures(document.figures, reference.figures)
+ metrics.update(figure_metrics)
+ return metrics
+
+
+def _match_tables(predicted_tables: list[Any], reference_tables: list[ReferenceTable]) -> list[tuple[ReferenceTable, Any | None]]:
+ matches: list[tuple[ReferenceTable, Any | None]] = []
+ unused = set(range(len(predicted_tables)))
+ for reference_table in reference_tables:
+ best_index: int | None = None
+ best_score: tuple[float, float, float] | None = None
+ for index in sorted(unused):
+ predicted_table = predicted_tables[index]
+ score = _table_match_score(predicted_table, reference_table)
+ if best_score is None or score > best_score:
+ best_score = score
+ best_index = index
+ if best_index is None:
+ matches.append((reference_table, None))
+ continue
+ unused.remove(best_index)
+ matches.append((reference_table, predicted_tables[best_index]))
+ return matches
+
+
+def _table_match_score(predicted_table: Any, reference_table: ReferenceTable) -> tuple[float, float, float]:
+ predicted_cells = predicted_table.cells if predicted_table is not None else []
+ predicted_grid = table_to_grid(predicted_table) if predicted_table is not None else []
+ cell_score = table_cell_score(predicted_grid, reference_table.grid)
+ return (
+ table_teds_text(predicted_cells, reference_table.cells),
+ table_teds_structure(predicted_cells, reference_table.cells),
+ cell_score.f1,
+ )
+
+
+def _document_reading_order(document: Document) -> list[str]:
+ ordered: list[str] = []
+ for page in sorted(document.pages, key=lambda item: item.page_index):
+ for block in sorted(page.blocks, key=lambda item: item.order):
+ if block.line_ids:
+ ordered.extend(line_id for line_id in block.line_ids if line_id)
+ else:
+ ordered.append(block.block_id)
+ return ordered
+
+
+def _load_reference_json(input_path: Path, reference_root: Path | None) -> dict[str, Any] | None:
+ candidates: list[Path] = []
+ if reference_root:
+ candidates.extend(
+ [
+ reference_root / f"{input_path.stem}.json",
+ reference_root / input_path.name / "reference.json",
+ reference_root / input_path.stem / "reference.json",
+ ]
+ )
+ candidates.extend([input_path.with_suffix(input_path.suffix + ".ref.json"), input_path.with_suffix(".ref.json")])
+ return _load_reference_json_candidates(candidates)
+
+
+def _load_reference_json_candidates(candidates: list[Path]) -> dict[str, Any] | None:
+ for candidate in candidates:
+ if candidate.exists():
+ try:
+ payload = json.loads(candidate.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid reference JSON {candidate}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"Reference JSON must be an object: {candidate}")
+ return payload
+ return None
+
+
+def _load_reference_text(input_path: Path, reference_root: Path | None) -> tuple[str, Path] | None:
+ candidates: list[Path] = []
+ if reference_root:
+ candidates.extend(
+ [
+ reference_root / f"{input_path.stem}.txt",
+ reference_root / input_path.name / "document.md",
+ reference_root / input_path.stem / "document.md",
+ ]
+ )
+ candidates.extend([input_path.with_suffix(input_path.suffix + ".ref.txt"), input_path.with_suffix(".ref.txt")])
+ return _load_reference_text_candidates(candidates)
+
+
+def _load_reference_text_candidates(candidates: list[Path]) -> tuple[str, Path] | None:
+ for candidate in candidates:
+ if candidate.exists():
+ return candidate.read_text(encoding="utf-8"), candidate
+ return None
+
+
+def _reference_from_text_path(text: str, path: Path) -> ReferenceDocument:
+ markdown = text if _is_markdown_reference_path(path) else None
+ return ReferenceDocument(text=text, markdown=markdown)
+
+
+def _is_markdown_reference_path(path: Path) -> bool:
+ return path.suffix.lower() in {".md", ".markdown"} or path.name == "document.md"
+
+
+def _reference_text_from_manifest_entry(entry: ManifestEntry) -> str:
+ text = entry.text.rstrip("\n")
+ return text + "\n"
+
+
+def _is_json_reference_path(path: Path) -> bool:
+ return path.suffix.lower() == ".json" or path.name.endswith(".ref.json") or path.name == "reference.json"
+
+
+def _reference_from_payload(payload: dict[str, Any]) -> ReferenceDocument:
+ text = payload.get("text")
+ if text is not None and not isinstance(text, str):
+ raise DataValidationError("reference text must be a string")
+ markdown = _reference_markdown_from_payload(payload)
+ reading_order = payload.get("reading_order")
+ if reading_order is not None:
+ if not isinstance(reading_order, list) or not all(isinstance(item, str) for item in reading_order):
+ raise DataValidationError("reference reading_order must be a list of strings")
+ tables_payload = payload.get("tables", [])
+ if not isinstance(tables_payload, list):
+ raise DataValidationError("reference tables must be a list")
+ tables = [_coerce_reference_table(item) for item in tables_payload]
+ figures_payload = payload.get("figures", [])
+ if not isinstance(figures_payload, list):
+ raise DataValidationError("reference figures must be a list")
+ figures = [_coerce_reference_figure(item) for item in figures_payload]
+ return ReferenceDocument(
+ text=normalize_ocr_text(text) if text is not None else None,
+ markdown=normalize_ocr_text(markdown) if markdown is not None else None,
+ reading_order=reading_order,
+ tables=tables,
+ figures=figures,
+ metadata=dict(payload.get("metadata") or {}),
+ )
+
+
+def _reference_markdown_from_payload(payload: dict[str, Any]) -> str | None:
+ for key in ("markdown", "document_markdown", "reconstruction_markdown"):
+ value = payload.get(key)
+ if value is None:
+ continue
+ if not isinstance(value, str):
+ raise DataValidationError(f"reference {key} must be a string")
+ return value
+ return None
+
+
+def _coerce_reference_table(value: Any) -> ReferenceTable:
+ if isinstance(value, dict):
+ if "cells" in value and _looks_like_cell_objects(value["cells"]):
+ return ReferenceTable(cells=[_coerce_reference_table_cell(item) for item in value["cells"]])
+ value = value.get("grid") or value.get("cells")
+ if not isinstance(value, list):
+ raise DataValidationError("reference table must be a grid or object with grid/cells")
+ cells: list[TableCell] = []
+ for row_index, row in enumerate(value):
+ if not isinstance(row, list):
+ raise DataValidationError("reference table row must be a list")
+ for col_index, cell in enumerate(row):
+ cells.append(TableCell(row=row_index, col=col_index, text=normalize_ocr_text(str(cell))))
+ return ReferenceTable(cells=cells)
+
+
+def _looks_like_cell_objects(value: Any) -> bool:
+ return isinstance(value, list) and all(isinstance(item, dict) and {"row", "col", "text"} <= set(item) for item in value)
+
+
+def _coerce_reference_table_cell(value: Any) -> TableCell:
+ if not isinstance(value, dict):
+ raise DataValidationError("reference table cell must be an object")
+ return TableCell(
+ row=int(value.get("row", 0)),
+ col=int(value.get("col", 0)),
+ text=normalize_ocr_text(str(value.get("text", ""))),
+ rowspan=int(value.get("rowspan", 1)),
+ colspan=int(value.get("colspan", 1)),
+ )
+
+
+def _table_cells_exact(predicted: list[TableCell], reference: list[TableCell]) -> bool:
+ return _cell_signature(predicted) == _cell_signature(reference)
+
+
+def _cell_signature(cells: list[TableCell]) -> list[tuple[int, int, int, int, str]]:
+ return sorted(
+ (
+ cell.row,
+ cell.col,
+ cell.rowspan,
+ cell.colspan,
+ normalize_ocr_text(cell.text, collapse_spaces=True),
+ )
+ for cell in cells
+ )
+
+
+def _coerce_reference_figure(value: Any) -> ReferenceFigure:
+ if not isinstance(value, dict):
+ raise DataValidationError("reference figure must be an object")
+ bbox_payload = value.get("bbox")
+ line_ids = value.get("line_ids", [])
+ if not isinstance(line_ids, list) or not all(isinstance(item, str) for item in line_ids):
+ raise DataValidationError("reference figure line_ids must be a list of strings")
+ caption = value.get("caption")
+ if caption is not None and not isinstance(caption, str):
+ raise DataValidationError("reference figure caption must be a string")
+ return ReferenceFigure(
+ caption=normalize_ocr_text(caption) if caption is not None else None,
+ bbox=BBox.from_any(bbox_payload) if bbox_payload is not None else None,
+ page_index=int(value.get("page_index", 0)),
+ figure_id=value.get("figure_id"),
+ line_ids=line_ids,
+ )
+
+
+def _score_figures(predicted: list[Figure], reference: list[ReferenceFigure]) -> dict[str, float]:
+ matches = _match_figures(predicted, reference)
+ score = detection_score(len(predicted), len(reference), len(matches))
+ metrics: dict[str, float] = {
+ "figure_detection_precision": score.precision,
+ "figure_detection_recall": score.recall,
+ "figure_detection_f1": score.f1,
+ }
+ caption_errors: list[float] = []
+ for predicted_index, reference_index in matches:
+ ref_caption = reference[reference_index].caption
+ pred_caption = predicted[predicted_index].caption or predicted[predicted_index].summary
+ if ref_caption is not None:
+ caption_errors.append(cer(pred_caption or "", ref_caption))
+ if caption_errors:
+ metrics["figure_caption_cer"] = sum(caption_errors) / len(caption_errors)
+ return metrics
+
+
+def _match_figures(predicted: list[Figure], reference: list[ReferenceFigure]) -> list[tuple[int, int]]:
+ used_predicted: set[int] = set()
+ matches: list[tuple[int, int]] = []
+ for ref_index, ref in enumerate(reference):
+ best: tuple[float, int] | None = None
+ for pred_index, pred in enumerate(predicted):
+ if pred_index in used_predicted or pred.page_index != ref.page_index:
+ continue
+ score = _figure_match_score(pred, ref)
+ if score <= 0:
+ continue
+ if best is None or score > best[0]:
+ best = (score, pred_index)
+ if best is not None:
+ used_predicted.add(best[1])
+ matches.append((best[1], ref_index))
+ return matches
+
+
+def _figure_match_score(predicted: Figure, reference: ReferenceFigure) -> float:
+ if reference.bbox is not None:
+ iou = bbox_iou(predicted.bbox, reference.bbox)
+ if iou >= 0.5:
+ return iou
+ if reference.caption and predicted.caption:
+ caption_error = cer(predicted.caption, reference.caption)
+ if caption_error <= 0.25:
+ return 1.0 - caption_error
+ if reference.line_ids:
+ source_ids = set(predicted.metadata.get("line_ids", [])) if isinstance(predicted.metadata, dict) else set()
+ if source_ids & set(reference.line_ids):
+ return 0.75
+ return 0.0
diff --git a/src/ocrtech/remote.py b/src/ocrtech/remote.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa2adf437cce7b3ac9c3df199382727fc7e9c917
--- /dev/null
+++ b/src/ocrtech/remote.py
@@ -0,0 +1,816 @@
+"""Remote host readiness checks for training and benchmark campaigns."""
+
+from __future__ import annotations
+
+import base64
+import json
+import os
+import subprocess
+import tempfile
+import textwrap
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import RemoteAuditError
+
+
+@dataclass(slots=True)
+class RemoteCheck:
+ name: str
+ status: str
+ summary: str
+ details: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "name": self.name,
+ "status": self.status,
+ "summary": self.summary,
+ "details": self.details,
+ }
+
+
+@dataclass(slots=True)
+class RemoteAuditReport:
+ passed: bool
+ host: str
+ user: str | None
+ workdir: str | None
+ checks: list[RemoteCheck]
+ probe: dict[str, Any]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "host": self.host,
+ "user": self.user,
+ "workdir": self.workdir,
+ "checks": [check.to_dict() for check in self.checks],
+ "probe": self.probe,
+ }
+
+
+@dataclass(slots=True)
+class RemoteBootstrapReport:
+ passed: bool
+ host: str
+ user: str | None
+ workdir: str
+ python_command: str
+ venv_dir: str
+ actions: dict[str, Any]
+ checks: list[RemoteCheck]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "host": self.host,
+ "user": self.user,
+ "workdir": self.workdir,
+ "python_command": self.python_command,
+ "venv_dir": self.venv_dir,
+ "actions": self.actions,
+ "checks": [check.to_dict() for check in self.checks],
+ }
+
+
+@dataclass(slots=True)
+class RemoteSyncReport:
+ passed: bool
+ host: str
+ user: str | None
+ local_root: str
+ remote_workdir: str
+ archive_path: str
+ checks: list[RemoteCheck]
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "host": self.host,
+ "user": self.user,
+ "local_root": self.local_root,
+ "remote_workdir": self.remote_workdir,
+ "archive_path": self.archive_path,
+ "checks": [check.to_dict() for check in self.checks],
+ }
+
+
+DEFAULT_PYTHON_CANDIDATES = [
+ "python3.11",
+ "~/.local/bin/python3.11",
+ "/opt/homebrew/bin/python3.11",
+ "python3.12",
+ "python3.13",
+ "python3",
+ "python",
+]
+
+
+def audit_remote_host(
+ host: str,
+ output_dir: str | Path,
+ *,
+ user: str | None = None,
+ port: int = 22,
+ password_env: str | None = None,
+ min_python: tuple[int, int] = (3, 11),
+ min_free_gb: float = 20.0,
+ workdir: str | None = None,
+ require_gpu: bool = False,
+ require_paddle_training: bool = False,
+ python_candidates: list[str] | None = None,
+ require_commands: list[str] | None = None,
+ optional_commands: list[str] | None = None,
+ require_paths: list[str] | None = None,
+) -> RemoteAuditReport:
+ if not host.strip():
+ raise RemoteAuditError("host is required")
+ if port < 1 or port > 65535:
+ raise RemoteAuditError(f"invalid port: {port}")
+ if password_env:
+ if password_env not in os.environ:
+ raise RemoteAuditError(f"password env var is not set: {password_env}")
+ if not shutil_which("expect"):
+ raise RemoteAuditError("password-based remote audit requires local expect")
+ required = require_commands or ["git"]
+ optional = optional_commands or ["uv", "nvidia-smi"]
+ paths = require_paths or []
+ python_names = python_candidates or DEFAULT_PYTHON_CANDIDATES
+ probe = _probe_remote(
+ host,
+ user=user,
+ port=port,
+ password_env=password_env,
+ workdir=workdir,
+ command_names=sorted({*required, *optional}),
+ path_checks=paths,
+ python_candidates=python_names,
+ )
+ checks = _evaluate_probe(
+ probe,
+ min_python=min_python,
+ min_free_gb=min_free_gb,
+ require_gpu=require_gpu,
+ require_paddle_training=require_paddle_training,
+ python_candidates=python_names,
+ require_commands=required,
+ optional_commands=optional,
+ require_paths=paths,
+ workdir=workdir,
+ )
+ report = RemoteAuditReport(
+ passed=all(check.status != "fail" for check in checks),
+ host=host,
+ user=user,
+ workdir=workdir,
+ checks=checks,
+ probe=probe,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ _write_remote_audit(report, out)
+ return report
+
+
+def bootstrap_remote_host(
+ host: str,
+ output_dir: str | Path,
+ *,
+ user: str | None = None,
+ port: int = 22,
+ password_env: str | None = None,
+ workdir: str,
+ min_python: tuple[int, int] = (3, 11),
+ python_candidates: list[str] | None = None,
+ venv_name: str = ".venv",
+ recreate_venv: bool = False,
+) -> RemoteBootstrapReport:
+ if not workdir.strip():
+ raise RemoteAuditError("bootstrap requires a non-empty workdir")
+ python_names = python_candidates or DEFAULT_PYTHON_CANDIDATES
+ audit = audit_remote_host(
+ host,
+ Path(output_dir) / "preflight",
+ user=user,
+ port=port,
+ password_env=password_env,
+ min_python=min_python,
+ min_free_gb=1.0,
+ workdir=None,
+ python_candidates=python_names,
+ require_paths=[],
+ )
+ selected = _select_python_candidate(audit.probe, min_python)
+ if selected is None:
+ raise RemoteAuditError(f"no remote python candidate satisfies >= {min_python[0]}.{min_python[1]}")
+ bootstrap_payload = _run_remote_json_script(
+ host,
+ user=user,
+ port=port,
+ password_env=password_env,
+ script=_bootstrap_script(workdir, selected["command"], venv_name, recreate_venv=recreate_venv),
+ )
+ if not isinstance(bootstrap_payload, dict):
+ raise RemoteAuditError("bootstrap payload must be an object")
+ checks = [
+ RemoteCheck("python", "pass", f"using remote interpreter {selected['command']} -> {selected['version']}"),
+ RemoteCheck("workdir", "pass", f"remote workdir ready: {bootstrap_payload.get('workdir') or workdir}"),
+ RemoteCheck("venv", "pass", f"remote virtualenv ready: {bootstrap_payload.get('venv_dir') or venv_name}"),
+ ]
+ report = RemoteBootstrapReport(
+ passed=True,
+ host=host,
+ user=user,
+ workdir=str(bootstrap_payload.get("workdir") or workdir),
+ python_command=str(bootstrap_payload.get("python_command") or selected["command"]),
+ venv_dir=str(bootstrap_payload.get("venv_dir") or venv_name),
+ actions=dict(bootstrap_payload),
+ checks=checks,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ _write_remote_bootstrap(report, out)
+ return report
+
+
+def sync_remote_workspace(
+ local_root: str | Path,
+ output_dir: str | Path,
+ *,
+ host: str,
+ user: str | None = None,
+ port: int = 22,
+ password_env: str | None = None,
+ remote_workdir: str,
+ exclude_patterns: list[str] | None = None,
+) -> RemoteSyncReport:
+ local_path = Path(local_root)
+ if not local_path.exists() or not local_path.is_dir():
+ raise RemoteAuditError(f"local_root does not exist or is not a directory: {local_path}")
+ if not remote_workdir.strip():
+ raise RemoteAuditError("remote_workdir is required")
+ excludes = exclude_patterns or [".venv", "outputs", "runs", "__pycache__", ".pytest_cache"]
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ expanded_remote_workdir = _expand_remote_path(host, user=user, port=port, password_env=password_env, remote_path=remote_workdir)
+ with tempfile.TemporaryDirectory(prefix="ocrtech-sync-") as tmp_dir:
+ archive_path = Path(tmp_dir) / "workspace.tar.gz"
+ _create_workspace_archive(local_path, archive_path, excludes)
+ remote_archive = f"{expanded_remote_workdir.rstrip('/')}/.ocrtech-sync.tar.gz"
+ _copy_file_to_remote(archive_path, remote_archive, host=host, user=user, port=port, password_env=password_env)
+ _run_remote_json_script(
+ host,
+ user=user,
+ port=port,
+ password_env=password_env,
+ script=_sync_extract_script(expanded_remote_workdir, remote_archive),
+ )
+ checks = [
+ RemoteCheck("archive", "pass", f"workspace archive created from {local_path}"),
+ RemoteCheck("transfer", "pass", f"workspace synced to {expanded_remote_workdir}"),
+ ]
+ report = RemoteSyncReport(
+ passed=True,
+ host=host,
+ user=user,
+ local_root=str(local_path),
+ remote_workdir=expanded_remote_workdir,
+ archive_path="temporary archive removed after sync",
+ checks=checks,
+ )
+ _write_remote_sync(report, out)
+ return report
+
+
+def _probe_remote(
+ host: str,
+ *,
+ user: str | None,
+ port: int,
+ password_env: str | None,
+ workdir: str | None,
+ command_names: list[str],
+ path_checks: list[str],
+ python_candidates: list[str],
+) -> dict[str, Any]:
+ return _run_remote_json_script(
+ host,
+ user=user,
+ port=port,
+ password_env=password_env,
+ script=_probe_script(command_names, path_checks, workdir, python_candidates),
+ )
+
+
+def _run_remote_json_script(
+ host: str,
+ *,
+ user: str | None,
+ port: int,
+ password_env: str | None,
+ script: str,
+) -> dict[str, Any]:
+ encoded_script = base64.b64encode(script.encode("utf-8")).decode("ascii")
+ remote_python = f"import base64; exec(base64.b64decode({encoded_script!r}).decode('utf-8'))"
+ command = _ssh_command(host, user=user, port=port, password_env=password_env, remote_python=remote_python)
+ completed = subprocess.run(command, check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ message = completed.stderr.strip() or completed.stdout.strip() or f"exit code {completed.returncode}"
+ raise RemoteAuditError(f"remote probe failed: {message}")
+ combined_output = "\n".join(item for item in [completed.stdout.strip(), completed.stderr.strip()] if item)
+ if not combined_output:
+ raise RemoteAuditError("remote probe returned no output")
+ for line in reversed([item.strip() for item in combined_output.splitlines() if item.strip()]):
+ try:
+ payload = json.loads(line)
+ except json.JSONDecodeError:
+ continue
+ if isinstance(payload, dict):
+ return payload
+ raise RemoteAuditError(f"remote probe did not return valid JSON: {combined_output[:200]}")
+
+
+def _run_remote_shell_command(
+ host: str,
+ *,
+ user: str | None,
+ port: int,
+ password_env: str | None,
+ shell_command: str,
+) -> None:
+ command = _ssh_shell_command(host, user=user, port=port, password_env=password_env, shell_command=shell_command)
+ completed = subprocess.run(command, check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ message = completed.stderr.strip() or completed.stdout.strip() or f"exit code {completed.returncode}"
+ raise RemoteAuditError(f"remote command failed: {message}")
+
+
+def _expand_remote_path(
+ host: str,
+ *,
+ user: str | None,
+ port: int,
+ password_env: str | None,
+ remote_path: str,
+) -> str:
+ payload = _run_remote_json_script(
+ host,
+ user=user,
+ port=port,
+ password_env=password_env,
+ script="\n".join(
+ [
+ "import json",
+ "import os",
+ f"remote_path = os.path.expanduser({remote_path!r})",
+ "print(json.dumps({'expanded_path': remote_path}, sort_keys=True))",
+ ]
+ ),
+ )
+ expanded = payload.get("expanded_path")
+ if not isinstance(expanded, str) or not expanded.strip():
+ raise RemoteAuditError(f"remote path expansion failed for: {remote_path}")
+ return expanded
+
+
+def _probe_script(command_names: list[str], path_checks: list[str], workdir: str | None, python_candidates: list[str]) -> str:
+ command_list = ", ".join(repr(name) for name in command_names)
+ path_list = ", ".join(repr(item) for item in path_checks)
+ python_list = ", ".join(repr(item) for item in python_candidates)
+ lines = [
+ "import json",
+ "import os",
+ "import pathlib",
+ "import platform",
+ "import shutil",
+ "import subprocess",
+ "import sys",
+ "",
+ "def free_bytes(path):",
+ " stats = os.statvfs(path)",
+ " return int(stats.f_bavail * stats.f_frsize)",
+ "",
+ "def probe_python(candidate):",
+ " expanded = os.path.expanduser(candidate)",
+ " resolved = shutil.which(candidate) or (expanded if os.path.exists(expanded) else None)",
+ " if not resolved:",
+ ' return {"candidate": candidate, "path": None, "version": None, "version_info": None}',
+ " completed = subprocess.run(",
+ " [resolved, '-c', 'import json, platform, sys; print(json.dumps({\"version\": platform.python_version(), \"version_info\": list(sys.version_info[:3])}))'],",
+ " check=False,",
+ " capture_output=True,",
+ " text=True,",
+ " )",
+ " if completed.returncode != 0:",
+ ' return {"candidate": candidate, "path": resolved, "version": None, "version_info": None, "error": completed.stderr.strip() or completed.stdout.strip() or f"exit {completed.returncode}"}',
+ " try:",
+ " payload = json.loads(completed.stdout.strip())",
+ " except json.JSONDecodeError:",
+ ' return {"candidate": candidate, "path": resolved, "version": None, "version_info": None, "error": completed.stdout.strip()}',
+ ' return {"candidate": candidate, "path": resolved, "version": payload.get("version"), "version_info": payload.get("version_info")}',
+ "",
+ f"target_workdir = {workdir!r}",
+ "if target_workdir:",
+ " os.chdir(os.path.expanduser(target_workdir))",
+ "",
+ f"command_names = [{command_list}]",
+ f"path_checks = [{path_list}]",
+ f"python_candidates = [{python_list}]",
+ "payload = {",
+ ' "python_version": platform.python_version(),',
+ ' "python_version_info": list(sys.version_info[:3]),',
+ ' "platform": platform.platform(),',
+ ' "system": platform.system(),',
+ ' "machine": platform.machine(),',
+ ' "cwd": os.getcwd(),',
+ ' "home": os.path.expanduser("~"),',
+ ' "free_bytes_cwd": free_bytes(os.getcwd()),',
+ ' "free_bytes_home": free_bytes(os.path.expanduser("~")),',
+ ' "commands": {name: shutil.which(name) for name in command_names},',
+ ' "python_candidates": {candidate: probe_python(candidate) for candidate in python_candidates},',
+ ' "paths": {},',
+ "}",
+ "for item in path_checks:",
+ " expanded = os.path.expanduser(item)",
+ ' payload["paths"][item] = {',
+ ' "expanded": expanded,',
+ ' "exists": os.path.exists(expanded),',
+ ' "is_dir": os.path.isdir(expanded),',
+ ' "is_file": os.path.isfile(expanded),',
+ " }",
+ "print(json.dumps(payload, sort_keys=True))",
+ ]
+ return "\n".join(lines)
+
+
+def _bootstrap_script(workdir: str, python_command: str, venv_name: str, *, recreate_venv: bool) -> str:
+ lines = [
+ "import json",
+ "import os",
+ "import pathlib",
+ "import shutil",
+ "import subprocess",
+ "",
+ f"workdir = os.path.expanduser({workdir!r})",
+ f"python_command = os.path.expanduser({python_command!r})",
+ f"venv_name = {venv_name!r}",
+ f"recreate_venv = {recreate_venv!r}",
+ "workdir_path = pathlib.Path(workdir)",
+ "workdir_existed = workdir_path.exists()",
+ "workdir_path.mkdir(parents=True, exist_ok=True)",
+ "venv_path = workdir_path / venv_name",
+ "venv_existed = venv_path.exists()",
+ "venv_recreated = False",
+ "if venv_existed and recreate_venv:",
+ " shutil.rmtree(venv_path)",
+ " venv_existed = False",
+ " venv_recreated = True",
+ "if not venv_existed:",
+ " subprocess.run([python_command, '-m', 'venv', str(venv_path)], check=True)",
+ "payload = {",
+ ' "workdir": str(workdir_path),',
+ ' "workdir_existed": workdir_existed,',
+ ' "venv_dir": str(venv_path),',
+ ' "venv_existed": venv_existed,',
+ ' "venv_recreated": venv_recreated,',
+ ' "python_command": python_command,',
+ ' "python_bin": str(venv_path / "bin" / "python"),',
+ ' "pip_bin": str(venv_path / "bin" / "pip"),',
+ "}",
+ "print(json.dumps(payload, sort_keys=True))",
+ ]
+ return "\n".join(lines)
+
+
+def _sync_extract_script(remote_workdir: str, remote_archive: str) -> str:
+ lines = [
+ "import json",
+ "import os",
+ "import pathlib",
+ "import shutil",
+ "import subprocess",
+ "",
+ f"remote_workdir = os.path.expanduser({remote_workdir!r})",
+ f"remote_archive = os.path.expanduser({remote_archive!r})",
+ "workdir_path = pathlib.Path(remote_workdir)",
+ "archive_path = pathlib.Path(remote_archive)",
+ "workdir_path.mkdir(parents=True, exist_ok=True)",
+ "subprocess.run(['tar', '-xzf', str(archive_path), '-C', str(workdir_path)], check=True)",
+ "for cache_dir in workdir_path.rglob('__pycache__'):",
+ " shutil.rmtree(cache_dir, ignore_errors=True)",
+ "pytest_cache = workdir_path / '.pytest_cache'",
+ "if pytest_cache.exists():",
+ " shutil.rmtree(pytest_cache, ignore_errors=True)",
+ "archive_path.unlink(missing_ok=True)",
+ "print(json.dumps({'workdir': str(workdir_path), 'archive_path': str(archive_path)}, sort_keys=True))",
+ ]
+ return "\n".join(lines)
+
+
+def _ssh_command(host: str, *, user: str | None, port: int, password_env: str | None, remote_python: str) -> list[str]:
+ remote_command = f"python3 -c {_shell_quote(remote_python)}"
+ remote_shell_command = f"sh -lc {_shell_quote(remote_command)}"
+ return _ssh_shell_command(host, user=user, port=port, password_env=password_env, shell_command=remote_shell_command)
+
+
+def _ssh_shell_command(host: str, *, user: str | None, port: int, password_env: str | None, shell_command: str) -> list[str]:
+ target = f"{user}@{host}" if user else host
+ ssh_args = [
+ "ssh",
+ "-p",
+ str(port),
+ "-o",
+ "StrictHostKeyChecking=accept-new",
+ target,
+ shell_command,
+ ]
+ return _wrap_password_command(ssh_args, password_env=password_env)
+
+
+def _copy_file_to_remote(
+ local_path: Path,
+ remote_path: str,
+ *,
+ host: str,
+ user: str | None,
+ port: int,
+ password_env: str | None,
+) -> None:
+ target = f"{user}@{host}:{remote_path}" if user else f"{host}:{remote_path}"
+ scp_args = [
+ "scp",
+ "-P",
+ str(port),
+ "-o",
+ "StrictHostKeyChecking=accept-new",
+ str(local_path),
+ target,
+ ]
+ completed = subprocess.run(_wrap_password_command(scp_args, password_env=password_env), check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ message = completed.stderr.strip() or completed.stdout.strip() or f"exit code {completed.returncode}"
+ raise RemoteAuditError(f"remote copy failed: {message}")
+
+
+def _wrap_password_command(args: list[str], *, password_env: str | None) -> list[str]:
+ if password_env is None:
+ return args
+ tcl_list = " ".join(_tcl_brace_quote(part) for part in args)
+ expect_script = textwrap.dedent(
+ f"""
+ set timeout -1
+ set cmd [list {tcl_list}]
+ eval spawn -noecho $cmd
+ expect {{
+ -nocase -re {{password:}} {{
+ send -- "$env({password_env})\\r"
+ exp_continue
+ }}
+ timeout {{
+ exit 124
+ }}
+ eof
+ }}
+ catch wait result
+ set exit_code [lindex $result 3]
+ exit $exit_code
+ """
+ ).strip()
+ return ["expect", "-c", expect_script]
+
+
+def _evaluate_probe(
+ probe: dict[str, Any],
+ *,
+ min_python: tuple[int, int],
+ min_free_gb: float,
+ require_gpu: bool,
+ require_paddle_training: bool,
+ python_candidates: list[str],
+ require_commands: list[str],
+ optional_commands: list[str],
+ require_paths: list[str],
+ workdir: str | None,
+) -> list[RemoteCheck]:
+ checks: list[RemoteCheck] = []
+ checks.append(_python_check(probe, min_python, python_candidates))
+ checks.append(_platform_check(probe, require_paddle_training=require_paddle_training))
+ checks.append(_disk_check(probe, min_free_gb, workdir))
+ checks.append(_command_check(probe, require_commands, optional_commands))
+ checks.append(_path_check(probe, require_paths))
+ checks.append(_gpu_check(probe, require_gpu))
+ return checks
+
+
+def _python_check(probe: dict[str, Any], min_python: tuple[int, int], python_candidates: list[str]) -> RemoteCheck:
+ selected = _select_python_candidate(probe, min_python, python_candidates=python_candidates)
+ python_payload = probe.get("python_candidates")
+ details: list[str] = []
+ if isinstance(python_payload, dict):
+ for candidate in python_candidates:
+ item = python_payload.get(candidate)
+ if not isinstance(item, dict):
+ continue
+ path = item.get("path")
+ version = item.get("version")
+ error = item.get("error")
+ if path and version:
+ details.append(f"{candidate} -> {path} ({version})")
+ elif path and error:
+ details.append(f"{candidate} -> {path} error={error}")
+ elif path:
+ details.append(f"{candidate} -> {path}")
+ if selected is None:
+ return RemoteCheck("python", "fail", f"no remote python candidate satisfies >= {min_python[0]}.{min_python[1]}", details=details)
+ return RemoteCheck("python", "pass", f"{selected['command']} -> {selected['version']} satisfies >= {min_python[0]}.{min_python[1]}", details=details)
+
+
+def _disk_check(probe: dict[str, Any], min_free_gb: float, workdir: str | None) -> RemoteCheck:
+ free_bytes = probe.get("free_bytes_cwd")
+ if not isinstance(free_bytes, int | float):
+ return RemoteCheck("disk", "fail", "remote probe did not report free_bytes_cwd")
+ free_gb = float(free_bytes) / (1024**3)
+ target = workdir or probe.get("cwd") or "."
+ if free_gb < min_free_gb:
+ return RemoteCheck("disk", "fail", f"{target} has {free_gb:.2f} GiB free < required {min_free_gb:.2f} GiB")
+ return RemoteCheck("disk", "pass", f"{target} has {free_gb:.2f} GiB free")
+
+
+def _platform_check(probe: dict[str, Any], *, require_paddle_training: bool) -> RemoteCheck:
+ system = str(probe.get("system") or "")
+ machine = str(probe.get("machine") or "")
+ platform_name = str(probe.get("platform") or f"{system}-{machine}")
+ if system == "Darwin" and machine == "arm64":
+ summary = (
+ "macOS arm64 host detected; PaddlePaddle official install guidance says macOS support requires x86_64, "
+ "so PaddleOCR training is not a valid target here"
+ )
+ status = "fail" if require_paddle_training else "warn"
+ return RemoteCheck("platform", status, summary, details=[platform_name])
+ if not platform_name:
+ return RemoteCheck("platform", "warn", "remote probe did not report platform details")
+ return RemoteCheck("platform", "pass", f"remote platform reported as {platform_name}")
+
+
+def _command_check(probe: dict[str, Any], require_commands: list[str], optional_commands: list[str]) -> RemoteCheck:
+ commands = probe.get("commands")
+ if not isinstance(commands, dict):
+ return RemoteCheck("commands", "fail", "remote probe did not report command availability")
+ missing_required = [name for name in require_commands if not commands.get(name)]
+ missing_optional = [name for name in optional_commands if not commands.get(name)]
+ details = []
+ if missing_optional:
+ details.append(f"optional missing: {', '.join(missing_optional)}")
+ if missing_required:
+ return RemoteCheck("commands", "fail", f"required commands missing: {', '.join(missing_required)}", details=details)
+ return RemoteCheck("commands", "pass", "required remote commands are present", details=details)
+
+
+def _path_check(probe: dict[str, Any], require_paths: list[str]) -> RemoteCheck:
+ if not require_paths:
+ return RemoteCheck("paths", "pass", "no required remote paths configured")
+ paths = probe.get("paths")
+ if not isinstance(paths, dict):
+ return RemoteCheck("paths", "fail", "remote probe did not report path checks")
+ missing = [path for path in require_paths if not isinstance(paths.get(path), dict) or not paths[path].get("exists")]
+ if missing:
+ return RemoteCheck("paths", "fail", f"required remote paths missing: {', '.join(missing)}")
+ details = [f"{path} -> {paths[path].get('expanded')}" for path in require_paths if isinstance(paths.get(path), dict)]
+ return RemoteCheck("paths", "pass", "required remote paths are present", details=details)
+
+
+def _gpu_check(probe: dict[str, Any], require_gpu: bool) -> RemoteCheck:
+ commands = probe.get("commands")
+ if not isinstance(commands, dict):
+ return RemoteCheck("gpu", "fail" if require_gpu else "warn", "remote probe did not report command availability for GPU check")
+ has_gpu_tool = bool(commands.get("nvidia-smi"))
+ if require_gpu and not has_gpu_tool:
+ return RemoteCheck("gpu", "fail", "nvidia-smi is missing but GPU is required")
+ if has_gpu_tool:
+ return RemoteCheck("gpu", "pass", "nvidia-smi is available")
+ return RemoteCheck("gpu", "warn", "nvidia-smi is not available")
+
+
+def _write_remote_audit(report: RemoteAuditReport, output_dir: Path) -> None:
+ (output_dir / "remote-audit.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Remote Host Audit",
+ "",
+ f"Passed: `{'yes' if report.passed else 'no'}`",
+ f"Host: `{report.host}`",
+ f"User: `{report.user or ''}`",
+ f"Workdir: `{report.workdir or ''}`",
+ "",
+ "| check | status | summary |",
+ "| --- | --- | --- |",
+ ]
+ for check in report.checks:
+ summary = check.summary.replace("|", "\\|")
+ lines.append(f"| {check.name} | {check.status} | {summary} |")
+ for detail in check.details:
+ escaped_detail = detail.replace("|", "\\|")
+ lines.append(f"| | | {escaped_detail} |")
+ (output_dir / "remote-audit.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_remote_bootstrap(report: RemoteBootstrapReport, output_dir: Path) -> None:
+ (output_dir / "remote-bootstrap.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Remote Host Bootstrap",
+ "",
+ f"Passed: `{'yes' if report.passed else 'no'}`",
+ f"Host: `{report.host}`",
+ f"User: `{report.user or ''}`",
+ f"Workdir: `{report.workdir}`",
+ f"Python: `{report.python_command}`",
+ f"Virtualenv: `{report.venv_dir}`",
+ "",
+ "| check | status | summary |",
+ "| --- | --- | --- |",
+ ]
+ for check in report.checks:
+ summary = check.summary.replace("|", "\\|")
+ lines.append(f"| {check.name} | {check.status} | {summary} |")
+ for detail in check.details:
+ escaped_detail = detail.replace("|", "\\|")
+ lines.append(f"| | | {escaped_detail} |")
+ (output_dir / "remote-bootstrap.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_remote_sync(report: RemoteSyncReport, output_dir: Path) -> None:
+ (output_dir / "remote-sync.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Remote Workspace Sync",
+ "",
+ f"Passed: `{'yes' if report.passed else 'no'}`",
+ f"Host: `{report.host}`",
+ f"User: `{report.user or ''}`",
+ f"Local root: `{report.local_root}`",
+ f"Remote workdir: `{report.remote_workdir}`",
+ "",
+ "| check | status | summary |",
+ "| --- | --- | --- |",
+ ]
+ for check in report.checks:
+ summary = check.summary.replace("|", "\\|")
+ lines.append(f"| {check.name} | {check.status} | {summary} |")
+ for detail in check.details:
+ escaped_detail = detail.replace("|", "\\|")
+ lines.append(f"| | | {escaped_detail} |")
+ (output_dir / "remote-sync.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def shutil_which(command: str) -> str | None:
+ return subprocess.run(
+ ["sh", "-lc", f"command -v {_shell_quote(command)}"],
+ check=False,
+ capture_output=True,
+ text=True,
+ ).stdout.strip() or None
+
+
+def _shell_quote(value: str) -> str:
+ return "'" + value.replace("'", "'\"'\"'") + "'"
+
+
+def _tcl_brace_quote(value: str) -> str:
+ return "{" + value.replace("\\", "\\\\").replace("{", "\\{").replace("}", "\\}") + "}"
+
+
+def _select_python_candidate(
+ probe: dict[str, Any],
+ min_python: tuple[int, int],
+ *,
+ python_candidates: list[str] | None = None,
+) -> dict[str, str] | None:
+ payload = probe.get("python_candidates")
+ if not isinstance(payload, dict):
+ return None
+ candidates = python_candidates or list(payload)
+ for candidate in candidates:
+ item = payload.get(candidate)
+ if not isinstance(item, dict):
+ continue
+ version_info = item.get("version_info")
+ path = item.get("path")
+ version = item.get("version")
+ if not isinstance(version_info, list) or len(version_info) < 2 or not path or not version:
+ continue
+ key = (int(version_info[0]), int(version_info[1]))
+ if key[:2] < min_python:
+ continue
+ return {"candidate": candidate, "command": str(path), "version": str(version)}
+ return None
+
+
+def _create_workspace_archive(local_root: Path, archive_path: Path, exclude_patterns: list[str]) -> None:
+ command = ["tar", "-czf", str(archive_path)]
+ for pattern in exclude_patterns:
+ command.extend(["--exclude", pattern])
+ command.extend(["-C", str(local_root), "."])
+ completed = subprocess.run(command, check=False, capture_output=True, text=True)
+ if completed.returncode != 0:
+ message = completed.stderr.strip() or completed.stdout.strip() or f"exit code {completed.returncode}"
+ raise RemoteAuditError(f"failed to create workspace archive: {message}")
diff --git a/src/ocrtech/schemas.py b/src/ocrtech/schemas.py
new file mode 100644
index 0000000000000000000000000000000000000000..3649300e3fb514ec213c318bae7d82deb3a01fb1
--- /dev/null
+++ b/src/ocrtech/schemas.py
@@ -0,0 +1,382 @@
+"""Stable JSON-compatible schemas for parsed documents."""
+
+from __future__ import annotations
+
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import DataValidationError
+
+
+JsonDict = dict[str, Any]
+
+
+def _number(value: Any, field_name: str) -> float:
+ if isinstance(value, bool) or not isinstance(value, int | float):
+ raise DataValidationError(f"{field_name} must be a number, got {type(value).__name__}")
+ return float(value)
+
+
+@dataclass(slots=True)
+class BBox:
+ """Axis-aligned bounding box in page coordinates."""
+
+ x: float
+ y: float
+ w: float
+ h: float
+
+ def __post_init__(self) -> None:
+ self.x = _number(self.x, "bbox.x")
+ self.y = _number(self.y, "bbox.y")
+ self.w = _number(self.w, "bbox.w")
+ self.h = _number(self.h, "bbox.h")
+ if self.w < 0 or self.h < 0:
+ raise DataValidationError(f"bbox width/height must be non-negative: {self.to_list()}")
+
+ @property
+ def right(self) -> float:
+ return self.x + self.w
+
+ @property
+ def bottom(self) -> float:
+ return self.y + self.h
+
+ def to_list(self) -> list[float]:
+ return [self.x, self.y, self.w, self.h]
+
+ def to_dict(self) -> JsonDict:
+ return {"x": self.x, "y": self.y, "w": self.w, "h": self.h}
+
+ @classmethod
+ def from_any(cls, value: Any) -> "BBox":
+ if isinstance(value, BBox):
+ return value
+ if isinstance(value, dict):
+ return cls(value.get("x"), value.get("y"), value.get("w"), value.get("h"))
+ if isinstance(value, list | tuple) and len(value) == 4:
+ return cls(value[0], value[1], value[2], value[3])
+ raise DataValidationError(f"bbox must be a dict or 4-item list, got {value!r}")
+
+
+def union_bbox(boxes: list[BBox]) -> BBox:
+ if not boxes:
+ return BBox(0, 0, 0, 0)
+ left = min(box.x for box in boxes)
+ top = min(box.y for box in boxes)
+ right = max(box.right for box in boxes)
+ bottom = max(box.bottom for box in boxes)
+ return BBox(left, top, right - left, bottom - top)
+
+
+def validate_confidence(value: float | int | None, field_name: str = "confidence") -> float | None:
+ if value is None:
+ return None
+ number = _number(value, field_name)
+ if number < 0 or number > 1:
+ raise DataValidationError(f"{field_name} must be between 0 and 1, got {number}")
+ return number
+
+
+@dataclass(slots=True)
+class TextLine:
+ text: str
+ bbox: BBox = field(default_factory=lambda: BBox(0, 0, 0, 0))
+ confidence: float | None = None
+ page_index: int = 0
+ line_id: str | None = None
+ metadata: JsonDict = field(default_factory=dict)
+
+ def __post_init__(self) -> None:
+ if not isinstance(self.text, str):
+ raise DataValidationError(f"text line must be a string, got {type(self.text).__name__}")
+ self.bbox = BBox.from_any(self.bbox)
+ self.confidence = validate_confidence(self.confidence)
+ if self.page_index < 0:
+ raise DataValidationError(f"page_index must be non-negative, got {self.page_index}")
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "line_id": self.line_id,
+ "page_index": self.page_index,
+ "text": self.text,
+ "bbox": self.bbox.to_list(),
+ "confidence": self.confidence,
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict, page_index: int = 0) -> "TextLine":
+ return cls(
+ text=data.get("text", ""),
+ bbox=BBox.from_any(data.get("bbox", [0, 0, 0, 0])),
+ confidence=data.get("confidence"),
+ page_index=int(data.get("page_index", page_index)),
+ line_id=data.get("line_id"),
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class TableCell:
+ row: int
+ col: int
+ text: str
+ rowspan: int = 1
+ colspan: int = 1
+ bbox: BBox | None = None
+ confidence: float | None = None
+
+ def __post_init__(self) -> None:
+ if self.row < 0 or self.col < 0:
+ raise DataValidationError("table cell row/col must be non-negative")
+ if self.rowspan < 1 or self.colspan < 1:
+ raise DataValidationError("table cell rowspan/colspan must be at least 1")
+ if not isinstance(self.text, str):
+ raise DataValidationError("table cell text must be a string")
+ if self.bbox is not None:
+ self.bbox = BBox.from_any(self.bbox)
+ self.confidence = validate_confidence(self.confidence)
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "row": self.row,
+ "col": self.col,
+ "rowspan": self.rowspan,
+ "colspan": self.colspan,
+ "text": self.text,
+ "bbox": self.bbox.to_list() if self.bbox else None,
+ "confidence": self.confidence,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "TableCell":
+ bbox = data.get("bbox")
+ return cls(
+ row=int(data.get("row", 0)),
+ col=int(data.get("col", 0)),
+ text=str(data.get("text", "")),
+ rowspan=int(data.get("rowspan", 1)),
+ colspan=int(data.get("colspan", 1)),
+ bbox=BBox.from_any(bbox) if bbox is not None else None,
+ confidence=data.get("confidence"),
+ )
+
+
+@dataclass(slots=True)
+class Table:
+ table_id: str
+ page_index: int
+ bbox: BBox
+ cells: list[TableCell] = field(default_factory=list)
+ html: str | None = None
+ csv_path: str | None = None
+ html_path: str | None = None
+ caption: str | None = None
+ confidence: float | None = None
+ metadata: JsonDict = field(default_factory=dict)
+
+ def __post_init__(self) -> None:
+ self.bbox = BBox.from_any(self.bbox)
+ self.confidence = validate_confidence(self.confidence)
+ if not self.table_id:
+ raise DataValidationError("table_id is required")
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "table_id": self.table_id,
+ "page_index": self.page_index,
+ "bbox": self.bbox.to_list(),
+ "cells": [cell.to_dict() for cell in self.cells],
+ "html": self.html,
+ "csv_path": self.csv_path,
+ "html_path": self.html_path,
+ "caption": self.caption,
+ "confidence": self.confidence,
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "Table":
+ return cls(
+ table_id=str(data.get("table_id") or data.get("id") or "table-0"),
+ page_index=int(data.get("page_index", 0)),
+ bbox=BBox.from_any(data.get("bbox", [0, 0, 0, 0])),
+ cells=[TableCell.from_dict(item) for item in data.get("cells", [])],
+ html=data.get("html"),
+ csv_path=data.get("csv_path"),
+ html_path=data.get("html_path"),
+ caption=data.get("caption"),
+ confidence=data.get("confidence"),
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class Figure:
+ figure_id: str
+ page_index: int
+ bbox: BBox
+ caption: str | None = None
+ summary: str | None = None
+ image_path: str | None = None
+ confidence: float | None = None
+ metadata: JsonDict = field(default_factory=dict)
+
+ def __post_init__(self) -> None:
+ if not self.figure_id:
+ raise DataValidationError("figure_id is required")
+ self.bbox = BBox.from_any(self.bbox)
+ self.confidence = validate_confidence(self.confidence)
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "figure_id": self.figure_id,
+ "page_index": self.page_index,
+ "bbox": self.bbox.to_list(),
+ "caption": self.caption,
+ "summary": self.summary,
+ "image_path": self.image_path,
+ "confidence": self.confidence,
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "Figure":
+ return cls(
+ figure_id=str(data.get("figure_id") or data.get("id") or "figure-0"),
+ page_index=int(data.get("page_index", 0)),
+ bbox=BBox.from_any(data.get("bbox", [0, 0, 0, 0])),
+ caption=data.get("caption"),
+ summary=data.get("summary"),
+ image_path=data.get("image_path"),
+ confidence=data.get("confidence"),
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class Block:
+ block_id: str
+ block_type: str
+ page_index: int
+ bbox: BBox
+ order: int
+ text: str = ""
+ confidence: float | None = None
+ line_ids: list[str] = field(default_factory=list)
+ table_id: str | None = None
+ figure_id: str | None = None
+ metadata: JsonDict = field(default_factory=dict)
+
+ def __post_init__(self) -> None:
+ if self.block_type not in {"text", "title", "table", "figure", "caption"}:
+ raise DataValidationError(f"unsupported block_type: {self.block_type}")
+ self.bbox = BBox.from_any(self.bbox)
+ self.confidence = validate_confidence(self.confidence)
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "block_id": self.block_id,
+ "block_type": self.block_type,
+ "page_index": self.page_index,
+ "bbox": self.bbox.to_list(),
+ "order": self.order,
+ "text": self.text,
+ "confidence": self.confidence,
+ "line_ids": self.line_ids,
+ "table_id": self.table_id,
+ "figure_id": self.figure_id,
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "Block":
+ return cls(
+ block_id=str(data.get("block_id") or data.get("id") or "block-0"),
+ block_type=str(data.get("block_type", "text")),
+ page_index=int(data.get("page_index", 0)),
+ bbox=BBox.from_any(data.get("bbox", [0, 0, 0, 0])),
+ order=int(data.get("order", 0)),
+ text=str(data.get("text", "")),
+ confidence=data.get("confidence"),
+ line_ids=list(data.get("line_ids", [])),
+ table_id=data.get("table_id"),
+ figure_id=data.get("figure_id"),
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class Page:
+ page_index: int
+ width: float | None = None
+ height: float | None = None
+ text_lines: list[TextLine] = field(default_factory=list)
+ blocks: list[Block] = field(default_factory=list)
+ metadata: JsonDict = field(default_factory=dict)
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "page_index": self.page_index,
+ "width": self.width,
+ "height": self.height,
+ "text_lines": [line.to_dict() for line in self.text_lines],
+ "blocks": [block.to_dict() for block in self.blocks],
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "Page":
+ page_index = int(data.get("page_index", data.get("index", 0)))
+ return cls(
+ page_index=page_index,
+ width=data.get("width"),
+ height=data.get("height"),
+ text_lines=[TextLine.from_dict(item, page_index) for item in data.get("text_lines", data.get("lines", []))],
+ blocks=[Block.from_dict(item) for item in data.get("blocks", [])],
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+
+@dataclass(slots=True)
+class Document:
+ source_path: str
+ pages: list[Page] = field(default_factory=list)
+ tables: list[Table] = field(default_factory=list)
+ figures: list[Figure] = field(default_factory=list)
+ metadata: JsonDict = field(default_factory=dict)
+
+ def to_dict(self) -> JsonDict:
+ return {
+ "schema_version": "1.0",
+ "source_path": self.source_path,
+ "pages": [page.to_dict() for page in self.pages],
+ "tables": [table.to_dict() for table in self.tables],
+ "figures": [figure.to_dict() for figure in self.figures],
+ "metadata": self.metadata,
+ }
+
+ @classmethod
+ def from_dict(cls, data: JsonDict) -> "Document":
+ return cls(
+ source_path=str(data.get("source_path", "")),
+ pages=[Page.from_dict(item) for item in data.get("pages", [])],
+ tables=[Table.from_dict(item) for item in data.get("tables", [])],
+ figures=[Figure.from_dict(item) for item in data.get("figures", [])],
+ metadata=dict(data.get("metadata") or {}),
+ )
+
+ @property
+ def text(self) -> str:
+ lines: list[str] = []
+ for page in sorted(self.pages, key=lambda item: item.page_index):
+ for block in sorted(page.blocks, key=lambda item: item.order):
+ if block.text:
+ lines.append(block.text)
+ return "\n".join(lines)
+
+
+def source_name(path: str | Path) -> str:
+ return Path(path).name
diff --git a/src/ocrtech/source_audit.py b/src/ocrtech/source_audit.py
new file mode 100644
index 0000000000000000000000000000000000000000..492b00e06e19c165fa64fd2d60cdcb57456a805c
--- /dev/null
+++ b/src/ocrtech/source_audit.py
@@ -0,0 +1,1621 @@
+"""Source audits for real-world validation data."""
+
+from __future__ import annotations
+
+import csv
+import json
+import re
+import shutil
+from dataclasses import dataclass, field
+from html.parser import HTMLParser
+from pathlib import Path
+from typing import Any
+from urllib.parse import parse_qs, unquote, urljoin, urlparse
+from urllib.request import Request, urlopen
+
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, sha256_file, sha256_text, write_manifest
+
+
+DEFAULT_GORKHAPATRA_CATEGORY_URLS = (
+ "https://gorkhapatraonline.com/categories/new-nepal",
+ "https://gorkhapatraonline.com/categories/new-nepal?page=2",
+)
+
+DEFAULT_GORKHAPATRA_EPAPER_URL = (
+ "https://epaper.gorkhapatraonline.com/epaper-list?"
+ "pdfdaterange1=2026-06-09&pdfdaterange2=2026-06-16&slug=gorkhapatra"
+)
+
+GORKHAPATRA_ONLINE_BASE = "https://gorkhapatraonline.com"
+GORKHAPATRA_EPAPER_BASE = "https://epaper.gorkhapatraonline.com"
+DEFAULT_NAYA_NEPAL_PUBLICATION_URL = "https://gorkhapatraonline.com/publications/naya-nepal"
+LANGUAGE_PAGE_MARKERS = ("भाषा पृष्ठ", "efiff k[i7", "bhasa pristha", "bhasa prishtha")
+NEPALI_MONTHS = {
+ "बैशाख": 1,
+ "वैशाख": 1,
+ "जेठ": 2,
+ "असार": 3,
+ "साउन": 4,
+ "भदौ": 5,
+ "भाद्र": 5,
+ "असोज": 6,
+ "कार्तिक": 7,
+ "मंसिर": 8,
+ "मङ्सिर": 8,
+ "पुस": 9,
+ "पुष": 9,
+ "माघ": 10,
+ "फागुन": 11,
+ "चैत": 12,
+}
+
+
+@dataclass(slots=True)
+class DownloadedArtifact:
+ url: str
+ path: str
+ sha256: str
+ size_bytes: int
+ kind: str
+ warnings: list[str] = field(default_factory=list)
+ pdf_audit: dict[str, Any] | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ payload = {
+ "url": self.url,
+ "path": self.path,
+ "sha256": self.sha256,
+ "size_bytes": self.size_bytes,
+ "kind": self.kind,
+ "warnings": self.warnings,
+ }
+ if self.pdf_audit is not None:
+ payload["pdf_audit"] = self.pdf_audit
+ return payload
+
+
+@dataclass(slots=True)
+class GorkhapatraArticleAsset:
+ article_url: str | None
+ image_url: str | None
+ title: str
+ language: str | None
+ source_page: str
+ downloaded_image: DownloadedArtifact | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "article_url": self.article_url,
+ "image_url": self.image_url,
+ "title": self.title,
+ "language": self.language,
+ "source_page": self.source_page,
+ "downloaded_image": self.downloaded_image.to_dict() if self.downloaded_image else None,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraEpaperAsset:
+ viewer_url: str
+ direct_pdf_url: str
+ source_page: str
+ date_label: str | None = None
+ thumbnail_url: str | None = None
+ downloaded_pdf: DownloadedArtifact | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "viewer_url": self.viewer_url,
+ "direct_pdf_url": self.direct_pdf_url,
+ "source_page": self.source_page,
+ "date_label": self.date_label,
+ "thumbnail_url": self.thumbnail_url,
+ "downloaded_pdf": self.downloaded_pdf.to_dict() if self.downloaded_pdf else None,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraSourceAudit:
+ category_sources: list[str]
+ epaper_sources: list[str]
+ article_count: int
+ epaper_count: int
+ language_counts: dict[str, int]
+ downloaded_count: int
+ articles: list[GorkhapatraArticleAsset]
+ epapers: list[GorkhapatraEpaperAsset]
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "category_sources": self.category_sources,
+ "epaper_sources": self.epaper_sources,
+ "article_count": self.article_count,
+ "epaper_count": self.epaper_count,
+ "language_counts": self.language_counts,
+ "downloaded_count": self.downloaded_count,
+ "warnings": self.warnings,
+ "articles": [article.to_dict() for article in self.articles],
+ "epapers": [epaper.to_dict() for epaper in self.epapers],
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraPackSummary:
+ manifest_path: str
+ sample_count: int
+ article_image_count: int
+ epaper_page_count: int
+ language_counts: dict[str, int]
+ reference_status_counts: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "sample_count": self.sample_count,
+ "article_image_count": self.article_image_count,
+ "epaper_page_count": self.epaper_page_count,
+ "language_counts": self.language_counts,
+ "reference_status_counts": self.reference_status_counts,
+ "warnings": self.warnings,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class NayaNepalPublicationItem:
+ article_url: str | None
+ image_url: str | None
+ title: str
+ language: str | None
+ date_label: str | None
+ date_key: str | None
+ source_page: str
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "article_url": self.article_url,
+ "image_url": self.image_url,
+ "title": self.title,
+ "language": self.language,
+ "date_label": self.date_label,
+ "date_key": self.date_key,
+ "source_page": self.source_page,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraLanguagePageHit:
+ page_index: int
+ marker: str
+ text_chars: int
+ text_preview: str
+ rendered_page_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "page_index": self.page_index,
+ "marker": self.marker,
+ "text_chars": self.text_chars,
+ "text_preview": self.text_preview,
+ "rendered_page_path": self.rendered_page_path,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraLanguagePageAlignment:
+ publication_item: NayaNepalPublicationItem
+ epaper: GorkhapatraEpaperAsset | None
+ pdf_path: str | None
+ pdf_sha256: str | None
+ page_hits: list[GorkhapatraLanguagePageHit]
+ alignment_status: str
+ claim_evidence_eligible: bool
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "publication_item": self.publication_item.to_dict(),
+ "epaper": self.epaper.to_dict() if self.epaper else None,
+ "pdf_path": self.pdf_path,
+ "pdf_sha256": self.pdf_sha256,
+ "page_hits": [hit.to_dict() for hit in self.page_hits],
+ "alignment_status": self.alignment_status,
+ "claim_evidence_eligible": self.claim_evidence_eligible,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraLanguagePageAudit:
+ publication_sources: list[str]
+ epaper_sources: list[str]
+ publication_item_count: int
+ aligned_count: int
+ language_page_hit_count: int
+ status_counts: dict[str, int]
+ language_counts: dict[str, int]
+ alignments: list[GorkhapatraLanguagePageAlignment]
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "publication_sources": self.publication_sources,
+ "epaper_sources": self.epaper_sources,
+ "publication_item_count": self.publication_item_count,
+ "aligned_count": self.aligned_count,
+ "language_page_hit_count": self.language_page_hit_count,
+ "status_counts": self.status_counts,
+ "language_counts": self.language_counts,
+ "warnings": self.warnings,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ "alignments": [alignment.to_dict() for alignment in self.alignments],
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraLanguagePagePackSummary:
+ manifest_path: str
+ sample_count: int
+ copied_page_count: int
+ language_counts: dict[str, int]
+ reference_status_counts: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+ summary_json_path: str | None = None
+ summary_md_path: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "sample_count": self.sample_count,
+ "copied_page_count": self.copied_page_count,
+ "language_counts": self.language_counts,
+ "reference_status_counts": self.reference_status_counts,
+ "warnings": self.warnings,
+ "summary_json_path": self.summary_json_path,
+ "summary_md_path": self.summary_md_path,
+ }
+
+
+@dataclass(slots=True)
+class GorkhapatraLanguagePageReviewSummary:
+ manifest_path: str
+ review_json_path: str
+ review_csv_path: str
+ review_md_path: str
+ sample_count: int
+ pending_review_count: int
+ claim_evidence_eligible_count: int
+ language_counts: dict[str, int]
+ page_candidate_counts: dict[str, int]
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "manifest_path": self.manifest_path,
+ "review_json_path": self.review_json_path,
+ "review_csv_path": self.review_csv_path,
+ "review_md_path": self.review_md_path,
+ "sample_count": self.sample_count,
+ "pending_review_count": self.pending_review_count,
+ "claim_evidence_eligible_count": self.claim_evidence_eligible_count,
+ "language_counts": self.language_counts,
+ "page_candidate_counts": self.page_candidate_counts,
+ "warnings": self.warnings,
+ }
+
+
+class _GorkhapatraCategoryParser(HTMLParser):
+ def __init__(self, *, base_url: str, source_page: str) -> None:
+ super().__init__(convert_charrefs=True)
+ self.base_url = base_url
+ self.source_page = source_page
+ self.assets: list[GorkhapatraArticleAsset] = []
+ self._href_stack: list[str | None] = []
+ self._link_text_stack: list[list[str]] = []
+ self._title_links: dict[str, str] = {}
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ attr = dict(attrs)
+ if tag == "a":
+ href = attr.get("href")
+ self._href_stack.append(urljoin(self.base_url, href) if href else None)
+ self._link_text_stack.append([])
+ return
+ if tag != "img":
+ return
+ alt = (attr.get("alt") or "").strip()
+ if "भाषा" not in alt:
+ return
+ src = attr.get("src")
+ article_url = self._nearest_article_url()
+ self.assets.append(
+ GorkhapatraArticleAsset(
+ article_url=article_url,
+ image_url=urljoin(self.base_url, src) if src else None,
+ title=alt,
+ language=_extract_language_label(alt),
+ source_page=self.source_page,
+ )
+ )
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag == "a" and self._href_stack:
+ href = self._href_stack.pop()
+ text_chunks = self._link_text_stack.pop() if self._link_text_stack else []
+ text = " ".join(" ".join(text_chunks).split())
+ if href and re.search(r"/news/\d+", href) and "भाषा" in text:
+ self._title_links[text] = href
+
+ def handle_data(self, data: str) -> None:
+ if self._link_text_stack:
+ self._link_text_stack[-1].append(data)
+
+ def _nearest_article_url(self) -> str | None:
+ for href in reversed(self._href_stack):
+ if href and re.search(r"/news/\d+", href):
+ return href
+ return None
+
+ def finalize_assets(self) -> list[GorkhapatraArticleAsset]:
+ for asset in self.assets:
+ if asset.article_url is None:
+ asset.article_url = self._title_links.get(" ".join(asset.title.split()))
+ return self.assets
+
+
+class _GorkhapatraEpaperParser(HTMLParser):
+ def __init__(self, *, base_url: str, source_page: str) -> None:
+ super().__init__(convert_charrefs=True)
+ self.base_url = base_url
+ self.source_page = source_page
+ self.assets: list[GorkhapatraEpaperAsset] = []
+ self._current_viewer: str | None = None
+ self._last_thumbnail: str | None = None
+ self._capture_date = False
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ attr = dict(attrs)
+ if tag == "a":
+ href = attr.get("href")
+ if href and "/pdf?file=" in href:
+ self._current_viewer = urljoin(self.base_url, href)
+ return
+ if tag == "img":
+ src = attr.get("src")
+ if src and "/uploads/image/" in src:
+ self._last_thumbnail = urljoin(self.base_url, src)
+ return
+ if tag == "span" and "date" in (attr.get("class") or ""):
+ self._capture_date = True
+
+ def handle_data(self, data: str) -> None:
+ if not self._capture_date or not self._current_viewer:
+ return
+ date_label = " ".join(data.split())
+ direct_pdf = _direct_epaper_pdf_url(self._current_viewer)
+ self.assets.append(
+ GorkhapatraEpaperAsset(
+ viewer_url=self._current_viewer,
+ direct_pdf_url=direct_pdf,
+ source_page=self.source_page,
+ date_label=date_label or None,
+ thumbnail_url=self._last_thumbnail,
+ )
+ )
+ self._current_viewer = None
+ self._last_thumbnail = None
+ self._capture_date = False
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag == "span":
+ self._capture_date = False
+
+
+class _NayaNepalPublicationParser(HTMLParser):
+ def __init__(self, *, base_url: str, source_page: str) -> None:
+ super().__init__(convert_charrefs=True)
+ self.base_url = base_url
+ self.source_page = source_page
+ self.items: list[NayaNepalPublicationItem] = []
+ self._href_stack: list[str | None] = []
+ self._current_index: int | None = None
+ self._capture_title = False
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ attr = dict(attrs)
+ if tag == "a":
+ href = attr.get("href")
+ self._href_stack.append(urljoin(self.base_url, href) if href else None)
+ return
+ if tag == "img":
+ alt = (attr.get("alt") or "").strip()
+ if "भाषा" not in alt:
+ return
+ src = attr.get("src")
+ self.items.append(
+ NayaNepalPublicationItem(
+ article_url=self._nearest_article_url(),
+ image_url=urljoin(self.base_url, src) if src else None,
+ title=alt,
+ language=_extract_language_label(alt),
+ date_label=None,
+ date_key=None,
+ source_page=self.source_page,
+ )
+ )
+ self._current_index = len(self.items) - 1
+ return
+ if tag in {"h2", "h3"} and self._current_index is not None:
+ self._capture_title = True
+
+ def handle_endtag(self, tag: str) -> None:
+ if tag == "a" and self._href_stack:
+ self._href_stack.pop()
+ if tag in {"h2", "h3"}:
+ self._capture_title = False
+
+ def handle_data(self, data: str) -> None:
+ if self._current_index is None:
+ return
+ text = " ".join(data.split())
+ if not text:
+ return
+ item = self.items[self._current_index]
+ date_key = _nepali_date_key(text)
+ if date_key and item.date_key is None:
+ item.date_label = _clean_date_label(text)
+ item.date_key = date_key
+ if self._capture_title and "भाषा" in text:
+ item.title = text
+ item.language = _extract_language_label(text)
+
+ def _nearest_article_url(self) -> str | None:
+ for href in reversed(self._href_stack):
+ if href and re.search(r"/news/\d+", href):
+ return href
+ return None
+
+
+def audit_gorkhapatra_source(
+ output_dir: str | Path,
+ *,
+ category_urls: list[str] | None = None,
+ epaper_urls: list[str] | None = None,
+ category_html_paths: list[str | Path] | None = None,
+ epaper_html_paths: list[str | Path] | None = None,
+ download_assets: bool = False,
+ max_article_images: int = 0,
+ max_epaper_pdfs: int = 0,
+ timeout_seconds: float = 30.0,
+) -> GorkhapatraSourceAudit:
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ warnings: list[str] = []
+ category_sources = list(category_urls or ())
+ epaper_sources = list(epaper_urls or ())
+ category_inputs = _read_html_inputs(category_sources, category_html_paths or [], timeout_seconds=timeout_seconds, output_dir=out, prefix="category")
+ epaper_inputs = _read_html_inputs(epaper_sources, epaper_html_paths or [], timeout_seconds=timeout_seconds, output_dir=out, prefix="epaper")
+ articles: list[GorkhapatraArticleAsset] = []
+ for source_name, html_text in category_inputs:
+ parser = _GorkhapatraCategoryParser(base_url=GORKHAPATRA_ONLINE_BASE, source_page=source_name)
+ parser.feed(html_text)
+ articles.extend(parser.finalize_assets())
+ epapers: list[GorkhapatraEpaperAsset] = []
+ for source_name, html_text in epaper_inputs:
+ parser = _GorkhapatraEpaperParser(base_url=GORKHAPATRA_EPAPER_BASE, source_page=source_name)
+ parser.feed(html_text)
+ epapers.extend(parser.assets)
+ articles = _dedupe_articles(articles)
+ epapers = _dedupe_epapers(epapers)
+ if download_assets:
+ _download_article_images(articles, out, max_count=max_article_images, timeout_seconds=timeout_seconds, warnings=warnings)
+ _download_epaper_pdfs(epapers, out, max_count=max_epaper_pdfs, timeout_seconds=timeout_seconds, warnings=warnings)
+ language_counts: dict[str, int] = {}
+ for article in articles:
+ if article.language:
+ language_counts[article.language] = language_counts.get(article.language, 0) + 1
+ downloaded_count = sum(1 for article in articles if article.downloaded_image) + sum(1 for epaper in epapers if epaper.downloaded_pdf)
+ audit = GorkhapatraSourceAudit(
+ category_sources=[source for source, _ in category_inputs],
+ epaper_sources=[source for source, _ in epaper_inputs],
+ article_count=len(articles),
+ epaper_count=len(epapers),
+ language_counts=dict(sorted(language_counts.items())),
+ downloaded_count=downloaded_count,
+ articles=articles,
+ epapers=epapers,
+ warnings=warnings,
+ )
+ _write_gorkhapatra_audit(audit, out)
+ return audit
+
+
+def prepare_gorkhapatra_pack(
+ audit_json_path: str | Path,
+ output_dir: str | Path,
+ *,
+ include_article_images: bool = True,
+ include_epaper_pages: bool = True,
+ max_article_images: int = 0,
+ max_epaper_pdfs: int = 0,
+ max_pages_per_pdf: int = 2,
+ split: str = "eval",
+ dataset_name: str = "gorkhapatra-naya-nepal",
+) -> GorkhapatraPackSummary:
+ audit_path = Path(audit_json_path)
+ if not audit_path.is_file():
+ raise DataValidationError(f"Gorkhapatra source audit JSON does not exist: {audit_path}")
+ if max_pages_per_pdf < 1:
+ raise DataValidationError("max_pages_per_pdf must be at least 1")
+ payload = json.loads(audit_path.read_text(encoding="utf-8"))
+ out = Path(output_dir)
+ inputs_dir = out / "inputs"
+ refs_dir = out / "references"
+ manifests_dir = out / "manifests"
+ inputs_dir.mkdir(parents=True, exist_ok=True)
+ refs_dir.mkdir(parents=True, exist_ok=True)
+ manifests_dir.mkdir(parents=True, exist_ok=True)
+ entries: list[ManifestEntry] = []
+ warnings: list[str] = []
+ article_count = 0
+ epaper_page_count = 0
+ if include_article_images:
+ for article_index, article in enumerate(payload.get("articles") or [], start=1):
+ if max_article_images and article_count >= max_article_images:
+ break
+ downloaded = article.get("downloaded_image") if isinstance(article, dict) else None
+ if not isinstance(downloaded, dict) or not downloaded.get("path"):
+ continue
+ source_path = _resolve_audit_artifact_path(str(downloaded["path"]), audit_path)
+ if not source_path.is_file():
+ warnings.append(f"missing downloaded article image for article {article_index}: {source_path}")
+ continue
+ sample_id = f"gorkhapatra-article-{article_index:04d}"
+ target_path = inputs_dir / f"{sample_id}{source_path.suffix.lower() or '.jpg'}"
+ shutil.copy2(source_path, target_path)
+ reference_path = refs_dir / f"{sample_id}.ref.json"
+ language = _clean_optional_str(article.get("language"))
+ source_url = _clean_optional_str(article.get("article_url")) or _clean_optional_str(article.get("image_url"))
+ _write_pending_reference(
+ reference_path,
+ sample_id=sample_id,
+ source_url=source_url,
+ language=language,
+ source_kind="gorkhapatra_article_image",
+ )
+ image_hash = sha256_file(target_path)
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset=dataset_name,
+ split=split,
+ image_path=str(target_path),
+ text="",
+ sha256=image_hash,
+ metadata={
+ "benchmark_name": "gorkhapatra-naya-nepal",
+ "source": "gorkhapatra",
+ "source_kind": "article_image",
+ "source_url": source_url,
+ "source_image_url": article.get("image_url"),
+ "language": language,
+ "script": "unknown",
+ "input_format": "image",
+ "document_type": "article_image",
+ "reference_path": str(reference_path),
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ "slices": _gorkhapatra_slices(language, "article_image"),
+ "text_sha256": sha256_text(""),
+ "sample_sha256": sha256_text(f"{image_hash}\n"),
+ },
+ )
+ )
+ article_count += 1
+ if include_epaper_pages:
+ epapers = payload.get("epapers") or []
+ rendered_pdf_count = 0
+ for epaper_index, epaper in enumerate(epapers, start=1):
+ if max_epaper_pdfs and rendered_pdf_count >= max_epaper_pdfs:
+ break
+ downloaded = epaper.get("downloaded_pdf") if isinstance(epaper, dict) else None
+ if not isinstance(downloaded, dict) or not downloaded.get("path"):
+ continue
+ source_path = _resolve_audit_artifact_path(str(downloaded["path"]), audit_path)
+ if not source_path.is_file():
+ warnings.append(f"missing downloaded epaper PDF for epaper {epaper_index}: {source_path}")
+ continue
+ try:
+ rendered_pages = _render_pdf_pages(source_path, inputs_dir, epaper_index=epaper_index, max_pages=max_pages_per_pdf)
+ except DataValidationError as exc:
+ warnings.append(str(exc))
+ continue
+ rendered_pdf_count += 1
+ for page_index, target_path in rendered_pages:
+ sample_id = f"gorkhapatra-epaper-{epaper_index:04d}-page-{page_index + 1:04d}"
+ reference_path = refs_dir / f"{sample_id}.ref.json"
+ source_url = _clean_optional_str(epaper.get("direct_pdf_url")) or _clean_optional_str(epaper.get("viewer_url"))
+ _write_pending_reference(
+ reference_path,
+ sample_id=sample_id,
+ source_url=source_url,
+ language=None,
+ source_kind="gorkhapatra_epaper_page",
+ )
+ image_hash = sha256_file(target_path)
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset=dataset_name,
+ split=split,
+ image_path=str(target_path),
+ text="",
+ sha256=image_hash,
+ metadata={
+ "benchmark_name": "gorkhapatra-naya-nepal",
+ "source": "gorkhapatra",
+ "source_kind": "epaper_page",
+ "source_url": source_url,
+ "viewer_url": epaper.get("viewer_url"),
+ "date_label": epaper.get("date_label"),
+ "pdf_sha256": downloaded.get("sha256"),
+ "pdf_page_index": page_index,
+ "language": None,
+ "script": "unknown",
+ "input_format": "image",
+ "document_type": "epaper_page",
+ "reference_path": str(reference_path),
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ "slices": _gorkhapatra_slices(None, "epaper_page"),
+ "text_sha256": sha256_text(""),
+ "sample_sha256": sha256_text(f"{image_hash}\n"),
+ },
+ )
+ )
+ epaper_page_count += 1
+ manifest_path = manifests_dir / "gorkhapatra-pack.jsonl"
+ write_manifest(entries, manifest_path)
+ summary = _gorkhapatra_pack_summary(
+ manifest_path,
+ entries,
+ article_image_count=article_count,
+ epaper_page_count=epaper_page_count,
+ warnings=warnings,
+ )
+ _write_gorkhapatra_pack_summary(summary, out)
+ return summary
+
+
+def audit_gorkhapatra_language_pages(
+ output_dir: str | Path,
+ *,
+ publication_urls: list[str] | None = None,
+ epaper_urls: list[str] | None = None,
+ publication_html_paths: list[str | Path] | None = None,
+ epaper_html_paths: list[str | Path] | None = None,
+ download_pdfs: bool = False,
+ render_pages: bool = False,
+ max_publication_items: int = 0,
+ max_epaper_pdfs: int = 0,
+ timeout_seconds: float = 30.0,
+) -> GorkhapatraLanguagePageAudit:
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ warnings: list[str] = []
+ publication_sources = list(publication_urls or ())
+ epaper_sources = list(epaper_urls or ())
+ publication_inputs = _read_html_inputs(
+ publication_sources,
+ publication_html_paths or [],
+ timeout_seconds=timeout_seconds,
+ output_dir=out,
+ prefix="naya-nepal-publication",
+ )
+ epaper_inputs = _read_html_inputs(epaper_sources, epaper_html_paths or [], timeout_seconds=timeout_seconds, output_dir=out, prefix="epaper")
+ publication_items: list[NayaNepalPublicationItem] = []
+ for source_name, html_text in publication_inputs:
+ parser = _NayaNepalPublicationParser(base_url=GORKHAPATRA_ONLINE_BASE, source_page=source_name)
+ parser.feed(html_text)
+ publication_items.extend(parser.items)
+ publication_items = _dedupe_publication_items(publication_items)
+ if max_publication_items:
+ publication_items = publication_items[:max_publication_items]
+ epapers: list[GorkhapatraEpaperAsset] = []
+ for source_name, html_text in epaper_inputs:
+ parser = _GorkhapatraEpaperParser(base_url=GORKHAPATRA_EPAPER_BASE, source_page=source_name)
+ parser.feed(html_text)
+ epapers.extend(parser.assets)
+ epapers = _dedupe_epapers(epapers)
+ epapers_by_date = {_nepali_date_key(epaper.date_label or ""): epaper for epaper in epapers if _nepali_date_key(epaper.date_label or "")}
+ alignments: list[GorkhapatraLanguagePageAlignment] = []
+ downloaded_pdf_count = 0
+ pdf_cache: dict[str, DownloadedArtifact] = {}
+ for index, item in enumerate(publication_items, start=1):
+ item_warnings: list[str] = []
+ if not item.date_key:
+ alignments.append(_language_page_alignment(item, None, None, None, [], "missing_publication_date", item_warnings))
+ continue
+ epaper = epapers_by_date.get(item.date_key)
+ if epaper is None:
+ alignments.append(_language_page_alignment(item, None, None, None, [], "no_matching_epaper_date", item_warnings))
+ continue
+ if not download_pdfs:
+ alignments.append(_language_page_alignment(item, epaper, None, None, [], "matched_epaper_not_downloaded", item_warnings))
+ continue
+ if max_epaper_pdfs and downloaded_pdf_count >= max_epaper_pdfs and epaper.direct_pdf_url not in pdf_cache:
+ alignments.append(_language_page_alignment(item, epaper, None, None, [], "matched_epaper_not_downloaded_limit", item_warnings))
+ continue
+ try:
+ artifact = pdf_cache.get(epaper.direct_pdf_url)
+ if artifact is None:
+ target = out / "epapers" / f"epaper-{item.date_key}.pdf"
+ artifact = _download_url(epaper.direct_pdf_url, target, timeout_seconds=timeout_seconds)
+ artifact.pdf_audit = _audit_pdf_with_pymupdf(target)
+ pdf_cache[epaper.direct_pdf_url] = artifact
+ downloaded_pdf_count += 1
+ epaper.downloaded_pdf = artifact
+ hits = _find_language_page_hits(Path(artifact.path), out / "language-pages", render_pages=render_pages)
+ status = "language_page_found" if hits else "matched_epaper_no_language_page_marker"
+ alignments.append(_language_page_alignment(item, epaper, artifact.path, artifact.sha256, hits, status, item_warnings))
+ except Exception as exc: # noqa: BLE001 - recorded as provenance warning, not ignored.
+ warning = f"{type(exc).__name__}: {exc}"
+ item_warnings.append(warning)
+ warnings.append(f"failed to inspect {epaper.direct_pdf_url}: {warning}")
+ alignments.append(_language_page_alignment(item, epaper, None, None, [], "pdf_inspection_failed", item_warnings))
+ audit = _gorkhapatra_language_page_audit(
+ publication_sources=[source for source, _ in publication_inputs],
+ epaper_sources=[source for source, _ in epaper_inputs],
+ publication_items=publication_items,
+ alignments=alignments,
+ warnings=warnings,
+ )
+ _write_gorkhapatra_language_page_audit(audit, out)
+ return audit
+
+
+def prepare_gorkhapatra_language_page_pack(
+ language_page_audit_json_path: str | Path,
+ output_dir: str | Path,
+ *,
+ split: str = "eval",
+ dataset_name: str = "gorkhapatra-language-pages",
+ max_samples: int = 0,
+) -> GorkhapatraLanguagePagePackSummary:
+ audit_path = Path(language_page_audit_json_path)
+ if not audit_path.is_file():
+ raise DataValidationError(f"Gorkhapatra language-page audit JSON does not exist: {audit_path}")
+ payload = json.loads(audit_path.read_text(encoding="utf-8"))
+ out = Path(output_dir)
+ inputs_dir = out / "inputs"
+ refs_dir = out / "references"
+ manifests_dir = out / "manifests"
+ inputs_dir.mkdir(parents=True, exist_ok=True)
+ refs_dir.mkdir(parents=True, exist_ok=True)
+ manifests_dir.mkdir(parents=True, exist_ok=True)
+ entries: list[ManifestEntry] = []
+ warnings: list[str] = []
+ copied_count = 0
+ for alignment_index, alignment in enumerate(payload.get("alignments") or [], start=1):
+ if max_samples and len(entries) >= max_samples:
+ break
+ if not isinstance(alignment, dict):
+ continue
+ publication_item = alignment.get("publication_item")
+ if not isinstance(publication_item, dict):
+ warnings.append(f"alignment {alignment_index} missing publication_item")
+ continue
+ language = _clean_optional_str(publication_item.get("language"))
+ date_key = _clean_optional_str(publication_item.get("date_key")) or "unknown-date"
+ page_hits = alignment.get("page_hits")
+ if not isinstance(page_hits, list) or not page_hits:
+ warnings.append(f"alignment {alignment_index} has no rendered page hits")
+ continue
+ for hit_index, hit in enumerate(page_hits, start=1):
+ if max_samples and len(entries) >= max_samples:
+ break
+ if not isinstance(hit, dict):
+ continue
+ rendered_path_value = _clean_optional_str(hit.get("rendered_page_path"))
+ if not rendered_path_value:
+ warnings.append(f"alignment {alignment_index} page hit {hit_index} has no rendered_page_path")
+ continue
+ source_path = _resolve_audit_artifact_path(rendered_path_value, audit_path)
+ if not source_path.is_file():
+ warnings.append(f"alignment {alignment_index} page hit {hit_index} missing rendered page: {source_path}")
+ continue
+ page_index = int(hit.get("page_index") or 0)
+ sample_id = f"gorkhapatra-language-page-{alignment_index:04d}-{hit_index:02d}"
+ target_path = inputs_dir / f"{sample_id}{source_path.suffix.lower() or '.png'}"
+ shutil.copy2(source_path, target_path)
+ reference_path = refs_dir / f"{sample_id}.ref.json"
+ source_url = _alignment_source_url(alignment)
+ _write_pending_reference(
+ reference_path,
+ sample_id=sample_id,
+ source_url=source_url,
+ language=language,
+ source_kind="gorkhapatra_language_page_candidate",
+ )
+ image_hash = sha256_file(target_path)
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset=dataset_name,
+ split=split,
+ image_path=str(target_path),
+ text="",
+ sha256=image_hash,
+ metadata={
+ "benchmark_name": "gorkhapatra-naya-nepal-language-pages",
+ "source": "gorkhapatra",
+ "source_kind": "language_page_candidate",
+ "source_url": source_url,
+ "article_url": publication_item.get("article_url"),
+ "source_image_url": publication_item.get("image_url"),
+ "candidate_language": language,
+ "language": language,
+ "date_label": publication_item.get("date_label"),
+ "date_key": date_key,
+ "pdf_path": alignment.get("pdf_path"),
+ "pdf_sha256": alignment.get("pdf_sha256"),
+ "pdf_page_index": page_index,
+ "pdf_page_number": page_index + 1,
+ "language_page_marker": hit.get("marker"),
+ "alignment_status": alignment.get("alignment_status"),
+ "page_disambiguation_status": "candidate_requires_manual_review",
+ "script": "unknown",
+ "input_format": "image",
+ "document_type": "language_page_candidate",
+ "reference_path": str(reference_path),
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ "slices": _gorkhapatra_slices(language, "language_page_candidate"),
+ "text_sha256": sha256_text(""),
+ "sample_sha256": sha256_text(f"{image_hash}\n{alignment.get('pdf_sha256') or ''}\n{page_index}\n"),
+ },
+ )
+ )
+ copied_count += 1
+ manifest_path = manifests_dir / "gorkhapatra-language-page-pack.jsonl"
+ write_manifest(entries, manifest_path)
+ summary = _gorkhapatra_language_page_pack_summary(
+ manifest_path,
+ entries,
+ copied_page_count=copied_count,
+ warnings=warnings,
+ )
+ _write_gorkhapatra_language_page_pack_summary(summary, out)
+ return summary
+
+
+def prepare_gorkhapatra_language_page_review(
+ manifest_path: str | Path,
+ output_dir: str | Path,
+) -> GorkhapatraLanguagePageReviewSummary:
+ source_manifest = Path(manifest_path)
+ if not source_manifest.is_file():
+ raise DataValidationError(f"Gorkhapatra language-page pack manifest does not exist: {source_manifest}")
+ entries = load_manifest(source_manifest)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ rows: list[dict[str, Any]] = []
+ warnings: list[str] = []
+ language_counts: dict[str, int] = {}
+ page_candidate_counts: dict[str, int] = {}
+ for entry in entries:
+ metadata = entry.metadata or {}
+ source_kind = metadata.get("source_kind")
+ if source_kind != "language_page_candidate":
+ warnings.append(f"{entry.sample_id} source_kind is not language_page_candidate: {source_kind}")
+ candidate_language = _clean_optional_str(metadata.get("candidate_language")) or _clean_optional_str(metadata.get("language"))
+ if candidate_language:
+ language_counts[candidate_language] = language_counts.get(candidate_language, 0) + 1
+ date_key = _clean_optional_str(metadata.get("date_key")) or "unknown-date"
+ page_number = metadata.get("pdf_page_number")
+ page_key = f"{date_key}:page-{page_number if page_number is not None else 'unknown'}"
+ page_candidate_counts[page_key] = page_candidate_counts.get(page_key, 0) + 1
+ rows.append(
+ {
+ "sample_id": entry.sample_id,
+ "candidate_language": candidate_language,
+ "date_label": metadata.get("date_label"),
+ "date_key": metadata.get("date_key"),
+ "pdf_page_index": metadata.get("pdf_page_index"),
+ "pdf_page_number": metadata.get("pdf_page_number"),
+ "image_path": entry.image_path,
+ "reference_path": metadata.get("reference_path"),
+ "article_url": metadata.get("article_url"),
+ "source_image_url": metadata.get("source_image_url"),
+ "source_url": metadata.get("source_url"),
+ "pdf_path": metadata.get("pdf_path"),
+ "pdf_sha256": metadata.get("pdf_sha256"),
+ "language_page_marker": metadata.get("language_page_marker"),
+ "alignment_status": metadata.get("alignment_status"),
+ "page_disambiguation_status": metadata.get("page_disambiguation_status"),
+ "reference_status": metadata.get("reference_status"),
+ "claim_evidence_eligible": bool(metadata.get("claim_evidence_eligible")),
+ "review_decision": "",
+ "reviewer": "",
+ "reviewed_at": "",
+ "notes": "",
+ }
+ )
+ json_path = out / "gorkhapatra-language-page-review.json"
+ csv_path = out / "gorkhapatra-language-page-review.csv"
+ md_path = out / "gorkhapatra-language-page-review.md"
+ summary = GorkhapatraLanguagePageReviewSummary(
+ manifest_path=str(source_manifest),
+ review_json_path=str(json_path),
+ review_csv_path=str(csv_path),
+ review_md_path=str(md_path),
+ sample_count=len(rows),
+ pending_review_count=sum(1 for row in rows if row["page_disambiguation_status"] == "candidate_requires_manual_review"),
+ claim_evidence_eligible_count=sum(1 for row in rows if row["claim_evidence_eligible"]),
+ language_counts=dict(sorted(language_counts.items())),
+ page_candidate_counts=dict(sorted(page_candidate_counts.items())),
+ warnings=warnings,
+ )
+ _write_gorkhapatra_language_page_review(summary, rows)
+ return summary
+
+
+def _read_html_inputs(
+ urls: list[str],
+ paths: list[str | Path],
+ *,
+ timeout_seconds: float,
+ output_dir: Path,
+ prefix: str,
+) -> list[tuple[str, str]]:
+ inputs: list[tuple[str, str]] = []
+ raw_dir = output_dir / "raw"
+ raw_dir.mkdir(parents=True, exist_ok=True)
+ for index, url in enumerate(urls, start=1):
+ text = _fetch_text(url, timeout_seconds=timeout_seconds)
+ raw_path = raw_dir / f"{prefix}-url-{index}.html"
+ raw_path.write_text(text, encoding="utf-8")
+ inputs.append((url, text))
+ for path in paths:
+ html_path = Path(path)
+ if not html_path.is_file():
+ raise DataValidationError(f"{prefix} HTML path does not exist: {html_path}")
+ inputs.append((str(html_path), html_path.read_text(encoding="utf-8")))
+ return inputs
+
+
+def _fetch_text(url: str, *, timeout_seconds: float) -> str:
+ request = Request(url, headers={"User-Agent": "ocrtech-source-audit/0.1"})
+ with urlopen(request, timeout=timeout_seconds) as response:
+ data = response.read()
+ return data.decode("utf-8", errors="replace")
+
+
+def _download_url(url: str, path: Path, *, timeout_seconds: float) -> DownloadedArtifact:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ request = Request(url, headers={"User-Agent": "ocrtech-source-audit/0.1"})
+ with urlopen(request, timeout=timeout_seconds) as response:
+ path.write_bytes(response.read())
+ return DownloadedArtifact(url=url, path=str(path), sha256=sha256_file(path), size_bytes=path.stat().st_size, kind=_artifact_kind(path))
+
+
+def _download_article_images(
+ articles: list[GorkhapatraArticleAsset],
+ output_dir: Path,
+ *,
+ max_count: int,
+ timeout_seconds: float,
+ warnings: list[str],
+) -> None:
+ count = 0
+ for index, article in enumerate(articles, start=1):
+ if max_count and count >= max_count:
+ return
+ if not article.image_url:
+ continue
+ suffix = _url_suffix(article.image_url, default=".jpg")
+ target = output_dir / "article-images" / f"article-{index:04d}{suffix}"
+ try:
+ article.downloaded_image = _download_url(article.image_url, target, timeout_seconds=timeout_seconds)
+ count += 1
+ except Exception as exc: # noqa: BLE001 - wrapped as provenance warning, not ignored.
+ warnings.append(f"failed to download article image {article.image_url}: {type(exc).__name__}: {exc}")
+
+
+def _download_epaper_pdfs(
+ epapers: list[GorkhapatraEpaperAsset],
+ output_dir: Path,
+ *,
+ max_count: int,
+ timeout_seconds: float,
+ warnings: list[str],
+) -> None:
+ count = 0
+ for index, epaper in enumerate(epapers, start=1):
+ if max_count and count >= max_count:
+ return
+ target = output_dir / "epapers" / f"epaper-{index:04d}.pdf"
+ try:
+ artifact = _download_url(epaper.direct_pdf_url, target, timeout_seconds=timeout_seconds)
+ artifact.pdf_audit = _audit_pdf_with_pymupdf(target)
+ epaper.downloaded_pdf = artifact
+ count += 1
+ except Exception as exc: # noqa: BLE001 - wrapped as provenance warning, not ignored.
+ warnings.append(f"failed to download epaper PDF {epaper.direct_pdf_url}: {type(exc).__name__}: {exc}")
+
+
+def _audit_pdf_with_pymupdf(path: Path) -> dict[str, Any]:
+ try:
+ import fitz # type: ignore[import-not-found]
+ except Exception as exc: # noqa: BLE001 - optional dependency.
+ return {"available": False, "error": f"{type(exc).__name__}: {exc}"}
+ with fitz.open(path) as document:
+ pages: list[dict[str, Any]] = []
+ total_text_chars = 0
+ for index, page in enumerate(document):
+ text = page.get_text("text") or ""
+ total_text_chars += len(text)
+ if index < 5:
+ pages.append(
+ {
+ "page_index": index,
+ "text_chars": len(text),
+ "text_preview": text[:300],
+ "block_count": len(page.get_text("blocks") or []),
+ "image_count": len(page.get_images(full=True) or []),
+ }
+ )
+ return {
+ "available": True,
+ "page_count": document.page_count,
+ "total_text_chars": total_text_chars,
+ "first_pages": pages,
+ "text_layer_warning": _pdf_text_layer_warning(pages),
+ }
+
+
+def _pdf_text_layer_warning(pages: list[dict[str, Any]]) -> str | None:
+ preview = "\n".join(str(page.get("text_preview") or "") for page in pages)
+ if not preview.strip():
+ return "no_text_extracted"
+ devanagari = sum(1 for char in preview if "\u0900" <= char <= "\u097f")
+ ascii_like = sum(1 for char in preview if char.isascii() and char.isalnum())
+ if ascii_like > devanagari * 5 and devanagari < 20:
+ return "extracted_text_may_be_legacy_encoded_or_mojibake"
+ return None
+
+
+def _find_language_page_hits(pdf_path: Path, output_dir: Path, *, render_pages: bool) -> list[GorkhapatraLanguagePageHit]:
+ try:
+ import fitz # type: ignore[import-not-found]
+ except Exception as exc: # noqa: BLE001 - optional dependency.
+ raise DataValidationError(f"PDF page marker search requires PyMuPDF: {type(exc).__name__}: {exc}") from exc
+ hits: list[GorkhapatraLanguagePageHit] = []
+ if render_pages:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ with fitz.open(pdf_path) as document:
+ for page_index, page in enumerate(document):
+ text = page.get_text("text") or ""
+ marker = _language_page_marker(text)
+ if marker is None:
+ continue
+ rendered_path: str | None = None
+ if render_pages:
+ target = output_dir / f"{pdf_path.stem}-page-{page_index + 1:04d}.png"
+ pixmap = page.get_pixmap(matrix=fitz.Matrix(2.0, 2.0), alpha=False)
+ pixmap.save(target)
+ rendered_path = str(target)
+ hits.append(
+ GorkhapatraLanguagePageHit(
+ page_index=page_index,
+ marker=marker,
+ text_chars=len(text),
+ text_preview=" ".join(text.split())[:500],
+ rendered_page_path=rendered_path,
+ )
+ )
+ return hits
+
+
+def _language_page_marker(text: str) -> str | None:
+ normalized = " ".join(text.split()).lower()
+ for marker in LANGUAGE_PAGE_MARKERS:
+ if marker.lower() in normalized:
+ return marker
+ if "भाषा" in normalized and "पृष्ठ" in normalized:
+ return "भाषा+पृष्ठ"
+ return None
+
+
+def _write_gorkhapatra_audit(audit: GorkhapatraSourceAudit, output_dir: Path) -> None:
+ json_path = output_dir / "gorkhapatra-source-audit.json"
+ md_path = output_dir / "gorkhapatra-source-audit.md"
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Gorkhapatra Source Audit",
+ "",
+ f"- article assets: {audit.article_count}",
+ f"- epaper assets: {audit.epaper_count}",
+ f"- downloaded artifacts: {audit.downloaded_count}",
+ f"- warnings: {len(audit.warnings)}",
+ "",
+ "## Languages",
+ "",
+ ]
+ if audit.language_counts:
+ lines.extend(f"- {language}: {count}" for language, count in audit.language_counts.items())
+ else:
+ lines.append("- none detected")
+ if audit.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings)
+ lines.extend(["", "## Sample Article Assets", ""])
+ for article in audit.articles[:20]:
+ lines.append(f"- {article.language or 'unknown'}: {article.title} ({article.article_url or 'no article URL'})")
+ lines.extend(["", "## Sample Epaper Assets", ""])
+ for epaper in audit.epapers[:20]:
+ lines.append(f"- {epaper.date_label or 'unknown date'}: {epaper.direct_pdf_url}")
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_gorkhapatra_language_page_audit(audit: GorkhapatraLanguagePageAudit, output_dir: Path) -> None:
+ json_path = output_dir / "gorkhapatra-language-pages.json"
+ md_path = output_dir / "gorkhapatra-language-pages.md"
+ audit.summary_json_path = str(json_path)
+ audit.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(audit.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Gorkhapatra Language Page Alignment",
+ "",
+ f"- publication items: {audit.publication_item_count}",
+ f"- aligned to epaper date: {audit.aligned_count}",
+ f"- language page hits: {audit.language_page_hit_count}",
+ f"- warnings: {len(audit.warnings)}",
+ "",
+ "## Status",
+ "",
+ ]
+ lines.extend(f"- `{status}`: {count}" for status, count in audit.status_counts.items()) if audit.status_counts else lines.append("- none")
+ lines.extend(["", "## Languages", ""])
+ lines.extend(f"- {language}: {count}" for language, count in audit.language_counts.items()) if audit.language_counts else lines.append("- none")
+ lines.extend(["", "## Alignments", ""])
+ for alignment in audit.alignments[:50]:
+ item = alignment.publication_item
+ page_list = ", ".join(str(hit.page_index + 1) for hit in alignment.page_hits) or "none"
+ lines.append(
+ f"- {item.date_label or 'unknown date'} / {item.language or 'unknown'}: "
+ f"`{alignment.alignment_status}` pages={page_list} title={item.title}"
+ )
+ if audit.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in audit.warnings)
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _direct_epaper_pdf_url(viewer_url: str) -> str:
+ parsed = urlparse(viewer_url)
+ values = parse_qs(parsed.query).get("file")
+ if not values:
+ raise DataValidationError(f"epaper viewer URL does not include file parameter: {viewer_url}")
+ return urljoin(GORKHAPATRA_EPAPER_BASE, unquote(values[0]))
+
+
+def _extract_language_label(title: str) -> str | None:
+ match = re.search(r"प्रकाशित\s+(.+?)\s+भाषा", title)
+ if not match:
+ return None
+ return " ".join(match.group(1).split())
+
+
+def _nepali_date_key(text: str) -> str | None:
+ normalized = _normalize_nepali_digits(" ".join(text.split()))
+ patterns = (
+ r"(?P\d{1,2})\s+(?P[^\s,]+)\s+(?P\d{4})",
+ r"(?P\d{4})\s+(?P[^\s,]+)\s+(?P\d{1,2})",
+ )
+ for pattern in patterns:
+ match = re.search(pattern, normalized)
+ if not match:
+ continue
+ month = NEPALI_MONTHS.get(match.group("month"))
+ if month is None:
+ continue
+ return f"{int(match.group('year')):04d}-{month:02d}-{int(match.group('day')):02d}"
+ return None
+
+
+def _normalize_nepali_digits(text: str) -> str:
+ table = str.maketrans("०१२३४५६७८९", "0123456789")
+ return text.translate(table)
+
+
+def _clean_date_label(text: str) -> str:
+ return " ".join(text.split()).strip()
+
+
+def _dedupe_publication_items(items: list[NayaNepalPublicationItem]) -> list[NayaNepalPublicationItem]:
+ seen: set[tuple[str | None, str | None, str, str | None]] = set()
+ unique: list[NayaNepalPublicationItem] = []
+ for item in items:
+ key = (item.article_url, item.image_url, item.title, item.date_key)
+ if key in seen:
+ continue
+ seen.add(key)
+ unique.append(item)
+ return unique
+
+
+def _language_page_alignment(
+ item: NayaNepalPublicationItem,
+ epaper: GorkhapatraEpaperAsset | None,
+ pdf_path: str | None,
+ pdf_sha256: str | None,
+ hits: list[GorkhapatraLanguagePageHit],
+ status: str,
+ warnings: list[str],
+) -> GorkhapatraLanguagePageAlignment:
+ return GorkhapatraLanguagePageAlignment(
+ publication_item=item,
+ epaper=epaper,
+ pdf_path=pdf_path,
+ pdf_sha256=pdf_sha256,
+ page_hits=hits,
+ alignment_status=status,
+ claim_evidence_eligible=False,
+ warnings=warnings,
+ )
+
+
+def _alignment_source_url(alignment: dict[str, Any]) -> str | None:
+ epaper = alignment.get("epaper")
+ if isinstance(epaper, dict):
+ return _clean_optional_str(epaper.get("direct_pdf_url")) or _clean_optional_str(epaper.get("viewer_url"))
+ publication_item = alignment.get("publication_item")
+ if isinstance(publication_item, dict):
+ return _clean_optional_str(publication_item.get("article_url")) or _clean_optional_str(publication_item.get("image_url"))
+ return None
+
+
+def _gorkhapatra_language_page_audit(
+ *,
+ publication_sources: list[str],
+ epaper_sources: list[str],
+ publication_items: list[NayaNepalPublicationItem],
+ alignments: list[GorkhapatraLanguagePageAlignment],
+ warnings: list[str],
+) -> GorkhapatraLanguagePageAudit:
+ status_counts: dict[str, int] = {}
+ language_counts: dict[str, int] = {}
+ for alignment in alignments:
+ status_counts[alignment.alignment_status] = status_counts.get(alignment.alignment_status, 0) + 1
+ language = alignment.publication_item.language
+ if language:
+ language_counts[language] = language_counts.get(language, 0) + 1
+ return GorkhapatraLanguagePageAudit(
+ publication_sources=publication_sources,
+ epaper_sources=epaper_sources,
+ publication_item_count=len(publication_items),
+ aligned_count=sum(1 for alignment in alignments if alignment.epaper is not None),
+ language_page_hit_count=sum(len(alignment.page_hits) for alignment in alignments),
+ status_counts=dict(sorted(status_counts.items())),
+ language_counts=dict(sorted(language_counts.items())),
+ alignments=alignments,
+ warnings=warnings,
+ )
+
+
+def _gorkhapatra_language_page_pack_summary(
+ manifest_path: Path,
+ entries: list[ManifestEntry],
+ *,
+ copied_page_count: int,
+ warnings: list[str],
+) -> GorkhapatraLanguagePagePackSummary:
+ language_counts: dict[str, int] = {}
+ reference_status_counts: dict[str, int] = {}
+ for entry in entries:
+ language = entry.metadata.get("language")
+ if isinstance(language, str) and language:
+ language_counts[language] = language_counts.get(language, 0) + 1
+ status = str(entry.metadata.get("reference_status") or "unknown")
+ reference_status_counts[status] = reference_status_counts.get(status, 0) + 1
+ return GorkhapatraLanguagePagePackSummary(
+ manifest_path=str(manifest_path),
+ sample_count=len(entries),
+ copied_page_count=copied_page_count,
+ language_counts=dict(sorted(language_counts.items())),
+ reference_status_counts=dict(sorted(reference_status_counts.items())),
+ warnings=warnings,
+ )
+
+
+def _dedupe_articles(articles: list[GorkhapatraArticleAsset]) -> list[GorkhapatraArticleAsset]:
+ seen: set[tuple[str | None, str | None, str]] = set()
+ unique: list[GorkhapatraArticleAsset] = []
+ for article in articles:
+ key = (article.article_url, article.image_url, article.title)
+ if key in seen:
+ continue
+ seen.add(key)
+ unique.append(article)
+ return unique
+
+
+def _dedupe_epapers(epapers: list[GorkhapatraEpaperAsset]) -> list[GorkhapatraEpaperAsset]:
+ seen: set[str] = set()
+ unique: list[GorkhapatraEpaperAsset] = []
+ for epaper in epapers:
+ if epaper.direct_pdf_url in seen:
+ continue
+ seen.add(epaper.direct_pdf_url)
+ unique.append(epaper)
+ return unique
+
+
+def _artifact_kind(path: Path) -> str:
+ suffix = path.suffix.lower()
+ if suffix == ".pdf":
+ return "pdf"
+ if suffix in {".jpg", ".jpeg", ".png", ".webp"}:
+ return "image"
+ return "file"
+
+
+def _url_suffix(url: str, *, default: str) -> str:
+ suffix = Path(urlparse(url).path).suffix.lower()
+ if suffix in {".jpg", ".jpeg", ".png", ".webp", ".pdf"}:
+ return suffix
+ return default
+
+
+def _resolve_audit_artifact_path(path_value: str, audit_json_path: Path) -> Path:
+ path = Path(path_value)
+ if path.is_absolute():
+ return path
+ audit_dir = audit_json_path.parent
+ candidate = audit_dir / path
+ if candidate.exists():
+ return candidate
+ return path
+
+
+def _write_pending_reference(
+ path: Path,
+ *,
+ sample_id: str,
+ source_url: str | None,
+ language: str | None,
+ source_kind: str,
+) -> None:
+ payload = {
+ "text": "",
+ "reading_order": [],
+ "tables": [],
+ "figures": [],
+ "metadata": {
+ "sample_id": sample_id,
+ "source_url": source_url,
+ "language": language,
+ "source_kind": source_kind,
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ "notes": "Real Gorkhapatra source input. Text/layout reference must be manually verified before claim use.",
+ },
+ }
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+
+
+def _render_pdf_pages(source_pdf: Path, inputs_dir: Path, *, epaper_index: int, max_pages: int) -> list[tuple[int, Path]]:
+ try:
+ import fitz # type: ignore[import-not-found]
+ except Exception as exc: # noqa: BLE001 - optional dependency.
+ raise DataValidationError(f"PDF page rendering requires PyMuPDF: {type(exc).__name__}: {exc}") from exc
+ rendered: list[tuple[int, Path]] = []
+ with fitz.open(source_pdf) as document:
+ page_count = min(document.page_count, max_pages)
+ for page_index in range(page_count):
+ page = document[page_index]
+ target = inputs_dir / f"gorkhapatra-epaper-{epaper_index:04d}-page-{page_index + 1:04d}.png"
+ pixmap = page.get_pixmap(matrix=fitz.Matrix(2.0, 2.0), alpha=False)
+ pixmap.save(target)
+ rendered.append((page_index, target))
+ return rendered
+
+
+def _gorkhapatra_slices(language: str | None, source_kind: str) -> list[str]:
+ slices = {"gorkhapatra", "naya_nepal", "real_publication", "image"}
+ if source_kind == "article_image":
+ slices.add("article_image")
+ if source_kind == "epaper_page":
+ slices.update({"epaper", "page"})
+ if source_kind == "language_page_candidate":
+ slices.update({"epaper", "page", "language_page_candidate", "pending_reference"})
+ if language:
+ slices.add(f"language:{language}")
+ return sorted(slices)
+
+
+def _gorkhapatra_pack_summary(
+ manifest_path: Path,
+ entries: list[ManifestEntry],
+ *,
+ article_image_count: int,
+ epaper_page_count: int,
+ warnings: list[str],
+) -> GorkhapatraPackSummary:
+ language_counts: dict[str, int] = {}
+ reference_status_counts: dict[str, int] = {}
+ for entry in entries:
+ language = entry.metadata.get("language")
+ if isinstance(language, str) and language:
+ language_counts[language] = language_counts.get(language, 0) + 1
+ status = str(entry.metadata.get("reference_status") or "unknown")
+ reference_status_counts[status] = reference_status_counts.get(status, 0) + 1
+ return GorkhapatraPackSummary(
+ manifest_path=str(manifest_path),
+ sample_count=len(entries),
+ article_image_count=article_image_count,
+ epaper_page_count=epaper_page_count,
+ language_counts=dict(sorted(language_counts.items())),
+ reference_status_counts=dict(sorted(reference_status_counts.items())),
+ warnings=warnings,
+ )
+
+
+def _write_gorkhapatra_pack_summary(summary: GorkhapatraPackSummary, output_dir: Path) -> None:
+ json_path = output_dir / "gorkhapatra-pack.json"
+ md_path = output_dir / "gorkhapatra-pack.md"
+ summary.summary_json_path = str(json_path)
+ summary.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Gorkhapatra Validation Pack",
+ "",
+ f"- manifest: `{summary.manifest_path}`",
+ f"- samples: {summary.sample_count}",
+ f"- article images: {summary.article_image_count}",
+ f"- epaper pages: {summary.epaper_page_count}",
+ "",
+ "## Reference Status",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.reference_status_counts.items()) if summary.reference_status_counts else lines.append("- none")
+ lines.extend(["", "## Languages", ""])
+ lines.extend(f"- {language}: {count}" for language, count in summary.language_counts.items()) if summary.language_counts else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in summary.warnings) if summary.warnings else lines.append("- none")
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_gorkhapatra_language_page_pack_summary(summary: GorkhapatraLanguagePagePackSummary, output_dir: Path) -> None:
+ json_path = output_dir / "gorkhapatra-language-page-pack.json"
+ md_path = output_dir / "gorkhapatra-language-page-pack.md"
+ summary.summary_json_path = str(json_path)
+ summary.summary_md_path = str(md_path)
+ json_path.write_text(json.dumps(summary.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# Gorkhapatra Language Page Candidate Pack",
+ "",
+ f"- manifest: `{summary.manifest_path}`",
+ f"- samples: {summary.sample_count}",
+ f"- copied page candidates: {summary.copied_page_count}",
+ "",
+ "## Reference Status",
+ "",
+ ]
+ lines.extend(f"- `{key}`: {value}" for key, value in summary.reference_status_counts.items()) if summary.reference_status_counts else lines.append("- none")
+ lines.extend(["", "## Languages", ""])
+ lines.extend(f"- {language}: {count}" for language, count in summary.language_counts.items()) if summary.language_counts else lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in summary.warnings) if summary.warnings else lines.append("- none")
+ lines.extend(
+ [
+ "",
+ "## Claim Status",
+ "",
+ "All rows are `claim_evidence_eligible=false` and `pending_manual_label` until page-language disambiguation and reference transcription are complete.",
+ ]
+ )
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _write_gorkhapatra_language_page_review(
+ summary: GorkhapatraLanguagePageReviewSummary,
+ rows: list[dict[str, Any]],
+) -> None:
+ json_path = Path(summary.review_json_path)
+ csv_path = Path(summary.review_csv_path)
+ md_path = Path(summary.review_md_path)
+ payload = {
+ "summary": summary.to_dict(),
+ "rows": rows,
+ "review_decision_values": [
+ "accept_language_page",
+ "reject_wrong_language",
+ "reject_not_language_page",
+ "duplicate_candidate",
+ "needs_additional_review",
+ ],
+ }
+ json_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ fieldnames = [
+ "sample_id",
+ "candidate_language",
+ "date_label",
+ "date_key",
+ "pdf_page_index",
+ "pdf_page_number",
+ "image_path",
+ "reference_path",
+ "article_url",
+ "source_image_url",
+ "source_url",
+ "pdf_path",
+ "pdf_sha256",
+ "language_page_marker",
+ "alignment_status",
+ "page_disambiguation_status",
+ "reference_status",
+ "claim_evidence_eligible",
+ "review_decision",
+ "reviewer",
+ "reviewed_at",
+ "notes",
+ ]
+ with csv_path.open("w", encoding="utf-8", newline="") as handle:
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
+ writer.writeheader()
+ for row in rows:
+ writer.writerow({field: row.get(field) for field in fieldnames})
+ lines = [
+ "# Gorkhapatra Language Page Review",
+ "",
+ f"- manifest: `{summary.manifest_path}`",
+ f"- samples: {summary.sample_count}",
+ f"- pending review: {summary.pending_review_count}",
+ f"- claim eligible: {summary.claim_evidence_eligible_count}",
+ f"- CSV: `{summary.review_csv_path}`",
+ "",
+ "## Review Rule",
+ "",
+ "Rows remain non-claim-ready until a reviewer confirms the language-page match and creates a verified reference transcript/layout.",
+ "",
+ "## Languages",
+ "",
+ ]
+ lines.extend(f"- {language}: {count}" for language, count in summary.language_counts.items()) if summary.language_counts else lines.append("- none")
+ lines.extend(["", "## Same Page Candidate Counts", ""])
+ lines.extend(f"- `{key}`: {count}" for key, count in summary.page_candidate_counts.items()) if summary.page_candidate_counts else lines.append("- none")
+ if summary.warnings:
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in summary.warnings)
+ lines.extend(["", "## Rows", ""])
+ for row in rows[:100]:
+ lines.append(
+ f"- `{row['sample_id']}` {row.get('candidate_language') or 'unknown'} "
+ f"date={row.get('date_key') or 'unknown'} page={row.get('pdf_page_number') or 'unknown'} "
+ f"status={row.get('page_disambiguation_status') or 'unknown'}"
+ )
+ md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def _clean_optional_str(value: Any) -> str | None:
+ if not isinstance(value, str):
+ return None
+ cleaned = value.strip()
+ return cleaned or None
diff --git a/src/ocrtech/structure.py b/src/ocrtech/structure.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3f45debc71cb5947b892373435d579d77eee3e3
--- /dev/null
+++ b/src/ocrtech/structure.py
@@ -0,0 +1,200 @@
+"""Convert OCR lines into blocks, tables, figures, and reading order."""
+
+from __future__ import annotations
+
+import re
+
+from .engines import EngineOutput
+from .metrics import bbox_iou
+from .normalization import normalize_ocr_text
+from .schemas import Block, Document, Figure, Page, Table, TextLine, union_bbox
+from .tables import infer_table_from_lines, looks_like_table_line
+
+
+FIGURE_MARKER_RE = re.compile(r"^\s*(?:\[(?:figure|chart|image|चित्र)[^\]]*\]|(?:figure|fig\.?|chart|चित्र)\s*[::]?)", re.IGNORECASE)
+CAPTION_RE = re.compile(r"^\s*(?:caption|figure|fig\.?|चित्र|तालिका)\s*[\s\d०-९IVXivx.-]*[::]", re.IGNORECASE)
+
+
+def sort_lines_reading_order(lines: list[TextLine]) -> list[TextLine]:
+ if not lines:
+ return []
+ heights = [line.bbox.h for line in lines if line.bbox.h > 0]
+ line_height = sorted(heights)[len(heights) // 2] if heights else 20
+ bucket_size = max(8, line_height * 0.75)
+ return sorted(lines, key=lambda line: (round(line.bbox.y / bucket_size), line.bbox.x, line.bbox.y))
+
+
+def build_document(source_path: str, output: EngineOutput) -> Document:
+ pages: list[Page] = []
+ tables = list(output.tables)
+ figures = list(output.figures)
+ for raw_page in output.pages:
+ sorted_lines = sort_lines_reading_order(raw_page.text_lines)
+ for index, line in enumerate(sorted_lines):
+ if line.line_id is None:
+ line.line_id = f"p{raw_page.page_index}-l{index}"
+ blocks: list[Block] = []
+ represented_figure_ids: set[str] = set()
+ order = 0
+ index = 0
+ while index < len(sorted_lines):
+ line = sorted_lines[index]
+ if looks_like_figure_marker(line.text):
+ marker_line = line
+ caption_line: TextLine | None = None
+ index += 1
+ if index < len(sorted_lines) and _looks_like_caption_after_marker(marker_line, sorted_lines[index]):
+ caption_line = sorted_lines[index]
+ index += 1
+ figure_lines = [marker_line] + ([caption_line] if caption_line is not None else [])
+ figure_id = f"p{raw_page.page_index}-f{len(figures)}"
+ caption = normalize_ocr_text(caption_line.text).strip() if caption_line is not None else None
+ summary = normalize_ocr_text(marker_line.text).strip()
+ figure = Figure(
+ figure_id=figure_id,
+ page_index=raw_page.page_index,
+ bbox=union_bbox([item.bbox for item in figure_lines]),
+ caption=caption,
+ summary=summary,
+ confidence=_average_confidence(figure_lines),
+ metadata={"line_ids": [item.line_id or "" for item in figure_lines]},
+ )
+ figures.append(figure)
+ represented_figure_ids.add(figure_id)
+ blocks.append(
+ Block(
+ block_id=f"p{raw_page.page_index}-b{order}",
+ block_type="figure",
+ page_index=raw_page.page_index,
+ bbox=figure.bbox,
+ order=order,
+ figure_id=figure_id,
+ confidence=figure.confidence,
+ line_ids=[item.line_id or "" for item in figure_lines],
+ text=caption or summary,
+ )
+ )
+ order += 1
+ continue
+ if looks_like_table_line(line.text):
+ table_lines = [line]
+ index += 1
+ while index < len(sorted_lines) and looks_like_table_line(sorted_lines[index].text):
+ table_lines.append(sorted_lines[index])
+ index += 1
+ table_id = f"p{raw_page.page_index}-t{len(tables)}"
+ table = infer_table_from_lines(table_lines, table_id)
+ existing_table = _find_overlapping_table(tables, table)
+ represented_table = existing_table or table
+ if existing_table is None:
+ tables.append(table)
+ blocks.append(
+ Block(
+ block_id=f"p{raw_page.page_index}-b{order}",
+ block_type="table",
+ page_index=raw_page.page_index,
+ bbox=represented_table.bbox,
+ order=order,
+ table_id=represented_table.table_id,
+ confidence=represented_table.confidence,
+ line_ids=[line.line_id or "" for line in table_lines],
+ )
+ )
+ order += 1
+ continue
+
+ text_lines = [line]
+ index += 1
+ while (
+ index < len(sorted_lines)
+ and not looks_like_table_line(sorted_lines[index].text)
+ and not looks_like_figure_marker(sorted_lines[index].text)
+ ):
+ previous = text_lines[-1]
+ current = sorted_lines[index]
+ vertical_gap = current.bbox.y - previous.bbox.bottom
+ if vertical_gap > max(previous.bbox.h, 24) * 1.5:
+ break
+ text_lines.append(current)
+ index += 1
+ text = "\n".join(normalize_ocr_text(item.text).strip() for item in text_lines if item.text.strip())
+ if not text.strip():
+ continue
+ confidence = _average_confidence(text_lines)
+ block_type = "title" if order == 0 and len(text) <= 120 and len(text_lines) == 1 else "text"
+ blocks.append(
+ Block(
+ block_id=f"p{raw_page.page_index}-b{order}",
+ block_type=block_type,
+ page_index=raw_page.page_index,
+ bbox=union_bbox([item.bbox for item in text_lines]),
+ order=order,
+ text=text,
+ confidence=confidence,
+ line_ids=[item.line_id or "" for item in text_lines],
+ )
+ )
+ order += 1
+
+ for figure in [item for item in figures if item.page_index == raw_page.page_index and item.figure_id not in represented_figure_ids]:
+ blocks.append(
+ Block(
+ block_id=f"p{raw_page.page_index}-b{order}",
+ block_type="figure",
+ page_index=raw_page.page_index,
+ bbox=figure.bbox,
+ order=order,
+ figure_id=figure.figure_id,
+ confidence=figure.confidence,
+ text=figure.caption or figure.summary or "",
+ )
+ )
+ order += 1
+ blocks = sorted(blocks, key=lambda block: (block.bbox.y, block.bbox.x, block.order))
+ for order_index, block in enumerate(blocks):
+ block.order = order_index
+ pages.append(
+ Page(
+ page_index=raw_page.page_index,
+ width=raw_page.width,
+ height=raw_page.height,
+ text_lines=sorted_lines,
+ blocks=blocks,
+ metadata=raw_page.metadata,
+ )
+ )
+ return Document(source_path=source_path, pages=pages, tables=tables, figures=figures, metadata=dict(output.metadata))
+
+
+def looks_like_figure_marker(text: str) -> bool:
+ return bool(FIGURE_MARKER_RE.match(text.strip()))
+
+
+def looks_like_caption(text: str) -> bool:
+ return bool(CAPTION_RE.match(text.strip()))
+
+
+def _looks_like_caption_after_marker(marker_line: TextLine, candidate: TextLine) -> bool:
+ if looks_like_caption(candidate.text):
+ return True
+ if looks_like_figure_marker(candidate.text) or looks_like_table_line(candidate.text):
+ return False
+ if not candidate.text.strip():
+ return False
+ vertical_gap = candidate.bbox.y - marker_line.bbox.bottom
+ max_gap = max(marker_line.bbox.h, candidate.bbox.h, 24) * 1.5
+ return 0 <= vertical_gap <= max_gap
+
+
+def _find_overlapping_table(tables: list[Table], candidate: Table, *, iou_threshold: float = 0.9) -> Table | None:
+ for table in tables:
+ if table.page_index != candidate.page_index:
+ continue
+ if bbox_iou(table.bbox, candidate.bbox) >= iou_threshold:
+ return table
+ return None
+
+
+def _average_confidence(lines: list[TextLine]) -> float | None:
+ confidences = [item.confidence for item in lines if item.confidence is not None]
+ return sum(confidences) / len(confidences) if confidences else None
diff --git a/src/ocrtech/table_analysis.py b/src/ocrtech/table_analysis.py
new file mode 100644
index 0000000000000000000000000000000000000000..5138ea1ada8c7e163909e5b399200070ea38556d
--- /dev/null
+++ b/src/ocrtech/table_analysis.py
@@ -0,0 +1,488 @@
+"""Cell-level table analysis for benchmark outputs."""
+
+from __future__ import annotations
+
+import json
+from collections import defaultdict
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import BenchmarkError, DataValidationError
+from .manifest import ManifestEntry, load_manifest
+from .metrics import bbox_iou, cer
+from .references import ReferenceTable, load_reference
+from .schemas import Document
+from .tables import table_to_grid
+
+
+@dataclass(slots=True)
+class TableCellSystemSummary:
+ system: str
+ reference_tables: int = 0
+ predicted_tables: int = 0
+ duplicate_overlapping_tables: int = 0
+ reference_cells: int = 0
+ exact_cells: int = 0
+ missing_cells: int = 0
+ total_cer: float = 0.0
+
+ @property
+ def exact_rate(self) -> float:
+ return self.exact_cells / self.reference_cells if self.reference_cells else 0.0
+
+ @property
+ def mean_cer(self) -> float:
+ return self.total_cer / self.reference_cells if self.reference_cells else 0.0
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "system": self.system,
+ "reference_tables": self.reference_tables,
+ "predicted_tables": self.predicted_tables,
+ "duplicate_overlapping_tables": self.duplicate_overlapping_tables,
+ "reference_cells": self.reference_cells,
+ "exact_cells": self.exact_cells,
+ "missing_cells": self.missing_cells,
+ "exact_rate": self.exact_rate,
+ "mean_cer": self.mean_cer,
+ }
+
+
+@dataclass(slots=True)
+class TableCellPairSummary:
+ baseline: str
+ cells: int = 0
+ candidate_better: int = 0
+ baseline_better: int = 0
+ ties: int = 0
+ candidate_exact_baseline_not: int = 0
+ baseline_exact_candidate_not: int = 0
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "baseline": self.baseline,
+ "cells": self.cells,
+ "candidate_better": self.candidate_better,
+ "baseline_better": self.baseline_better,
+ "ties": self.ties,
+ "candidate_exact_baseline_not": self.candidate_exact_baseline_not,
+ "baseline_exact_candidate_not": self.baseline_exact_candidate_not,
+ }
+
+
+@dataclass(slots=True)
+class TableCellSampleSummary:
+ sample_id: str
+ system: str
+ reference_tables: int
+ predicted_tables: int
+ duplicate_overlapping_tables: int
+ reference_shapes: list[list[int]]
+ predicted_shapes: list[list[int]]
+ reference_cells: int
+ exact_cells: int
+ missing_cells: int
+ mean_cer: float
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "sample_id": self.sample_id,
+ "system": self.system,
+ "reference_tables": self.reference_tables,
+ "predicted_tables": self.predicted_tables,
+ "duplicate_overlapping_tables": self.duplicate_overlapping_tables,
+ "reference_shapes": self.reference_shapes,
+ "predicted_shapes": self.predicted_shapes,
+ "reference_cells": self.reference_cells,
+ "exact_cells": self.exact_cells,
+ "missing_cells": self.missing_cells,
+ "exact_rate": self.exact_cells / self.reference_cells if self.reference_cells else 0.0,
+ "mean_cer": self.mean_cer,
+ }
+
+
+@dataclass(slots=True)
+class TableCellAnalysis:
+ benchmark_report: str
+ eval_manifest: str
+ candidate: str
+ systems: dict[str, TableCellSystemSummary]
+ paired: dict[str, TableCellPairSummary]
+ samples: list[TableCellSampleSummary] = field(default_factory=list)
+ top_failures: list[dict[str, Any]] = field(default_factory=list)
+ warnings: list[str] = field(default_factory=list)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "benchmark_report": self.benchmark_report,
+ "eval_manifest": self.eval_manifest,
+ "candidate": self.candidate,
+ "systems": {key: value.to_dict() for key, value in sorted(self.systems.items())},
+ "paired": {key: value.to_dict() for key, value in sorted(self.paired.items())},
+ "samples": [item.to_dict() for item in self.samples],
+ "top_failures": self.top_failures,
+ "warnings": self.warnings,
+ }
+
+
+def analyze_table_cells(
+ benchmark_report: str | Path,
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ candidate: str = "candidate",
+ baselines: list[str] | None = None,
+ top_n: int = 25,
+) -> TableCellAnalysis:
+ report_path = Path(benchmark_report)
+ rows = _load_report_rows(report_path)
+ entries = {entry.sample_id: entry for entry in load_manifest(eval_manifest)}
+ if not rows:
+ raise BenchmarkError("benchmark report has no rows")
+ systems = sorted({str(row.get("baseline") or "") for row in rows if row.get("status") == "ok"})
+ if candidate not in systems:
+ raise BenchmarkError(f"candidate system {candidate!r} is not present in benchmark report")
+ selected_baselines = baselines or [name for name in systems if name != candidate]
+ missing = [name for name in selected_baselines if name not in systems]
+ if missing:
+ raise BenchmarkError(f"requested systems missing from benchmark report: {', '.join(missing)}")
+
+ docs = _load_documents(report_path, rows)
+ system_summaries = {system: TableCellSystemSummary(system=system) for system in systems}
+ pair_summaries = {baseline: TableCellPairSummary(baseline=baseline) for baseline in selected_baselines}
+ sample_summaries: list[TableCellSampleSummary] = []
+ top_failures: list[dict[str, Any]] = []
+ warnings: list[str] = []
+
+ rows_by_sample: dict[str, set[str]] = defaultdict(set)
+ for row in rows:
+ sample_id = str(row.get("sample_id") or "")
+ baseline = str(row.get("baseline") or "")
+ if sample_id and baseline and row.get("status") == "ok":
+ rows_by_sample[sample_id].add(baseline)
+
+ for sample_id, present_systems in sorted(rows_by_sample.items()):
+ entry = entries.get(sample_id)
+ if entry is None:
+ warnings.append(f"{sample_id}: missing eval manifest entry")
+ continue
+ reference = load_reference(Path(entry.image_path), explicit_path=entry.metadata.get("reference_path"))
+ if reference is None or not reference.tables:
+ continue
+ reference_cells = _reference_cells(reference.tables)
+ if not reference_cells:
+ continue
+ predictions: dict[str, dict[tuple[int, int, int], str]] = {}
+ for system in systems:
+ document = docs.get((system, sample_id))
+ if document is None:
+ continue
+ _update_table_summary(system_summaries[system], document, reference.tables)
+ predictions[system] = _predicted_cells(document)
+ _update_system_summary(system_summaries[system], reference_cells, predictions[system])
+ sample_summaries.append(_sample_summary(sample_id, system, document, reference.tables, reference_cells, predictions[system]))
+ candidate_cells = predictions.get(candidate)
+ if candidate_cells is None:
+ warnings.append(f"{sample_id}: missing candidate document")
+ continue
+ for baseline in selected_baselines:
+ baseline_cells = predictions.get(baseline)
+ if baseline_cells is None:
+ continue
+ _update_pair_summary(pair_summaries[baseline], reference_cells, candidate_cells, baseline_cells)
+ top_failures.extend(_sample_failures(sample_id, reference_cells, candidate_cells, selected_baselines, predictions))
+
+ top_failures = sorted(top_failures, key=lambda item: float(item["candidate_cer"]), reverse=True)[:top_n]
+ analysis = TableCellAnalysis(
+ benchmark_report=str(report_path),
+ eval_manifest=str(eval_manifest),
+ candidate=candidate,
+ systems=system_summaries,
+ paired=pair_summaries,
+ samples=sample_summaries,
+ top_failures=top_failures,
+ warnings=warnings,
+ )
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "table-cell-analysis.json").write_text(json.dumps(analysis.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ _write_markdown(analysis, out / "table-cell-analysis.md")
+ return analysis
+
+
+def _load_report_rows(path: Path) -> list[dict[str, Any]]:
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise BenchmarkError(f"invalid benchmark report JSON {path}: {exc}") from exc
+ if not isinstance(payload, list):
+ raise BenchmarkError("benchmark report must be a JSON list")
+ rows: list[dict[str, Any]] = []
+ for index, item in enumerate(payload):
+ if not isinstance(item, dict):
+ raise BenchmarkError(f"benchmark row {index} must be an object")
+ rows.append(dict(item))
+ return rows
+
+
+def _load_documents(report_path: Path, rows: list[dict[str, Any]]) -> dict[tuple[str, str], Document]:
+ benchmark_dir = report_path.parent
+ docs: dict[tuple[str, str], Document] = {}
+ for row in rows:
+ if row.get("status") != "ok":
+ continue
+ baseline = str(row.get("baseline") or "")
+ sample_id = str(row.get("sample_id") or "")
+ input_path = Path(str(row.get("input_path") or ""))
+ if not baseline or not sample_id or not input_path.name:
+ continue
+ document_path = benchmark_dir / baseline / input_path.stem / "document.json"
+ if not document_path.exists():
+ continue
+ try:
+ payload = json.loads(document_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"invalid document JSON {document_path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"document JSON must be an object: {document_path}")
+ docs[(baseline, sample_id)] = Document.from_dict(payload)
+ return docs
+
+
+def _reference_cells(tables: list[ReferenceTable]) -> dict[tuple[int, int, int], str]:
+ cells: dict[tuple[int, int, int], str] = {}
+ for table_index, table in enumerate(tables):
+ for row_index, row in enumerate(table.grid):
+ for col_index, value in enumerate(row):
+ cells[(table_index, row_index, col_index)] = str(value)
+ return cells
+
+
+def _predicted_cells(document: Document) -> dict[tuple[int, int, int], str]:
+ cells: dict[tuple[int, int, int], str] = {}
+ tables = sorted(document.tables, key=lambda item: (item.page_index, item.bbox.y, item.bbox.x))
+ for table_index, table in enumerate(tables):
+ grid = table_to_grid(table)
+ for row_index, row in enumerate(grid):
+ for col_index, value in enumerate(row):
+ cells[(table_index, row_index, col_index)] = str(value)
+ return cells
+
+
+def _update_table_summary(summary: TableCellSystemSummary, document: Document, reference_tables: list[ReferenceTable]) -> None:
+ summary.reference_tables += len(reference_tables)
+ summary.predicted_tables += len(document.tables)
+ summary.duplicate_overlapping_tables += _duplicate_overlapping_table_count(document.tables)
+
+
+def _duplicate_overlapping_table_count(tables: list[Any], *, iou_threshold: float = 0.9) -> int:
+ duplicates = 0
+ kept: list[Any] = []
+ for table in sorted(tables, key=lambda item: (item.page_index, item.bbox.y, item.bbox.x)):
+ duplicate = False
+ for existing in kept:
+ if table.page_index == existing.page_index and bbox_iou(table.bbox, existing.bbox) >= iou_threshold:
+ duplicate = True
+ break
+ if duplicate:
+ duplicates += 1
+ else:
+ kept.append(table)
+ return duplicates
+
+
+def _update_system_summary(
+ summary: TableCellSystemSummary,
+ reference_cells: dict[tuple[int, int, int], str],
+ predicted_cells: dict[tuple[int, int, int], str],
+) -> None:
+ for key, reference_text in reference_cells.items():
+ predicted_text = predicted_cells.get(key, "")
+ score = cer(predicted_text, reference_text)
+ summary.reference_cells += 1
+ summary.total_cer += score
+ if not predicted_text:
+ summary.missing_cells += 1
+ if score == 0.0:
+ summary.exact_cells += 1
+
+
+def _sample_summary(
+ sample_id: str,
+ system: str,
+ document: Document,
+ reference_tables: list[ReferenceTable],
+ reference_cells: dict[tuple[int, int, int], str],
+ predicted_cells: dict[tuple[int, int, int], str],
+) -> TableCellSampleSummary:
+ exact_cells = 0
+ missing_cells = 0
+ total_cer = 0.0
+ for key, reference_text in reference_cells.items():
+ predicted_text = predicted_cells.get(key, "")
+ score = cer(predicted_text, reference_text)
+ total_cer += score
+ if score == 0.0:
+ exact_cells += 1
+ if not predicted_text:
+ missing_cells += 1
+ return TableCellSampleSummary(
+ sample_id=sample_id,
+ system=system,
+ reference_tables=len(reference_tables),
+ predicted_tables=len(document.tables),
+ duplicate_overlapping_tables=_duplicate_overlapping_table_count(document.tables),
+ reference_shapes=[_grid_shape(table.grid) for table in reference_tables],
+ predicted_shapes=[_grid_shape(table_to_grid(table)) for table in sorted(document.tables, key=lambda item: (item.page_index, item.bbox.y, item.bbox.x))],
+ reference_cells=len(reference_cells),
+ exact_cells=exact_cells,
+ missing_cells=missing_cells,
+ mean_cer=total_cer / len(reference_cells) if reference_cells else 0.0,
+ )
+
+
+def _grid_shape(grid: list[list[str]]) -> list[int]:
+ return [len(grid), max((len(row) for row in grid), default=0)]
+
+
+def _update_pair_summary(
+ summary: TableCellPairSummary,
+ reference_cells: dict[tuple[int, int, int], str],
+ candidate_cells: dict[tuple[int, int, int], str],
+ baseline_cells: dict[tuple[int, int, int], str],
+) -> None:
+ for key, reference_text in reference_cells.items():
+ candidate_score = cer(candidate_cells.get(key, ""), reference_text)
+ baseline_score = cer(baseline_cells.get(key, ""), reference_text)
+ summary.cells += 1
+ if candidate_score < baseline_score:
+ summary.candidate_better += 1
+ elif baseline_score < candidate_score:
+ summary.baseline_better += 1
+ else:
+ summary.ties += 1
+ if candidate_score == 0.0 and baseline_score != 0.0:
+ summary.candidate_exact_baseline_not += 1
+ if baseline_score == 0.0 and candidate_score != 0.0:
+ summary.baseline_exact_candidate_not += 1
+
+
+def _sample_failures(
+ sample_id: str,
+ reference_cells: dict[tuple[int, int, int], str],
+ candidate_cells: dict[tuple[int, int, int], str],
+ baselines: list[str],
+ predictions: dict[str, dict[tuple[int, int, int], str]],
+) -> list[dict[str, Any]]:
+ failures: list[dict[str, Any]] = []
+ for key, reference_text in reference_cells.items():
+ candidate_text = candidate_cells.get(key, "")
+ candidate_score = cer(candidate_text, reference_text)
+ if candidate_score == 0.0:
+ continue
+ baseline_payload: dict[str, Any] = {}
+ for baseline in baselines:
+ baseline_cells = predictions.get(baseline)
+ if baseline_cells is None:
+ continue
+ baseline_text = baseline_cells.get(key, "")
+ baseline_payload[baseline] = {
+ "text": baseline_text,
+ "cer": cer(baseline_text, reference_text),
+ }
+ table_index, row_index, col_index = key
+ failures.append(
+ {
+ "sample_id": sample_id,
+ "table_index": table_index,
+ "row": row_index,
+ "col": col_index,
+ "reference": reference_text,
+ "candidate": candidate_text,
+ "candidate_cer": candidate_score,
+ "baselines": baseline_payload,
+ }
+ )
+ return failures
+
+
+def _write_markdown(analysis: TableCellAnalysis, path: Path) -> None:
+ lines = [
+ "# Table Cell Analysis",
+ "",
+ f"Benchmark report: `{analysis.benchmark_report}`",
+ f"Eval manifest: `{analysis.eval_manifest}`",
+ f"Candidate: `{analysis.candidate}`",
+ "",
+ "## Systems",
+ "",
+ "| system | reference_tables | predicted_tables | duplicate_tables | reference_cells | exact_cells | exact_rate | missing_cells | mean_cer |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ for summary in sorted(analysis.systems.values(), key=lambda item: item.system):
+ lines.append(
+ f"| {summary.system} | {summary.reference_tables} | {summary.predicted_tables} | {summary.duplicate_overlapping_tables} | "
+ f"{summary.reference_cells} | {summary.exact_cells} | {summary.exact_rate:.6f} | {summary.missing_cells} | {summary.mean_cer:.6f} |"
+ )
+ lines.extend(
+ [
+ "",
+ "## Paired",
+ "",
+ "| baseline | cells | candidate_better | baseline_better | ties | candidate_exact_baseline_not | baseline_exact_candidate_not |",
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: |",
+ ]
+ )
+ for summary in sorted(analysis.paired.values(), key=lambda item: item.baseline):
+ lines.append(
+ f"| {summary.baseline} | {summary.cells} | {summary.candidate_better} | {summary.baseline_better} | {summary.ties} | {summary.candidate_exact_baseline_not} | {summary.baseline_exact_candidate_not} |"
+ )
+ lines.extend(
+ [
+ "",
+ "## Per-Sample Table Shape",
+ "",
+ "| sample | system | reference_tables | predicted_tables | reference_shapes | predicted_shapes | exact_cells | missing_cells | mean_cer |",
+ "| --- | --- | ---: | ---: | --- | --- | ---: | ---: | ---: |",
+ ]
+ )
+ for item in sorted(analysis.samples, key=lambda value: (value.sample_id, value.system)):
+ lines.append(
+ "| {sample_id} | {system} | {reference_tables} | {predicted_tables} | {reference_shapes} | {predicted_shapes} | {exact_cells} | {missing_cells} | {mean_cer:.6f} |".format(
+ sample_id=item.sample_id,
+ system=item.system,
+ reference_tables=item.reference_tables,
+ predicted_tables=item.predicted_tables,
+ reference_shapes="; ".join(f"{shape[0]}x{shape[1]}" for shape in item.reference_shapes),
+ predicted_shapes="; ".join(f"{shape[0]}x{shape[1]}" for shape in item.predicted_shapes),
+ exact_cells=item.exact_cells,
+ missing_cells=item.missing_cells,
+ mean_cer=item.mean_cer,
+ )
+ )
+ lines.extend(["", "## Top Candidate Cell Failures", ""])
+ if analysis.top_failures:
+ lines.extend(
+ [
+ "| sample | table | row | col | reference | candidate | candidate_cer |",
+ "| --- | ---: | ---: | ---: | --- | --- | ---: |",
+ ]
+ )
+ for item in analysis.top_failures:
+ lines.append(
+ "| {sample_id} | {table_index} | {row} | {col} | {reference} | {candidate} | {candidate_cer:.6f} |".format(
+ sample_id=item["sample_id"],
+ table_index=item["table_index"],
+ row=item["row"],
+ col=item["col"],
+ reference=str(item["reference"]).replace("|", "\\|"),
+ candidate=str(item["candidate"]).replace("|", "\\|"),
+ candidate_cer=float(item["candidate_cer"]),
+ )
+ )
+ else:
+ lines.append("- none")
+ lines.extend(["", "## Warnings", ""])
+ lines.extend(f"- {warning}" for warning in analysis.warnings) if analysis.warnings else lines.append("- none")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/src/ocrtech/tables.py b/src/ocrtech/tables.py
new file mode 100644
index 0000000000000000000000000000000000000000..84a8b8926e2f6b637d89bf4cb8f2cfd533a0cf57
--- /dev/null
+++ b/src/ocrtech/tables.py
@@ -0,0 +1,347 @@
+"""Table reconstruction and export helpers."""
+
+from __future__ import annotations
+
+import csv
+import html
+import io
+import re
+from pathlib import Path
+
+from dataclasses import replace
+
+from .normalization import normalize_ocr_text
+from .schemas import BBox, Table, TableCell, TextLine, union_bbox
+
+
+PIPE_ROW_RE = re.compile(r"^\s*\|?.+\|.+\|?\s*$")
+MULTISPACE_RE = re.compile(r"\s{2,}")
+MAX_NORMALIZED_GRID_WIDTH = 12
+
+
+def looks_like_table_line(text: str) -> bool:
+ stripped = text.strip()
+ if not stripped:
+ return False
+ if "\t" in stripped:
+ return True
+ if PIPE_ROW_RE.match(stripped):
+ return True
+ return len(MULTISPACE_RE.split(stripped)) >= 3
+
+
+def split_table_row(text: str) -> list[str]:
+ stripped = text.strip()
+ if "\t" in stripped:
+ return [part.strip() for part in stripped.split("\t")]
+ if "|" in stripped:
+ parts = [part.strip() for part in stripped.strip("|").split("|")]
+ return [part for part in parts if part]
+ return [part.strip() for part in MULTISPACE_RE.split(stripped) if part.strip()]
+
+
+def infer_table_from_lines(lines: list[TextLine], table_id: str) -> Table:
+ cells: list[TableCell] = []
+ for row_index, line in enumerate(lines):
+ for col_index, text in enumerate(split_table_row(line.text)):
+ cells.append(TableCell(row=row_index, col=col_index, text=text, bbox=line.bbox, confidence=line.confidence))
+ confidence_values = [line.confidence for line in lines if line.confidence is not None]
+ confidence = sum(confidence_values) / len(confidence_values) if confidence_values else None
+ return Table(
+ table_id=table_id,
+ page_index=lines[0].page_index if lines else 0,
+ bbox=union_bbox([line.bbox for line in lines]),
+ cells=cells,
+ confidence=confidence,
+ )
+
+
+def table_to_grid(table: Table) -> list[list[str]]:
+ return cells_to_grid(table.cells)
+
+
+def cells_to_grid(cells: list[TableCell]) -> list[list[str]]:
+ if not cells:
+ return []
+ rows = max(cell.row + cell.rowspan for cell in cells)
+ cols = max(cell.col + cell.colspan for cell in cells)
+ grid = [["" for _ in range(cols)] for _ in range(rows)]
+ for cell in cells:
+ grid[cell.row][cell.col] = cell.text
+ return grid
+
+
+def grid_to_csv(grid: list[list[str]]) -> str:
+ output = io.StringIO()
+ writer = csv.writer(output, lineterminator="\n")
+ writer.writerows(grid)
+ return output.getvalue()
+
+
+def grid_to_html(grid: list[list[str]]) -> str:
+ rows = []
+ for row in grid:
+ cells = "".join(f"| {html.escape(value)} | " for value in row)
+ rows.append(f"{cells}
")
+ return "\n" + "\n".join(rows) + "\n
"
+
+
+def cells_to_html(cells: list[TableCell]) -> str:
+ if not cells:
+ return ""
+ rows = max(cell.row + cell.rowspan for cell in cells)
+ cols = max(cell.col + cell.colspan for cell in cells)
+ by_row: dict[int, dict[int, TableCell]] = {}
+ for cell in cells:
+ by_row.setdefault(cell.row, {})[cell.col] = cell
+ covered: set[tuple[int, int]] = set()
+ rendered_rows: list[str] = []
+ for row_index in range(rows):
+ rendered_cells: list[str] = []
+ col_index = 0
+ while col_index < cols:
+ if (row_index, col_index) in covered:
+ col_index += 1
+ continue
+ cell = by_row.get(row_index, {}).get(col_index)
+ if cell is None:
+ rendered_cells.append(" | ")
+ col_index += 1
+ continue
+ attrs = []
+ if cell.rowspan > 1:
+ attrs.append(f'rowspan="{cell.rowspan}"')
+ if cell.colspan > 1:
+ attrs.append(f'colspan="{cell.colspan}"')
+ for row_offset in range(cell.rowspan):
+ for col_offset in range(cell.colspan):
+ position = (row_index + row_offset, col_index + col_offset)
+ if position != (row_index, col_index):
+ covered.add(position)
+ attr_text = (" " + " ".join(attrs)) if attrs else ""
+ rendered_cells.append(f"{html.escape(cell.text)} | ")
+ col_index += cell.colspan
+ rendered_rows.append("" + "".join(rendered_cells) + "
")
+ return "\n" + "\n".join(rendered_rows) + "\n
"
+
+
+def infer_repeated_header_colspans(table: Table, *, max_header_rows: int = 2) -> tuple[Table, int]:
+ """Collapse adjacent identical header cells into colspan cells.
+
+ This is intentionally narrow: it only looks at the first few rows and only
+ collapses a repeated run when a following row contains distinct detail cells
+ beneath the run. That avoids rewriting ordinary repeated body values.
+ """
+
+ if max_header_rows < 1 or not table.cells:
+ return table, 0
+ rows: dict[int, list[TableCell]] = {}
+ for cell in table.cells:
+ rows.setdefault(cell.row, []).append(cell)
+ changed = 0
+ replaced_cells: list[TableCell] = []
+ removed: set[int] = set()
+ cell_ids = {id(cell): index for index, cell in enumerate(table.cells)}
+ for row_index in sorted(rows):
+ row_cells = sorted(rows[row_index], key=lambda cell: cell.col)
+ if row_index >= max_header_rows or not _has_distinct_detail_row(rows, row_index):
+ continue
+ scan_index = 0
+ while scan_index < len(row_cells):
+ cell = row_cells[scan_index]
+ normalized = normalize_ocr_text(cell.text, collapse_spaces=True).strip()
+ if not normalized or cell.colspan != 1 or cell.rowspan != 1:
+ scan_index += 1
+ continue
+ run = [cell]
+ next_index = scan_index + 1
+ while next_index < len(row_cells):
+ next_cell = row_cells[next_index]
+ next_text = normalize_ocr_text(next_cell.text, collapse_spaces=True).strip()
+ if next_cell.col != run[-1].col + run[-1].colspan:
+ break
+ if next_cell.colspan != 1 or next_cell.rowspan != 1 or next_text != normalized:
+ break
+ run.append(next_cell)
+ next_index += 1
+ if len(run) < 2 or not _run_has_distinct_children(rows, row_index, run, normalized):
+ scan_index += 1
+ continue
+ boxes = [item.bbox for item in run if item.bbox is not None]
+ bbox = union_bbox(boxes) if boxes else cell.bbox
+ confidence_values = [item.confidence for item in run if item.confidence is not None]
+ confidence = sum(confidence_values) / len(confidence_values) if confidence_values else cell.confidence
+ replaced_cells.append(replace(cell, colspan=len(run), bbox=bbox, confidence=confidence))
+ removed.update(cell_ids[id(item)] for item in run)
+ changed += len(run) - 1
+ scan_index = next_index
+ if not changed:
+ return table, 0
+ merged_cells: list[TableCell] = []
+ inserted_by_position = {(cell.row, cell.col): cell for cell in replaced_cells}
+ for index, cell in enumerate(table.cells):
+ replacement = inserted_by_position.get((cell.row, cell.col))
+ if replacement is not None:
+ merged_cells.append(replacement)
+ continue
+ if index in removed:
+ continue
+ merged_cells.append(cell)
+ metadata = dict(table.metadata)
+ metadata["inferred_repeated_header_colspans"] = changed
+ return replace(table, cells=merged_cells, html=cells_to_html(merged_cells), metadata=metadata), changed
+
+
+def normalize_table_grid_structure(table: Table) -> tuple[Table, int]:
+ """Remove obvious non-content columns from a reconstructed table.
+
+ The rules are intentionally conservative and reference-free:
+ - drop columns that are entirely empty
+ - drop columns that only contain separator glyphs
+ - drop exact duplicate adjacent columns
+ """
+
+ grid = table_to_grid(table)
+ if not grid:
+ return table, 0
+ width = max(len(row) for row in grid)
+ if width <= 1:
+ return table, 0
+ if width > MAX_NORMALIZED_GRID_WIDTH:
+ return table, 0
+ padded = [row + [""] * (width - len(row)) for row in grid]
+ keep: list[int] = []
+ dropped = 0
+ previous_kept_values: list[str] | None = None
+ for col_index in range(width):
+ values = [normalize_ocr_text(row[col_index], collapse_spaces=True).strip() for row in padded]
+ non_empty = [value for value in values if value]
+ if not non_empty:
+ dropped += 1
+ continue
+ if all(_is_separator_cell(value) for value in non_empty):
+ dropped += 1
+ continue
+ if previous_kept_values is not None and values == previous_kept_values and any(values):
+ dropped += 1
+ continue
+ keep.append(col_index)
+ previous_kept_values = values
+ if not keep:
+ return table, 0
+ normalized_grid = [[row[col_index] for col_index in keep] for row in padded]
+ normalized_grid, merged_rows = _merge_sparse_bullet_continuation_rows(normalized_grid)
+ if dropped == 0 and merged_rows == 0:
+ return table, 0
+ cells = cells_from_grid(normalized_grid)
+ metadata = dict(table.metadata)
+ if dropped:
+ metadata["normalized_table_grid_dropped_columns"] = dropped
+ if merged_rows:
+ metadata["normalized_table_grid_merged_rows"] = merged_rows
+ normalized = replace(table, cells=cells, html=cells_to_html(cells), metadata=metadata)
+ return normalized, dropped + merged_rows
+
+
+def _is_separator_cell(value: str) -> bool:
+ return bool(value) and all(char in {"-", "–", "—", "_", " "} for char in value)
+
+
+def _merge_sparse_bullet_continuation_rows(grid: list[list[str]]) -> tuple[list[list[str]], int]:
+ if len(grid) < 2:
+ return grid, 0
+ output: list[list[str]] = []
+ merged = 0
+ for row in grid:
+ non_empty = [(index, normalize_ocr_text(value, collapse_spaces=True).strip()) for index, value in enumerate(row) if value.strip()]
+ if output and len(non_empty) == 1:
+ source_col, text = non_empty[0]
+ target_col = _continuation_target_column(output[-1], source_col=source_col, text=text)
+ if target_col is not None:
+ output[-1][target_col] = "\n".join(part for part in [output[-1][target_col].strip(), text] if part)
+ merged += 1
+ continue
+ if non_empty:
+ output.append(list(row))
+ elif not output:
+ output.append(list(row))
+ else:
+ merged += 1
+ return output, merged
+
+
+def _continuation_target_column(previous_row: list[str], *, source_col: int, text: str) -> int | None:
+ if source_col != 0 or not _looks_like_list_continuation(text):
+ return None
+ candidates = [
+ (index, normalize_ocr_text(value, collapse_spaces=True).strip())
+ for index, value in enumerate(previous_row)
+ if index > source_col and value.strip()
+ ]
+ list_candidates = [item for item in candidates if _looks_like_list_continuation(item[1])]
+ if list_candidates:
+ return list_candidates[0][0]
+ return None
+
+
+def _looks_like_list_continuation(value: str) -> bool:
+ return value.lstrip().startswith(("-", "–", "—", "•"))
+
+
+def _has_distinct_detail_row(rows: dict[int, list[TableCell]], row_index: int) -> bool:
+ current_cols = {cell.col for cell in rows.get(row_index, []) if cell.text.strip()}
+ next_cols = {cell.col for cell in rows.get(row_index + 1, []) if cell.text.strip()}
+ return len(next_cols) >= max(2, len(current_cols))
+
+
+def _run_has_distinct_children(rows: dict[int, list[TableCell]], row_index: int, run: list[TableCell], normalized: str) -> bool:
+ child_by_col = {cell.col: cell for cell in rows.get(row_index + 1, [])}
+ child_texts: list[str] = []
+ for col in range(run[0].col, run[-1].col + 1):
+ child = child_by_col.get(col)
+ if child is None:
+ return False
+ child_text = normalize_ocr_text(child.text, collapse_spaces=True).strip()
+ if not child_text or child_text == normalized:
+ return False
+ child_texts.append(child_text)
+ return len(set(child_texts)) > 1
+
+
+def table_to_markdown(table: Table) -> str:
+ grid = table_to_grid(table)
+ if not grid:
+ return ""
+ width = max(len(row) for row in grid)
+ padded = [row + [""] * (width - len(row)) for row in grid]
+ header = padded[0]
+ separator = ["---"] * width
+ body = padded[1:]
+
+ def render_row(row: list[str]) -> str:
+ return "| " + " | ".join(value.replace("\n", " ") for value in row) + " |"
+
+ return "\n".join([render_row(header), render_row(separator), *[render_row(row) for row in body]])
+
+
+def write_table_files(table: Table, out_dir: Path) -> Table:
+ out_dir.mkdir(parents=True, exist_ok=True)
+ grid = table_to_grid(table)
+ csv_text = grid_to_csv(grid)
+ html_text = table.html or cells_to_html(table.cells)
+ csv_path = out_dir / f"{table.table_id}.csv"
+ html_path = out_dir / f"{table.table_id}.html"
+ csv_path.write_text(csv_text, encoding="utf-8")
+ html_path.write_text(html_text, encoding="utf-8")
+ table.csv_path = str(csv_path)
+ table.html_path = str(html_path)
+ table.html = html_text
+ return table
+
+
+def cells_from_grid(grid: list[list[str]]) -> list[TableCell]:
+ cells: list[TableCell] = []
+ for row_index, row in enumerate(grid):
+ for col_index, text in enumerate(row):
+ cells.append(TableCell(row=row_index, col=col_index, text=text, bbox=BBox(0, 0, 0, 0)))
+ return cells
diff --git a/src/ocrtech/training.py b/src/ocrtech/training.py
new file mode 100644
index 0000000000000000000000000000000000000000..6248d7d79aea0edee4e1c9e50dd8e8d469ca71c6
--- /dev/null
+++ b/src/ocrtech/training.py
@@ -0,0 +1,1984 @@
+"""Training recipe generation for recognizer and corrector models."""
+
+from __future__ import annotations
+
+import json
+import math
+import random
+import shlex
+import shutil
+import subprocess
+import tarfile
+import tempfile
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Any
+
+from .admission import assert_recognizer_family_not_stopped
+from .datasets import audit_recognizer_corpus
+from .errors import DataValidationError
+from .manifest import ManifestEntry, load_manifest, prepare_hf_correction_pairs, sha256_file, write_manifest
+from .metrics import cer, exact_line_accuracy, wer
+from .models import audit_model_card, write_model_card
+from .normalization import dictionary_from_texts, normalize_ocr_text
+
+
+PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED = (
+ "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/"
+ "devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams"
+)
+
+
+def write_recognizer_recipe(
+ train_manifest: str | Path,
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ base_model: str = PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED,
+ dictionary_path: str | Path | None = None,
+ train_batch_size: int = 64,
+ eval_batch_size: int = 64,
+ learning_rate: float = 0.001,
+ epochs: float | None = None,
+ failure_review: str | Path | None = None,
+ run: bool = False,
+) -> Path:
+ return write_paddle_recognizer_recipe(
+ train_manifest,
+ eval_manifest,
+ output_dir,
+ base_model=base_model,
+ dictionary_path=dictionary_path,
+ train_batch_size=train_batch_size,
+ eval_batch_size=eval_batch_size,
+ learning_rate=learning_rate,
+ epochs=epochs,
+ failure_review=failure_review,
+ run=run,
+ )
+
+
+def write_paddle_recognizer_recipe(
+ train_manifest: str | Path,
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ base_model: str = PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED,
+ dictionary_path: str | Path | None = None,
+ train_batch_size: int = 64,
+ eval_batch_size: int = 64,
+ learning_rate: float = 0.001,
+ epochs: float | None = None,
+ failure_review: str | Path | None = None,
+ run: bool = False,
+) -> Path:
+ if train_batch_size <= 0:
+ raise DataValidationError("train_batch_size must be positive")
+ if eval_batch_size <= 0:
+ raise DataValidationError("eval_batch_size must be positive")
+ if learning_rate <= 0:
+ raise DataValidationError("learning_rate must be positive")
+ if epochs is not None and epochs <= 0:
+ raise DataValidationError("epochs must be positive when provided")
+ if failure_review is not None:
+ assert_recognizer_family_not_stopped(failure_review, backend="paddleocr", base_model=base_model)
+ train_entries = load_manifest(train_manifest)
+ eval_entries = load_manifest(eval_manifest)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ labels_dir = out / "labels"
+ labels_dir.mkdir(exist_ok=True)
+ train_label = labels_dir / "train.txt"
+ eval_label = labels_dir / "eval.txt"
+ _write_paddle_label_file(train_entries, train_label)
+ _write_paddle_label_file(eval_entries, eval_label)
+
+ dict_path = Path(dictionary_path) if dictionary_path else out / "nep_eng_dict.txt"
+ if dictionary_path is None:
+ chars = dictionary_from_texts([entry.text for entry in [*train_entries, *eval_entries]])
+ dict_path.write_text("\n".join(chars) + "\n", encoding="utf-8")
+ elif not dict_path.exists():
+ raise DataValidationError(f"dictionary_path does not exist: {dict_path}")
+ dictionary_chars = [line for line in dict_path.read_text(encoding="utf-8").splitlines() if line]
+ _validate_paddle_dictionary_coverage([*train_entries, *eval_entries], dictionary_chars, dict_path)
+
+ config_path = out / "paddle_recognizer.yml"
+ config_path.write_text(
+ _recognizer_config_text(
+ train_label=train_label,
+ eval_label=eval_label,
+ dictionary_path=dict_path,
+ base_model=base_model,
+ output_dir=out / "checkpoints",
+ train_batch_size=train_batch_size,
+ eval_batch_size=eval_batch_size,
+ learning_rate=learning_rate,
+ epochs=epochs,
+ ),
+ encoding="utf-8",
+ )
+ summary_path = out / "recognizer-training-summary.json"
+ summary_path.write_text(
+ json.dumps(
+ _recognizer_training_summary(
+ train_manifest=Path(train_manifest),
+ eval_manifest=Path(eval_manifest),
+ train_entries=train_entries,
+ eval_entries=eval_entries,
+ train_label=train_label,
+ eval_label=eval_label,
+ dictionary_path=dict_path,
+ dictionary_chars=dictionary_chars,
+ config_path=config_path,
+ base_model=base_model,
+ train_batch_size=train_batch_size,
+ eval_batch_size=eval_batch_size,
+ learning_rate=learning_rate,
+ epochs=epochs,
+ ),
+ ensure_ascii=False,
+ indent=2,
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ (out / "README.md").write_text(
+ "\n".join(
+ [
+ "# Recognizer Training Recipe",
+ "",
+ f"Training summary: `{summary_path}`",
+ f"Base model: `{base_model}`",
+ f"Train labels: `{train_label}`",
+ f"Eval labels: `{eval_label}`",
+ f"Dictionary: `{dict_path}`",
+ f"Train batch size: `{train_batch_size}`",
+ f"Eval batch size: `{eval_batch_size}`",
+ f"Learning rate: `{learning_rate}`",
+ f"Epochs: `{epochs if epochs is not None else 'PaddleOCR default'}`",
+ "",
+ "Run with a checked-out PaddleOCR repo:",
+ "",
+ "```bash",
+ f"python PaddleOCR/tools/train.py -c {config_path}",
+ "```",
+ "",
+ ]
+ ),
+ encoding="utf-8",
+ )
+ if run:
+ completed = subprocess.run(["python", "PaddleOCR/tools/train.py", "-c", str(config_path)], check=False)
+ if completed.returncode != 0:
+ raise DataValidationError(f"PaddleOCR training failed with exit code {completed.returncode}")
+ return config_path
+
+
+def _recognizer_training_summary(
+ *,
+ train_manifest: Path,
+ eval_manifest: Path,
+ train_entries: list[ManifestEntry],
+ eval_entries: list[ManifestEntry],
+ train_label: Path,
+ eval_label: Path,
+ dictionary_path: Path,
+ dictionary_chars: list[str],
+ config_path: Path,
+ base_model: str,
+ train_batch_size: int,
+ eval_batch_size: int,
+ learning_rate: float,
+ epochs: float | None,
+) -> dict[str, Any]:
+ return {
+ "backend": "paddleocr",
+ "base_model": base_model,
+ "manifests": {
+ "train": _manifest_summary(train_manifest, train_entries),
+ "eval": _manifest_summary(eval_manifest, eval_entries),
+ },
+ "artifacts": {
+ "config": _file_summary(config_path),
+ "train_label": _file_summary(train_label),
+ "eval_label": _file_summary(eval_label),
+ "dictionary": {
+ **_file_summary(dictionary_path),
+ "character_count": len(dictionary_chars),
+ "contains_space": " " in dictionary_chars,
+ "contains_ascii": any(char.isascii() and char.isalnum() for char in dictionary_chars),
+ "contains_devanagari": any("\u0900" <= char <= "\u097f" for char in dictionary_chars),
+ },
+ },
+ "hyperparameters": {
+ "train_batch_size": train_batch_size,
+ "eval_batch_size": eval_batch_size,
+ "learning_rate": learning_rate,
+ "epochs": epochs,
+ },
+ }
+
+
+def _manifest_summary(path: Path, entries: list[ManifestEntry]) -> dict[str, Any]:
+ texts = [entry.text for entry in entries]
+ chars = dictionary_from_texts(texts)
+ return {
+ "path": str(path),
+ "sha256": sha256_file(path) if path.exists() else None,
+ "sample_count": len(entries),
+ "dataset_counts": _count_values(entry.dataset for entry in entries),
+ "slice_counts": _slice_counts(entries),
+ "character_count": len(chars),
+ "contains_ascii": any(char.isascii() and char.isalnum() for char in chars),
+ "contains_devanagari": any("\u0900" <= char <= "\u097f" for char in chars),
+ }
+
+
+def _file_summary(path: Path) -> dict[str, Any]:
+ return {
+ "path": str(path),
+ "sha256": sha256_file(path) if path.exists() and path.is_file() else None,
+ }
+
+
+def _slice_counts(entries: list[ManifestEntry]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ for entry in entries:
+ for slice_name in _entry_slices(entry):
+ counts[slice_name] = counts.get(slice_name, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _entry_slices(entry: ManifestEntry) -> list[str]:
+ metadata = entry.metadata or {}
+ values: set[str] = set()
+ for key in ("slice", "script", "document_type", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _count_values(values: object) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ for value in values:
+ key = str(value)
+ counts[key] = counts.get(key, 0) + 1
+ return dict(sorted(counts.items()))
+
+
+def _write_paddle_label_file(entries: list[ManifestEntry], path: Path) -> None:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ with path.open("w", encoding="utf-8") as handle:
+ for entry in entries:
+ if "\t" in entry.image_path or "\n" in entry.image_path or "\r" in entry.image_path:
+ raise DataValidationError(f"image_path contains a tab or newline and cannot be serialized for PaddleOCR: {entry.sample_id}")
+ handle.write(f"{entry.image_path}\t{_paddle_label_text(entry.text)}\n")
+
+
+def _validate_paddle_dictionary_coverage(
+ entries: list[ManifestEntry],
+ dictionary_chars: list[str],
+ dictionary_path: Path,
+) -> None:
+ allowed = set(dictionary_chars)
+ missing: dict[str, list[str]] = {}
+ for entry in entries:
+ label = _paddle_label_text(entry.text)
+ missing_chars = sorted({char for char in label if char not in allowed})
+ if missing_chars:
+ missing[entry.sample_id] = missing_chars
+ if missing:
+ details = [
+ f"{sample_id}: {''.join(chars)}"
+ for sample_id, chars in list(missing.items())[:10]
+ ]
+ suffix = "; ".join(details)
+ raise DataValidationError(
+ f"dictionary_path is missing label characters for {len(missing)} samples: {dictionary_path}; {suffix}"
+ )
+
+
+def _paddle_label_text(text: str) -> str:
+ label = normalize_ocr_text(text).replace("\t", " ")
+ return " ".join(label.split())
+
+
+def _yaml_float(value: float) -> str:
+ if not math.isfinite(value):
+ raise DataValidationError(f"PaddleOCR YAML float must be finite: {value!r}")
+ if value == 0:
+ return "0.0"
+ text = f"{value:.12f}".rstrip("0").rstrip(".")
+ if "." not in text:
+ text += ".0"
+ return text
+
+
+def _recognizer_config_text(
+ *,
+ train_label: Path,
+ eval_label: Path,
+ dictionary_path: Path,
+ base_model: str,
+ output_dir: Path,
+ train_batch_size: int,
+ eval_batch_size: int,
+ learning_rate: float,
+ epochs: float | None,
+) -> str:
+ epoch_value: int | float | None
+ if epochs is None:
+ epoch_value = None
+ elif float(epochs).is_integer():
+ epoch_value = int(epochs)
+ else:
+ epoch_value = epochs
+ epoch_line = f" epoch_num: {epoch_value}\n" if epoch_value is not None else ""
+ learning_rate_value = _yaml_float(float(learning_rate))
+ return f"""# Generated by ocrtech train-recognizer.
+# PP-OCRv3 mobile recognizer recipe for PaddleOCR's tools/train.py.
+# Keep this in sync with PaddleOCR configs/rec/PP-OCRv3/multi_language/devanagari_PP-OCRv3_mobile_rec.yml.
+Global:
+ model_name: devanagari_PP-OCRv3_mobile_rec
+ debug: false
+ use_gpu: true
+{epoch_line} log_smooth_window: 20
+ print_batch_step: 10
+ pretrained_model: {base_model}
+ character_dict_path: {dictionary_path}
+ save_model_dir: {output_dir}
+ save_epoch_step: 1
+ eval_batch_step:
+ - 0
+ - 200
+ cal_metric_during_train: true
+ use_space_char: true
+ max_text_length: 128
+ infer_mode: false
+ distributed: false
+ save_res_path: {output_dir.parent / "predicts.txt"}
+
+Optimizer:
+ name: Adam
+ beta1: 0.9
+ beta2: 0.999
+ lr:
+ name: Cosine
+ learning_rate: {learning_rate_value}
+ warmup_epoch: 1
+ regularizer:
+ name: L2
+ factor: 3.0e-05
+
+Architecture:
+ model_type: rec
+ algorithm: SVTR_LCNet
+ Transform:
+ Backbone:
+ name: MobileNetV1Enhance
+ scale: 0.5
+ last_conv_stride:
+ - 1
+ - 2
+ last_pool_type: avg
+ last_pool_kernel_size:
+ - 2
+ - 2
+ Head:
+ name: MultiHead
+ head_list:
+ - CTCHead:
+ Neck:
+ name: svtr
+ dims: 64
+ depth: 2
+ hidden_dims: 120
+ use_guide: true
+ Head:
+ fc_decay: 1.0e-05
+ - SARHead:
+ enc_dim: 512
+ max_text_length: 128
+
+Loss:
+ name: MultiLoss
+ loss_config_list:
+ - CTCLoss:
+ - SARLoss:
+
+PostProcess:
+ name: CTCLabelDecode
+
+Metric:
+ name: RecMetric
+ main_indicator: acc
+ ignore_space: false
+
+Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: .
+ ext_op_transform_idx: 1
+ label_file_list:
+ - {train_label}
+ transforms:
+ - DecodeImage:
+ img_mode: BGR
+ channel_first: false
+ - RecConAug:
+ prob: 0.5
+ ext_data_num: 2
+ image_shape:
+ - 48
+ - 320
+ - 3
+ - RecAug:
+ - MultiLabelEncode:
+ - RecResizeImg:
+ image_shape:
+ - 3
+ - 48
+ - 320
+ - KeepKeys:
+ keep_keys:
+ - image
+ - label_ctc
+ - label_sar
+ - length
+ - valid_ratio
+ loader:
+ shuffle: true
+ batch_size_per_card: {train_batch_size}
+ drop_last: true
+ num_workers: 2
+
+Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: .
+ label_file_list:
+ - {eval_label}
+ transforms:
+ - DecodeImage:
+ img_mode: BGR
+ channel_first: false
+ - MultiLabelEncode:
+ - RecResizeImg:
+ image_shape:
+ - 3
+ - 48
+ - 320
+ - KeepKeys:
+ keep_keys:
+ - image
+ - label_ctc
+ - label_sar
+ - length
+ - valid_ratio
+ loader:
+ shuffle: false
+ batch_size_per_card: {eval_batch_size}
+ drop_last: false
+ num_workers: 2
+"""
+
+
+@dataclass(slots=True)
+class HfRecognizerTrainingConfig:
+ train_manifest: str
+ eval_manifest: str
+ output_dir: str
+ base_model: str
+ max_target_length: int
+ per_device_train_batch_size: int
+ per_device_eval_batch_size: int
+ learning_rate: float
+ num_train_epochs: float
+ warmup_steps: int
+ logging_steps: int
+ save_total_limit: int
+ predict_with_generate: bool
+ generation_max_length: int
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "train_manifest": self.train_manifest,
+ "eval_manifest": self.eval_manifest,
+ "output_dir": self.output_dir,
+ "base_model": self.base_model,
+ "max_target_length": self.max_target_length,
+ "per_device_train_batch_size": self.per_device_train_batch_size,
+ "per_device_eval_batch_size": self.per_device_eval_batch_size,
+ "learning_rate": self.learning_rate,
+ "num_train_epochs": self.num_train_epochs,
+ "warmup_steps": self.warmup_steps,
+ "logging_steps": self.logging_steps,
+ "save_total_limit": self.save_total_limit,
+ "predict_with_generate": self.predict_with_generate,
+ "generation_max_length": self.generation_max_length,
+ }
+
+ @classmethod
+ def from_path(cls, path: str | Path) -> "HfRecognizerTrainingConfig":
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise DataValidationError("hf recognizer config must be a JSON object")
+ return cls(
+ train_manifest=str(payload.get("train_manifest") or ""),
+ eval_manifest=str(payload.get("eval_manifest") or ""),
+ output_dir=str(payload.get("output_dir") or ""),
+ base_model=str(payload.get("base_model") or ""),
+ max_target_length=int(payload.get("max_target_length", 128)),
+ per_device_train_batch_size=int(payload.get("per_device_train_batch_size", 8)),
+ per_device_eval_batch_size=int(payload.get("per_device_eval_batch_size", 8)),
+ learning_rate=float(payload.get("learning_rate", 5e-5)),
+ num_train_epochs=float(payload.get("num_train_epochs", 3.0)),
+ warmup_steps=int(payload.get("warmup_steps", 0)),
+ logging_steps=int(payload.get("logging_steps", 10)),
+ save_total_limit=int(payload.get("save_total_limit", 2)),
+ predict_with_generate=bool(payload.get("predict_with_generate", True)),
+ generation_max_length=int(payload.get("generation_max_length", payload.get("max_target_length", 128))),
+ )
+
+
+@dataclass(slots=True)
+class HfTextCorrectorTrainingConfig:
+ train_pairs: str
+ eval_pairs: str
+ output_dir: str
+ base_model: str
+ max_source_length: int
+ max_target_length: int
+ per_device_train_batch_size: int
+ per_device_eval_batch_size: int
+ learning_rate: float
+ num_train_epochs: float
+ warmup_steps: int
+ logging_steps: int
+ save_total_limit: int
+ predict_with_generate: bool
+ generation_max_length: int
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "train_pairs": self.train_pairs,
+ "eval_pairs": self.eval_pairs,
+ "output_dir": self.output_dir,
+ "base_model": self.base_model,
+ "max_source_length": self.max_source_length,
+ "max_target_length": self.max_target_length,
+ "per_device_train_batch_size": self.per_device_train_batch_size,
+ "per_device_eval_batch_size": self.per_device_eval_batch_size,
+ "learning_rate": self.learning_rate,
+ "num_train_epochs": self.num_train_epochs,
+ "warmup_steps": self.warmup_steps,
+ "logging_steps": self.logging_steps,
+ "save_total_limit": self.save_total_limit,
+ "predict_with_generate": self.predict_with_generate,
+ "generation_max_length": self.generation_max_length,
+ }
+
+ @classmethod
+ def from_path(cls, path: str | Path) -> "HfTextCorrectorTrainingConfig":
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ if not isinstance(payload, dict):
+ raise DataValidationError("hf text corrector config must be a JSON object")
+ return cls(
+ train_pairs=str(payload.get("train_pairs") or ""),
+ eval_pairs=str(payload.get("eval_pairs") or ""),
+ output_dir=str(payload.get("output_dir") or ""),
+ base_model=str(payload.get("base_model") or ""),
+ max_source_length=int(payload.get("max_source_length", 256)),
+ max_target_length=int(payload.get("max_target_length", 256)),
+ per_device_train_batch_size=int(payload.get("per_device_train_batch_size", 16)),
+ per_device_eval_batch_size=int(payload.get("per_device_eval_batch_size", 16)),
+ learning_rate=float(payload.get("learning_rate", 5e-5)),
+ num_train_epochs=float(payload.get("num_train_epochs", 3.0)),
+ warmup_steps=int(payload.get("warmup_steps", 0)),
+ logging_steps=int(payload.get("logging_steps", 10)),
+ save_total_limit=int(payload.get("save_total_limit", 2)),
+ predict_with_generate=bool(payload.get("predict_with_generate", True)),
+ generation_max_length=int(payload.get("generation_max_length", payload.get("max_target_length", 256))),
+ )
+
+
+@dataclass(slots=True)
+class RecognizerTrainingBundle:
+ archive_path: str
+ manifest_path: str
+ readme_path: str
+ file_count: int
+ total_bytes: int
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "archive_path": self.archive_path,
+ "manifest_path": self.manifest_path,
+ "readme_path": self.readme_path,
+ "file_count": self.file_count,
+ "total_bytes": self.total_bytes,
+ }
+
+
+@dataclass(slots=True)
+class HfRecognizerFinalization:
+ run_dir: str
+ package_dir: str
+ model_card_path: str
+ audit_path: str
+ report_json_path: str
+ report_md_path: str
+ audit_passed: bool
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "run_dir": self.run_dir,
+ "package_dir": self.package_dir,
+ "model_card_path": self.model_card_path,
+ "audit_path": self.audit_path,
+ "report_json_path": self.report_json_path,
+ "report_md_path": self.report_md_path,
+ "audit_passed": self.audit_passed,
+ }
+
+
+def write_hf_recognizer_recipe(
+ train_manifest: str | Path,
+ eval_manifest: str | Path,
+ output_dir: str | Path,
+ *,
+ base_model: str = "microsoft/trocr-small-printed",
+ max_target_length: int = 128,
+ per_device_train_batch_size: int = 8,
+ per_device_eval_batch_size: int = 8,
+ learning_rate: float = 5e-5,
+ num_train_epochs: float = 3.0,
+ warmup_steps: int = 0,
+ logging_steps: int = 10,
+ save_total_limit: int = 2,
+ run: bool = False,
+) -> Path:
+ train_entries = load_manifest(train_manifest)
+ eval_entries = load_manifest(eval_manifest)
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ config = HfRecognizerTrainingConfig(
+ train_manifest=str(Path(train_manifest)),
+ eval_manifest=str(Path(eval_manifest)),
+ output_dir=str(out),
+ base_model=base_model,
+ max_target_length=max_target_length,
+ per_device_train_batch_size=per_device_train_batch_size,
+ per_device_eval_batch_size=per_device_eval_batch_size,
+ learning_rate=learning_rate,
+ num_train_epochs=num_train_epochs,
+ warmup_steps=warmup_steps,
+ logging_steps=logging_steps,
+ save_total_limit=save_total_limit,
+ predict_with_generate=True,
+ generation_max_length=max_target_length,
+ )
+ config_path = out / "hf_recognizer_config.json"
+ config_path.write_text(json.dumps(config.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ summary_path = out / "recognizer-training-summary.json"
+ summary_path.write_text(
+ json.dumps(
+ _hf_recognizer_training_summary(
+ train_manifest=Path(train_manifest),
+ eval_manifest=Path(eval_manifest),
+ train_entries=train_entries,
+ eval_entries=eval_entries,
+ config_path=config_path,
+ base_model=base_model,
+ max_target_length=max_target_length,
+ per_device_train_batch_size=per_device_train_batch_size,
+ per_device_eval_batch_size=per_device_eval_batch_size,
+ learning_rate=learning_rate,
+ num_train_epochs=num_train_epochs,
+ warmup_steps=warmup_steps,
+ logging_steps=logging_steps,
+ save_total_limit=save_total_limit,
+ ),
+ ensure_ascii=False,
+ indent=2,
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ (out / "README.md").write_text(
+ "\n".join(
+ [
+ "# Hugging Face Recognizer Training Recipe",
+ "",
+ f"Training summary: `{summary_path}`",
+ f"Base model: `{base_model}`",
+ f"Train manifest: `{train_manifest}` ({len(train_entries)} samples)",
+ f"Eval manifest: `{eval_manifest}` ({len(eval_entries)} samples)",
+ "",
+ "Install the backend dependencies first:",
+ "",
+ "```bash",
+ "python -m pip install -e '.[hf-recognizer]'",
+ "```",
+ "",
+ "Run in-process:",
+ "",
+ "```bash",
+ _hf_recognizer_train_command(config, run=True),
+ "```",
+ ]
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ if run:
+ run_hf_recognizer_training(config_path)
+ return config_path
+
+
+def _hf_recognizer_train_command(config: HfRecognizerTrainingConfig, *, run: bool = False) -> str:
+ parts = [
+ "ocrtech",
+ "train-recognizer",
+ "--backend",
+ "hf-vision-encoder-decoder",
+ "--base-model",
+ config.base_model,
+ "--train-manifest",
+ config.train_manifest,
+ "--eval-manifest",
+ config.eval_manifest,
+ "--out",
+ config.output_dir,
+ "--max-target-length",
+ str(config.max_target_length),
+ "--train-batch-size",
+ str(config.per_device_train_batch_size),
+ "--eval-batch-size",
+ str(config.per_device_eval_batch_size),
+ "--learning-rate",
+ _format_float(config.learning_rate),
+ "--epochs",
+ _format_float(config.num_train_epochs),
+ ]
+ if run:
+ parts.append("--run")
+ return " ".join(shlex.quote(part) for part in parts)
+
+
+def _format_float(value: float) -> str:
+ return f"{value:.12g}"
+
+
+def _hf_recognizer_training_summary(
+ *,
+ train_manifest: Path,
+ eval_manifest: Path,
+ train_entries: list[ManifestEntry],
+ eval_entries: list[ManifestEntry],
+ config_path: Path,
+ base_model: str,
+ max_target_length: int,
+ per_device_train_batch_size: int,
+ per_device_eval_batch_size: int,
+ learning_rate: float,
+ num_train_epochs: float,
+ warmup_steps: int,
+ logging_steps: int,
+ save_total_limit: int,
+) -> dict[str, Any]:
+ texts = [entry.text for entry in [*train_entries, *eval_entries]]
+ chars = dictionary_from_texts(texts)
+ return {
+ "backend": "hf_vision_encoder_decoder",
+ "base_model": base_model,
+ "manifests": {
+ "train": _manifest_summary(train_manifest, train_entries),
+ "eval": _manifest_summary(eval_manifest, eval_entries),
+ },
+ "artifacts": {
+ "config": _file_summary(config_path),
+ "dictionary": {
+ "character_count": len(chars),
+ "contains_space": " " in chars,
+ "contains_ascii": any(char.isascii() and char.isalnum() for char in chars),
+ "contains_devanagari": any("\u0900" <= char <= "\u097f" for char in chars),
+ },
+ },
+ "hyperparameters": {
+ "max_target_length": max_target_length,
+ "per_device_train_batch_size": per_device_train_batch_size,
+ "per_device_eval_batch_size": per_device_eval_batch_size,
+ "learning_rate": learning_rate,
+ "num_train_epochs": num_train_epochs,
+ "warmup_steps": warmup_steps,
+ "logging_steps": logging_steps,
+ "save_total_limit": save_total_limit,
+ "generation_max_length": max_target_length,
+ },
+ }
+
+
+def run_hf_recognizer_training(config_path: str | Path) -> Path:
+ config = HfRecognizerTrainingConfig.from_path(config_path)
+ train_entries = load_manifest(config.train_manifest)
+ eval_entries = load_manifest(config.eval_manifest)
+ if not train_entries:
+ raise DataValidationError("hf recognizer training requires non-empty train_manifest")
+ if not eval_entries:
+ raise DataValidationError("hf recognizer training requires non-empty eval_manifest")
+ try:
+ import torch
+ except ImportError as exc:
+ raise DataValidationError("hf recognizer training requires torch. Install ocr-tech[hf-recognizer].") from exc
+ try:
+ from PIL import Image
+ except ImportError as exc:
+ raise DataValidationError("hf recognizer training requires Pillow. Install ocr-tech[hf-recognizer].") from exc
+ try:
+ from transformers import Seq2SeqTrainer, Seq2SeqTrainingArguments, TrOCRProcessor, VisionEncoderDecoderModel
+ except ImportError as exc:
+ raise DataValidationError("hf recognizer training requires transformers. Install ocr-tech[hf-recognizer].") from exc
+
+ output_dir = Path(config.output_dir)
+ output_dir.mkdir(parents=True, exist_ok=True)
+ processor = _load_trocr_processor(TrOCRProcessor, config.base_model)
+ model = VisionEncoderDecoderModel.from_pretrained(config.base_model)
+ tokenizer = processor.tokenizer
+ decoder_start_token_id = _read_token_id(model.config, "decoder_start_token_id")
+ pad_token_id = _read_token_id(model.config, "pad_token_id")
+ if decoder_start_token_id is None:
+ decoder_start_token_id = tokenizer.cls_token_id or tokenizer.bos_token_id
+ if pad_token_id is None:
+ pad_token_id = tokenizer.pad_token_id
+ if decoder_start_token_id is None or pad_token_id is None:
+ raise DataValidationError("hf recognizer base model tokenizer must define decoder_start_token_id and pad_token_id")
+ _write_token_ids(model, decoder_start_token_id=decoder_start_token_id, pad_token_id=pad_token_id)
+ model.generation_config.max_length = config.generation_max_length
+
+ train_dataset = _VisionTextDataset(train_entries, processor, Image, config.max_target_length)
+ eval_dataset = _VisionTextDataset(eval_entries, processor, Image, config.max_target_length)
+ training_args = Seq2SeqTrainingArguments(
+ output_dir=str(output_dir / "checkpoints"),
+ eval_strategy="epoch",
+ save_strategy="epoch",
+ learning_rate=config.learning_rate,
+ per_device_train_batch_size=config.per_device_train_batch_size,
+ per_device_eval_batch_size=config.per_device_eval_batch_size,
+ num_train_epochs=config.num_train_epochs,
+ warmup_steps=config.warmup_steps,
+ logging_steps=config.logging_steps,
+ save_total_limit=config.save_total_limit,
+ predict_with_generate=config.predict_with_generate,
+ remove_unused_columns=False,
+ report_to=[],
+ )
+ trainer = Seq2SeqTrainer(
+ model=model,
+ args=training_args,
+ train_dataset=train_dataset,
+ eval_dataset=eval_dataset,
+ processing_class=processor,
+ data_collator=_VisionTextCollator(processor, torch),
+ compute_metrics=_hf_compute_metrics_factory(processor),
+ )
+ trainer.train()
+ final_model_dir = output_dir / "final-model"
+ trainer.save_model(str(final_model_dir))
+ processor.save_pretrained(str(final_model_dir))
+ metrics = trainer.evaluate(max_length=config.generation_max_length)
+ metrics_path = output_dir / "training_metrics.json"
+ metrics_path.write_text(json.dumps(metrics, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ return final_model_dir
+
+
+def bundle_recognizer_training(
+ recipe_dir: str | Path,
+ output_dir: str | Path,
+ *,
+ train_manifest: str | Path,
+ eval_manifest: str | Path,
+ archive_name: str = "recognizer-training-bundle.tar.gz",
+ base_dir: str | Path = ".",
+ require_corpus_audit: bool = False,
+ min_train_samples: int = 1000,
+ min_eval_samples: int = 100,
+ min_train_english: int = 200,
+ min_train_devanagari: int = 200,
+ min_train_mixed: int = 25,
+ min_eval_english: int = 50,
+ min_eval_devanagari: int = 50,
+ min_eval_mixed: int = 10,
+ min_train_latin_only: int = 50,
+ min_train_devanagari_only: int = 50,
+ min_eval_latin_only: int = 10,
+ min_eval_devanagari_only: int = 10,
+ min_train_real: int = 100,
+ min_train_synthetic: int = 100,
+ failure_review: str | Path | None = None,
+) -> RecognizerTrainingBundle:
+ base = Path(base_dir).resolve()
+ recipe_path = _resolve_under_base(recipe_dir, base=base)
+ train_path = _resolve_under_base(train_manifest, base=base)
+ eval_path = _resolve_under_base(eval_manifest, base=base)
+ if not recipe_path.is_dir():
+ raise DataValidationError(f"recipe_dir does not exist or is not a directory: {recipe_path}")
+ if not train_path.is_file():
+ raise DataValidationError(f"train_manifest does not exist or is not a file: {train_path}")
+ if not eval_path.is_file():
+ raise DataValidationError(f"eval_manifest does not exist or is not a file: {eval_path}")
+ training_summary_path = recipe_path / "recognizer-training-summary.json"
+ if failure_review is not None:
+ if not training_summary_path.is_file():
+ raise DataValidationError(f"recognizer training summary does not exist for stopped-family guard: {training_summary_path}")
+ summary_payload = _read_json_object(training_summary_path, "recognizer training summary")
+ assert_recognizer_family_not_stopped(
+ failure_review,
+ backend=str(summary_payload.get("backend") or ""),
+ base_model=str(summary_payload.get("base_model") or ""),
+ )
+
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ corpus_audit_payload: dict[str, Any] = {"required": require_corpus_audit, "present": False}
+ if require_corpus_audit:
+ corpus_audit = audit_recognizer_corpus(
+ train_path,
+ eval_path,
+ out / "recognizer-corpus-audit",
+ min_train_samples=min_train_samples,
+ min_eval_samples=min_eval_samples,
+ min_train_english=min_train_english,
+ min_train_devanagari=min_train_devanagari,
+ min_train_mixed=min_train_mixed,
+ min_eval_english=min_eval_english,
+ min_eval_devanagari=min_eval_devanagari,
+ min_eval_mixed=min_eval_mixed,
+ min_train_latin_only=min_train_latin_only,
+ min_train_devanagari_only=min_train_devanagari_only,
+ min_eval_latin_only=min_eval_latin_only,
+ min_eval_devanagari_only=min_eval_devanagari_only,
+ min_train_real=min_train_real,
+ min_train_synthetic=min_train_synthetic,
+ )
+ corpus_audit_payload = {
+ "required": True,
+ "present": True,
+ "passed": corpus_audit.passed,
+ "path": "recognizer-corpus-audit/recognizer-corpus-audit.json",
+ }
+ if not corpus_audit.passed:
+ raise DataValidationError(
+ "recognizer corpus audit failed; refusing to bundle training job: "
+ + "; ".join(corpus_audit.issues)
+ )
+ archive_path = out / archive_name
+ manifest_path = out / "recognizer-training-bundle.json"
+ readme_path = out / "recognizer-training-bundle.md"
+ train_entries = load_manifest(train_path)
+ eval_entries = load_manifest(eval_path)
+ with tempfile.TemporaryDirectory(prefix="ocrtech-recognizer-bundle-") as tmp_dir_name:
+ staging = Path(tmp_dir_name)
+ recipe_arcname = _relative_to_base(recipe_path, base=base)
+ train_arcname = _relative_to_base(train_path, base=base)
+ eval_arcname = _relative_to_base(eval_path, base=base)
+ shutil.copytree(recipe_path, staging / recipe_arcname)
+ rewritten_train = _stage_bundle_manifest(train_entries, staging, split_name="train", base=base)
+ rewritten_eval = _stage_bundle_manifest(eval_entries, staging, split_name="eval", base=base)
+ write_manifest(rewritten_train, staging / train_arcname)
+ write_manifest(rewritten_eval, staging / eval_arcname)
+ _write_paddle_label_file(rewritten_train, staging / recipe_arcname / "labels" / "train.txt")
+ _write_paddle_label_file(rewritten_eval, staging / recipe_arcname / "labels" / "eval.txt")
+ staged_files = sorted(path for path in staging.rglob("*") if path.is_file())
+ total_bytes = sum(path.stat().st_size for path in staged_files)
+ staged_summary = staging / recipe_arcname / "recognizer-training-summary.json"
+ summary_payload = _bundle_file_reference(staged_summary, staging)
+ recipe_backend, run_command = _bundle_recipe_run_command(staging / recipe_arcname, recipe_arcname=recipe_arcname)
+ with tarfile.open(archive_path, "w:gz") as archive:
+ for source in staged_files:
+ archive.add(source, arcname=str(source.relative_to(staging)))
+ payload = {
+ "archive_path": str(archive_path),
+ "base_dir": str(base),
+ "recipe_dir": str(_relative_to_base(recipe_path, base=base)),
+ "train_manifest": str(_relative_to_base(train_path, base=base)),
+ "eval_manifest": str(_relative_to_base(eval_path, base=base)),
+ "portable_image_root": "bundle_assets/images",
+ "recipe_backend": recipe_backend,
+ "run_command": run_command,
+ "training_summary": summary_payload,
+ "recognizer_corpus_audit": corpus_audit_payload,
+ "file_count": len(staged_files),
+ "total_bytes": total_bytes,
+ "files": [str(path.relative_to(staging)) for path in staged_files],
+ }
+ manifest_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ readme_path.write_text(
+ "# Recognizer Training Bundle\n\n"
+ f"Archive: `{archive_path}`\n"
+ f"Training summary: `{summary_payload.get('path') or 'not present'}`\n"
+ f"Recognizer corpus audit: `{corpus_audit_payload.get('path') or 'not required'}`\n"
+ f"Files: `{len(staged_files)}`\n"
+ f"Bytes before compression: `{total_bytes}`\n\n"
+ "Extract this archive at the root of an ocr-tech workspace or an empty training workspace. "
+ "The recipe uses relative paths, so run training from the extraction root.\n\n"
+ "```bash\n"
+ f"tar -xzf {archive_path.name}\n"
+ f"{run_command}\n"
+ "```\n",
+ encoding="utf-8",
+ )
+ return RecognizerTrainingBundle(
+ archive_path=str(archive_path),
+ manifest_path=str(manifest_path),
+ readme_path=str(readme_path),
+ file_count=len(staged_files),
+ total_bytes=total_bytes,
+)
+
+
+def _bundle_recipe_run_command(recipe_dir: Path, *, recipe_arcname: Path) -> tuple[str, str]:
+ paddle_config = recipe_dir / "paddle_recognizer.yml"
+ hf_config = recipe_dir / "hf_recognizer_config.json"
+ if paddle_config.is_file():
+ return "paddleocr", f"python PaddleOCR/tools/train.py -c {recipe_arcname / 'paddle_recognizer.yml'}"
+ if hf_config.is_file():
+ config = HfRecognizerTrainingConfig.from_path(hf_config)
+ return "hf_vision_encoder_decoder", _hf_recognizer_train_command(config, run=True)
+ return "unknown", f"# no supported recognizer training config found under {recipe_dir}"
+
+
+def _bundle_file_reference(path: Path, staging_root: Path) -> dict[str, Any]:
+ if not path.exists() or not path.is_file():
+ return {"present": False, "path": str(path.relative_to(staging_root))}
+ return {
+ "present": True,
+ "path": str(path.relative_to(staging_root)),
+ "sha256": sha256_file(path),
+ }
+
+
+def _read_json_object(path: Path, label: str) -> dict[str, Any]:
+ try:
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ except FileNotFoundError as exc:
+ raise DataValidationError(f"{label} does not exist: {path}") from exc
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"invalid {label} JSON {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise DataValidationError(f"{label} must be a JSON object: {path}")
+ return payload
+
+
+def _stage_bundle_manifest(entries: list[ManifestEntry], staging: Path, *, split_name: str, base: Path) -> list[ManifestEntry]:
+ rewritten: list[ManifestEntry] = []
+ for entry in entries:
+ image_path = Path(entry.image_path)
+ if not image_path.is_absolute():
+ image_path = base / image_path
+ image_path = image_path.resolve()
+ if not image_path.exists():
+ raise DataValidationError(f"manifest image_path does not exist for {entry.sample_id}: {image_path}")
+ if not image_path.is_file():
+ raise DataValidationError(f"recognizer training bundle only supports file image_path entries: {entry.sample_id}: {image_path}")
+ suffix = image_path.suffix or ".img"
+ target_rel = Path("bundle_assets") / "images" / split_name / f"{_safe_sample_id(entry.sample_id)}{suffix}"
+ target = staging / target_rel
+ target.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copy2(image_path, target)
+ rewritten.append(
+ ManifestEntry(
+ sample_id=entry.sample_id,
+ dataset=entry.dataset,
+ split=entry.split,
+ image_path=str(target_rel),
+ text=entry.text,
+ sha256=entry.sha256,
+ metadata=dict(entry.metadata),
+ )
+ )
+ return rewritten
+
+
+def _safe_sample_id(sample_id: str) -> str:
+ safe = "".join(char if char.isalnum() or char in {"-", "_", "."} else "_" for char in sample_id)
+ return safe or "sample"
+
+
+def _resolve_under_base(path: str | Path, *, base: Path) -> Path:
+ value = Path(path)
+ resolved = value if value.is_absolute() else base / value
+ resolved = resolved.resolve()
+ try:
+ resolved.relative_to(base)
+ except ValueError as exc:
+ raise DataValidationError(f"path must be inside base_dir {base}: {path}") from exc
+ return resolved
+
+
+def _relative_to_base(path: Path, *, base: Path) -> Path:
+ try:
+ return path.resolve().relative_to(base)
+ except ValueError as exc:
+ raise DataValidationError(f"path must be inside base_dir {base}: {path}") from exc
+
+
+def _load_trocr_processor(processor_cls: type[object], source: str | Path) -> object:
+ attempts = ({"backend": "pil"}, {"use_fast": False})
+ for kwargs in attempts:
+ try:
+ return processor_cls.from_pretrained(str(source), **kwargs)
+ except TypeError as exc:
+ if any(key in str(exc) for key in kwargs):
+ continue
+ raise
+ except ImportError as exc:
+ raise DataValidationError("TrOCR processor loading requires sentencepiece and protobuf. Install ocr-tech[hf-recognizer].") from exc
+ except ValueError as exc:
+ message = str(exc)
+ if "SentencePiece" in message or "sentencepiece" in message or "tiktoken" in message or "protobuf" in message:
+ raise DataValidationError("TrOCR processor loading requires sentencepiece and protobuf. Install ocr-tech[hf-recognizer].") from exc
+ raise
+ return processor_cls.from_pretrained(str(source))
+
+
+def _read_token_id(config: object, name: str) -> int | None:
+ value = getattr(config, name, None)
+ if value is not None:
+ return int(value)
+ nested_decoder = getattr(config, "decoder", None)
+ nested_value = getattr(nested_decoder, name, None)
+ return int(nested_value) if nested_value is not None else None
+
+
+def _set_attr_if_possible(target: object, name: str, value: int) -> None:
+ try:
+ setattr(target, name, value)
+ except AttributeError:
+ return
+
+
+def _write_token_ids(model: object, *, decoder_start_token_id: int, pad_token_id: int) -> None:
+ config = getattr(model, "config", None)
+ if config is not None:
+ _set_attr_if_possible(config, "decoder_start_token_id", decoder_start_token_id)
+ _set_attr_if_possible(config, "pad_token_id", pad_token_id)
+ nested_decoder = getattr(config, "decoder", None)
+ if nested_decoder is not None:
+ _set_attr_if_possible(nested_decoder, "decoder_start_token_id", decoder_start_token_id)
+ _set_attr_if_possible(nested_decoder, "pad_token_id", pad_token_id)
+ generation_config = getattr(model, "generation_config", None)
+ if generation_config is not None:
+ _set_attr_if_possible(generation_config, "decoder_start_token_id", decoder_start_token_id)
+ _set_attr_if_possible(generation_config, "pad_token_id", pad_token_id)
+
+
+def write_corrector_recipe(
+ output_dir: str | Path,
+ *,
+ clean_manifest: str | Path | None = None,
+ pairs_source: str | Path | None = None,
+ hf_dataset: str | None = None,
+ hf_split: str = "train",
+ limit: int | None = None,
+ seed: int = 13,
+) -> Path:
+ sources = [clean_manifest is not None, pairs_source is not None, hf_dataset is not None]
+ if sum(1 for item in sources if item) != 1:
+ raise DataValidationError("train-corrector requires exactly one of --clean-manifest, --pairs-source, or --hf-dataset")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ pairs_path = out / "correction_pairs.jsonl"
+ if pairs_source is not None:
+ _copy_pairs(pairs_source, pairs_path, limit=limit)
+ elif hf_dataset is not None:
+ prepare_hf_correction_pairs(hf_dataset, pairs_path, split=hf_split, limit=limit)
+ else:
+ entries = load_manifest(clean_manifest or "")
+ pairs = _synthetic_pairs(entries, limit=limit, seed=seed)
+ with pairs_path.open("w", encoding="utf-8") as handle:
+ for noisy, clean in pairs:
+ handle.write(json.dumps({"noisy_text": noisy, "clean_text": clean}, ensure_ascii=False) + "\n")
+ config_path = out / "corrector_config.json"
+ config_path.write_text(
+ json.dumps(
+ {
+ "task": "ocr_text_correction",
+ "pairs": str(pairs_path),
+ "recommended_model_family": "compact seq2seq or encoder-decoder text corrector",
+ "metrics": ["cer", "wer", "exact_line_accuracy"],
+ },
+ ensure_ascii=False,
+ indent=2,
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ (out / "README.md").write_text(
+ "# Corrector Training Recipe\n\n"
+ f"Pairs: `{pairs_path}`\n\n"
+ "Use these noisy-clean pairs with a compact text-to-text model. Keep Nepali and English validation sets separate.\n",
+ encoding="utf-8",
+ )
+ return config_path
+
+
+def generate_correction_pairs(
+ manifest_path: str | Path,
+ output_path: str | Path,
+ *,
+ engine_name: str = "tesseract",
+ model_config: str | Path | None = None,
+ limit: int | None = None,
+ only_errors: bool = False,
+) -> Path:
+ from .engines import create_engine
+
+ entries = load_manifest(manifest_path)
+ if not entries:
+ raise DataValidationError("generate-correction-pairs requires a non-empty manifest")
+ engine_kwargs: dict[str, Any] = {}
+ if engine_name in {"candidate", "ours"}:
+ engine_kwargs["model_config"] = model_config
+ engine = create_engine(engine_name, **engine_kwargs)
+ out = Path(output_path)
+ out.parent.mkdir(parents=True, exist_ok=True)
+ written = 0
+ with out.open("w", encoding="utf-8") as handle:
+ for entry in entries:
+ if limit is not None and written >= limit:
+ break
+ recognized = engine.recognize(Path(entry.image_path))
+ noisy = normalize_ocr_text("\n".join(line.text for page in recognized.pages for line in page.text_lines))
+ clean = normalize_ocr_text(entry.text)
+ if only_errors and noisy == clean:
+ continue
+ handle.write(
+ json.dumps(
+ {
+ "sample_id": entry.sample_id,
+ "engine": engine_name,
+ "noisy_text": noisy,
+ "clean_text": clean,
+ "slices": list(entry.metadata.get("slices") or []) if entry.metadata else [],
+ },
+ ensure_ascii=False,
+ )
+ + "\n"
+ )
+ written += 1
+ if written == 0:
+ raise DataValidationError("No correction pairs generated")
+ return out
+
+
+def write_hf_text_corrector_recipe(
+ pairs_source: str | Path,
+ output_dir: str | Path,
+ *,
+ base_model: str = "google/byt5-small",
+ max_source_length: int = 256,
+ max_target_length: int = 256,
+ per_device_train_batch_size: int = 16,
+ per_device_eval_batch_size: int = 16,
+ learning_rate: float = 5e-5,
+ num_train_epochs: float = 3.0,
+ warmup_steps: int = 0,
+ logging_steps: int = 10,
+ save_total_limit: int = 2,
+ eval_ratio: float = 0.1,
+ seed: int = 13,
+ run: bool = False,
+) -> Path:
+ pairs = _load_correction_pairs(Path(pairs_source))
+ if len(pairs) < 2:
+ raise DataValidationError("hf text corrector training requires at least two correction pairs")
+ if eval_ratio <= 0 or eval_ratio >= 1:
+ raise DataValidationError("hf text corrector eval_ratio must be between 0 and 1")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ rng = random.Random(seed)
+ shuffled = list(pairs)
+ rng.shuffle(shuffled)
+ eval_count = min(max(1, round(len(shuffled) * eval_ratio)), len(shuffled) - 1)
+ eval_pairs = shuffled[:eval_count]
+ train_pairs = shuffled[eval_count:]
+ train_pairs_path = out / "train_pairs.jsonl"
+ eval_pairs_path = out / "eval_pairs.jsonl"
+ _write_correction_pairs_jsonl(train_pairs, train_pairs_path)
+ _write_correction_pairs_jsonl(eval_pairs, eval_pairs_path)
+ config = HfTextCorrectorTrainingConfig(
+ train_pairs=str(train_pairs_path),
+ eval_pairs=str(eval_pairs_path),
+ output_dir=str(out),
+ base_model=base_model,
+ max_source_length=max_source_length,
+ max_target_length=max_target_length,
+ per_device_train_batch_size=per_device_train_batch_size,
+ per_device_eval_batch_size=per_device_eval_batch_size,
+ learning_rate=learning_rate,
+ num_train_epochs=num_train_epochs,
+ warmup_steps=warmup_steps,
+ logging_steps=logging_steps,
+ save_total_limit=save_total_limit,
+ predict_with_generate=True,
+ generation_max_length=max_target_length,
+ )
+ config_path = out / "hf_text_corrector_config.json"
+ config_path.write_text(json.dumps(config.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (out / "README.md").write_text(
+ "\n".join(
+ [
+ "# Hugging Face Text Corrector Training Recipe",
+ "",
+ f"Base model: `{base_model}`",
+ f"Pairs source: `{pairs_source}` ({len(pairs)} pairs)",
+ f"Train pairs: `{train_pairs_path}` ({len(train_pairs)} pairs)",
+ f"Eval pairs: `{eval_pairs_path}` ({len(eval_pairs)} pairs)",
+ "",
+ "Install the backend dependencies first:",
+ "",
+ "```bash",
+ "python -m pip install -e '.[hf-recognizer]'",
+ "```",
+ "",
+ "Run in-process:",
+ "",
+ "```bash",
+ f"ocrtech train-corrector --backend hf-seq2seq --pairs-source {pairs_source} --out {out} --run",
+ "```",
+ ]
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ if run:
+ run_hf_text_corrector_training(config_path)
+ return config_path
+
+
+def run_hf_text_corrector_training(config_path: str | Path) -> Path:
+ config = HfTextCorrectorTrainingConfig.from_path(config_path)
+ train_pairs = _load_correction_pairs(Path(config.train_pairs))
+ eval_pairs = _load_correction_pairs(Path(config.eval_pairs))
+ if not train_pairs:
+ raise DataValidationError("hf text corrector training requires non-empty train_pairs")
+ if not eval_pairs:
+ raise DataValidationError("hf text corrector training requires non-empty eval_pairs")
+ try:
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, DataCollatorForSeq2Seq, Seq2SeqTrainer, Seq2SeqTrainingArguments
+ except ImportError as exc:
+ raise DataValidationError("hf text corrector training requires transformers. Install ocr-tech[hf-recognizer].") from exc
+
+ output_dir = Path(config.output_dir)
+ output_dir.mkdir(parents=True, exist_ok=True)
+ tokenizer = AutoTokenizer.from_pretrained(config.base_model, use_fast=False)
+ model = AutoModelForSeq2SeqLM.from_pretrained(config.base_model)
+ model.generation_config.max_length = config.generation_max_length
+ train_dataset = _TextCorrectionDataset(train_pairs, tokenizer, config.max_source_length, config.max_target_length)
+ eval_dataset = _TextCorrectionDataset(eval_pairs, tokenizer, config.max_source_length, config.max_target_length)
+ training_args = Seq2SeqTrainingArguments(
+ output_dir=str(output_dir / "checkpoints"),
+ eval_strategy="epoch",
+ save_strategy="epoch",
+ learning_rate=config.learning_rate,
+ per_device_train_batch_size=config.per_device_train_batch_size,
+ per_device_eval_batch_size=config.per_device_eval_batch_size,
+ num_train_epochs=config.num_train_epochs,
+ warmup_steps=config.warmup_steps,
+ logging_steps=config.logging_steps,
+ save_total_limit=config.save_total_limit,
+ predict_with_generate=config.predict_with_generate,
+ generation_max_length=config.generation_max_length,
+ remove_unused_columns=False,
+ report_to=[],
+ )
+ trainer = Seq2SeqTrainer(
+ model=model,
+ args=training_args,
+ train_dataset=train_dataset,
+ eval_dataset=eval_dataset,
+ processing_class=tokenizer,
+ data_collator=DataCollatorForSeq2Seq(tokenizer=tokenizer, model=model),
+ compute_metrics=_hf_text_corrector_metrics_factory(tokenizer),
+ )
+ trainer.train()
+ final_model_dir = output_dir / "final-model"
+ trainer.save_model(str(final_model_dir))
+ tokenizer.save_pretrained(str(final_model_dir))
+ metrics = trainer.evaluate(max_length=config.generation_max_length)
+ metrics_path = output_dir / "training_metrics.json"
+ metrics_path.write_text(json.dumps(metrics, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ return final_model_dir
+
+
+def write_recognizer_export_recipe(
+ training_config: str | Path,
+ checkpoint: str | Path,
+ output_dir: str | Path,
+ *,
+ inference_dir: str | Path | None = None,
+ paddleocr_dir: str | Path = "PaddleOCR",
+ run: bool = False,
+) -> Path:
+ config_path = Path(training_config)
+ checkpoint_path = _paddle_checkpoint_prefix(Path(checkpoint))
+ if not config_path.exists():
+ raise DataValidationError(f"training_config does not exist: {config_path}")
+ if run and not _paddle_checkpoint_exists(checkpoint_path):
+ raise DataValidationError(f"checkpoint does not exist: {checkpoint_path}")
+ out = Path(output_dir)
+ out.mkdir(parents=True, exist_ok=True)
+ save_dir = Path(inference_dir) if inference_dir else out / "inference"
+ export_spec = {
+ "training_config": str(config_path),
+ "checkpoint": str(checkpoint_path),
+ "paddleocr_dir": str(paddleocr_dir),
+ "save_inference_dir": str(save_dir),
+ "command": [
+ "python",
+ str(Path(paddleocr_dir) / "tools" / "export_model.py"),
+ "-c",
+ str(config_path),
+ "-o",
+ f"Global.pretrained_model={checkpoint_path}",
+ f"Global.save_inference_dir={save_dir}",
+ ],
+ }
+ export_path = out / "export-recognizer.json"
+ export_path.write_text(json.dumps(export_spec, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ (out / "EXPORT.md").write_text(
+ "# Recognizer Export\n\n"
+ "Run this after training has produced a PaddleOCR checkpoint.\n\n"
+ "```bash\n"
+ + " ".join(export_spec["command"])
+ + "\n```\n",
+ encoding="utf-8",
+ )
+ if run:
+ completed = subprocess.run(export_spec["command"], check=False)
+ if completed.returncode != 0:
+ raise DataValidationError(f"PaddleOCR export failed with exit code {completed.returncode}")
+ return export_path
+
+
+def _paddle_checkpoint_prefix(checkpoint: Path) -> Path:
+ if checkpoint.name.endswith(".pdparams"):
+ return checkpoint.with_name(checkpoint.name[: -len(".pdparams")])
+ return checkpoint
+
+
+def _paddle_checkpoint_exists(checkpoint_prefix: Path) -> bool:
+ return checkpoint_prefix.exists() or checkpoint_prefix.with_name(f"{checkpoint_prefix.name}.pdparams").is_file()
+
+
+def package_paddleocr_model(
+ inference_dir: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ dictionary_path: str | Path,
+ base_model: str = PADDLE_DEVANAGARI_PPOCRV3_PRETRAINED,
+ train_manifest: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ training_summary: str | Path | None = None,
+ metrics_report: str | Path | None = None,
+ admission_validation_report: str | Path | None = None,
+) -> Path:
+ source_dir = Path(inference_dir)
+ dictionary = Path(dictionary_path)
+ if not source_dir.exists() or not source_dir.is_dir():
+ raise DataValidationError(f"inference_dir does not exist or is not a directory: {source_dir}")
+ if not dictionary.exists() or not dictionary.is_file():
+ raise DataValidationError(f"dictionary_path does not exist or is not a file: {dictionary}")
+ model_files = _find_paddle_inference_files(source_dir)
+ out = Path(output_dir)
+ artifacts_dir = out / "artifacts"
+ artifacts_dir.mkdir(parents=True, exist_ok=True)
+ copied: list[Path] = []
+ for file_path in model_files:
+ target = artifacts_dir / file_path.name
+ shutil.copy2(file_path, target)
+ copied.append(target)
+ dict_target = artifacts_dir / dictionary.name
+ shutil.copy2(dictionary, dict_target)
+ copied.append(dict_target)
+ card_path = out / "model-card.json"
+ write_model_card(
+ card_path,
+ model_id=model_id,
+ backend="paddleocr",
+ base_model=base_model,
+ artifact_paths=[path.relative_to(out) for path in copied],
+ backend_kwargs={
+ "lang": "ne",
+ "text_recognition_model_name": "devanagari_PP-OCRv3_mobile_rec",
+ "text_recognition_model_dir": str(artifacts_dir.relative_to(out)),
+ },
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ metrics_report=metrics_report,
+ admission_validation_report=admission_validation_report,
+ artifact_base_path=out,
+ )
+ (out / "PACKAGE.md").write_text(
+ "# Packaged PaddleOCR Candidate\n\n"
+ f"Model card: `{card_path}`\n"
+ f"Artifacts: `{artifacts_dir}`\n\n"
+ "Audit before benchmarking:\n\n"
+ "```bash\n"
+ f"ocrtech audit-model {card_path}\n"
+ "```\n",
+ encoding="utf-8",
+ )
+ return card_path
+
+
+def package_hf_recognizer_model(
+ model_dir: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ base_model: str,
+ train_manifest: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ training_summary: str | Path | None = None,
+ metrics_report: str | Path | None = None,
+ admission_validation_report: str | Path | None = None,
+ max_new_tokens: int = 128,
+) -> Path:
+ source_dir = Path(model_dir)
+ if not source_dir.exists() or not source_dir.is_dir():
+ raise DataValidationError(f"model_dir does not exist or is not a directory: {source_dir}")
+ out = Path(output_dir)
+ artifacts_dir = out / "artifacts" / "model"
+ if artifacts_dir.exists():
+ shutil.rmtree(artifacts_dir)
+ artifacts_dir.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copytree(source_dir, artifacts_dir)
+ card_path = out / "model-card.json"
+ write_model_card(
+ card_path,
+ model_id=model_id,
+ backend="hf_vision_encoder_decoder",
+ base_model=base_model,
+ artifact_paths=[artifacts_dir.relative_to(out)],
+ backend_kwargs={
+ "model_dir": str(artifacts_dir.relative_to(out)),
+ "processor_dir": str(artifacts_dir.relative_to(out)),
+ "max_new_tokens": max_new_tokens,
+ },
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ metrics_report=metrics_report,
+ admission_validation_report=admission_validation_report,
+ artifact_base_path=out,
+ )
+ (out / "PACKAGE.md").write_text(
+ "# Packaged Hugging Face OCR Candidate\n\n"
+ f"Model card: `{card_path}`\n"
+ f"Artifacts: `{artifacts_dir}`\n\n"
+ "Audit before benchmarking:\n\n"
+ "```bash\n"
+ f"ocrtech audit-model {card_path}\n"
+ "```\n",
+ encoding="utf-8",
+ )
+ return card_path
+
+
+def finalize_hf_recognizer_run(
+ run_dir: str | Path,
+ *,
+ output_dir: str | Path | None = None,
+ model_id: str,
+ base_model: str,
+ train_manifest: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ training_summary: str | Path | None = None,
+ admission_validation_report: str | Path | None = None,
+ max_new_tokens: int = 128,
+) -> HfRecognizerFinalization:
+ run_path = Path(run_dir)
+ if not run_path.exists() or not run_path.is_dir():
+ raise DataValidationError(f"run_dir does not exist or is not a directory: {run_path}")
+ final_model_dir = run_path / "final-model"
+ metrics_path = run_path / "training_metrics.json"
+ if not final_model_dir.exists() or not final_model_dir.is_dir():
+ raise DataValidationError(f"HF recognizer run is not finished; missing final model directory: {final_model_dir}")
+ if not metrics_path.exists() or not metrics_path.is_file():
+ raise DataValidationError(f"HF recognizer run is not finished; missing training metrics report: {metrics_path}")
+ try:
+ metrics_payload = json.loads(metrics_path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise DataValidationError(f"Invalid training metrics JSON {metrics_path}: {exc}") from exc
+ if not isinstance(metrics_payload, dict):
+ raise DataValidationError(f"training metrics report must be a JSON object: {metrics_path}")
+
+ out = Path(output_dir) if output_dir is not None else run_path / "finalized"
+ package_dir = out / "package"
+ audit_dir = out / "audit"
+ report_json = out / "hf-recognizer-finalization.json"
+ report_md = out / "hf-recognizer-finalization.md"
+ out.mkdir(parents=True, exist_ok=True)
+ card_path = package_hf_recognizer_model(
+ final_model_dir,
+ package_dir,
+ model_id=model_id,
+ base_model=base_model,
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ metrics_report=metrics_path,
+ admission_validation_report=admission_validation_report,
+ max_new_tokens=max_new_tokens,
+ )
+ audit = audit_model_card(card_path, audit_dir)
+ result = HfRecognizerFinalization(
+ run_dir=str(run_path),
+ package_dir=str(package_dir),
+ model_card_path=str(card_path),
+ audit_path=str(audit_dir / "model-audit.json"),
+ report_json_path=str(report_json),
+ report_md_path=str(report_md),
+ audit_passed=audit.passed,
+ )
+ report_json.write_text(json.dumps(result.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ report_md.write_text(_render_hf_recognizer_finalization(result), encoding="utf-8")
+ return result
+
+
+def _render_hf_recognizer_finalization(result: HfRecognizerFinalization) -> str:
+ return "\n".join(
+ [
+ "# HF Recognizer Finalization",
+ "",
+ f"Run directory: `{result.run_dir}`",
+ f"Package directory: `{result.package_dir}`",
+ f"Model card: `{result.model_card_path}`",
+ f"Model audit: `{result.audit_path}`",
+ f"Audit passed: `{'yes' if result.audit_passed else 'no'}`",
+ "",
+ "## Next Claim-Bearing Steps",
+ "",
+ "1. Run `ocrtech audit-model` on the packaged model card if the generated audit did not pass.",
+ "2. Benchmark the packaged candidate against named baselines on the held-out manifest.",
+ "3. Summarize paired metrics and run `ocrtech validate-claim` before writing any SOTA claim.",
+ "",
+ "Example experiment command:",
+ "",
+ "```bash",
+ "ocrtech run-experiment \\",
+ " --eval-manifest data/splits-mixed-v1/eval-with-refs.jsonl \\",
+ " --out outputs/experiment-hf-recognizer-mixed-v2-full \\",
+ " --baselines candidate,tesseract,surya,stock-paddle,glm-ocr,paddleocr-vl \\",
+ " --candidate-model-config " + result.model_card_path + " \\",
+ " --train-manifest data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl",
+ "```",
+ "",
+ ]
+ )
+
+
+def package_hf_text_corrector_model(
+ model_dir: str | Path,
+ output_dir: str | Path,
+ *,
+ model_id: str,
+ base_model: str,
+ base_engine: str = "tesseract",
+ base_engine_kwargs: dict[str, Any] | None = None,
+ train_manifest: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ metrics_report: str | Path | None = None,
+ max_new_tokens: int = 256,
+) -> Path:
+ source_dir = Path(model_dir)
+ if not source_dir.exists() or not source_dir.is_dir():
+ raise DataValidationError(f"model_dir does not exist or is not a directory: {source_dir}")
+ out = Path(output_dir)
+ artifacts_dir = out / "artifacts" / "model"
+ if artifacts_dir.exists():
+ shutil.rmtree(artifacts_dir)
+ artifacts_dir.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copytree(source_dir, artifacts_dir)
+ card_path = out / "model-card.json"
+ write_model_card(
+ card_path,
+ model_id=model_id,
+ backend="text_correction_composite",
+ base_model=base_model,
+ artifact_paths=[artifacts_dir.relative_to(out)],
+ backend_kwargs={
+ "base_engine": base_engine,
+ "base_engine_kwargs": base_engine_kwargs or {},
+ "model_dir": str(artifacts_dir.relative_to(out)),
+ "tokenizer_dir": str(artifacts_dir.relative_to(out)),
+ "max_new_tokens": max_new_tokens,
+ },
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ metrics_report=metrics_report,
+ )
+ (out / "PACKAGE.md").write_text(
+ "# Packaged Text Correction Composite Candidate\n\n"
+ f"Model card: `{card_path}`\n"
+ f"Artifacts: `{artifacts_dir}`\n\n"
+ "Audit before benchmarking:\n\n"
+ "```bash\n"
+ f"ocrtech audit-model {card_path}\n"
+ "```\n",
+ encoding="utf-8",
+ )
+ return card_path
+
+
+def _copy_pairs(source: str | Path, target: Path, *, limit: int | None) -> None:
+ source_path = Path(source)
+ count = 0
+ with source_path.open("r", encoding="utf-8") as src, target.open("w", encoding="utf-8") as dst:
+ for line_number, line in enumerate(src, start=1):
+ if limit is not None and count >= limit:
+ break
+ if not line.strip():
+ continue
+ data = json.loads(line)
+ if "noisy_text" not in data or "clean_text" not in data:
+ raise DataValidationError(f"Correction pair at {source_path}:{line_number} needs noisy_text and clean_text")
+ dst.write(json.dumps({"noisy_text": data["noisy_text"], "clean_text": data["clean_text"]}, ensure_ascii=False) + "\n")
+ count += 1
+
+
+def _synthetic_pairs(entries: list[ManifestEntry], *, limit: int | None, seed: int) -> list[tuple[str, str]]:
+ rng = random.Random(seed)
+ pairs: list[tuple[str, str]] = []
+ for entry in entries:
+ clean = normalize_ocr_text(entry.text)
+ noisy = _corrupt_text(clean, rng)
+ if noisy != clean:
+ pairs.append((noisy, clean))
+ if limit is not None and len(pairs) >= limit:
+ break
+ if not pairs:
+ raise DataValidationError("No correction pairs generated")
+ return pairs
+
+
+def _load_correction_pairs(path: Path) -> list[dict[str, str]]:
+ pairs: list[dict[str, str]] = []
+ with path.open("r", encoding="utf-8") as handle:
+ for line_number, line in enumerate(handle, start=1):
+ if not line.strip():
+ continue
+ data = json.loads(line)
+ noisy = data.get("noisy_text")
+ clean = data.get("clean_text")
+ if not isinstance(noisy, str) or not isinstance(clean, str):
+ raise DataValidationError(f"Correction pair at {path}:{line_number} needs string noisy_text and clean_text")
+ pairs.append({"noisy_text": normalize_ocr_text(noisy), "clean_text": normalize_ocr_text(clean)})
+ if not pairs:
+ raise DataValidationError(f"No correction pairs found in {path}")
+ return pairs
+
+
+def _write_correction_pairs_jsonl(pairs: list[dict[str, str]], path: Path) -> None:
+ with path.open("w", encoding="utf-8") as handle:
+ for pair in pairs:
+ handle.write(json.dumps(pair, ensure_ascii=False) + "\n")
+
+
+def _corrupt_text(text: str, rng: random.Random) -> str:
+ chars = list(text)
+ if len(chars) < 2:
+ return text
+ operations = max(1, len(chars) // 24)
+ for _ in range(operations):
+ index = rng.randrange(len(chars))
+ draw = rng.random()
+ if draw < 0.4:
+ chars.pop(index)
+ if not chars:
+ break
+ elif draw < 0.7:
+ chars[index] = " "
+ else:
+ chars.insert(index, chars[index])
+ return "".join(chars)
+
+
+def _find_paddle_inference_files(source_dir: Path) -> list[Path]:
+ files = [path for path in source_dir.iterdir() if path.is_file()]
+ if not files:
+ raise DataValidationError(f"inference_dir contains no files: {source_dir}")
+ parameter_files = sorted(path for path in files if path.suffix == ".pdiparams" or path.name.endswith(".pdiparams"))
+ model_files = sorted(path for path in files if path.suffix in {".pdmodel", ".json"} or path.name in {"inference.pdmodel", "inference.json"})
+ config_files = sorted(path for path in files if path.name in {"inference.yml", "inference.yaml"})
+ info_files = sorted(path for path in files if path.name.endswith(".pdiparams.info"))
+ if not parameter_files:
+ raise DataValidationError(f"inference_dir is missing PaddleOCR parameter file (*.pdiparams): {source_dir}")
+ if not model_files:
+ raise DataValidationError(f"inference_dir is missing PaddleOCR model file (*.pdmodel or *.json): {source_dir}")
+ return [*model_files, *parameter_files, *config_files, *info_files]
+
+
+class _VisionTextDataset:
+ def __init__(self, entries: list[ManifestEntry], processor: Any, image_module: Any, max_target_length: int) -> None:
+ self.entries = entries
+ self.processor = processor
+ self.image_module = image_module
+ self.max_target_length = max_target_length
+
+ def __len__(self) -> int:
+ return len(self.entries)
+
+ def __getitem__(self, index: int) -> dict[str, Any]:
+ entry = self.entries[index]
+ image = self.image_module.open(Path(entry.image_path)).convert("RGB")
+ pixel_values = self.processor(image, return_tensors="pt").pixel_values.squeeze(0)
+ labels = self.processor.tokenizer(
+ entry.text,
+ padding=False,
+ truncation=True,
+ max_length=self.max_target_length,
+ return_tensors="pt",
+ ).input_ids.squeeze(0)
+ return {"pixel_values": pixel_values, "labels": labels}
+
+
+class _VisionTextCollator:
+ def __init__(self, processor: Any, torch: Any) -> None:
+ self.processor = processor
+ self.torch = torch
+
+ def __call__(self, features: list[dict[str, Any]]) -> dict[str, Any]:
+ pixel_values = self.torch.stack([feature["pixel_values"] for feature in features])
+ label_features = [{"input_ids": feature["labels"]} for feature in features]
+ labels = self.processor.tokenizer.pad(label_features, padding=True, return_tensors="pt").input_ids
+ labels = labels.masked_fill(labels == self.processor.tokenizer.pad_token_id, -100)
+ return {"pixel_values": pixel_values, "labels": labels}
+
+
+class _TextCorrectionDataset:
+ def __init__(self, pairs: list[dict[str, str]], tokenizer: Any, max_source_length: int, max_target_length: int) -> None:
+ self.pairs = pairs
+ self.tokenizer = tokenizer
+ self.max_source_length = max_source_length
+ self.max_target_length = max_target_length
+
+ def __len__(self) -> int:
+ return len(self.pairs)
+
+ def __getitem__(self, index: int) -> dict[str, Any]:
+ pair = self.pairs[index]
+ model_inputs = self.tokenizer(
+ pair["noisy_text"],
+ padding=False,
+ truncation=True,
+ max_length=self.max_source_length,
+ )
+ labels = self.tokenizer(
+ text_target=pair["clean_text"],
+ padding=False,
+ truncation=True,
+ max_length=self.max_target_length,
+ )
+ model_inputs["labels"] = labels["input_ids"]
+ return model_inputs
+
+
+def _hf_compute_metrics_factory(processor: Any):
+ def compute_metrics(eval_pred: Any) -> dict[str, float]:
+ prediction_ids = eval_pred.predictions
+ label_ids = eval_pred.label_ids
+ if isinstance(prediction_ids, tuple):
+ prediction_ids = prediction_ids[0]
+ predicted_text = processor.batch_decode(
+ _sanitize_batch_token_ids(processor.tokenizer, prediction_ids),
+ skip_special_tokens=True,
+ )
+ reference_text = processor.batch_decode(
+ _sanitize_batch_token_ids(processor.tokenizer, label_ids),
+ skip_special_tokens=True,
+ )
+ return {
+ "cer": sum(cer(pred, ref) for pred, ref in zip(predicted_text, reference_text, strict=True)) / len(reference_text),
+ "wer": sum(wer(pred, ref) for pred, ref in zip(predicted_text, reference_text, strict=True)) / len(reference_text),
+ "exact_line_accuracy": exact_line_accuracy(predicted_text, reference_text),
+ }
+
+ return compute_metrics
+
+
+def _hf_text_corrector_metrics_factory(tokenizer: Any):
+ def compute_metrics(eval_pred: Any) -> dict[str, float]:
+ prediction_ids = eval_pred.predictions
+ label_ids = eval_pred.label_ids
+ if isinstance(prediction_ids, tuple):
+ prediction_ids = prediction_ids[0]
+ predicted_text = [
+ normalize_ocr_text(text)
+ for text in tokenizer.batch_decode(_sanitize_batch_token_ids(tokenizer, prediction_ids), skip_special_tokens=True)
+ ]
+ reference_text = [
+ normalize_ocr_text(text)
+ for text in tokenizer.batch_decode(_sanitize_batch_token_ids(tokenizer, label_ids), skip_special_tokens=True)
+ ]
+ return {
+ "cer": sum(cer(pred, ref) for pred, ref in zip(predicted_text, reference_text, strict=True)) / len(reference_text),
+ "wer": sum(wer(pred, ref) for pred, ref in zip(predicted_text, reference_text, strict=True)) / len(reference_text),
+ "exact_line_accuracy": exact_line_accuracy(predicted_text, reference_text),
+ }
+
+ return compute_metrics
+
+
+def _sanitize_batch_token_ids(tokenizer: Any, token_rows: Any) -> list[list[int]]:
+ rows = token_rows.tolist() if hasattr(token_rows, "tolist") else token_rows
+ pad_token_id = _fallback_token_id(tokenizer)
+ vocab_size = _tokenizer_vocab_size(tokenizer)
+ sanitized_rows: list[list[int]] = []
+ for row in rows:
+ values = row.tolist() if hasattr(row, "tolist") else row
+ sanitized_rows.append([_sanitize_token_id(token, pad_token_id=pad_token_id, vocab_size=vocab_size) for token in values])
+ return sanitized_rows
+
+
+def _sanitize_token_id(token: Any, *, pad_token_id: int, vocab_size: int | None) -> int:
+ try:
+ value = int(token)
+ except (TypeError, ValueError, OverflowError):
+ return pad_token_id
+ if value == -100:
+ return pad_token_id
+ if value < 0:
+ return pad_token_id
+ if vocab_size is not None and value >= vocab_size:
+ return pad_token_id
+ return value
+
+
+def _tokenizer_vocab_size(tokenizer: Any) -> int | None:
+ vocab_size = getattr(tokenizer, "vocab_size", None)
+ if vocab_size is not None:
+ return int(vocab_size)
+ try:
+ return len(tokenizer)
+ except TypeError:
+ return None
+
+
+def _fallback_token_id(tokenizer: Any) -> int:
+ for attribute in ("pad_token_id", "eos_token_id", "bos_token_id"):
+ value = getattr(tokenizer, attribute, None)
+ if value is not None:
+ return int(value)
+ return 0
diff --git a/src/ocrtech/validation.py b/src/ocrtech/validation.py
new file mode 100644
index 0000000000000000000000000000000000000000..1d9eda3b1572bc0a1cf7f89fd4cc1aba4f909439
--- /dev/null
+++ b/src/ocrtech/validation.py
@@ -0,0 +1,800 @@
+"""Validation gates for defensible OCR quality claims."""
+
+from __future__ import annotations
+
+import json
+import math
+import random
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+
+from .errors import ValidationError
+from .manifest import ManifestEntry, load_manifest, sha256_file, sha256_text
+
+
+LOWER_IS_BETTER = {
+ "cer",
+ "wer",
+ "text_cer",
+ "text_wer",
+ "document_reconstruction_cer",
+ "document_reconstruction_wer",
+ "figure_count_error",
+ "figure_caption_cer",
+}
+HIGHER_IS_BETTER = {
+ "quality_score",
+ "document_reconstruction_similarity",
+ "figure_detection_precision",
+ "figure_detection_recall",
+ "figure_detection_f1",
+ "reading_order_pair_accuracy",
+ "table_cell_precision",
+ "table_cell_recall",
+ "table_cell_f1",
+ "table_exact_match",
+ "table_structure_similarity",
+ "table_teds_structure",
+ "table_teds_text",
+}
+
+
+@dataclass(slots=True)
+class ClaimGate:
+ baseline: str
+ metric: str
+ direction: str
+ slice: str | None = None
+ slices: list[str] = field(default_factory=list)
+ min_absolute_margin: float = 0.0
+ min_relative_improvement: float = 0.0
+ min_pairs: int = 1
+ min_pair_win_rate: float | None = None
+ max_p_value: float | None = None
+ require_ci_above_zero: bool = True
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any]) -> "ClaimGate":
+ metric = str(data.get("metric") or "")
+ direction = str(data.get("direction") or metric_direction(metric))
+ if direction not in {"lower", "higher"}:
+ raise ValidationError(f"gate direction must be lower or higher: {direction}")
+ baseline = str(data.get("baseline") or "")
+ if not baseline:
+ raise ValidationError("gate baseline is required")
+ if not metric:
+ raise ValidationError("gate metric is required")
+ slices_payload = data.get("slices")
+ if slices_payload is None:
+ slices = [str(data["slice"])] if data.get("slice") else []
+ elif isinstance(slices_payload, list):
+ slices = [str(item) for item in slices_payload if str(item)]
+ else:
+ raise ValidationError("gate slices must be a list when provided")
+ min_pair_win_rate = _optional_rate(data.get("min_pair_win_rate"), "min_pair_win_rate")
+ return cls(
+ baseline=baseline,
+ metric=metric,
+ direction=direction,
+ slice=data.get("slice"),
+ slices=slices,
+ min_absolute_margin=float(data.get("min_absolute_margin", 0.0)),
+ min_relative_improvement=float(data.get("min_relative_improvement", 0.0)),
+ min_pairs=int(data.get("min_pairs", 1)),
+ min_pair_win_rate=min_pair_win_rate,
+ max_p_value=float(data["max_p_value"]) if data.get("max_p_value") is not None else None,
+ require_ci_above_zero=bool(data.get("require_ci_above_zero", True)),
+ )
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "baseline": self.baseline,
+ "metric": self.metric,
+ "direction": self.direction,
+ "slice": self.slice,
+ "slices": self.slices,
+ "min_absolute_margin": self.min_absolute_margin,
+ "min_relative_improvement": self.min_relative_improvement,
+ "min_pairs": self.min_pairs,
+ "min_pair_win_rate": self.min_pair_win_rate,
+ "max_p_value": self.max_p_value,
+ "require_ci_above_zero": self.require_ci_above_zero,
+ }
+
+
+@dataclass(slots=True)
+class ValidationConfig:
+ candidate: str = "ours"
+ min_samples: int = 30
+ required_slices: dict[str, int] = field(default_factory=dict)
+ gates: list[ClaimGate] = field(default_factory=list)
+ require_full_eval_manifest_coverage: bool = False
+ bootstrap_iterations: int = 1000
+ bootstrap_confidence: float = 0.95
+ random_seed: int = 13
+
+ @classmethod
+ def from_path(cls, path: str | Path | None) -> "ValidationConfig":
+ if path is None:
+ return default_validation_config()
+ try:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise ValidationError(f"Invalid validation config JSON {path}: {exc}") from exc
+ if not isinstance(payload, dict):
+ raise ValidationError("validation config must be a JSON object")
+ return cls(
+ candidate=str(payload.get("candidate", "ours")),
+ min_samples=int(payload.get("min_samples", 30)),
+ required_slices={str(key): int(value) for key, value in dict(payload.get("required_slices", {})).items()},
+ gates=[ClaimGate.from_dict(item) for item in payload.get("gates", [])],
+ require_full_eval_manifest_coverage=bool(payload.get("require_full_eval_manifest_coverage", False)),
+ bootstrap_iterations=int(payload.get("bootstrap_iterations", 1000)),
+ bootstrap_confidence=float(payload.get("bootstrap_confidence", 0.95)),
+ random_seed=int(payload.get("random_seed", 13)),
+ )
+
+
+@dataclass(slots=True)
+class LeakageReport:
+ train_manifests: list[str]
+ eval_manifest: str | None
+ overlaps: dict[str, list[str]]
+ warnings: dict[str, list[str]] = field(default_factory=dict)
+
+ @property
+ def passed(self) -> bool:
+ return not any(self.overlaps.values())
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "passed": self.passed,
+ "train_manifests": self.train_manifests,
+ "eval_manifest": self.eval_manifest,
+ "overlaps": self.overlaps,
+ "warnings": self.warnings,
+ }
+
+
+@dataclass(slots=True)
+class GateResult:
+ gate: ClaimGate
+ passed: bool
+ pairs: int
+ candidate_mean: float | None
+ baseline_mean: float | None
+ absolute_improvement: float | None
+ relative_improvement: float | None
+ improvement_ci_low: float | None
+ improvement_ci_high: float | None
+ win_count: int
+ loss_count: int
+ tie_count: int
+ win_rate: float | None
+ pair_win_rate: float | None
+ sign_test_p_value: float | None
+ reason: str | None = None
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "gate": self.gate.to_dict(),
+ "passed": self.passed,
+ "pairs": self.pairs,
+ "candidate_mean": self.candidate_mean,
+ "baseline_mean": self.baseline_mean,
+ "absolute_improvement": self.absolute_improvement,
+ "relative_improvement": self.relative_improvement,
+ "improvement_ci_low": self.improvement_ci_low,
+ "improvement_ci_high": self.improvement_ci_high,
+ "win_count": self.win_count,
+ "loss_count": self.loss_count,
+ "tie_count": self.tie_count,
+ "win_rate": self.win_rate,
+ "pair_win_rate": self.pair_win_rate,
+ "sign_test_p_value": self.sign_test_p_value,
+ "reason": self.reason,
+ }
+
+
+@dataclass(slots=True)
+class ValidationReport:
+ claim_status: str
+ passed: bool
+ sample_count: int
+ slice_counts: dict[str, int]
+ aggregate_metrics: dict[str, dict[str, dict[str, float | int]]]
+ missing_requirements: list[str]
+ leakage: LeakageReport
+ gates: list[GateResult]
+ provenance: dict[str, Any] = field(default_factory=dict)
+
+ def to_dict(self) -> dict[str, Any]:
+ return {
+ "claim_status": self.claim_status,
+ "passed": self.passed,
+ "sample_count": self.sample_count,
+ "slice_counts": self.slice_counts,
+ "aggregate_metrics": self.aggregate_metrics,
+ "missing_requirements": self.missing_requirements,
+ "leakage": self.leakage.to_dict(),
+ "gates": [gate.to_dict() for gate in self.gates],
+ "provenance": self.provenance,
+ }
+
+
+def validate_claim(
+ benchmark_report: str | Path,
+ output_dir: str | Path,
+ *,
+ config_path: str | Path | None = None,
+ eval_manifest: str | Path | None = None,
+ train_manifests: list[str | Path] | None = None,
+ candidate_model_config: str | Path | None = None,
+ fallback_model_config: str | Path | None = None,
+) -> ValidationReport:
+ config = ValidationConfig.from_path(config_path)
+ results = _load_benchmark_results(benchmark_report)
+ eval_entries = load_manifest(eval_manifest) if eval_manifest else []
+ enriched = [_enrich_result(item, eval_entries) for item in results]
+ candidate_rows = [item for item in enriched if item["baseline"] == config.candidate and item["status"] == "ok"]
+ sample_count = len({sample_key(item) for item in candidate_rows})
+ slice_counts = _slice_counts(candidate_rows)
+ leakage = check_leakage(train_manifests or [], eval_manifest)
+
+ missing: list[str] = []
+ if sample_count < config.min_samples:
+ missing.append(f"candidate sample count {sample_count} < required {config.min_samples}")
+ for slice_name, required_count in config.required_slices.items():
+ actual = slice_counts.get(slice_name, 0)
+ if actual < required_count:
+ missing.append(f"slice {slice_name!r} count {actual} < required {required_count}")
+ missing.extend(_full_eval_manifest_coverage_failures(enriched, config, eval_entries))
+ if not leakage.passed:
+ missing.append("train/eval leakage detected")
+ gate_results = [_evaluate_gate(enriched, config, gate) for gate in config.gates]
+ for gate_result in gate_results:
+ if not gate_result.passed:
+ missing.append(gate_result.reason or f"gate failed: {gate_result.gate.metric} vs {gate_result.gate.baseline}")
+
+ passed = not missing and bool(config.gates)
+ report = ValidationReport(
+ claim_status="validated" if passed else "not_validated",
+ passed=passed,
+ sample_count=sample_count,
+ slice_counts=slice_counts,
+ aggregate_metrics=_aggregate_metrics(enriched),
+ missing_requirements=missing,
+ leakage=leakage,
+ gates=gate_results,
+ provenance=_validation_provenance(
+ benchmark_report,
+ config_path,
+ eval_manifest,
+ train_manifests or [],
+ candidate_model_config,
+ fallback_model_config,
+ ),
+ )
+ _write_validation_report(report, Path(output_dir))
+ return report
+
+
+def check_leakage(train_manifests: list[str | Path], eval_manifest: str | Path | None) -> LeakageReport:
+ if eval_manifest is None or not train_manifests:
+ return LeakageReport([str(item) for item in train_manifests], str(eval_manifest) if eval_manifest else None, {})
+ eval_entries = load_manifest(eval_manifest)
+ train_entries: list[ManifestEntry] = []
+ for manifest in train_manifests:
+ train_entries.extend(load_manifest(manifest))
+ overlaps = {
+ "sample_id": sorted({entry.sample_id for entry in train_entries} & {entry.sample_id for entry in eval_entries}),
+ "image_sha256": _hash_overlap(train_entries, eval_entries, "sha256"),
+ "sample_sha256": _sample_hash_overlap(train_entries, eval_entries),
+ "text_sha256": _text_hash_overlap(train_entries, eval_entries),
+ "image_path": sorted({entry.image_path for entry in train_entries} & {entry.image_path for entry in eval_entries}),
+ }
+ warnings = {"text_sha256": overlaps.pop("text_sha256")}
+ return LeakageReport([str(item) for item in train_manifests], str(eval_manifest), overlaps, warnings)
+
+
+def _validation_provenance(
+ benchmark_report: str | Path,
+ config_path: str | Path | None,
+ eval_manifest: str | Path | None,
+ train_manifests: list[str | Path],
+ candidate_model_config: str | Path | None,
+ fallback_model_config: str | Path | None,
+) -> dict[str, Any]:
+ benchmark_path = Path(benchmark_report)
+ payload: dict[str, Any] = {
+ "benchmark_report": {
+ "path": str(benchmark_path),
+ "sha256": _sha256_if_file(benchmark_path),
+ },
+ "validation_config": None,
+ "eval_manifest": None,
+ "candidate_model_config": None,
+ "fallback_model_config": None,
+ "train_manifests": [],
+ }
+ if config_path is not None:
+ config = Path(config_path)
+ payload["validation_config"] = {"path": str(config), "sha256": _sha256_if_file(config)}
+ if eval_manifest is not None:
+ eval_path = Path(eval_manifest)
+ payload["eval_manifest"] = {"path": str(eval_path), "sha256": _sha256_if_file(eval_path)}
+ if candidate_model_config is not None:
+ candidate_path = Path(candidate_model_config)
+ payload["candidate_model_config"] = {"path": str(candidate_path), "sha256": _sha256_if_file(candidate_path)}
+ if fallback_model_config is not None:
+ fallback_path = Path(fallback_model_config)
+ payload["fallback_model_config"] = {"path": str(fallback_path), "sha256": _sha256_if_file(fallback_path)}
+ for manifest in train_manifests:
+ path = Path(manifest)
+ payload["train_manifests"].append({"path": str(path), "sha256": _sha256_if_file(path)})
+ return payload
+
+
+def _sha256_if_file(path: Path) -> str | None:
+ if not path.exists() or not path.is_file():
+ return None
+ return sha256_file(path)
+
+
+def _optional_rate(value: object, field_name: str) -> float | None:
+ if value is None:
+ return None
+ rate = float(value)
+ if rate < 0 or rate > 1:
+ raise ValidationError(f"{field_name} must be between 0 and 1")
+ return rate
+
+
+def default_validation_config() -> ValidationConfig:
+ return ValidationConfig(
+ candidate="ours",
+ min_samples=30,
+ required_slices={"nepali": 10, "english": 10, "table": 5, "reading_order": 5},
+ require_full_eval_manifest_coverage=False,
+ gates=[
+ ClaimGate(baseline="tesseract", metric="cer", direction="lower", slice="nepali", min_relative_improvement=0.05),
+ ClaimGate(baseline="stock-paddle", metric="cer", direction="lower", slice="nepali", min_relative_improvement=0.02),
+ ClaimGate(baseline="stock-paddle", metric="cer", direction="lower", slice="english", min_relative_improvement=0.0),
+ ClaimGate(baseline="glm-ocr", metric="cer", direction="lower", slice="nepali", min_relative_improvement=0.02),
+ ClaimGate(baseline="glm-ocr", metric="table_cell_f1", direction="higher", slice="table", min_absolute_margin=0.01),
+ ClaimGate(baseline="paddleocr-vl", metric="reading_order_pair_accuracy", direction="higher", slice="reading_order", min_absolute_margin=0.01),
+ ],
+ )
+
+
+def metric_direction(metric: str) -> str:
+ if metric in LOWER_IS_BETTER:
+ return "lower"
+ if metric in HIGHER_IS_BETTER:
+ return "higher"
+ raise ValidationError(f"Unknown metric direction for {metric!r}; specify direction explicitly")
+
+
+def sample_key(result: dict[str, Any]) -> str:
+ return str(result.get("sample_id") or result.get("input_path") or "")
+
+
+def _load_benchmark_results(path: str | Path) -> list[dict[str, Any]]:
+ payload = json.loads(Path(path).read_text(encoding="utf-8"))
+ if not isinstance(payload, list):
+ raise ValidationError("benchmark report must be a JSON list")
+ rows: list[dict[str, Any]] = []
+ for index, item in enumerate(payload):
+ if not isinstance(item, dict):
+ raise ValidationError(f"benchmark row {index} must be an object")
+ rows.append(dict(item))
+ return rows
+
+
+def _enrich_result(row: dict[str, Any], eval_entries: list[ManifestEntry]) -> dict[str, Any]:
+ enriched = dict(row)
+ entry = _entry_for_input(str(row.get("input_path", "")), eval_entries)
+ if entry:
+ enriched["sample_id"] = row.get("sample_id") or entry.sample_id
+ existing_slices = row.get("slices") if isinstance(row.get("slices"), list) else []
+ enriched["slices"] = sorted({*existing_slices, *_slices_for_entry(entry)})
+ else:
+ enriched.setdefault("slices", [])
+ return enriched
+
+
+def _entry_for_input(input_path: str, entries: list[ManifestEntry]) -> ManifestEntry | None:
+ if not entries:
+ return None
+ path = Path(input_path)
+ try:
+ resolved = path.resolve()
+ except OSError:
+ resolved = path
+ for entry in entries:
+ entry_path = Path(entry.image_path)
+ try:
+ resolved_entry = entry_path.resolve()
+ except OSError:
+ resolved_entry = entry_path
+ if resolved == resolved_entry or input_path == entry.image_path:
+ return entry
+ return None
+
+
+def _slices_for_entry(entry: ManifestEntry) -> list[str]:
+ values: set[str] = set()
+ metadata = entry.metadata or {}
+ for key in ("slice", "script", "document_type", "degradation", "language"):
+ value = metadata.get(key)
+ if isinstance(value, str) and value:
+ values.add(value)
+ for key in ("slices", "scripts", "tags"):
+ value = metadata.get(key)
+ if isinstance(value, list):
+ values.update(str(item) for item in value if str(item))
+ elif isinstance(value, str) and value:
+ values.add(value)
+ return sorted(values)
+
+
+def _slice_counts(rows: list[dict[str, Any]]) -> dict[str, int]:
+ counts: dict[str, int] = {}
+ seen: set[tuple[str, str]] = set()
+ for row in rows:
+ key = sample_key(row)
+ for slice_name in row.get("slices", []) or []:
+ pair = (key, str(slice_name))
+ if pair in seen:
+ continue
+ seen.add(pair)
+ counts[str(slice_name)] = counts.get(str(slice_name), 0) + 1
+ return counts
+
+
+def _full_eval_manifest_coverage_failures(
+ rows: list[dict[str, Any]],
+ config: ValidationConfig,
+ eval_entries: list[ManifestEntry],
+) -> list[str]:
+ if not config.require_full_eval_manifest_coverage:
+ return []
+ if not eval_entries:
+ return ["eval manifest is required when require_full_eval_manifest_coverage is true"]
+ eval_sample_ids = {entry.sample_id for entry in eval_entries}
+ required_baselines = {config.candidate, *(gate.baseline for gate in config.gates)}
+ failures: list[str] = []
+ for baseline in sorted(required_baselines):
+ ok_sample_ids = {
+ str(row.get("sample_id"))
+ for row in rows
+ if row.get("baseline") == baseline and row.get("status") == "ok" and str(row.get("sample_id") or "")
+ }
+ missing = sorted(eval_sample_ids - ok_sample_ids)
+ if missing:
+ preview = ", ".join(missing[:5])
+ suffix = "" if len(missing) <= 5 else f", ... (+{len(missing) - 5} more)"
+ failures.append(
+ f"baseline {baseline!r} is missing successful rows for {len(missing)} eval manifest samples: {preview}{suffix}"
+ )
+ return failures
+
+
+def _evaluate_gate(rows: list[dict[str, Any]], config: ValidationConfig, gate: ClaimGate) -> GateResult:
+ gate_slices = gate.slices or ([gate.slice] if gate.slice else [])
+ candidate = _rows_by_sample(rows, config.candidate, gate.metric, gate_slices)
+ baseline = _rows_by_sample(rows, gate.baseline, gate.metric, gate_slices)
+ shared = sorted(set(candidate) & set(baseline))
+ if not shared:
+ return GateResult(gate, False, 0, None, None, None, None, None, None, 0, 0, 0, None, None, None, f"no paired samples for {config.candidate} vs {gate.baseline} on {gate.metric}")
+ candidate_values = [candidate[key] for key in shared]
+ baseline_values = [baseline[key] for key in shared]
+ improvements = [
+ _absolute_improvement(candidate_value, baseline_value, gate.direction)
+ for candidate_value, baseline_value in zip(candidate_values, baseline_values, strict=True)
+ ]
+ candidate_mean = sum(candidate_values) / len(candidate_values)
+ baseline_mean = sum(baseline_values) / len(baseline_values)
+ absolute = _absolute_improvement(candidate_mean, baseline_mean, gate.direction)
+ relative = _relative_improvement(absolute, baseline_mean)
+ ci_low, ci_high = _bootstrap_ci(improvements, config.bootstrap_iterations, config.bootstrap_confidence, config.random_seed)
+ wins, losses, ties = _paired_outcome_counts(candidate_values, baseline_values, gate.direction)
+ non_ties = wins + losses
+ win_rate = (wins / non_ties) if non_ties else None
+ pair_win_rate = wins / len(shared)
+ sign_test_p_value = _sign_test_p_value(wins, losses)
+ reasons: list[str] = []
+ if len(shared) < gate.min_pairs:
+ reasons.append(f"paired samples {len(shared)} < required {gate.min_pairs}")
+ if absolute < gate.min_absolute_margin:
+ reasons.append(f"absolute improvement {absolute:.6f} < required {gate.min_absolute_margin:.6f}")
+ if relative < gate.min_relative_improvement:
+ reasons.append(f"relative improvement {relative:.6f} < required {gate.min_relative_improvement:.6f}")
+ if gate.min_pair_win_rate is not None and pair_win_rate < gate.min_pair_win_rate:
+ reasons.append(f"paired win rate {pair_win_rate:.6f} < required {gate.min_pair_win_rate:.6f}")
+ if gate.max_p_value is not None:
+ if sign_test_p_value is None:
+ reasons.append("sign test p-value is unavailable because all paired outcomes are ties")
+ elif sign_test_p_value > gate.max_p_value:
+ reasons.append(f"sign test p-value {sign_test_p_value:.6f} > required {gate.max_p_value:.6f}")
+ if gate.require_ci_above_zero and ci_low <= 0:
+ reasons.append(f"bootstrap CI low {ci_low:.6f} <= 0")
+ return GateResult(
+ gate=gate,
+ passed=not reasons,
+ pairs=len(shared),
+ candidate_mean=candidate_mean,
+ baseline_mean=baseline_mean,
+ absolute_improvement=absolute,
+ relative_improvement=relative,
+ improvement_ci_low=ci_low,
+ improvement_ci_high=ci_high,
+ win_count=wins,
+ loss_count=losses,
+ tie_count=ties,
+ win_rate=win_rate,
+ pair_win_rate=pair_win_rate,
+ sign_test_p_value=sign_test_p_value,
+ reason="; ".join(reasons) if reasons else None,
+ )
+
+
+def gate_has_quantitative_evidence(item: dict[str, Any]) -> bool:
+ gate = item.get("gate")
+ gate_payload = gate if isinstance(gate, dict) else {}
+ pairs = item.get("pairs")
+ if isinstance(pairs, bool) or not isinstance(pairs, int | float) or int(pairs) <= 0:
+ return False
+ pair_count = int(pairs)
+ for key in ("candidate_mean", "baseline_mean", "absolute_improvement"):
+ value = item.get(key)
+ if isinstance(value, bool) or not isinstance(value, int | float) or not math.isfinite(float(value)):
+ return False
+ counts: list[int] = []
+ for key in ("win_count", "loss_count", "tie_count"):
+ value = item.get(key)
+ if isinstance(value, bool) or not isinstance(value, int | float):
+ return False
+ count = int(value)
+ if count < 0:
+ return False
+ counts.append(count)
+ if sum(counts) != pair_count:
+ return False
+ min_pairs = gate_payload.get("min_pairs")
+ if min_pairs is not None:
+ if isinstance(min_pairs, bool) or not isinstance(min_pairs, int | float):
+ return False
+ if pair_count < int(min_pairs):
+ return False
+ min_absolute_margin = gate_payload.get("min_absolute_margin")
+ if min_absolute_margin is not None and not _numeric_threshold_passes(item.get("absolute_improvement"), min_absolute_margin):
+ return False
+ min_relative_improvement = gate_payload.get("min_relative_improvement")
+ if min_relative_improvement is not None and not _numeric_threshold_passes(item.get("relative_improvement"), min_relative_improvement):
+ return False
+ min_pair_win_rate = gate_payload.get("min_pair_win_rate")
+ if min_pair_win_rate is not None and not _numeric_threshold_passes(item.get("pair_win_rate"), min_pair_win_rate):
+ return False
+ max_p_value = gate_payload.get("max_p_value")
+ if max_p_value is not None and not _numeric_max_threshold_passes(item.get("sign_test_p_value"), max_p_value):
+ return False
+ if bool(gate_payload.get("require_ci_above_zero", True)):
+ ci_low = item.get("improvement_ci_low")
+ if isinstance(ci_low, bool) or not isinstance(ci_low, int | float) or not math.isfinite(float(ci_low)) or float(ci_low) <= 0:
+ return False
+ return True
+
+
+def _numeric_threshold_passes(value: Any, threshold: Any) -> bool:
+ if isinstance(value, bool) or isinstance(threshold, bool):
+ return False
+ if not isinstance(value, int | float) or not isinstance(threshold, int | float):
+ return False
+ if not math.isfinite(float(value)) or not math.isfinite(float(threshold)):
+ return False
+ return float(value) >= float(threshold)
+
+
+def _numeric_max_threshold_passes(value: Any, threshold: Any) -> bool:
+ if isinstance(value, bool) or isinstance(threshold, bool):
+ return False
+ if not isinstance(value, int | float) or not isinstance(threshold, int | float):
+ return False
+ if not math.isfinite(float(value)) or not math.isfinite(float(threshold)):
+ return False
+ return float(value) <= float(threshold)
+
+
+def _rows_by_sample(rows: list[dict[str, Any]], baseline: str, metric: str, slice_names: list[str] | None) -> dict[str, float]:
+ values: dict[str, float] = {}
+ required_slices = {str(item) for item in slice_names or [] if str(item)}
+ for row in rows:
+ if row.get("baseline") != baseline or row.get("status") != "ok":
+ continue
+ row_slices = {str(item) for item in row.get("slices") or []}
+ if required_slices and not required_slices.issubset(row_slices):
+ continue
+ metrics = row.get("metrics") or {}
+ if metric not in metrics:
+ continue
+ value = metrics[metric]
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ values[sample_key(row)] = float(value)
+ return values
+
+
+def _absolute_improvement(candidate_value: float, baseline_value: float, direction: str) -> float:
+ if direction == "lower":
+ return baseline_value - candidate_value
+ return candidate_value - baseline_value
+
+
+def _relative_improvement(absolute_improvement: float, baseline_mean: float) -> float:
+ denominator = abs(baseline_mean)
+ if denominator == 0:
+ return math.inf if absolute_improvement > 0 else 0.0
+ return absolute_improvement / denominator
+
+
+def _bootstrap_ci(values: list[float], iterations: int, confidence: float, seed: int) -> tuple[float, float]:
+ if not values:
+ return 0.0, 0.0
+ if len(values) == 1 or iterations <= 0:
+ mean = sum(values) / len(values)
+ return mean, mean
+ rng = random.Random(seed)
+ means: list[float] = []
+ for _ in range(iterations):
+ sample = [values[rng.randrange(len(values))] for _ in values]
+ means.append(sum(sample) / len(sample))
+ means.sort()
+ alpha = 1 - confidence
+ low_index = max(0, min(len(means) - 1, int((alpha / 2) * len(means))))
+ high_index = max(0, min(len(means) - 1, int((1 - alpha / 2) * len(means)) - 1))
+ return means[low_index], means[high_index]
+
+
+def _paired_outcome_counts(candidate_values: list[float], baseline_values: list[float], direction: str) -> tuple[int, int, int]:
+ wins = 0
+ losses = 0
+ ties = 0
+ for candidate_value, baseline_value in zip(candidate_values, baseline_values, strict=True):
+ improvement = _absolute_improvement(candidate_value, baseline_value, direction)
+ if improvement > 0:
+ wins += 1
+ elif improvement < 0:
+ losses += 1
+ else:
+ ties += 1
+ return wins, losses, ties
+
+
+def _sign_test_p_value(wins: int, losses: int) -> float | None:
+ trials = wins + losses
+ if trials == 0:
+ return None
+ numerator = sum(math.comb(trials, success_count) for success_count in range(wins, trials + 1))
+ return numerator / (2**trials)
+
+
+def _aggregate_metrics(rows: list[dict[str, Any]]) -> dict[str, dict[str, dict[str, float | int]]]:
+ grouped: dict[str, dict[str, dict[str, list[float]]]] = {}
+ for row in rows:
+ if row.get("status") != "ok":
+ continue
+ baseline = str(row.get("baseline") or "")
+ if not baseline:
+ continue
+ slices = [*({str(item) for item in row.get("slices") or []} or {"all"})]
+ slices.append("all")
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ for slice_name in slices:
+ slice_bucket = grouped.setdefault(baseline, {}).setdefault(slice_name, {})
+ for metric_name, value in metrics.items():
+ if isinstance(value, int | float) and math.isfinite(float(value)):
+ slice_bucket.setdefault(str(metric_name), []).append(float(value))
+ aggregates: dict[str, dict[str, dict[str, float | int]]] = {}
+ for baseline, slice_map in grouped.items():
+ aggregates[baseline] = {}
+ for slice_name, metric_map in slice_map.items():
+ aggregates[baseline][slice_name] = {
+ metric_name: sum(values) / len(values)
+ for metric_name, values in sorted(metric_map.items())
+ if values
+ }
+ if metric_map:
+ first_values = next(iter(metric_map.values()))
+ aggregates[baseline][slice_name]["sample_count"] = len(first_values)
+ return aggregates
+
+
+def _hash_overlap(train_entries: list[ManifestEntry], eval_entries: list[ManifestEntry], attr: str) -> list[str]:
+ train_values = {getattr(entry, attr) for entry in train_entries if getattr(entry, attr)}
+ eval_values = {getattr(entry, attr) for entry in eval_entries if getattr(entry, attr)}
+ return sorted(str(item) for item in train_values & eval_values)
+
+
+def _text_hash_overlap(train_entries: list[ManifestEntry], eval_entries: list[ManifestEntry]) -> list[str]:
+ def text_hash(entry: ManifestEntry) -> str:
+ value = entry.metadata.get("text_sha256") if entry.metadata else None
+ return str(value) if value else sha256_text(entry.text)
+
+ return sorted({text_hash(entry) for entry in train_entries} & {text_hash(entry) for entry in eval_entries})
+
+
+def _sample_hash_overlap(train_entries: list[ManifestEntry], eval_entries: list[ManifestEntry]) -> list[str]:
+ def sample_hash(entry: ManifestEntry) -> str:
+ value = entry.metadata.get("sample_sha256") if entry.metadata else None
+ if value:
+ return str(value)
+ image_hash = entry.sha256 or ""
+ return sha256_text(f"{image_hash}\n{sha256_text(entry.text)}")
+
+ return sorted({sample_hash(entry) for entry in train_entries} & {sample_hash(entry) for entry in eval_entries})
+
+
+def _write_validation_report(report: ValidationReport, output_dir: Path) -> None:
+ output_dir.mkdir(parents=True, exist_ok=True)
+ (output_dir / "validation.json").write_text(json.dumps(report.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ lines = [
+ "# OCR Claim Validation",
+ "",
+ f"Status: `{report.claim_status}`",
+ f"Samples: `{report.sample_count}`",
+ f"Leakage check: `{'pass' if report.leakage.passed else 'fail'}`",
+ "",
+ "## Missing Requirements",
+ "",
+ ]
+ if report.missing_requirements:
+ lines.extend(f"- {item}" for item in report.missing_requirements)
+ else:
+ lines.append("- none")
+ lines.extend(
+ [
+ "",
+ "## Gates",
+ "",
+ "| baseline | slice | metric | pairs | wins | losses | ties | win_rate | pair_win_rate | p_value | candidate | baseline_mean | improvement | ci_low | pass | reason |",
+ "| --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- | --- |",
+ ]
+ )
+ for gate in report.gates:
+ lines.append(
+ "| {baseline} | {slice} | {metric} | {pairs} | {wins} | {losses} | {ties} | {win_rate} | {pair_win_rate} | {p_value} | {candidate} | {baseline_mean} | {improvement} | {ci_low} | {passed} | {reason} |".format(
+ baseline=gate.gate.baseline,
+ slice=",".join(gate.gate.slices or ([gate.gate.slice] if gate.gate.slice else [])),
+ metric=gate.gate.metric,
+ pairs=gate.pairs,
+ wins=gate.win_count,
+ losses=gate.loss_count,
+ ties=gate.tie_count,
+ win_rate=f"{gate.win_rate:.4f}" if gate.win_rate is not None else "",
+ pair_win_rate=f"{gate.pair_win_rate:.4f}" if gate.pair_win_rate is not None else "",
+ p_value=f"{gate.sign_test_p_value:.6f}" if gate.sign_test_p_value is not None else "",
+ candidate=f"{gate.candidate_mean:.6f}" if gate.candidate_mean is not None else "",
+ baseline_mean=f"{gate.baseline_mean:.6f}" if gate.baseline_mean is not None else "",
+ improvement=f"{gate.absolute_improvement:.6f}" if gate.absolute_improvement is not None else "",
+ ci_low=f"{gate.improvement_ci_low:.6f}" if gate.improvement_ci_low is not None else "",
+ passed="yes" if gate.passed else "no",
+ reason=(gate.reason or "").replace("|", "\\|"),
+ )
+ )
+ lines.extend(["", "## Aggregate Metrics", ""])
+ for baseline, slice_map in sorted(report.aggregate_metrics.items()):
+ lines.append(f"### {baseline}")
+ lines.append("")
+ lines.append("| slice | sample_count | metric | mean |")
+ lines.append("| --- | ---: | --- | ---: |")
+ for slice_name, metrics in sorted(slice_map.items()):
+ sample_count = metrics.get("sample_count", "")
+ for metric_name, value in sorted(metrics.items()):
+ if metric_name == "sample_count":
+ continue
+ lines.append(f"| {slice_name} | {sample_count} | {metric_name} | {float(value):.6f} |")
+ lines.append("")
+ (output_dir / "validation.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
diff --git a/tests/test_claim_review.py b/tests/test_claim_review.py
new file mode 100644
index 0000000000000000000000000000000000000000..e1b44654c67db7b9aef39bc68925ec2afbc9e1de
--- /dev/null
+++ b/tests/test_claim_review.py
@@ -0,0 +1,1924 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.errors import ClaimReviewError
+from ocrtech.claim_review import review_claim
+from ocrtech.evalpack import create_eval_pack
+from ocrtech.experiments import run_experiment
+from ocrtech.manifest import ManifestEntry, sha256_file, write_manifest
+from ocrtech.models import write_model_card
+
+
+def test_review_claim_passes_for_internal_and_public_bundle(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), model)
+ public = _build_public_experiment(tmp_path / "public", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "required_slices": ["nepali", "english", "table"],
+ },
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ },
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal, public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ assert len(report.experiments) == 2
+ assert (tmp_path / "review" / "claim-review.json").exists()
+
+
+def test_review_claim_fails_when_required_metric_is_missing(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer", "figure_detection_f1", "not_a_real_metric"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "missing metrics: candidate:not_a_real_metric" in required_check.summary
+
+
+def test_review_claim_derives_error_counts_from_benchmark_rows(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ rows[0]["status"] = "error"
+ rows[0]["error"] = "simulated stale status summary"
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ payload["benchmark_status_counts"] = {"ok": len(rows)}
+ stale = tmp_path / "stale-status-counts-experiment.json"
+ stale.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([stale], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "benchmark has 1 error rows" in required_check.summary
+
+
+def test_review_claim_fails_when_eval_manifest_hash_is_stale(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ payload["environment"]["eval_manifest_sha256"] = "0" * 64
+ stale = tmp_path / "stale-eval-hash-experiment.json"
+ stale.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([stale], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "experiment eval_manifest sha256 does not match environment.eval_manifest_sha256" in required_check.summary
+
+
+def test_review_claim_fails_when_benchmark_sample_is_not_in_eval_manifest(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ rows[0]["sample_id"] = "not-in-eval-manifest"
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "benchmark row sample_id not in eval_manifest: not-in-eval-manifest" in required_check.summary
+
+
+def test_review_claim_fails_when_benchmark_slices_do_not_match_eval_manifest(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ rows[0]["slices"] = ["table"]
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "benchmark row slices do not match eval_manifest for sample_id: ocrbench-s1" in required_check.summary
+
+
+def test_review_claim_fails_when_required_baseline_skips_eval_sample(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ benchmark_report.write_text(json.dumps([], indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert rows
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "missing baselines: candidate" in required_check.summary
+ assert "missing baseline sample coverage: candidate:ocrbench-s1" in required_check.summary
+
+
+def test_review_claim_accepts_required_metric_slice_coverage(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["table_cell_f1"],
+ "required_metric_slices": {"table_cell_f1": ["table"]},
+ "required_slices": ["table"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "pass"
+
+
+def test_review_claim_fails_when_required_metric_is_missing_on_slice(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ for row in rows:
+ if row.get("baseline") != "candidate" or row.get("status") != "ok":
+ continue
+ metrics = row.get("metrics")
+ if not isinstance(metrics, dict):
+ continue
+ if "table" in set(row.get("slices") or []):
+ metrics.pop("table_cell_f1", None)
+ else:
+ metrics["table_cell_f1"] = 1.0
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["table_cell_f1"],
+ "required_metric_slices": {"table_cell_f1": ["table"]},
+ "required_slices": ["table"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "missing metric slice coverage: candidate:table_cell_f1@table" in required_check.summary
+
+
+def test_review_claim_accepts_required_metric_paired_coverage(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ _clone_candidate_rows_to_baseline(public, "tesseract")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate", "tesseract"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+
+
+def test_review_claim_fails_when_required_metric_has_no_candidate_baseline_pairs(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ baseline_row = dict(next(row for row in rows if row.get("baseline") == "candidate"))
+ baseline_row["baseline"] = "tesseract"
+ baseline_row["sample_id"] = "different-sample"
+ baseline_row["input_path"] = str(tmp_path / "different-input.png")
+ rows.append(baseline_row)
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate", "tesseract"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "missing paired metric coverage: candidate:tesseract:cer@all" in required_check.summary
+
+
+def test_review_claim_accepts_candidate_fallback_policy(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ _set_candidate_metric(public, "fallback_triggered", 0.0)
+ _set_candidate_metric(public, "fallback_failed", 0.0)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "require_candidate_fallback_metrics": True,
+ "max_candidate_fallback_trigger_rate": 0.5,
+ "max_candidate_fallback_failed_rate": 0.0,
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "pass"
+
+
+def test_review_claim_fails_when_required_output_artifact_is_missing(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ candidate_row = next(row for row in rows if row.get("baseline") == "candidate")
+ document_md = benchmark_report.parent / "candidate" / Path(candidate_row["input_path"]).stem / "document.md"
+ document_md.unlink()
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "required_output_artifacts": ["document_json", "document_md"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "missing output artifacts: candidate:ocrbench-s1:document_md" in required_check.summary
+
+
+def test_review_claim_fails_when_required_output_artifact_is_invalid_json(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ candidate_row = next(row for row in rows if row.get("baseline") == "candidate")
+ document_json = benchmark_report.parent / "candidate" / Path(candidate_row["input_path"]).stem / "document.json"
+ document_json.write_text("{not-json", encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "required_output_artifacts": ["document_json"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "candidate:ocrbench-s1:document_json (invalid json:" in required_check.summary
+
+
+def test_review_claim_fails_when_candidate_fallback_metrics_are_missing(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "require_candidate_fallback_metrics": True,
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "missing candidate fallback_triggered metrics" in required_check.summary
+ assert "missing candidate fallback_failed metrics" in required_check.summary
+
+
+def test_review_claim_fails_when_candidate_fallback_trigger_rate_is_too_high(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ _set_candidate_metric(public, "fallback_triggered", 1.0)
+ _set_candidate_metric(public, "fallback_failed", 0.0)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "require_candidate_fallback_metrics": True,
+ "max_candidate_fallback_trigger_rate": 0.5,
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:ocrbench-v2")
+ assert required_check.status == "fail"
+ assert "candidate fallback trigger rate 1.000000 exceeds max 0.500000" in required_check.summary
+
+
+def test_review_claim_audits_recorded_fallback_model_config(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "pass"
+ assert any("audited model_id=ocrtech-fallback" in detail for detail in fallback_check.details)
+
+
+def test_review_claim_can_require_fallback_model_config_presence(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_fallback_model_present": True,
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "fail"
+ assert "missing required fallback_model_config provenance" in fallback_check.summary
+ assert fallback_check.details == ["experiment"]
+
+
+def test_review_claim_requires_candidate_fallback_model_card_provenance(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_fallback_model_present": True,
+ "require_candidate_fallback_provenance": True,
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "fail"
+ assert "missing provenance.fallback_model_card" in provenance_check.summary
+
+
+def test_review_claim_accepts_candidate_fallback_model_card_provenance(tmp_path: Path) -> None:
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ model = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=fallback,
+ )
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_fallback_model_present": True,
+ "require_candidate_fallback_provenance": True,
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "pass"
+ assert "matches reviewed experiment fallback configs" in provenance_check.summary
+
+
+def test_review_claim_rejects_candidate_fallback_model_card_mismatch(tmp_path: Path) -> None:
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ other_fallback = write_model_card(tmp_path / "other-fallback.json", model_id="ocrtech-other-fallback", backend="sidecar", base_model="fixture")
+ model = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=other_fallback,
+ )
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_fallback_model_present": True,
+ "require_candidate_fallback_provenance": True,
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "fail"
+ assert "does not match experiment fallback_model_config" in provenance_check.summary
+
+
+def test_review_claim_fails_when_fallback_model_hash_is_missing(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ payload["environment"]["fallback_model_config_sha256"] = None
+ public.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "fail"
+ assert "fallback model config path is recorded but sha256 is missing" in fallback_check.summary
+
+
+def test_review_claim_fails_when_fallback_model_card_audit_fails(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-bad-fallback", backend="paddleocr", base_model="fixture")
+ public = _rewrite_fallback_model_path(_build_public_experiment(tmp_path / "public", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "ocrbench-v2",
+ "datasets": ["ocrbench-v2"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([public], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "fail"
+ assert "fallback model card failed audit" in fallback_check.summary
+ assert any("paddleocr candidate requires at least one recorded artifact" in detail for detail in fallback_check.details)
+
+
+def test_review_claim_verifies_validation_report_status_matches_experiment(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["claim_status"] = "not_validated"
+ validation_payload["passed"] = False
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report claim_status not_validated != required validated" in required_check.summary
+
+
+def test_review_claim_verifies_validation_report_benchmark_provenance(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["provenance"]["benchmark_report"]["sha256"] = "0" * 64
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report benchmark_report sha256 does not match experiment benchmark_report" in required_check.summary
+
+
+def test_review_claim_verifies_validation_report_config_provenance(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["provenance"]["validation_config"]["sha256"] = "0" * 64
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report validation_config sha256 does not match experiment validation_config" in required_check.summary
+
+
+def test_review_claim_fails_when_experiment_used_wrong_validation_config(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ required_config = tmp_path / "required-validation.json"
+ required_config.write_text(
+ json.dumps(
+ {
+ "candidate": "candidate",
+ "min_samples": 99,
+ "required_slices": {"nepali": 99},
+ "gates": [],
+ }
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "required_validation_config": str(required_config),
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "experiment validation_config sha256 does not match required config" in required_check.summary
+
+
+def test_review_claim_verifies_validation_report_train_manifest_provenance(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["provenance"]["train_manifests"] = [{"path": "data/train.jsonl", "sha256": "0" * 64}]
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report train_manifests provenance does not match experiment train_manifests" in required_check.summary
+
+
+def test_review_claim_verifies_validation_report_candidate_model_provenance(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["provenance"]["candidate_model_config"]["sha256"] = "0" * 64
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report candidate_model_config sha256 does not match experiment candidate_model_config" in required_check.summary
+
+
+def test_review_claim_requires_validation_report_fallback_model_provenance_when_experiment_has_fallback(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ internal = _rewrite_fallback_model_path(_build_internal_experiment(tmp_path / "internal", model), fallback)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "validation_report missing provenance.fallback_model_config" in required_check.summary
+
+
+def test_review_claim_accepts_required_passing_validation_gate(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer", "quality_score"],
+ "required_validation_gates": [
+ {"baseline": "candidate", "metric": "quality_score"}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "pass"
+
+
+def test_review_claim_fails_when_required_passing_validation_gate_is_missing(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate", "tesseract"],
+ "required_metrics": ["cer"],
+ "required_validation_gates": [
+ {"baseline": "tesseract", "metric": "cer", "slices": ["nepali"]}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "missing passing validation gate: tesseract:cer@nepali" in required_check.summary
+
+
+def test_review_claim_rejects_passing_validation_gate_without_quantitative_evidence(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["gates"] = [
+ {
+ "passed": True,
+ "gate": {"baseline": "candidate", "metric": "quality_score"},
+ }
+ ]
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["quality_score"],
+ "required_validation_gates": [
+ {"baseline": "candidate", "metric": "quality_score"}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "missing passing validation gate: candidate:quality_score" in required_check.summary
+
+
+def test_review_claim_rejects_passing_validation_gate_below_own_min_pairs(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ validation_report = Path(payload["validation_report"])
+ validation_payload = json.loads(validation_report.read_text(encoding="utf-8"))
+ validation_payload["gates"] = [
+ {
+ "passed": True,
+ "pairs": 1,
+ "candidate_mean": 1.0,
+ "baseline_mean": 0.0,
+ "absolute_improvement": 1.0,
+ "relative_improvement": 1.0,
+ "improvement_ci_low": 0.1,
+ "win_count": 1,
+ "loss_count": 0,
+ "tie_count": 0,
+ "pair_win_rate": 1.0,
+ "sign_test_p_value": 0.0,
+ "gate": {
+ "baseline": "candidate",
+ "metric": "quality_score",
+ "min_pairs": 2,
+ "require_ci_above_zero": True,
+ },
+ }
+ ]
+ validation_report.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["quality_score"],
+ "required_validation_gates": [
+ {"baseline": "candidate", "metric": "quality_score"}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ required_check = next(check for check in report.checks if check.name == "required:internal-pack")
+ assert required_check.status == "fail"
+ assert "missing passing validation gate: candidate:quality_score" in required_check.summary
+
+
+def test_review_claim_config_rejects_validation_gate_without_validation_status(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["quality_score"],
+ "required_validation_gates": [{"baseline": "candidate", "metric": "quality_score"}],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ with pytest.raises(ClaimReviewError, match="required_validation_gates without require_validation_status"):
+ review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+
+def test_review_claim_config_rejects_validation_gate_outside_required_baselines(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "required_validation_gates": [{"baseline": "tesseract", "metric": "cer"}],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ with pytest.raises(ClaimReviewError, match="validation gate baselines not listed"):
+ review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+
+def test_review_claim_config_rejects_validation_gate_outside_required_metrics(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ "required_validation_gates": [{"baseline": "candidate", "metric": "quality_score"}],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ with pytest.raises(ClaimReviewError, match="validation gate metrics not listed"):
+ review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+
+def test_review_claim_requires_trained_recognizer_when_configured(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ seed_model = write_model_card(tmp_path / "seed-trained-pass.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_trained_recognizer": True,
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ trained_check = next(check for check in report.checks if check.name == "trained-recognizer")
+ assert trained_check.status == "fail"
+ assert "lacks trained local recognizer provenance" in trained_check.summary
+
+
+def test_review_claim_accepts_trained_recognizer_provenance(tmp_path: Path) -> None:
+ train_manifest = _write_fixture_manifest(tmp_path / "train.jsonl", sample_id="train-s1")
+ eval_manifest = _write_fixture_manifest(tmp_path / "eval.jsonl", sample_id="eval-s1")
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"trained weights")
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "paddleocr"}\n', encoding="utf-8")
+ model = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-trained",
+ backend="paddleocr",
+ base_model="fixture-pretrained",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne", "text_recognition_model_dir": str(tmp_path)},
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ )
+ seed_model = write_model_card(tmp_path / "seed-trained-pass.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_trained_recognizer": True,
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ trained_check = next(check for check in report.checks if check.name == "trained-recognizer")
+ assert trained_check.status == "pass"
+
+
+def test_review_claim_accepts_nested_trained_recognizer_provenance(tmp_path: Path) -> None:
+ train_manifest = _write_fixture_manifest(tmp_path / "train.jsonl", sample_id="train-s1")
+ eval_manifest = _write_fixture_manifest(tmp_path / "eval.jsonl", sample_id="eval-s1")
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"trained weights")
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "hf_vision_encoder_decoder"}\n', encoding="utf-8")
+ trained_model = write_model_card(
+ tmp_path / "trained-model.json",
+ model_id="ocrtech-trained",
+ backend="hf_vision_encoder_decoder",
+ base_model="fixture-pretrained",
+ artifact_paths=[artifact],
+ backend_kwargs={"model_dir": str(tmp_path)},
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ )
+ composite_model = write_model_card(
+ tmp_path / "composite.json",
+ model_id="ocrtech-composite-with-trained-component",
+ backend="table_cell_refine_composite",
+ base_model="trained+tesseract",
+ backend_kwargs={"structure_engine": "surya", "crop_engine": "tesseract"},
+ provenance={
+ "trained_recognizer_model_card": {
+ "path": str(trained_model),
+ "sha256": sha256_file(trained_model),
+ }
+ },
+ )
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), composite_model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_trained_recognizer": True,
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=composite_model)
+
+ assert report.passed
+ trained_check = next(check for check in report.checks if check.name == "trained-recognizer")
+ assert trained_check.status == "pass"
+
+
+def test_review_claim_requires_model_admission_when_configured(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_model_admission": True,
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert not report.passed
+ admission_check = next(check for check in report.checks if check.name == "model-admission")
+ assert admission_check.status == "fail"
+ assert "not passed admission validation" in admission_check.summary
+
+
+def test_review_claim_accepts_model_admission_when_configured(tmp_path: Path) -> None:
+ validation = tmp_path / "validation.json"
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ model_path = tmp_path / "model.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(model_path)}},
+ "gates": [_passing_admission_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ model = write_model_card(
+ model_path,
+ model_id="ocrtech-admitted",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ admission_validation_report=validation,
+ )
+ seed_model = write_model_card(tmp_path / "seed-admission-pass.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _rewrite_candidate_model_path(_build_internal_experiment(tmp_path / "internal", seed_model), model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "require_model_admission": True,
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([internal], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ admission_check = next(check for check in report.checks if check.name == "model-admission")
+ assert admission_check.status == "pass"
+
+
+def test_review_claim_eval_manifest_patterns_use_wildcards(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ public = _build_public_experiment(tmp_path / "public", model)
+ payload = json.loads(public.read_text(encoding="utf-8"))
+ manifest = Path(payload["eval_manifest"])
+ real5_manifest = manifest.with_name("PaddlePaddle-Real5-OmniDocBench-eval.jsonl")
+ real5_manifest.write_text(manifest.read_text(encoding="utf-8"), encoding="utf-8")
+ payload["eval_manifest"] = str(real5_manifest)
+ rewritten = tmp_path / "public-real5-experiment.json"
+ rewritten.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "real5-slot",
+ "eval_manifest_patterns": ["*Real5-OmniDocBench*"],
+ "require_baselines": ["candidate"],
+ "required_metrics": ["cer"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([rewritten], tmp_path / "review", config_path=config, model_config=model)
+
+ assert report.passed
+ required_check = next(check for check in report.checks if check.name == "required:real5-slot")
+ assert required_check.status == "pass"
+
+
+def test_review_claim_rejects_stale_benchmark_report_path(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ payload["benchmark_report"] = str(tmp_path / "missing" / "report.json")
+ stale = tmp_path / "stale-experiment.json"
+ stale.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+
+ with pytest.raises(ClaimReviewError, match="benchmark_report .* does not exist"):
+ review_claim([stale], tmp_path / "review", model_config=model)
+
+
+def test_review_claim_fails_on_inconsistent_candidate_model(tmp_path: Path) -> None:
+ first_model = write_model_card(tmp_path / "model-a.json", model_id="ocrtech-sidecar-a", backend="sidecar", base_model="fixture")
+ second_model = write_model_card(tmp_path / "model-b.json", model_id="ocrtech-sidecar-b", backend="sidecar", base_model="fixture", notes="different")
+ first = _build_internal_experiment(tmp_path / "internal-a", first_model)
+ second = _build_public_experiment(tmp_path / "public-b", second_model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {"name": "internal-pack", "datasets": ["ocrtech-eval-pack"], "require_validation_status": "validated", "require_baselines": ["candidate"]},
+ {"name": "ocrbench-v2", "datasets": ["ocrbench-v2"], "require_baselines": ["candidate"]},
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([first, second], tmp_path / "review", config_path=config)
+
+ assert not report.passed
+ model_check = next(check for check in report.checks if check.name == "candidate-model")
+ assert model_check.status == "fail"
+ assert "do not share one model config" in model_check.summary
+
+
+def test_review_claim_fails_when_candidate_model_hash_is_stale_without_explicit_model(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", model)
+ payload = json.loads(internal.read_text(encoding="utf-8"))
+ payload["environment"]["candidate_model_config_sha256"] = "0" * 64
+ stale = tmp_path / "stale-candidate-hash-experiment.json"
+ stale.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = review_claim([stale], tmp_path / "review", config_path=config)
+
+ assert not report.passed
+ model_check = next(check for check in report.checks if check.name == "candidate-model")
+ assert model_check.status == "fail"
+ assert "candidate model config sha256 does not match experiment evidence" in model_check.summary
+
+
+def test_review_claim_fails_when_quality_router_calibration_matches_reviewed_eval(tmp_path: Path) -> None:
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", seed_model)
+ internal_payload = json.loads(internal.read_text(encoding="utf-8"))
+ internal_eval_manifest = Path(internal_payload["eval_manifest"])
+ routed_model = write_model_card(
+ tmp_path / "quality-router.json",
+ model_id="ocrtech-quality-router",
+ backend="quality_select_composite",
+ base_model="tesseract-ocr",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "tesseract", "secondary_quality_margin": 0.02},
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": str(internal_eval_manifest),
+ "sha256": sha256_file(internal_eval_manifest),
+ },
+ "metric": "cer",
+ "selected_threshold": 0.02,
+ }
+ },
+ )
+ public = _build_public_experiment(tmp_path / "public", seed_model)
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {"name": "internal-pack", "datasets": ["ocrtech-eval-pack"], "require_validation_status": "validated", "require_baselines": ["candidate"]},
+ {"name": "ocrbench-v2", "datasets": ["ocrbench-v2"], "require_baselines": ["candidate"]},
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+ internal_for_review = _rewrite_candidate_model_path(internal, routed_model)
+ public_for_review = _rewrite_candidate_model_path(public, routed_model)
+
+ report = review_claim([internal_for_review, public_for_review], tmp_path / "review", config_path=config, model_config=routed_model)
+
+ assert not report.passed
+ calibration_check = next(check for check in report.checks if check.name == "candidate-calibration")
+ assert calibration_check.status == "fail"
+ assert "matches a reviewed experiment eval manifest" in calibration_check.summary
+
+
+def test_review_claim_fails_when_script_router_collapses_to_secondary_engine(tmp_path: Path) -> None:
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", seed_model)
+ public = _build_public_experiment(tmp_path / "public", seed_model)
+ calibration = tmp_path / "calibration.json"
+ calibration.write_text(
+ json.dumps(
+ {
+ "eval_manifest": "different.jsonl",
+ "metric": "cer",
+ "selected_threshold": 0.0,
+ "selected_trial": {
+ "threshold": 0.0,
+ "pairs": 5,
+ "secondary_picks": 5,
+ "chosen_mean": 0.1,
+ "primary_mean": 0.5,
+ "absolute_improvement": 0.4,
+ "relative_improvement": 0.8,
+ },
+ }
+ ),
+ encoding="utf-8",
+ )
+ routed_model = write_model_card(
+ tmp_path / "script-router.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "surya", "primary_script_threshold": 0.0},
+ metrics_report=calibration,
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": "different-eval.jsonl",
+ "sha256": "1234567890abcdef",
+ },
+ "metric": "cer",
+ "selected_threshold": 0.0,
+ }
+ },
+ )
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {"name": "internal-pack", "datasets": ["ocrtech-eval-pack"], "require_validation_status": "validated", "require_baselines": ["candidate"]},
+ {"name": "ocrbench-v2", "datasets": ["ocrbench-v2"], "require_baselines": ["candidate"]},
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+ internal_for_review = _rewrite_candidate_model_path(internal, routed_model)
+ public_for_review = _rewrite_candidate_model_path(public, routed_model)
+
+ report = review_claim([internal_for_review, public_for_review], tmp_path / "review", config_path=config, model_config=routed_model)
+
+ assert not report.passed
+ calibration_check = next(check for check in report.checks if check.name == "candidate-calibration")
+ assert calibration_check.status == "fail"
+ assert "collapses to the secondary engine" in calibration_check.summary
+
+
+def test_review_claim_fails_when_routed_candidate_is_identical_to_component_baseline_on_holdout(tmp_path: Path) -> None:
+ seed_model = write_model_card(tmp_path / "seed.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ internal = _build_internal_experiment(tmp_path / "internal", seed_model)
+ _clone_candidate_rows_to_baseline(internal, "surya")
+ public = _build_public_experiment(tmp_path / "public", seed_model)
+ calibration = tmp_path / "calibration.json"
+ calibration.write_text(
+ json.dumps(
+ {
+ "eval_manifest": "separate-dev.jsonl",
+ "metric": "cer",
+ "selected_threshold": 0.4,
+ "selected_trial": {
+ "threshold": 0.4,
+ "pairs": 5,
+ "secondary_picks": 3,
+ "chosen_mean": 0.1,
+ "primary_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ },
+ }
+ ),
+ encoding="utf-8",
+ )
+ routed_model = write_model_card(
+ tmp_path / "script-router.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "surya", "primary_script_threshold": 0.4},
+ metrics_report=calibration,
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": "separate-dev.jsonl",
+ "sha256": "abcdef1234567890",
+ },
+ "metric": "cer",
+ "selected_threshold": 0.4,
+ }
+ },
+ )
+ config = tmp_path / "claim-review.json"
+ config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {"name": "internal-pack", "datasets": ["ocrtech-eval-pack"], "require_validation_status": "validated", "require_baselines": ["candidate", "surya"]},
+ {"name": "ocrbench-v2", "datasets": ["ocrbench-v2"], "require_baselines": ["candidate"]},
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+ internal_for_review = _rewrite_candidate_model_path(internal, routed_model)
+ public_for_review = _rewrite_candidate_model_path(public, routed_model)
+
+ report = review_claim([internal_for_review, public_for_review], tmp_path / "review", config_path=config, model_config=routed_model)
+
+ assert not report.passed
+ distinctness_check = next(check for check in report.checks if check.name == "candidate-distinctness")
+ assert distinctness_check.status == "fail"
+ assert "indistinguishable from component baseline surya" in distinctness_check.summary
+
+
+def _write_fixture_manifest(path: Path, *, sample_id: str) -> Path:
+ source = path.with_suffix(".txt")
+ source.write_text("नेपाल सरकार\n", encoding="utf-8")
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset="fixture",
+ split="train" if "train" in path.stem else "eval",
+ image_path=str(source),
+ text="नेपाल सरकार",
+ sha256=sha256_file(source),
+ )
+ ],
+ path,
+ )
+ return path
+
+
+def _build_internal_experiment(root: Path, model: Path) -> Path:
+ pack = create_eval_pack(root / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ config = root / "validation.json"
+ config.parent.mkdir(parents=True, exist_ok=True)
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "candidate",
+ "min_samples": 5,
+ "required_slices": {"nepali": 1, "english": 1, "multi_page": 1},
+ "gates": [
+ {
+ "baseline": "candidate",
+ "metric": "quality_score",
+ "direction": "higher",
+ "min_absolute_margin": 0.0,
+ "require_ci_above_zero": False,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ report = run_experiment(
+ pack.manifest_path,
+ root / "experiment",
+ baselines=["candidate"],
+ references_dir=root / "pack" / "references",
+ validation_config=config,
+ candidate_model_config=model,
+ )
+ return Path(report.output_dir) / "experiment.json"
+
+
+def _build_public_experiment(root: Path, model: Path) -> Path:
+ inputs = root / "pack" / "inputs"
+ refs = root / "pack" / "references"
+ manifests = root / "pack" / "manifests"
+ inputs.mkdir(parents=True)
+ refs.mkdir()
+ manifests.mkdir()
+ source = inputs / "ocrbench-sample.txt"
+ source.write_text("Invoice Number 42\nनेपाल सरकार\n", encoding="utf-8")
+ refs.joinpath("ocrbench-sample.ref.txt").write_text("Invoice Number 42\nनेपाल सरकार\n", encoding="utf-8")
+ manifest = manifests / "ocrbench-v2-eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="ocrbench-s1",
+ dataset="ocrbench-v2",
+ split="eval",
+ image_path=str(source),
+ text="Invoice Number 42\nनेपाल सरकार",
+ metadata={"slices": ["english", "nepali", "mixed_script"], "reference_path": str(refs / "ocrbench-sample.ref.txt")},
+ )
+ ],
+ manifest,
+ )
+ report = run_experiment(
+ manifest,
+ root / "experiment",
+ baselines=["candidate"],
+ references_dir=refs,
+ candidate_model_config=model,
+ run_validation=False,
+ )
+ return Path(report.output_dir) / "experiment.json"
+
+
+def _rewrite_candidate_model_path(experiment_path: Path, model: Path) -> Path:
+ payload = json.loads(experiment_path.read_text(encoding="utf-8"))
+ payload.setdefault("environment", {})
+ payload["environment"]["candidate_model_config"] = str(model)
+ payload["environment"]["candidate_model_config_sha256"] = sha256_file(model)
+ validation_report = payload.get("validation_report")
+ if validation_report:
+ validation_path = Path(validation_report)
+ if validation_path.exists():
+ validation_payload = json.loads(validation_path.read_text(encoding="utf-8"))
+ validation_payload.setdefault("provenance", {})["candidate_model_config"] = {
+ "path": str(model),
+ "sha256": sha256_file(model),
+ }
+ validation_path.write_text(json.dumps(validation_payload, indent=2), encoding="utf-8")
+ rewritten = experiment_path.parent / "experiment-rewritten.json"
+ rewritten.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ return rewritten
+
+
+def _rewrite_fallback_model_path(experiment_path: Path, model: Path) -> Path:
+ payload = json.loads(experiment_path.read_text(encoding="utf-8"))
+ payload.setdefault("environment", {})
+ payload["environment"]["fallback_model_config"] = str(model)
+ payload["environment"]["fallback_model_config_sha256"] = sha256_file(model)
+ rewritten = experiment_path.parent / "experiment-fallback-rewritten.json"
+ rewritten.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ return rewritten
+
+
+def _clone_candidate_rows_to_baseline(experiment_path: Path, baseline_name: str) -> None:
+ payload = json.loads(experiment_path.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ cloned_rows = []
+ for row in rows:
+ if row.get("baseline") != "candidate":
+ continue
+ clone = dict(row)
+ clone["baseline"] = baseline_name
+ cloned_rows.append(clone)
+ benchmark_report.write_text(json.dumps([*rows, *cloned_rows], indent=2), encoding="utf-8")
+
+
+def _set_candidate_metric(experiment_path: Path, metric: str, value: float) -> None:
+ payload = json.loads(experiment_path.read_text(encoding="utf-8"))
+ benchmark_report = Path(payload["benchmark_report"])
+ rows = json.loads(benchmark_report.read_text(encoding="utf-8"))
+ for row in rows:
+ if row.get("baseline") != "candidate" or row.get("status") != "ok":
+ continue
+ row.setdefault("metrics", {})[metric] = value
+ benchmark_report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+
+
+def _passing_admission_validation_gate() -> dict[str, object]:
+ return {
+ "passed": True,
+ "pairs": 2,
+ "candidate_mean": 0.1,
+ "baseline_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ "improvement_ci_low": 0.01,
+ "win_count": 2,
+ "loss_count": 0,
+ "tie_count": 0,
+ "pair_win_rate": 1.0,
+ "sign_test_p_value": 0.0,
+ "gate": {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "min_pairs": 2,
+ "min_pair_win_rate": 0.5,
+ "require_ci_above_zero": True,
+ },
+ }
diff --git a/tests/test_claim_review_sota_config.py b/tests/test_claim_review_sota_config.py
new file mode 100644
index 0000000000000000000000000000000000000000..d21e71c70f6774cfc5ae9b4c79af53c592c87a59
--- /dev/null
+++ b/tests/test_claim_review_sota_config.py
@@ -0,0 +1,110 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+
+_VALIDATION_CONFIG_BY_EXPERIMENT = {
+ "internal-nepali-english-document-pack": Path("configs/validation-internal-sota-v1.json"),
+ "public-omnidocbench": Path("configs/validation-public-omnidocbench-sota-v1.json"),
+ "public-real5-omnidocbench-or-olmocr": Path("configs/validation-public-real5-sota-v1.json"),
+}
+
+
+def test_sota_claim_review_config_requires_validated_baseline_comparisons() -> None:
+ config_path = Path("configs/claim-review-sota-v1.json")
+ payload = json.loads(config_path.read_text(encoding="utf-8"))
+ assert payload["require_fallback_model_present"] is True
+ assert payload["require_candidate_fallback_provenance"] is True
+ assert payload["require_shared_fallback_model"] is True
+ assert payload["require_fallback_model_audit_passed"] is True
+ experiments = payload["required_experiments"]
+
+ for experiment in experiments:
+ assert experiment["require_validation_status"] == "validated"
+ assert Path(experiment["required_validation_config"]) == _VALIDATION_CONFIG_BY_EXPERIMENT[experiment["name"]]
+ baselines = set(experiment["require_baselines"])
+ metrics = set(experiment["required_metrics"])
+ assert "candidate" in baselines
+ assert baselines - {"candidate"}
+ required_gates = experiment["required_validation_gates"]
+ assert required_gates
+ required_artifacts = set(experiment["required_output_artifacts"])
+ assert {"document_json", "document_md", "quality_json"}.issubset(required_artifacts)
+ assert {gate["baseline"] for gate in required_gates} - {"candidate"}
+ for gate in required_gates:
+ assert gate["baseline"] in baselines
+ assert gate["metric"] in metrics
+
+ internal = next(item for item in experiments if item["name"] == "internal-nepali-english-document-pack")
+ assert {"tesseract", "stock-paddle", "glm-ocr", "paddleocr-vl"}.issubset(set(internal["require_baselines"]))
+ internal_gate_baselines = {gate["baseline"] for gate in internal["required_validation_gates"]}
+ assert {"tesseract", "stock-paddle", "glm-ocr", "surya", "paddleocr-vl"}.issubset(internal_gate_baselines)
+ internal_gate_requirements = {
+ (gate["baseline"], gate["metric"], tuple(gate.get("slices", [])))
+ for gate in internal["required_validation_gates"]
+ }
+ assert ("tesseract", "wer", ("nepali",)) in internal_gate_requirements
+ assert ("stock-paddle", "wer", ("english",)) in internal_gate_requirements
+ assert ("surya", "table_cell_f1", ("table",)) in internal_gate_requirements
+ assert ("surya", "figure_detection_f1", ("figure",)) in internal_gate_requirements
+ assert ("surya", "figure_caption_cer", ("figure",)) in internal_gate_requirements
+ assert ("paddleocr-vl", "reading_order_pair_accuracy", ("reading_order",)) in internal_gate_requirements
+ assert ("paddleocr-vl", "document_reconstruction_similarity", ("figure",)) in internal_gate_requirements
+ assert internal["required_output_artifact_slices"] == {
+ "table_csv_html": ["table"],
+ "figure_metadata": ["figure"],
+ "figure_images": ["figure"],
+ }
+
+ public_slots = [item for item in experiments if item["name"].startswith("public-")]
+ assert public_slots
+ for experiment in public_slots:
+ assert {"surya", "paddleocr-vl"} & set(experiment["require_baselines"])
+ public_real5 = next(item for item in experiments if item["name"] == "public-real5-omnidocbench-or-olmocr")
+ public_real5_gates = {
+ (gate["baseline"], gate["metric"], tuple(gate.get("slices", [])))
+ for gate in public_real5["required_validation_gates"]
+ }
+ assert ("surya", "wer", ("public",)) in public_real5_gates
+ assert ("glm-ocr", "wer", ("public",)) in public_real5_gates
+
+
+def test_sota_validation_configs_cover_required_review_gates() -> None:
+ claim_payload = json.loads(Path("configs/claim-review-sota-v1.json").read_text(encoding="utf-8"))
+ experiments = claim_payload["required_experiments"]
+
+ for experiment in experiments:
+ validation_config = Path(experiment["required_validation_config"])
+ validation_payload = json.loads(validation_config.read_text(encoding="utf-8"))
+ validation_gates = validation_payload["gates"]
+
+ for required in experiment["required_validation_gates"]:
+ assert any(_gate_covers_required_gate(gate, required) for gate in validation_gates), (
+ experiment["name"],
+ required,
+ validation_config,
+ )
+
+
+def test_sota_validation_improvement_gates_require_pair_win_rate() -> None:
+ claim_payload = json.loads(Path("configs/claim-review-sota-v1.json").read_text(encoding="utf-8"))
+ experiments = claim_payload["required_experiments"]
+
+ for experiment in experiments:
+ validation_config = Path(experiment["required_validation_config"])
+ validation_payload = json.loads(validation_config.read_text(encoding="utf-8"))
+ for gate in validation_payload["gates"]:
+ margin = float(gate.get("min_absolute_margin", 0.0))
+ relative = float(gate.get("min_relative_improvement", 0.0))
+ if margin <= 0 and relative <= 0:
+ continue
+ assert gate.get("min_pair_win_rate", 0.0) >= 0.55, (experiment["name"], validation_config, gate)
+
+
+def _gate_covers_required_gate(gate: dict[str, object], required: dict[str, object]) -> bool:
+ if gate.get("baseline") != required.get("baseline") or gate.get("metric") != required.get("metric"):
+ return False
+ gate_slices = {str(item) for item in gate.get("slices", [])}
+ required_slices = {str(item) for item in required.get("slices", [])}
+ return required_slices.issubset(gate_slices)
diff --git a/tests/test_cli.py b/tests/test_cli.py
new file mode 100644
index 0000000000000000000000000000000000000000..b5086a6e1505572bf4656c7e99db756b8938b285
--- /dev/null
+++ b/tests/test_cli.py
@@ -0,0 +1,1745 @@
+from __future__ import annotations
+
+import json
+import sys
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+
+from ocrtech.cli import main
+from ocrtech.experiments import run_experiment
+from ocrtech.models import write_model_card
+from ocrtech.manifest import ManifestEntry, load_manifest, sha256_file, sha256_text, write_manifest
+
+
+def test_cli_prepare_data_with_skip_invalid(tmp_path: Path, capsys) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"line")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline.png,नेपाल\nline.png,\n", encoding="utf-8")
+
+ exit_code = main(
+ [
+ "prepare-data",
+ str(labels),
+ "--out",
+ str(tmp_path / "manifests"),
+ "--dataset-name",
+ "local",
+ "--skip-invalid",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "local-train.jsonl" in captured.out
+ assert "local-train-rejects.jsonl" in captured.out
+ assert "prepared=1 rejected=1" in captured.out
+
+
+def test_cli_prepare_data_can_stamp_slices(tmp_path: Path, capsys) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"line")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline.png,नेपाल\n", encoding="utf-8")
+
+ exit_code = main(
+ [
+ "prepare-data",
+ str(labels),
+ "--out",
+ str(tmp_path / "manifests"),
+ "--dataset-name",
+ "local",
+ "--slice",
+ "nepali",
+ "--slice",
+ "real",
+ ]
+ )
+
+ entries = [json.loads(line) for line in (tmp_path / "manifests" / "local-train.jsonl").read_text(encoding="utf-8").splitlines() if line.strip()]
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert entries[0]["metadata"]["slices"] == ["nepali", "real"]
+ assert "local-train.jsonl" in captured.out
+
+
+def test_cli_parse_doc_sidecar_text(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल सरकार\n\nhello world\n", encoding="utf-8")
+
+ exit_code = main(["parse-doc", str(source), "--out", str(tmp_path / "out"), "--engine", "sidecar"])
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "document.json" in captured.out
+ assert (tmp_path / "out" / "document.md").exists()
+
+
+def test_cli_parse_doc_passes_fallback_model_config(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ captured: dict[str, object] = {}
+ source = tmp_path / "sample.png"
+ source.write_bytes(b"image")
+
+ class DocumentStub:
+ pages: list[object] = []
+ tables: list[object] = []
+ figures: list[object] = []
+
+ def fake_parse_document(*args: object, **kwargs: object) -> DocumentStub:
+ captured["args"] = args
+ captured["kwargs"] = kwargs
+ return DocumentStub()
+
+ monkeypatch.setattr("ocrtech.cli.parse_document", fake_parse_document)
+
+ exit_code = main(
+ [
+ "parse-doc",
+ str(source),
+ "--out",
+ str(tmp_path / "out"),
+ "--engine",
+ "sidecar",
+ "--fallback-model-config",
+ str(tmp_path / "fallback.json"),
+ ]
+ )
+
+ assert exit_code == 0
+ assert captured["kwargs"]["fallback_model_config"] == str(tmp_path / "fallback.json")
+
+
+def test_cli_validate_claim_returns_success_only_when_validated(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "ours",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.01},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.10},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 1,
+ "required_slices": {"nepali": 1},
+ "gates": [{"baseline": "tesseract", "metric": "cer", "direction": "lower", "slice": "nepali"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(["validate-claim", "--benchmark-report", str(report), "--config", str(config), "--out", str(tmp_path / "validation")])
+
+ assert exit_code == 0
+ assert (tmp_path / "validation" / "validation.json").exists()
+
+
+def test_cli_recognizer_admission_decision_exit_codes(tmp_path: Path) -> None:
+ admitted = tmp_path / "admitted.json"
+ admitted.write_text('{"claim_status":"validated","passed":true,"sample_count":3}\n', encoding="utf-8")
+ rejected = tmp_path / "rejected.json"
+ rejected.write_text('{"claim_status":"not_validated","passed":false,"sample_count":3}\n', encoding="utf-8")
+
+ admitted_exit = main(
+ [
+ "recognizer-admission-decision",
+ "--validation-report",
+ str(admitted),
+ "--out",
+ str(tmp_path / "admitted-decision"),
+ ]
+ )
+ rejected_exit = main(
+ [
+ "recognizer-admission-decision",
+ "--validation-report",
+ str(rejected),
+ "--out",
+ str(tmp_path / "rejected-decision"),
+ ]
+ )
+
+ assert admitted_exit == 0
+ assert rejected_exit == 1
+ assert (tmp_path / "admitted-decision" / "recognizer-admission-decision.json").exists()
+ assert (tmp_path / "rejected-decision" / "recognizer-admission-decision.md").exists()
+
+
+def test_cli_recognizer_failure_review_stops_family(tmp_path: Path) -> None:
+ args = ["recognizer-failure-review", "--out", str(tmp_path / "review")]
+ for index in range(3):
+ card = tmp_path / f"model-{index}.json"
+ card.write_text(
+ json.dumps(
+ {
+ "model_id": f"candidate-{index}",
+ "backend": "paddleocr",
+ "base_model": "PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "artifacts": [],
+ "backend_kwargs": {},
+ "metrics": {},
+ }
+ ),
+ encoding="utf-8",
+ )
+ decision = tmp_path / f"decision-{index}.json"
+ decision.write_text(
+ json.dumps(
+ {
+ "decision": "reject",
+ "claim_status": "not_validated",
+ "passed": False,
+ "sample_count": 50,
+ "failed_gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "slices": ["nepali"],
+ "pairs": 50,
+ "win_count": 0,
+ "loss_count": 50,
+ "tie_count": 0,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ args.extend(["--admission-decision", str(decision), "--model-card", str(card)])
+
+ exit_code = main(args)
+ review = json.loads((tmp_path / "review" / "recognizer-failure-review.json").read_text(encoding="utf-8"))
+
+ assert exit_code == 1
+ assert review["families"][0]["recommendation"] == "stop_family"
+ assert (tmp_path / "review" / "recognizer-failure-review.md").exists()
+
+
+def test_cli_create_and_audit_eval_pack(tmp_path: Path) -> None:
+ pack_dir = tmp_path / "pack"
+ create_exit = main(["create-eval-pack", "--out", str(pack_dir), "--input-format", "text"])
+ manifest = pack_dir / "manifests" / "ocrtech-eval-pack.jsonl"
+
+ assert create_exit == 0
+ assert manifest.exists()
+
+ audit_exit = main(["audit-eval-pack", str(manifest), "--out", str(tmp_path / "audit")])
+
+ assert audit_exit == 0
+ assert (tmp_path / "audit" / "eval-pack-audit.json").exists()
+
+
+def test_cli_audit_and_split_manifest(tmp_path: Path) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ entries = []
+ for index in range(6):
+ image = tmp_path / f"line-{index}.png"
+ image.write_bytes(f"image-{index}".encode("utf-8"))
+ image_hash = sha256_file(image)
+ text = "नेपाल" if index % 2 == 0 else "English"
+ text_hash = sha256_text(text)
+ entries.append(
+ ManifestEntry(
+ sample_id=f"sample-{index}",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text=text,
+ sha256=image_hash,
+ metadata={"slices": ["nepali" if index % 2 == 0 else "english"], "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ )
+ write_manifest(entries, manifest)
+
+ audit_exit = main(["audit-manifest", str(manifest), "--out", str(tmp_path / "audit"), "--require-slice", "nepali"])
+ split_exit = main(["split-manifest", str(manifest), "--out", str(tmp_path / "split"), "--eval-ratio", "0.33", "--seed", "1"])
+
+ assert audit_exit == 0
+ assert split_exit == 0
+ assert (tmp_path / "audit" / "manifest-audit.json").exists()
+ assert (tmp_path / "split" / "train.jsonl").exists()
+ assert (tmp_path / "split" / "eval.jsonl").exists()
+
+
+def test_cli_merge_manifests(tmp_path: Path) -> None:
+ first = tmp_path / "first.jsonl"
+ second = tmp_path / "second.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=2), first)
+ write_manifest(_entries(tmp_path, start=2, count=2), second)
+
+ merge_exit = main(["merge-manifests", str(first), str(second), "--out", str(tmp_path / "combined.jsonl")])
+
+ assert merge_exit == 0
+ assert (tmp_path / "combined.jsonl").exists()
+ assert (tmp_path / "combined-merge.json").exists()
+ assert (tmp_path / "combined-merge.md").exists()
+
+
+def test_cli_filter_manifest(tmp_path: Path, capsys) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=4), manifest)
+
+ exit_code = main(
+ [
+ "filter-manifest",
+ str(manifest),
+ "--out",
+ str(tmp_path / "filtered.jsonl"),
+ "--sample-id",
+ "merge-sample-0",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "selected=1 source=4" in captured.out
+ assert (tmp_path / "filtered.jsonl").exists()
+ assert (tmp_path / "filtered-filter.json").exists()
+ assert (tmp_path / "filtered-filter.md").exists()
+
+
+def test_cli_rebalance_manifest(tmp_path: Path, capsys) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=5), manifest)
+
+ exit_code = main(
+ [
+ "rebalance-manifest",
+ str(manifest),
+ "--out",
+ str(tmp_path / "rebalanced.jsonl"),
+ "--slice",
+ "english",
+ "--slice",
+ "nepali",
+ "--target-count",
+ "4",
+ "--seed",
+ "7",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "rebalanced.jsonl" in captured.out
+ assert "rebalanced-rebalance.json" in captured.out
+ assert "original=5 rebalanced=8 target=4" in captured.out
+ assert (tmp_path / "rebalanced.jsonl").exists()
+
+
+def test_cli_audit_recognizer_corpus(tmp_path: Path, capsys) -> None:
+ train = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ image_train_en = tmp_path / "train-en.png"
+ image_train_ne = tmp_path / "train-ne.png"
+ image_train_mix = tmp_path / "train-mix.png"
+ image_eval_mix = tmp_path / "eval-mix.png"
+ for path in [image_train_en, image_train_ne, image_train_mix, image_eval_mix]:
+ path.write_bytes(path.name.encode("utf-8"))
+ write_manifest(
+ [
+ ManifestEntry(sample_id="tr-en", dataset="fixture", split="train", image_path=str(image_train_en), text="Invoice", sha256=sha256_file(image_train_en), metadata={"slices": ["english", "real"]}),
+ ManifestEntry(sample_id="tr-ne", dataset="fixture", split="train", image_path=str(image_train_ne), text="नेपाल", sha256=sha256_file(image_train_ne), metadata={"slices": ["nepali", "synthetic"]}),
+ ManifestEntry(sample_id="tr-mix", dataset="fixture", split="train", image_path=str(image_train_mix), text="नाम Ram", sha256=sha256_file(image_train_mix), metadata={"slices": ["mixed_script", "real", "synthetic"]}),
+ ],
+ train,
+ )
+ write_manifest(
+ [
+ ManifestEntry(sample_id="ev-mix", dataset="fixture", split="eval", image_path=str(image_eval_mix), text="बिल No", sha256=sha256_file(image_eval_mix), metadata={"slices": ["mixed_script", "hard_eval"]}),
+ ],
+ eval_manifest,
+ )
+
+ exit_code = main(
+ [
+ "audit-recognizer-corpus",
+ "--train-manifest",
+ str(train),
+ "--eval-manifest",
+ str(eval_manifest),
+ "--out",
+ str(tmp_path / "audit"),
+ "--min-train-samples",
+ "3",
+ "--min-eval-samples",
+ "1",
+ "--min-train-english",
+ "2",
+ "--min-train-devanagari",
+ "2",
+ "--min-train-mixed",
+ "1",
+ "--min-eval-english",
+ "1",
+ "--min-eval-devanagari",
+ "1",
+ "--min-eval-mixed",
+ "1",
+ "--min-train-latin-only",
+ "1",
+ "--min-train-devanagari-only",
+ "1",
+ "--min-eval-latin-only",
+ "0",
+ "--min-eval-devanagari-only",
+ "0",
+ "--min-train-real",
+ "2",
+ "--min-train-synthetic",
+ "2",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "recognizer-corpus-audit.json" in captured.out
+ assert "passed=True train=3 eval=1" in captured.out
+ assert (tmp_path / "audit" / "recognizer-corpus-audit.md").exists()
+
+
+def test_cli_build_recognizer_corpus(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "source.jsonl"
+ images = {
+ "en": tmp_path / "en.png",
+ "ne": tmp_path / "ne.png",
+ "mix": tmp_path / "mix.png",
+ }
+ for path in images.values():
+ path.write_bytes(path.name.encode("utf-8"))
+ write_manifest(
+ [
+ ManifestEntry(sample_id="en", dataset="fixture", split="train", image_path=str(images["en"]), text="Invoice", sha256=sha256_file(images["en"]), metadata={"slices": ["english", "real"]}),
+ ManifestEntry(sample_id="ne", dataset="fixture", split="train", image_path=str(images["ne"]), text="नेपाल", sha256=sha256_file(images["ne"]), metadata={"slices": ["nepali", "real"]}),
+ ManifestEntry(sample_id="mix", dataset="fixture", split="train", image_path=str(images["mix"]), text="नाम Ram", sha256=sha256_file(images["mix"]), metadata={"slices": ["mixed_script", "synthetic"]}),
+ ],
+ source,
+ )
+
+ exit_code = main(
+ [
+ "build-recognizer-corpus",
+ str(source),
+ "--out",
+ str(tmp_path / "built.jsonl"),
+ "--target-latin-only",
+ "2",
+ "--target-devanagari-only",
+ "2",
+ "--target-mixed",
+ "2",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "source=3" in captured.out
+ assert (tmp_path / "built.jsonl").exists()
+ assert (tmp_path / "built-recognizer-corpus-build.json").exists()
+
+
+def test_cli_materialize_references(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "sample.png"
+ source.write_bytes(b"png")
+ manifest = tmp_path / "eval.jsonl"
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={"text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ manifest,
+ )
+
+ exit_code = main(
+ [
+ "materialize-references",
+ str(manifest),
+ "--out",
+ str(tmp_path / "references"),
+ "--rewritten-manifest",
+ str(tmp_path / "eval-with-refs.jsonl"),
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "reference-pack.json" in captured.out
+ assert (tmp_path / "references" / "sample-1" / "document.md").exists()
+
+
+def test_cli_normalize_manifest_images(tmp_path: Path, capsys, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "sample.img"
+ source.write_bytes(b"raw image bytes")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=sha256_file(source),
+ )
+ ],
+ manifest,
+ )
+
+ class FakeImage:
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc, tb) -> None:
+ return None
+
+ def save(self, target: Path, format: str) -> None:
+ assert format == "PNG"
+ target.write_bytes(b"converted png bytes")
+
+ monkeypatch.setitem(sys.modules, "PIL", SimpleNamespace(Image=SimpleNamespace(open=lambda path: FakeImage())))
+
+ exit_code = main(["normalize-manifest-images", str(manifest), "--out", str(tmp_path / "normalized")])
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "manifest-images-normalized.jsonl" in captured.out
+ assert "converted=1" in captured.out
+ entries = load_manifest(tmp_path / "normalized" / "manifest-images-normalized.jsonl")
+ assert Path(entries[0].image_path).suffix == ".png"
+ assert (tmp_path / "normalized" / "image-normalization.json").exists()
+
+
+def test_cli_train_recognizer_hf_backend(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ monkeypatch.setattr("ocrtech.cli.write_hf_recognizer_recipe", lambda *args, **kwargs: tmp_path / "run" / "hf_recognizer_config.json")
+
+ exit_code = main(
+ [
+ "train-recognizer",
+ "--backend",
+ "hf-vision-encoder-decoder",
+ "--train-manifest",
+ "train.jsonl",
+ "--eval-manifest",
+ "eval.jsonl",
+ "--out",
+ str(tmp_path / "run"),
+ ]
+ )
+
+ assert exit_code == 0
+
+
+def test_cli_bundle_recognizer_training_passes_corpus_audit_options(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ captured: dict[str, object] = {}
+
+ class FakeBundle:
+ archive_path = str(tmp_path / "bundle.tar.gz")
+ manifest_path = str(tmp_path / "bundle.json")
+ readme_path = str(tmp_path / "bundle.md")
+ file_count = 3
+ total_bytes = 42
+
+ def fake_bundle(*args, **kwargs):
+ captured["args"] = args
+ captured["kwargs"] = kwargs
+ return FakeBundle()
+
+ monkeypatch.setattr("ocrtech.cli.bundle_recognizer_training", fake_bundle)
+
+ exit_code = main(
+ [
+ "bundle-recognizer-training",
+ "--recipe-dir",
+ "runs/recipe",
+ "--train-manifest",
+ "data/train.jsonl",
+ "--eval-manifest",
+ "data/eval.jsonl",
+ "--out",
+ str(tmp_path / "bundle"),
+ "--require-corpus-audit",
+ "--min-train-samples",
+ "11",
+ "--min-eval-samples",
+ "7",
+ "--min-train-english",
+ "5",
+ "--min-train-latin-only",
+ "3",
+ "--failure-review",
+ str(tmp_path / "review.json"),
+ ]
+ )
+
+ assert exit_code == 0
+ kwargs = captured["kwargs"]
+ assert isinstance(kwargs, dict)
+ assert kwargs["require_corpus_audit"] is True
+ assert kwargs["min_train_samples"] == 11
+ assert kwargs["min_eval_samples"] == 7
+ assert kwargs["min_train_english"] == 5
+ assert kwargs["min_train_latin_only"] == 3
+ assert kwargs["failure_review"] == str(tmp_path / "review.json")
+
+
+def test_cli_generate_correction_pairs(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ output = tmp_path / "pairs.jsonl"
+ monkeypatch.setattr("ocrtech.cli.generate_correction_pairs", lambda *args, **kwargs: output)
+
+ exit_code = main(
+ [
+ "generate-correction-pairs",
+ "--manifest",
+ "train.jsonl",
+ "--out",
+ str(output),
+ "--engine",
+ "tesseract",
+ ]
+ )
+
+ assert exit_code == 0
+
+
+def test_cli_train_corrector_hf_backend(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ def fake_recipe(*args, **kwargs):
+ pairs = tmp_path / "corrector" / "correction_pairs.jsonl"
+ pairs.parent.mkdir(parents=True, exist_ok=True)
+ pairs.write_text('{"noisy_text":"गलत","clean_text":"सही"}\n{"noisy_text":"A","clean_text":"A"}\n', encoding="utf-8")
+ return tmp_path / "corrector" / "corrector_config.json"
+
+ monkeypatch.setattr("ocrtech.cli.write_corrector_recipe", fake_recipe)
+ monkeypatch.setattr("ocrtech.cli.write_hf_text_corrector_recipe", lambda *args, **kwargs: tmp_path / "corrector" / "hf_text_corrector_config.json")
+
+ exit_code = main(
+ [
+ "train-corrector",
+ "--pairs-source",
+ "pairs.jsonl",
+ "--out",
+ str(tmp_path / "corrector"),
+ "--backend",
+ "hf-seq2seq",
+ ]
+ )
+
+ assert exit_code == 0
+
+
+def test_cli_run_experiment_without_validation(tmp_path: Path) -> None:
+ pack_dir = tmp_path / "pack"
+ create_exit = main(["create-eval-pack", "--out", str(pack_dir), "--input-format", "text"])
+ manifest = pack_dir / "manifests" / "ocrtech-eval-pack.jsonl"
+
+ experiment_exit = main(
+ [
+ "run-experiment",
+ "--eval-manifest",
+ str(manifest),
+ "--out",
+ str(tmp_path / "experiment"),
+ "--baselines",
+ "ours",
+ "--skip-validation",
+ ]
+ )
+
+ assert create_exit == 0
+ assert experiment_exit == 0
+ assert (tmp_path / "experiment" / "experiment.json").exists()
+ assert (tmp_path / "experiment" / "benchmark" / "report.json").exists()
+
+
+def test_cli_preflight_claim_with_smoke_pack(tmp_path: Path) -> None:
+ pack_dir = tmp_path / "pack"
+ create_exit = main(["create-eval-pack", "--out", str(pack_dir), "--input-format", "text"])
+ manifest = pack_dir / "manifests" / "ocrtech-eval-pack.jsonl"
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-cli-fallback", backend="sidecar", base_model="fixture")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-cli-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=fallback,
+ )
+
+ preflight_exit = main(
+ [
+ "preflight-claim",
+ "--eval-manifest",
+ str(manifest),
+ "--references-dir",
+ str(pack_dir / "references"),
+ "--baselines",
+ "ours",
+ "--candidate-model-config",
+ str(card),
+ "--fallback-model-config",
+ str(fallback),
+ "--allow-smoke-eval-pack",
+ "--out",
+ str(tmp_path / "preflight"),
+ ]
+ )
+
+ assert create_exit == 0
+ assert preflight_exit == 0
+ assert (tmp_path / "preflight" / "preflight.json").exists()
+ payload = json.loads((tmp_path / "preflight" / "preflight.json").read_text(encoding="utf-8"))
+ fallback_check = next(check for check in payload["checks"] if check["name"] == "fallback-model")
+ assert fallback_check["status"] == "pass"
+ provenance_check = next(check for check in payload["checks"] if check["name"] == "candidate-fallback-provenance")
+ assert provenance_check["status"] == "pass"
+
+
+def test_cli_review_claim(tmp_path: Path) -> None:
+ model = write_model_card(tmp_path / "model.json", model_id="ocrtech-cli-sidecar", backend="sidecar", base_model="fixture")
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("hello world\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ manifest.write_text(
+ '{"sample_id":"s1","dataset":"ocrtech-eval-pack","split":"eval","image_path":"'
+ + str(source)
+ + '","text":"hello world","sha256":null,"metadata":{"slices":["english"],"reference_path":"'
+ + str(source.with_suffix(".ref.txt"))
+ + '"}}\n',
+ encoding="utf-8",
+ )
+ validation_config = tmp_path / "validation.json"
+ validation_config.write_text(
+ json.dumps(
+ {
+ "candidate": "candidate",
+ "min_samples": 1,
+ "required_slices": {"english": 1},
+ "gates": [{"baseline": "candidate", "metric": "quality_score", "direction": "higher", "require_ci_above_zero": False}],
+ }
+ ),
+ encoding="utf-8",
+ )
+ experiment = run_experiment(
+ manifest,
+ tmp_path / "experiment",
+ baselines=["candidate"],
+ candidate_model_config=model,
+ run_validation=True,
+ validation_config=validation_config,
+ )
+ review_config = tmp_path / "claim-review.json"
+ review_config.write_text(
+ json.dumps(
+ {
+ "required_experiments": [
+ {
+ "name": "internal-pack",
+ "datasets": ["ocrtech-eval-pack"],
+ "require_validation_status": "validated",
+ "require_baselines": ["candidate"],
+ "required_slices": ["english"],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ review_exit = main(
+ [
+ "review-claim",
+ "--experiment",
+ str(Path(experiment.output_dir) / "experiment.json"),
+ "--config",
+ str(review_config),
+ "--model-config",
+ str(model),
+ "--out",
+ str(tmp_path / "review"),
+ ]
+ )
+
+ assert review_exit == 0
+ assert (tmp_path / "review" / "claim-review.json").exists()
+
+
+def test_cli_audit_remote_host(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ captured: dict[str, object] = {}
+
+ def fake_audit_remote_host(host, out, **kwargs):
+ captured.update(kwargs)
+ return type(
+ "RemoteAuditResult",
+ (),
+ {"passed": True, "host": host},
+ )()
+
+ monkeypatch.setattr(
+ "ocrtech.cli.audit_remote_host",
+ fake_audit_remote_host,
+ )
+
+ exit_code = main(
+ [
+ "audit-remote-host",
+ "--host",
+ "100.97.238.103",
+ "--user",
+ "k2",
+ "--require-paddle-training",
+ "--out",
+ str(tmp_path / "remote"),
+ ]
+ )
+
+ assert exit_code == 0
+ assert captured["require_paddle_training"] is True
+
+
+def test_cli_bootstrap_remote_host(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ monkeypatch.setattr(
+ "ocrtech.cli.bootstrap_remote_host",
+ lambda host, out, **kwargs: type(
+ "RemoteBootstrapResult",
+ (),
+ {"passed": True, "workdir": "/Users/k2/ocr-tech", "venv_dir": "/Users/k2/ocr-tech/.venv"},
+ )(),
+ )
+
+ exit_code = main(
+ [
+ "bootstrap-remote-host",
+ "--host",
+ "100.97.238.103",
+ "--user",
+ "k2",
+ "--workdir",
+ "~/ocr-tech",
+ "--recreate-venv",
+ "--out",
+ str(tmp_path / "bootstrap"),
+ ]
+ )
+
+ assert exit_code == 0
+
+
+def test_cli_sync_remote_workspace(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ monkeypatch.setattr(
+ "ocrtech.cli.sync_remote_workspace",
+ lambda local_root, out, **kwargs: type(
+ "RemoteSyncResult",
+ (),
+ {"passed": True, "remote_workdir": "/Users/k2/ocr-tech"},
+ )(),
+ )
+
+ exit_code = main(
+ [
+ "sync-remote-workspace",
+ "--host",
+ "100.97.238.103",
+ "--user",
+ "k2",
+ "--remote-workdir",
+ "~/ocr-tech",
+ "--out",
+ str(tmp_path / "sync"),
+ ]
+ )
+
+ assert exit_code == 0
+
+
+def test_cli_package_hf_recognizer(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
+ captured: dict[str, object] = {}
+
+ def fake_package_hf_recognizer_model(*args: object, **kwargs: object) -> Path:
+ captured["args"] = args
+ captured["kwargs"] = kwargs
+ return tmp_path / "package" / "model-card.json"
+
+ monkeypatch.setattr("ocrtech.cli.package_hf_recognizer_model", fake_package_hf_recognizer_model)
+
+ exit_code = main(
+ [
+ "package-hf-recognizer",
+ "--model-dir",
+ "runs/hf/final-model",
+ "--out",
+ str(tmp_path / "package"),
+ "--model-id",
+ "ocrtech-hf",
+ "--base-model",
+ "microsoft/trocr-small-printed",
+ "--admission-validation-report",
+ "outputs/validation-next-recognizer-hard50/validation.json",
+ "--training-summary",
+ "runs/hf/recognizer-training-summary.json",
+ ]
+ )
+
+ assert exit_code == 0
+ assert captured["kwargs"]["admission_validation_report"] == "outputs/validation-next-recognizer-hard50/validation.json"
+ assert captured["kwargs"]["training_summary"] == "runs/hf/recognizer-training-summary.json"
+
+
+def _entries(tmp_path: Path, *, start: int, count: int) -> list[ManifestEntry]:
+ entries: list[ManifestEntry] = []
+ for index in range(start, start + count):
+ image = tmp_path / f"merge-line-{index}.png"
+ image.write_bytes(f"merge-image-{index}".encode("utf-8"))
+ image_hash = sha256_file(image)
+ text = "नेपाल" if index % 2 == 0 else "English"
+ text_hash = sha256_text(text)
+ entries.append(
+ ManifestEntry(
+ sample_id=f"merge-sample-{index}",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text=text,
+ sha256=image_hash,
+ metadata={"slices": ["nepali" if index % 2 == 0 else "english"], "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ )
+ return entries
+
+
+def test_cli_parse_python_version_rejects_invalid_format() -> None:
+ exit_code = main(["audit-remote-host", "--host", "100.97.238.103", "--min-python", "3"])
+
+ assert exit_code == 2
+
+
+def test_cli_create_and_audit_model_card(tmp_path: Path) -> None:
+ artifact = tmp_path / "model.pdmodel"
+ artifact.write_bytes(b"model")
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-cli",
+ "--backend",
+ "sidecar",
+ "--base-model",
+ "fixture",
+ "--artifact",
+ str(artifact),
+ ]
+ )
+ audit_exit = main(["audit-model", str(card), "--out", str(tmp_path / "audit")])
+
+ assert create_exit == 0
+ assert audit_exit == 0
+ assert (tmp_path / "audit" / "model-audit.json").exists()
+
+
+def test_cli_create_tesseract_model_card_with_backend_kwargs(tmp_path: Path) -> None:
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-tess-cli",
+ "--backend",
+ "tesseract",
+ "--base-model",
+ "tesseract-ocr",
+ "--backend-kwarg",
+ "language=nep+eng",
+ "--backend-kwarg",
+ "psm=7",
+ ]
+ )
+
+ payload = json.loads(card.read_text(encoding="utf-8"))
+
+ assert create_exit == 0
+ assert payload["backend"] == "tesseract"
+ assert payload["backend_kwargs"] == {"language": "nep+eng", "psm": 7}
+
+
+def test_cli_create_model_card_records_fallback_model_card(tmp_path: Path) -> None:
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-hybrid-cli",
+ "--backend",
+ "sidecar",
+ "--base-model",
+ "fixture",
+ "--fallback-model-card",
+ str(fallback),
+ ]
+ )
+
+ payload = json.loads(card.read_text(encoding="utf-8"))
+
+ assert create_exit == 0
+ assert payload["provenance"]["fallback_model_card"] == {
+ "path": str(fallback),
+ "sha256": sha256_file(fallback),
+ }
+
+
+def test_cli_summarize_benchmark(tmp_path: Path, capsys) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.10},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.20},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "summarize-benchmark",
+ "--benchmark-report",
+ str(report),
+ "--out",
+ str(tmp_path / "summary"),
+ "--candidate",
+ "candidate",
+ "--baseline",
+ "tesseract",
+ "--metric",
+ "cer",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "summary.json" in captured.out
+ assert (tmp_path / "summary" / "summary.json").exists()
+ assert (tmp_path / "summary" / "summary.md").exists()
+
+
+def test_cli_benchmark_loads_inputs_from_manifest(tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys) -> None:
+ image = tmp_path / "image.png"
+ image.write_bytes(b"image")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="s1",
+ dataset="eval",
+ split="eval",
+ image_path="image.png",
+ text="नेपाल",
+ sha256=sha256_file(image),
+ metadata={"reference_path": "refs/s1.json"},
+ )
+ ],
+ manifest,
+ )
+ captured_args: dict[str, object] = {}
+
+ def fake_run_benchmark(inputs, output_dir, **kwargs):
+ captured_args["inputs"] = inputs
+ captured_args["output_dir"] = output_dir
+ captured_args.update(kwargs)
+ return []
+
+ monkeypatch.setattr("ocrtech.cli.run_benchmark", fake_run_benchmark)
+
+ exit_code = main(
+ [
+ "benchmark",
+ "--inputs-from-manifest",
+ str(manifest),
+ "--out",
+ str(tmp_path / "bench"),
+ "--baselines",
+ "candidate,tesseract",
+ "--fallback-model-config",
+ str(tmp_path / "fallback.json"),
+ "--low-confidence-threshold",
+ "0.71",
+ ]
+ )
+
+ stdout = capsys.readouterr().out
+ assert exit_code == 0
+ assert captured_args["inputs"] == [str(image)]
+ assert captured_args["eval_manifest"] == str(manifest)
+ assert captured_args["baselines"] == ["candidate", "tesseract"]
+ assert captured_args["fallback_model_config"] == str(tmp_path / "fallback.json")
+ assert captured_args["low_confidence_threshold"] == 0.71
+ assert "runs=0" in stdout
+
+
+def test_cli_paper_benchmark_table(tmp_path: Path, capsys) -> None:
+ first = tmp_path / "first-summary.json"
+ second = tmp_path / "second-summary.json"
+ first.write_text(
+ json.dumps(
+ {
+ "report_path": "outputs/first/report.json",
+ "candidate": "candidate",
+ "baselines": ["tesseract"],
+ "metrics": ["cer"],
+ "aggregate_metrics": {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "table_cell_f1": 1.0, "latency_seconds": 4.2}},
+ "tesseract": {"all": {"sample_count": 5, "cer": 0.73, "table_cell_f1": 0.0, "latency_seconds": 0.2}},
+ },
+ "paired_metrics": [],
+ }
+ ),
+ encoding="utf-8",
+ )
+ second.write_text(
+ json.dumps(
+ {
+ "report_path": "outputs/second/report.json",
+ "candidate": "candidate",
+ "baselines": ["surya"],
+ "metrics": ["cer"],
+ "aggregate_metrics": {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "reading_order_pair_accuracy": 0.78, "latency_seconds": 4.2}},
+ "surya": {"all": {"sample_count": 5, "cer": 0.19, "reading_order_pair_accuracy": 0.75, "latency_seconds": 3.8}},
+ },
+ "paired_metrics": [],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "paper-benchmark-table",
+ "--summary",
+ str(first),
+ "--summary",
+ str(second),
+ "--out",
+ str(tmp_path / "paper-table"),
+ "--system",
+ "candidate",
+ "--system",
+ "surya",
+ "--system",
+ "tesseract",
+ "--label",
+ "candidate=Candidate",
+ "--source-preference",
+ "candidate=" + str(first),
+ "--metric",
+ "cer",
+ "--metric",
+ "table_cell_f1",
+ "--metric",
+ "reading_order_pair_accuracy",
+ "--metric",
+ "latency_seconds",
+ "--title",
+ "Blur Comparison",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "paper-table.json" in captured.out
+ assert (tmp_path / "paper-table" / "paper-table.json").exists()
+ assert (tmp_path / "paper-table" / "paper-table.md").exists()
+
+
+def test_cli_benchmark_oracle(tmp_path: Path, capsys) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "surya",
+ "input_path": "s1.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.10},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "s1.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.20},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "benchmark-oracle",
+ "--benchmark-report",
+ str(report),
+ "--out",
+ str(tmp_path / "oracle"),
+ "--system",
+ "surya",
+ "--system",
+ "tesseract",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "oracle-analysis.json" in captured.out
+ assert (tmp_path / "oracle" / "oracle-analysis.json").exists()
+ assert (tmp_path / "oracle" / "oracle-choices.json").exists()
+ assert (tmp_path / "oracle" / "oracle-summary" / "summary.json").exists()
+
+
+def test_cli_benchmark_error_analysis(tmp_path: Path, capsys) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "surya",
+ "input_path": "s1.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.30},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "s1.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.20},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "benchmark-error-analysis",
+ "--benchmark-report",
+ str(report),
+ "--out",
+ str(tmp_path / "analysis"),
+ "--system",
+ "surya",
+ "--baseline",
+ "tesseract",
+ "--top-n",
+ "1",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "error-analysis.json" in captured.out
+ assert (tmp_path / "analysis" / "error-analysis.json").exists()
+ assert (tmp_path / "analysis" / "top-failures.json").exists()
+
+
+def test_cli_export_failure_manifest(tmp_path: Path, capsys) -> None:
+ image = tmp_path / "sample.png"
+ image.write_bytes(b"image")
+ manifest = tmp_path / "source.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="s1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image),
+ text="नेपाल",
+ metadata={"slices": ["figure"]},
+ )
+ ],
+ manifest,
+ )
+ failures = tmp_path / "top-failures.json"
+ failures.write_text(json.dumps([{"sample_id": "s1", "cer": 0.5, "badness": 0.5, "worst_gap": None, "comparisons": {}}]), encoding="utf-8")
+
+ exit_code = main(
+ [
+ "export-failure-manifest",
+ "--source-manifest",
+ str(manifest),
+ "--top-failures",
+ str(failures),
+ "--out",
+ str(tmp_path / "failure.jsonl"),
+ "--split",
+ "hard_eval",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "selected=1" in captured.out
+ entries = load_manifest(tmp_path / "failure.jsonl")
+ assert entries[0].split == "hard_eval"
+ assert entries[0].metadata["failure_analysis"]["metric_value"] == 0.5
+
+
+def test_cli_create_quality_select_model_card(tmp_path: Path) -> None:
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-quality-router",
+ "--backend",
+ "quality_select_composite",
+ "--base-model",
+ "tesseract-ocr",
+ "--backend-kwarg",
+ "primary_engine=tesseract",
+ "--backend-kwarg",
+ "secondary_engine=tesseract",
+ "--backend-kwarg",
+ 'primary_engine_kwargs={"language":"nep+eng","psm":6}',
+ "--backend-kwarg",
+ 'secondary_engine_kwargs={"language":"nep+eng","psm":13}',
+ "--backend-kwarg",
+ "secondary_quality_margin=0.02",
+ ]
+ )
+
+ payload = json.loads(card.read_text(encoding="utf-8"))
+
+ assert create_exit == 0
+ assert payload["backend"] == "quality_select_composite"
+ assert payload["backend_kwargs"]["secondary_quality_margin"] == 0.02
+ assert payload["backend_kwargs"]["secondary_engine_kwargs"]["psm"] == 13
+
+
+def test_cli_create_script_select_model_card(tmp_path: Path) -> None:
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-script-router",
+ "--backend",
+ "script_select_composite",
+ "--base-model",
+ "tesseract+surya",
+ "--backend-kwarg",
+ "primary_engine=tesseract",
+ "--backend-kwarg",
+ "secondary_engine=surya",
+ "--backend-kwarg",
+ "primary_script_threshold=0.2",
+ ]
+ )
+
+ payload = json.loads(card.read_text(encoding="utf-8"))
+
+ assert create_exit == 0
+ assert payload["backend"] == "script_select_composite"
+ assert payload["backend_kwargs"]["primary_script_threshold"] == 0.2
+
+
+def test_cli_create_line_align_model_card(tmp_path: Path) -> None:
+ card = tmp_path / "model.json"
+
+ create_exit = main(
+ [
+ "create-model-card",
+ "--out",
+ str(card),
+ "--model-id",
+ "ocrtech-line-align",
+ "--backend",
+ "line_align_composite",
+ "--base-model",
+ "surya+tesseract",
+ "--backend-kwarg",
+ "primary_engine=surya",
+ "--backend-kwarg",
+ "secondary_engine=tesseract",
+ "--backend-kwarg",
+ "append_unmatched_primary=true",
+ ]
+ )
+
+ payload = json.loads(card.read_text(encoding="utf-8"))
+
+ assert create_exit == 0
+ assert payload["backend"] == "line_align_composite"
+ assert payload["backend_kwargs"]["primary_engine"] == "surya"
+ assert payload["backend_kwargs"]["secondary_engine"] == "tesseract"
+ assert payload["backend_kwargs"]["append_unmatched_primary"] is True
+
+
+def test_cli_calibrate_quality_router(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(source), text="नेपाल", metadata={"slices": ["nepali"]})],
+ manifest,
+ )
+ benchmark_report = tmp_path / "report.json"
+ benchmark_report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.2, "quality_score": 0.9},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.4, "quality_score": 0.7},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+ experiment_report = tmp_path / "experiment.json"
+ experiment_report.write_text(
+ json.dumps(
+ {
+ "experiment_id": "calibration",
+ "output_dir": str(tmp_path / "exp"),
+ "eval_manifest": str(manifest),
+ "references_dir": None,
+ "baselines": ["candidate", "tesseract"],
+ "input_count": 1,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1},
+ "benchmark_report": str(benchmark_report),
+ "benchmark_status_counts": {"ok": 2},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "calibrate-quality-router",
+ "--experiment-report",
+ str(experiment_report),
+ "--out",
+ str(tmp_path / "calibration"),
+ "--model-id",
+ "ocrtech-quality-router",
+ "--primary-engine",
+ "tesseract",
+ "--secondary-engine",
+ "tesseract",
+ "--primary-engine-kwarg",
+ "psm=6",
+ "--secondary-engine-kwarg",
+ "psm=13",
+ "--threshold-start",
+ "0.0",
+ "--threshold-end",
+ "0.1",
+ "--threshold-step",
+ "0.05",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "calibration.json" in captured.out
+ assert (tmp_path / "calibration" / "model-card.json").exists()
+
+
+def test_cli_calibrate_script_router(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(source), text="नेपाल", metadata={"slices": ["nepali"]})],
+ manifest,
+ )
+ experiment_dir = tmp_path / "exp"
+ (experiment_dir / "benchmark" / "tesseract" / source.stem).mkdir(parents=True)
+ (experiment_dir / "benchmark" / "tesseract" / source.stem / "document.md").write_text("नेपाल सरकार\n", encoding="utf-8")
+ benchmark_report = tmp_path / "report.json"
+ benchmark_report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "tesseract",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.4},
+ "error": None,
+ },
+ {
+ "baseline": "surya",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.2},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+ experiment_report = tmp_path / "experiment.json"
+ experiment_report.write_text(
+ json.dumps(
+ {
+ "experiment_id": "script-calibration",
+ "output_dir": str(experiment_dir),
+ "eval_manifest": str(manifest),
+ "references_dir": None,
+ "baselines": ["surya", "tesseract"],
+ "input_count": 1,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1},
+ "benchmark_report": str(benchmark_report),
+ "benchmark_status_counts": {"ok": 2},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "calibrate-script-router",
+ "--experiment-report",
+ str(experiment_report),
+ "--out",
+ str(tmp_path / "calibration"),
+ "--model-id",
+ "ocrtech-script-router",
+ "--primary-engine",
+ "tesseract",
+ "--secondary-engine",
+ "surya",
+ "--threshold-start",
+ "0.0",
+ "--threshold-end",
+ "0.2",
+ "--threshold-step",
+ "0.2",
+ "--routing-granularity",
+ "page",
+ "--secondary-structure-backfill",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "calibration.json" in captured.out
+ assert (tmp_path / "calibration" / "model-card.json").exists()
+
+
+def test_cli_calibrate_tesseract_psm_ensemble(tmp_path: Path, capsys) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(source), text="नेपाल", metadata={"slices": ["nepali"]})],
+ manifest,
+ )
+
+ def write_experiment(name: str, benchmark_rows: list[dict[str, object]]) -> Path:
+ benchmark = tmp_path / f"{name}-report.json"
+ benchmark.write_text(json.dumps(benchmark_rows), encoding="utf-8")
+ experiment = tmp_path / f"{name}-experiment.json"
+ experiment.write_text(
+ json.dumps(
+ {
+ "experiment_id": name,
+ "output_dir": str(tmp_path / name),
+ "eval_manifest": str(manifest),
+ "references_dir": None,
+ "baselines": ["candidate", "tesseract"],
+ "input_count": 1,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1},
+ "benchmark_report": str(benchmark),
+ "benchmark_status_counts": {"ok": len(benchmark_rows)},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ }
+ ),
+ encoding="utf-8",
+ )
+ return experiment
+
+ primary = write_experiment("primary", [{"baseline": "tesseract", "input_path": str(source), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.4, "quality_score": 0.7}, "error": None}])
+ psm7 = write_experiment("psm7", [{"baseline": "candidate", "input_path": str(source), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.3, "quality_score": 0.6}, "error": None}])
+ psm13 = write_experiment("psm13", [{"baseline": "candidate", "input_path": str(source), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.2, "quality_score": 0.9}, "error": None}])
+
+ exit_code = main(
+ [
+ "calibrate-tesseract-psm-ensemble",
+ "--primary-experiment-report",
+ str(primary),
+ "--variant-experiment",
+ f"psm7={psm7}",
+ "--variant-experiment",
+ f"psm13={psm13}",
+ "--out",
+ str(tmp_path / "ensemble"),
+ "--model-id",
+ "ocrtech-ensemble",
+ "--bias-start",
+ "-0.04",
+ "--bias-end",
+ "0.04",
+ "--bias-step",
+ "0.04",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ assert exit_code == 0
+ assert "calibration.json" in captured.out
+ assert (tmp_path / "ensemble" / "model-card.json").exists()
+
+
+def test_cli_export_and_package_recognizer(tmp_path: Path) -> None:
+ training_config = tmp_path / "paddle_recognizer.yml"
+ training_config.write_text("Global:\n save_model_dir: checkpoints\n", encoding="utf-8")
+ export_exit = main(
+ [
+ "export-recognizer",
+ "--training-config",
+ str(training_config),
+ "--checkpoint",
+ str(tmp_path / "checkpoints" / "best_accuracy"),
+ "--out",
+ str(tmp_path / "export"),
+ ]
+ )
+ inference_dir = tmp_path / "inference"
+ inference_dir.mkdir()
+ (inference_dir / "inference.pdmodel").write_bytes(b"model")
+ (inference_dir / "inference.pdiparams").write_bytes(b"params")
+ dictionary = tmp_path / "dict.txt"
+ dictionary.write_text("क\nA\n", encoding="utf-8")
+ package_exit = main(
+ [
+ "package-recognizer",
+ "--inference-dir",
+ str(inference_dir),
+ "--dictionary",
+ str(dictionary),
+ "--out",
+ str(tmp_path / "package"),
+ "--model-id",
+ "ocrtech-cli-package",
+ ]
+ )
+
+ assert export_exit == 0
+ assert package_exit == 0
+ assert (tmp_path / "export" / "export-recognizer.json").exists()
+ assert (tmp_path / "package" / "model-card.json").exists()
diff --git a/tests/test_datasets.py b/tests/test_datasets.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed7478c20e86dc68f78b89ce5f2ba500fa982352
--- /dev/null
+++ b/tests/test_datasets.py
@@ -0,0 +1,508 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.datasets import audit_manifest, audit_recognizer_corpus, build_recognizer_corpus, filter_manifest, merge_manifests, rebalance_manifest, split_manifest
+from ocrtech.errors import DataValidationError
+from ocrtech.manifest import ManifestEntry, load_manifest, sha256_file, sha256_path, sha256_text, write_manifest
+from ocrtech.validation import check_leakage
+
+
+def test_audit_manifest_reports_counts_and_missing_slice(tmp_path: Path) -> None:
+ manifest = _write_combined_manifest(tmp_path, count=4)
+
+ audit = audit_manifest(manifest, tmp_path / "audit", require_slices=["nepali", "table", "missing"])
+
+ assert not audit.passed
+ assert audit.sample_count == 4
+ assert audit.slice_counts["nepali"] == 2
+ assert "required slice missing: missing" in audit.issues
+ assert (tmp_path / "audit" / "manifest-audit.json").exists()
+
+
+def test_split_manifest_is_deterministic_and_leakage_safe(tmp_path: Path) -> None:
+ manifest = _write_combined_manifest(tmp_path, count=10)
+
+ first = split_manifest(manifest, tmp_path / "split-a", eval_ratio=0.3, seed=7)
+ second = split_manifest(manifest, tmp_path / "split-b", eval_ratio=0.3, seed=7)
+
+ first_eval_ids = [entry.sample_id for entry in load_manifest(first.eval_manifest)]
+ second_eval_ids = [entry.sample_id for entry in load_manifest(second.eval_manifest)]
+ assert first_eval_ids == second_eval_ids
+ assert first.train_count + first.eval_count == 10
+ assert check_leakage([first.train_manifest], first.eval_manifest).passed
+
+
+def test_split_manifest_keeps_duplicate_sample_signature_in_same_split(tmp_path: Path) -> None:
+ image = tmp_path / "shared.png"
+ image.write_bytes(b"same-image")
+ image_hash = sha256_file(image)
+ text_hash = sha256_text("same text")
+ sample_hash = sha256_text(f"{image_hash}\n{text_hash}")
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-a",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text="same text",
+ sha256=image_hash,
+ metadata={"slices": ["nepali"], "text_sha256": text_hash, "sample_sha256": sample_hash},
+ ),
+ ManifestEntry(
+ sample_id="sample-b",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text="same text",
+ sha256=image_hash,
+ metadata={"slices": ["nepali"], "text_sha256": text_hash, "sample_sha256": sample_hash},
+ ),
+ *_entries(tmp_path, start=2, count=4),
+ ],
+ manifest,
+ )
+
+ summary = split_manifest(manifest, tmp_path / "split", eval_ratio=0.5, seed=3)
+ train_ids = {entry.sample_id for entry in load_manifest(summary.train_manifest)}
+ eval_ids = {entry.sample_id for entry in load_manifest(summary.eval_manifest)}
+
+ assert {"sample-a", "sample-b"}.issubset(train_ids) or {"sample-a", "sample-b"}.issubset(eval_ids)
+ assert check_leakage([summary.train_manifest], summary.eval_manifest).passed
+
+
+def test_split_manifest_can_group_by_text_sha256(tmp_path: Path) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ entries = []
+ for index in range(6):
+ text = "shared text" if index < 3 else f"text {index}"
+ image = tmp_path / f"sample-{index}.png"
+ image.write_bytes(f"image-{index}".encode("utf-8"))
+ text_hash = sha256_text(text)
+ entries.append(
+ ManifestEntry(
+ sample_id=f"sample-{index}",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text=text,
+ sha256=sha256_file(image),
+ metadata={"slices": ["nepali"], "text_sha256": text_hash},
+ )
+ )
+ write_manifest(entries, manifest)
+
+ summary = split_manifest(manifest, tmp_path / "split", eval_ratio=0.5, seed=1, group_by="text_sha256")
+ train_entries = load_manifest(summary.train_manifest)
+ eval_entries = load_manifest(summary.eval_manifest)
+ train_shared = {entry.sample_id for entry in train_entries if entry.text == "shared text"}
+ eval_shared = {entry.sample_id for entry in eval_entries if entry.text == "shared text"}
+
+ assert summary.group_by == "text_sha256"
+ assert not (train_shared and eval_shared)
+
+
+def test_audit_manifest_fails_on_hash_mismatch(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"actual")
+ manifest = tmp_path / "manifest.jsonl"
+ manifest.write_text(
+ json.dumps(
+ {
+ "sample_id": "bad",
+ "dataset": "local",
+ "split": "train",
+ "image_path": str(image),
+ "text": "नेपाल",
+ "sha256": "not-the-real-hash",
+ "metadata": {"slices": ["nepali"]},
+ },
+ ensure_ascii=False,
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+
+ audit = audit_manifest(manifest)
+
+ assert not audit.passed
+ assert any("sha256 mismatch" in issue for issue in audit.issues)
+
+
+def test_audit_manifest_supports_directory_inputs(tmp_path: Path) -> None:
+ bundle = tmp_path / "bundle"
+ bundle.mkdir()
+ (bundle / "page-0001.png").write_bytes(b"page-1")
+ (bundle / "page-0002.png").write_bytes(b"page-2")
+ manifest = tmp_path / "manifest.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="bundle-sample",
+ dataset="local",
+ split="eval",
+ image_path=str(bundle),
+ text="नेपाल सरकार\nApproved by: Sita Rana",
+ sha256=sha256_path(bundle),
+ metadata={"slices": ["nepali", "english", "multi_page"], "text_sha256": sha256_text("नेपाल सरकार\nApproved by: Sita Rana")},
+ )
+ ],
+ manifest,
+ )
+
+ audit = audit_manifest(manifest)
+
+ assert audit.passed
+ assert audit.sample_count == 1
+
+
+def test_merge_manifests_combines_inputs_and_writes_summary(tmp_path: Path) -> None:
+ first = tmp_path / "first.jsonl"
+ second = tmp_path / "second.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=2), first)
+ write_manifest(_entries(tmp_path, start=2, count=2), second)
+
+ summary = merge_manifests([first, second], tmp_path / "combined.jsonl")
+ merged = load_manifest(summary.output_manifest)
+
+ assert len(merged) == 4
+ assert summary.sample_count == 4
+ assert (tmp_path / "combined-merge.json").exists()
+ assert (tmp_path / "combined-merge.md").exists()
+
+
+def test_rebalance_manifest_upsamples_requested_slice_and_writes_summary(tmp_path: Path) -> None:
+ manifest = _write_combined_manifest(tmp_path, count=6)
+
+ summary = rebalance_manifest(manifest, tmp_path / "rebalanced.jsonl", slices=["english", "nepali"], seed=5)
+ rebalanced = load_manifest(summary.output_manifest)
+
+ assert summary.original_count == 6
+ assert summary.target_count == 3
+ assert summary.slice_counts_before == {"english": 3, "nepali": 3}
+ assert summary.slice_counts_after == {"english": 3, "nepali": 3}
+ assert len(rebalanced) == 6
+ assert (tmp_path / "rebalanced-rebalance.json").exists()
+ assert (tmp_path / "rebalanced-rebalance.md").exists()
+
+
+def test_rebalance_manifest_can_fill_underrepresented_slice(tmp_path: Path) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=5), manifest)
+
+ summary = rebalance_manifest(manifest, tmp_path / "rebalanced.jsonl", slices=["english", "nepali"], target_count=4, seed=7)
+ rebalanced = load_manifest(summary.output_manifest)
+ duplicated = [entry for entry in rebalanced if entry.metadata.get("rebalance_duplicate")]
+
+ assert summary.original_count == 5
+ assert summary.rebalanced_count == 8
+ assert summary.slice_counts_before == {"english": 2, "nepali": 3}
+ assert summary.slice_counts_after == {"english": 4, "nepali": 4}
+ assert len(duplicated) == 3
+ assert all(entry.sample_id.startswith("sample-") and "~rebalance-english-" in entry.sample_id for entry in duplicated[:2])
+ assert all(entry.metadata["rebalance_source_sample_id"].startswith("sample-") for entry in duplicated)
+
+
+def test_rebalance_manifest_requires_present_slice(tmp_path: Path) -> None:
+ manifest = _write_combined_manifest(tmp_path, count=4)
+
+ with pytest.raises(DataValidationError, match="missing requested slices: missing"):
+ rebalance_manifest(manifest, tmp_path / "rebalanced.jsonl", slices=["missing"], target_count=5)
+
+
+def test_audit_recognizer_corpus_passes_balanced_train_eval_manifests(tmp_path: Path) -> None:
+ train = _write_recognizer_manifest(
+ tmp_path,
+ "train.jsonl",
+ [
+ ("tr-en-1", "Invoice total", ["english", "real"]),
+ ("tr-en-2", "Account number", ["english", "synthetic"]),
+ ("tr-ne-1", "नेपाल सरकार", ["nepali", "real"]),
+ ("tr-ne-2", "जम्मा रकम", ["nepali", "synthetic"]),
+ ("tr-mix-1", "नाम Sita", ["mixed_script", "real"]),
+ ("tr-mix-2", "रकम USD", ["mixed_script", "synthetic"]),
+ ],
+ )
+ eval_manifest = _write_recognizer_manifest(
+ tmp_path,
+ "eval.jsonl",
+ [
+ ("ev-en", "Receipt date", ["english", "hard_eval"]),
+ ("ev-ne", "प्रदेश कार्यालय", ["nepali", "hard_eval"]),
+ ("ev-mix", "बिल No 7", ["mixed_script", "hard_eval"]),
+ ],
+ )
+
+ audit = audit_recognizer_corpus(
+ train,
+ eval_manifest,
+ tmp_path / "audit",
+ min_train_samples=6,
+ min_eval_samples=3,
+ min_train_english=3,
+ min_train_devanagari=4,
+ min_train_mixed=2,
+ min_eval_english=2,
+ min_eval_devanagari=2,
+ min_eval_mixed=1,
+ min_train_latin_only=2,
+ min_train_devanagari_only=2,
+ min_eval_latin_only=1,
+ min_eval_devanagari_only=1,
+ min_train_real=3,
+ min_train_synthetic=3,
+ )
+
+ assert audit.passed
+ assert audit.leakage_passed
+ assert audit.train_profile.script_sample_counts["mixed_devanagari_latin"] == 2
+ assert (tmp_path / "audit" / "recognizer-corpus-audit.json").exists()
+ assert (tmp_path / "audit" / "recognizer-corpus-audit.md").exists()
+
+
+def test_audit_recognizer_corpus_fails_missing_english_and_leakage(tmp_path: Path) -> None:
+ train = _write_recognizer_manifest(
+ tmp_path,
+ "train.jsonl",
+ [
+ ("shared", "नेपाल सरकार", ["nepali", "real"]),
+ ("tr-ne-2", "जम्मा रकम", ["nepali", "synthetic"]),
+ ],
+ )
+ eval_manifest = _write_recognizer_manifest(
+ tmp_path,
+ "eval.jsonl",
+ [
+ ("shared", "नेपाल सरकार", ["nepali", "hard_eval"]),
+ ("ev-ne-2", "प्रदेश कार्यालय", ["nepali", "hard_eval"]),
+ ],
+ )
+
+ audit = audit_recognizer_corpus(
+ train,
+ eval_manifest,
+ min_train_samples=2,
+ min_eval_samples=2,
+ min_train_english=1,
+ min_train_devanagari=2,
+ min_train_mixed=1,
+ min_eval_english=1,
+ min_eval_devanagari=2,
+ min_eval_mixed=0,
+ min_train_latin_only=1,
+ min_train_devanagari_only=1,
+ min_eval_latin_only=1,
+ min_eval_devanagari_only=1,
+ min_train_real=1,
+ min_train_synthetic=1,
+ )
+
+ assert not audit.passed
+ assert not audit.leakage_passed
+ assert "train latin-script samples 0 < required 1" in audit.issues
+ assert "train mixed-script samples 0 < required 1" in audit.issues
+ assert "train latin-only samples 0 < required 1" in audit.issues
+ assert any(issue.startswith("train/eval leakage detected") for issue in audit.issues)
+
+
+def test_audit_recognizer_corpus_can_require_isolated_script_samples(tmp_path: Path) -> None:
+ train = _write_recognizer_manifest(
+ tmp_path,
+ "train.jsonl",
+ [
+ ("tr-mix-1", "नाम Ram", ["mixed_script", "real"]),
+ ("tr-mix-2", "रकम USD", ["mixed_script", "synthetic"]),
+ ],
+ )
+ eval_manifest = _write_recognizer_manifest(
+ tmp_path,
+ "eval.jsonl",
+ [("ev-mix", "बिल No", ["mixed_script", "hard_eval"])],
+ )
+
+ audit = audit_recognizer_corpus(
+ train,
+ eval_manifest,
+ min_train_samples=2,
+ min_eval_samples=1,
+ min_train_english=2,
+ min_train_devanagari=2,
+ min_train_mixed=2,
+ min_eval_english=1,
+ min_eval_devanagari=1,
+ min_eval_mixed=1,
+ min_train_latin_only=1,
+ min_train_devanagari_only=1,
+ min_eval_latin_only=1,
+ min_eval_devanagari_only=1,
+ min_train_real=1,
+ min_train_synthetic=1,
+ )
+
+ assert not audit.passed
+ assert "train latin-only samples 0 < required 1" in audit.issues
+ assert "train devanagari-only samples 0 < required 1" in audit.issues
+ markdown_dir = tmp_path / "audit"
+ audit = audit_recognizer_corpus(
+ train,
+ eval_manifest,
+ markdown_dir,
+ min_train_samples=2,
+ min_eval_samples=1,
+ min_train_english=2,
+ min_train_devanagari=2,
+ min_train_mixed=2,
+ min_eval_english=1,
+ min_eval_devanagari=1,
+ min_eval_mixed=1,
+ min_train_latin_only=1,
+ min_train_devanagari_only=1,
+ min_eval_latin_only=1,
+ min_eval_devanagari_only=1,
+ min_train_real=1,
+ min_train_synthetic=1,
+ )
+ markdown = (markdown_dir / "recognizer-corpus-audit.md").read_text(encoding="utf-8")
+ assert "add Latin-only English samples to protect English preservation" in markdown
+ assert "add Devanagari-only Nepali samples to prevent mixed-script-only overfitting" in markdown
+
+
+def test_build_recognizer_corpus_upsamples_script_and_source_buckets(tmp_path: Path) -> None:
+ source = _write_recognizer_manifest(
+ tmp_path,
+ "source.jsonl",
+ [
+ ("en", "Invoice total", ["english", "real"]),
+ ("ne", "नेपाल सरकार", ["nepali", "real"]),
+ ("mix", "नाम Ram", ["mixed_script", "synthetic"]),
+ ],
+ )
+
+ summary = build_recognizer_corpus(
+ [source],
+ tmp_path / "built.jsonl",
+ target_latin_only=2,
+ target_devanagari_only=2,
+ target_mixed=2,
+ target_real=4,
+ target_synthetic=2,
+ seed=3,
+ )
+ built = load_manifest(summary.output_manifest)
+
+ assert summary.source_count == 3
+ assert summary.output_count >= 6
+ assert summary.bucket_counts_after["latin_only"] >= 2
+ assert summary.bucket_counts_after["devanagari_only"] >= 2
+ assert summary.bucket_counts_after["mixed_devanagari_latin"] >= 2
+ assert summary.bucket_counts_after["real"] >= 4
+ assert summary.bucket_counts_after["synthetic"] >= 2
+ assert any(entry.metadata.get("recognizer_corpus_duplicate") for entry in built)
+ assert (tmp_path / "built-recognizer-corpus-build.json").exists()
+ assert (tmp_path / "built-recognizer-corpus-build.md").exists()
+
+
+def test_build_recognizer_corpus_fails_when_required_bucket_is_missing(tmp_path: Path) -> None:
+ source = _write_recognizer_manifest(
+ tmp_path,
+ "source.jsonl",
+ [("ne", "नेपाल सरकार", ["nepali", "real"])],
+ )
+
+ with pytest.raises(DataValidationError, match="missing bucket: latin_only"):
+ build_recognizer_corpus([source], tmp_path / "built.jsonl", target_latin_only=1)
+
+
+def test_filter_manifest_selects_by_sample_id_and_metadata(tmp_path: Path) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=6), manifest)
+
+ summary = filter_manifest(
+ manifest,
+ tmp_path / "filtered.jsonl",
+ sample_ids=["sample-0", "sample-3"],
+ document_types=["table"],
+ degradations=["scan"],
+ )
+ filtered = load_manifest(summary.output_manifest)
+
+ assert summary.source_count == 6
+ assert summary.selected_count == 2
+ assert [entry.sample_id for entry in filtered] == ["sample-0", "sample-3"]
+ assert (tmp_path / "filtered-filter.json").exists()
+ assert (tmp_path / "filtered-filter.md").exists()
+
+
+def test_filter_manifest_requires_existing_sample_ids(tmp_path: Path) -> None:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=4), manifest)
+
+ with pytest.raises(DataValidationError, match="requested sample_ids not found"):
+ filter_manifest(manifest, tmp_path / "filtered.jsonl", sample_ids=["missing-sample"])
+
+
+def _write_combined_manifest(tmp_path: Path, *, count: int) -> Path:
+ manifest = tmp_path / "combined.jsonl"
+ write_manifest(_entries(tmp_path, start=0, count=count), manifest)
+ return manifest
+
+
+def _write_recognizer_manifest(tmp_path: Path, name: str, rows: list[tuple[str, str, list[str]]]) -> Path:
+ manifest = tmp_path / name
+ entries: list[ManifestEntry] = []
+ for sample_id, text, slices in rows:
+ image = tmp_path / f"{name}-{sample_id}.png"
+ image.write_bytes(f"image-{name}-{sample_id}".encode("utf-8"))
+ image_hash = sha256_file(image)
+ text_hash = sha256_text(text)
+ entries.append(
+ ManifestEntry(
+ sample_id=sample_id,
+ dataset="fixture",
+ split="train" if name.startswith("train") else "eval",
+ image_path=str(image),
+ text=text,
+ sha256=image_hash,
+ metadata={"slices": slices, "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ )
+ write_manifest(entries, manifest)
+ return manifest
+
+
+def _entries(tmp_path: Path, *, start: int, count: int) -> list[ManifestEntry]:
+ entries: list[ManifestEntry] = []
+ for index in range(start, start + count):
+ image = tmp_path / f"line-{index}.png"
+ image.write_bytes(f"image-{index}".encode("utf-8"))
+ image_hash = sha256_file(image)
+ text = "नेपाल" if index % 2 == 0 else "English"
+ text_hash = sha256_text(text)
+ slices = ["nepali"] if index % 2 == 0 else ["english"]
+ document_type = "table" if index % 3 == 0 else "paragraph"
+ degradation = "scan" if index % 3 == 0 else "clean"
+ if document_type == "table":
+ slices.append("table")
+ entries.append(
+ ManifestEntry(
+ sample_id=f"sample-{index}",
+ dataset="local",
+ split="all",
+ image_path=str(image),
+ text=text,
+ sha256=image_hash,
+ metadata={
+ "slices": slices,
+ "document_type": document_type,
+ "degradation": degradation,
+ "text_sha256": text_hash,
+ "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}"),
+ },
+ )
+ )
+ return entries
diff --git a/tests/test_engines.py b/tests/test_engines.py
new file mode 100644
index 0000000000000000000000000000000000000000..47865b159b299af6746558b688b790bede336e6d
--- /dev/null
+++ b/tests/test_engines.py
@@ -0,0 +1,48 @@
+from __future__ import annotations
+
+from ocrtech.engines import PaddleOcrEngine
+
+
+def test_paddleocr_engine_parses_v3_page_results() -> None:
+ engine = object.__new__(PaddleOcrEngine)
+
+ raw_result = [
+ {
+ "input_path": "page.png",
+ "rec_texts": ["नेपाल सरकार", "Mixed English 123"],
+ "rec_scores": [0.98, 0.87],
+ "rec_polys": [
+ [[10, 10], [210, 10], [210, 40], [10, 40]],
+ [[10, 50], [250, 50], [250, 80], [10, 80]],
+ ],
+ }
+ ]
+
+ lines = engine._parse_result(raw_result, page_index=0)
+
+ assert [line.text for line in lines] == ["नेपाल सरकार", "Mixed English 123"]
+ assert [line.confidence for line in lines] == [0.98, 0.87]
+ assert [line.line_id for line in lines] == ["p0-l0", "p0-l1"]
+
+
+def test_paddleocr_engine_parses_v3_json_wrapper_results() -> None:
+ engine = object.__new__(PaddleOcrEngine)
+
+ class FakeOcrResult:
+ def __init__(self) -> None:
+ self.json = {
+ "res": {
+ "rec_texts": ["तालिका", "Table"],
+ "rec_scores": [0.75, 0.66],
+ "rec_polys": [
+ [[0, 0], [80, 0], [80, 20], [0, 20]],
+ [[0, 30], [80, 30], [80, 50], [0, 50]],
+ ],
+ }
+ }
+
+ lines = engine._parse_result([FakeOcrResult()], page_index=2)
+
+ assert [line.text for line in lines] == ["तालिका", "Table"]
+ assert [line.page_index for line in lines] == [2, 2]
+ assert [line.line_id for line in lines] == ["p2-l0", "p2-l1"]
diff --git a/tests/test_error_analysis.py b/tests/test_error_analysis.py
new file mode 100644
index 0000000000000000000000000000000000000000..fc9b24518590b9d045d441117d25ac430023dacd
--- /dev/null
+++ b/tests/test_error_analysis.py
@@ -0,0 +1,263 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.admission import assert_recognizer_family_not_stopped, decide_recognizer_admission, review_recognizer_failures
+from ocrtech.error_analysis import analyze_benchmark_errors, export_failure_manifest
+from ocrtech.errors import ValidationError
+from ocrtech.manifest import ManifestEntry, load_manifest, write_manifest
+
+
+def test_analyze_benchmark_errors_ranks_hard_samples_and_slice_gaps(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("surya", "s1", ["nepali", "blur"], 0.40),
+ _row("surya", "s2", ["english", "clean"], 0.10),
+ _row("surya", "s3", ["nepali", "clean"], 0.25),
+ _row("tesseract", "s1", ["nepali", "blur"], 0.60),
+ _row("tesseract", "s2", ["english", "clean"], 0.05),
+ _row("tesseract", "s3", ["nepali", "clean"], 0.30),
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ analysis = analyze_benchmark_errors(
+ report,
+ tmp_path / "analysis",
+ system="surya",
+ baselines=["tesseract"],
+ metric="cer",
+ top_n=2,
+ )
+
+ assert analysis.sample_count == 3
+ payload = json.loads((tmp_path / "analysis" / "error-analysis.json").read_text(encoding="utf-8"))
+ assert payload["baseline_summary"]["tesseract"]["pairs"] == 3
+ assert payload["baseline_summary"]["tesseract"]["system_worse_count"] == 1
+ top = json.loads((tmp_path / "analysis" / "top-failures.json").read_text(encoding="utf-8"))
+ assert [item["sample_id"] for item in top] == ["s2", "s1"]
+ assert top[0]["comparisons"]["tesseract"]["worse_than_baseline"] == 0.05
+ assert payload["top_failure_slice_counts"] == [
+ {"slice": "blur", "count": 1},
+ {"slice": "clean", "count": 1},
+ {"slice": "english", "count": 1},
+ {"slice": "nepali", "count": 1},
+ ]
+ slice_summary = {item["slice"]: item for item in payload["slice_summary"]}
+ assert slice_summary["nepali"]["sample_count"] == 2
+ assert slice_summary["nepali"]["system_mean"] == (0.40 + 0.25) / 2
+
+
+def test_analyze_benchmark_errors_without_baseline_uses_metric_badness(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(json.dumps([_row("surya", "easy", ["clean"], 0.01), _row("surya", "hard", ["blur"], 0.50)]), encoding="utf-8")
+
+ analyze_benchmark_errors(report, tmp_path / "analysis", system="surya", metric="cer", top_n=1)
+
+ top = json.loads((tmp_path / "analysis" / "top-failures.json").read_text(encoding="utf-8"))
+ assert [item["sample_id"] for item in top] == ["hard"]
+ assert top[0]["worst_gap"] is None
+
+
+def test_export_failure_manifest_preserves_entries_and_stamps_failure_metadata(tmp_path: Path) -> None:
+ image = tmp_path / "hard.png"
+ image.write_bytes(b"image")
+ source_manifest = tmp_path / "source.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="hard",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image),
+ text="नेपाल total",
+ metadata={"slices": ["table"], "reference_path": "refs/hard.json"},
+ )
+ ],
+ source_manifest,
+ )
+ failures = tmp_path / "top-failures.json"
+ failures.write_text(
+ json.dumps(
+ [
+ {
+ "sample_id": "hard",
+ "sample_key": "hard",
+ "slices": ["table"],
+ "cer": 0.42,
+ "badness": 0.42,
+ "worst_gap": 0.10,
+ "comparisons": {"surya": {"baseline_value": 0.32, "worse_than_baseline": 0.10}},
+ }
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ export = export_failure_manifest(source_manifest, failures, tmp_path / "hard.jsonl", split="hard_eval")
+ entries = load_manifest(export.output_manifest)
+
+ assert export.selected_count == 1
+ assert entries[0].sample_id == "hard"
+ assert entries[0].text == "नेपाल total"
+ assert entries[0].split == "hard_eval"
+ assert entries[0].metadata["reference_path"] == "refs/hard.json"
+ assert "hard_eval" in entries[0].metadata["slices"]
+ assert entries[0].metadata["failure_analysis"]["rank"] == 1
+ assert entries[0].metadata["failure_analysis"]["metric"] == "cer"
+ assert entries[0].metadata["failure_analysis"]["metric_value"] == 0.42
+
+
+def test_decide_recognizer_admission_rejects_failed_gate_and_recommends_next_actions(tmp_path: Path) -> None:
+ validation = tmp_path / "validation.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "not_validated",
+ "passed": False,
+ "sample_count": 50,
+ "missing_requirements": ["absolute improvement -0.1 < required 0.0"],
+ "gates": [
+ {
+ "gate": {"baseline": "tesseract", "metric": "cer", "slices": ["english", "line_crop"]},
+ "passed": False,
+ "pairs": 38,
+ "candidate_mean": 0.95,
+ "baseline_mean": 0.03,
+ "absolute_improvement": -0.92,
+ "relative_improvement": -30.0,
+ "win_count": 0,
+ "loss_count": 38,
+ "tie_count": 0,
+ "reason": "absolute improvement -0.92 < required 0.0",
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ decision = decide_recognizer_admission(validation, tmp_path / "decision")
+ payload = json.loads((tmp_path / "decision" / "recognizer-admission-decision.json").read_text(encoding="utf-8"))
+
+ assert decision.decision == "reject"
+ assert decision.failed_gates[0].loss_count == 38
+ assert payload["failed_gates"][0]["baseline"] == "tesseract"
+ assert any("English preservation" in action for action in decision.next_actions)
+ assert (tmp_path / "decision" / "recognizer-admission-decision.md").exists()
+
+
+def test_decide_recognizer_admission_admits_validated_report(tmp_path: Path) -> None:
+ validation = tmp_path / "validation.json"
+ validation.write_text('{"claim_status":"validated","passed":true,"sample_count":50,"gates":[]}\n', encoding="utf-8")
+
+ decision = decide_recognizer_admission(validation, tmp_path / "decision")
+
+ assert decision.decision == "admit"
+ assert any("full document SOTA portfolio" in action for action in decision.next_actions)
+
+
+def test_review_recognizer_failures_stops_repeated_zero_win_family(tmp_path: Path) -> None:
+ model_cards: list[Path] = []
+ decisions: list[Path] = []
+ for index in range(3):
+ card = tmp_path / f"model-{index}.json"
+ card.write_text(
+ json.dumps(
+ {
+ "model_id": f"paddle-{index}",
+ "backend": "paddleocr",
+ "base_model": "PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "artifacts": [],
+ "backend_kwargs": {},
+ "metrics": {},
+ }
+ ),
+ encoding="utf-8",
+ )
+ model_cards.append(card)
+ decision = tmp_path / f"decision-{index}.json"
+ decision.write_text(
+ json.dumps(
+ {
+ "validation_report": f"validation-{index}.json",
+ "decision": "reject",
+ "claim_status": "not_validated",
+ "passed": False,
+ "sample_count": 50,
+ "failed_gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "slices": ["english", "line_crop"],
+ "pairs": 50,
+ "win_count": 0,
+ "loss_count": 50,
+ "tie_count": 0,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ decisions.append(decision)
+
+ review = review_recognizer_failures(decisions, [], tmp_path / "review", model_cards=model_cards)
+ payload = json.loads((tmp_path / "review" / "recognizer-failure-review.json").read_text(encoding="utf-8"))
+
+ assert review.families[0].recommendation == "stop_family"
+ assert review.families[0].total_wins == 0
+ assert review.families[0].rejected_count == 3
+ assert payload["families"][0]["failed_slices"] == ["english", "line_crop"]
+ assert (tmp_path / "review" / "recognizer-failure-review.md").exists()
+
+
+def test_stopped_recognizer_family_guard_normalizes_devanagari_ppocrv3_names(tmp_path: Path) -> None:
+ review = tmp_path / "recognizer-failure-review.json"
+ review.write_text(
+ json.dumps(
+ {
+ "families": [
+ {
+ "backend": "paddleocr",
+ "base_model": "PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "family_key": "paddleocr::PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "recommendation": "stop_family",
+ "rejected_count": 4,
+ "total_wins": 0,
+ "total_losses": 545,
+ "total_ties": 7,
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ with pytest.raises(ValidationError, match="recognizer family is stopped"):
+ assert_recognizer_family_not_stopped(
+ review,
+ backend="paddleocr",
+ base_model="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/devanagari_PP-OCRv3_mobile_rec_pretrained.pdparams",
+ )
+
+ assert_recognizer_family_not_stopped(review, backend="hf_vision_encoder_decoder", base_model="microsoft/trocr-small-printed")
+
+
+def _row(baseline: str, sample_id: str, slices: list[str], cer: float) -> dict[str, object]:
+ return {
+ "baseline": baseline,
+ "input_path": f"{sample_id}.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": sample_id,
+ "slices": slices,
+ "metrics": {"cer": cer},
+ "error": None,
+ }
diff --git a/tests/test_evalpack.py b/tests/test_evalpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..b18fce50bf97f56f75ff50df653eb31d4b13c0f3
--- /dev/null
+++ b/tests/test_evalpack.py
@@ -0,0 +1,206 @@
+from __future__ import annotations
+
+import importlib.util
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.benchmark import run_benchmark
+from ocrtech.crops import extract_crop_manifest
+from ocrtech.errors import DataValidationError
+from ocrtech.evalpack import audit_eval_pack, create_eval_pack
+from ocrtech.manifest import load_manifest
+
+
+def test_create_text_eval_pack_and_audit(tmp_path: Path) -> None:
+ summary = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ manifest = Path(summary.manifest_path)
+
+ assert manifest.exists()
+ assert summary.sample_count == 6
+ assert not summary.claim_ready
+ assert "table" in summary.slices
+ assert "complex_table" in summary.slices
+ assert "multi_page" in summary.slices
+ entries = load_manifest(manifest)
+ assert all(Path(entry.image_path).exists() for entry in entries)
+ assert all(Path(str(entry.metadata["reference_path"])).exists() for entry in entries)
+
+ audit = audit_eval_pack(manifest, tmp_path / "audit")
+
+ assert audit.passed
+ assert not audit.claim_ready
+ assert (tmp_path / "audit" / "eval-pack-audit.json").exists()
+
+
+def test_create_full_image_claim_pack_is_claim_ready_when_degradations_cover_required_slices(tmp_path: Path) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="image",
+ count_per_template=1,
+ degradations=["clean", "scan", "blur", "low_contrast", "skew"],
+ )
+
+ audit = audit_eval_pack(summary.manifest_path)
+
+ assert summary.claim_ready
+ assert audit.claim_ready
+ assert audit.passed
+
+
+def test_create_image_eval_pack_writes_multi_page_bundle(tmp_path: Path) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ summary = create_eval_pack(tmp_path / "pack", input_format="image", count_per_template=1, degradations=["clean"])
+ entries = load_manifest(Path(summary.manifest_path))
+ multi_page_entry = next(entry for entry in entries if "multi-page-brief" in entry.sample_id)
+
+ bundle = Path(multi_page_entry.image_path)
+
+ assert summary.sample_count == 6
+ assert bundle.is_dir()
+ assert (bundle / "page-0001.png").exists()
+ assert (bundle / "page-0002.png").exists()
+
+
+def test_image_eval_pack_references_include_render_layout(tmp_path: Path) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="image",
+ count_per_template=1,
+ degradations=["clean"],
+ templates=["table-ledger"],
+ )
+ entry = load_manifest(Path(summary.manifest_path))[0]
+ reference = json.loads(Path(str(entry.metadata["reference_path"])).read_text(encoding="utf-8"))
+ layout = reference["metadata"]["layout"]
+
+ assert layout["schema_version"] == 1
+ assert layout["pages"][0]["lines"][0]["text"] == "दैनिक हिसाब"
+ assert layout["pages"][0]["table_cells"][0]["text"] == "नाम"
+ assert len(layout["pages"][0]["table_cells"][0]["bbox"]) == 4
+
+
+def test_complex_table_eval_pack_writes_span_reference(tmp_path: Path) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="image",
+ count_per_template=1,
+ degradations=["clean"],
+ templates=["complex-table-ledger"],
+ )
+ entry = load_manifest(Path(summary.manifest_path))[0]
+ reference = json.loads(Path(str(entry.metadata["reference_path"])).read_text(encoding="utf-8"))
+ cells = reference["tables"][0]["cells"]
+
+ assert "complex_table" in entry.metadata["slices"]
+ assert cells[0] == {"row": 0, "col": 0, "text": "Ledger Summary", "rowspan": 1, "colspan": 2}
+ assert any(cell["text"] == "नाम" for cell in cells)
+ assert reference["metadata"]["layout"]["pages"][0]["table_cells"][0]["text"] == "Ledger Summary"
+
+
+def test_extract_crop_manifest_from_rendered_eval_pack(tmp_path: Path) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="image",
+ count_per_template=1,
+ degradations=["clean"],
+ templates=["table-ledger", "figure-caption"],
+ )
+
+ crop_summary = extract_crop_manifest(
+ summary.manifest_path,
+ tmp_path / "crops",
+ crop_types=["line", "table_cell", "figure_caption"],
+ )
+ entries = load_manifest(crop_summary.manifest_path)
+
+ assert crop_summary.crop_type_counts["line"] >= 3
+ assert crop_summary.crop_type_counts["table_cell"] == 12
+ assert crop_summary.crop_type_counts["figure_caption"] == 1
+ assert all(Path(entry.image_path).exists() for entry in entries)
+ assert all(entry.metadata["source_sample_id"] for entry in entries)
+ assert any(entry.text == "नाम" and entry.metadata["crop_type"] == "table_cell" for entry in entries)
+ assert any(entry.metadata["crop_type"] == "figure_caption" for entry in entries)
+ assert (tmp_path / "crops" / "crop-manifest-summary.md").exists()
+
+
+def test_extract_crop_manifest_requires_layout_metadata(tmp_path: Path) -> None:
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="text",
+ count_per_template=1,
+ degradations=["clean"],
+ templates=["table-ledger"],
+ )
+
+ with pytest.raises(DataValidationError, match="renderer layout metadata"):
+ extract_crop_manifest(summary.manifest_path, tmp_path / "crops")
+
+
+def test_count_per_template_materializes_distinct_text_variants(tmp_path: Path) -> None:
+ summary = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=2, degradations=["clean"])
+ entries = load_manifest(Path(summary.manifest_path))
+
+ mixed_entries = sorted((entry for entry in entries if "mixed-paragraph" in entry.sample_id), key=lambda entry: entry.sample_id)
+ assert len(mixed_entries) == 2
+ assert mixed_entries[0].text != mixed_entries[1].text
+
+ multi_page_entries = sorted((entry for entry in entries if "multi-page-brief" in entry.sample_id), key=lambda entry: entry.sample_id)
+ assert len(multi_page_entries) == 2
+ assert multi_page_entries[0].text != multi_page_entries[1].text
+
+
+def test_create_eval_pack_can_select_templates_and_variant_offset(tmp_path: Path) -> None:
+ summary = create_eval_pack(
+ tmp_path / "pack",
+ input_format="text",
+ count_per_template=2,
+ degradations=["clean"],
+ templates=["table-ledger", "figure-caption"],
+ variant_offset=10,
+ )
+ entries = load_manifest(Path(summary.manifest_path))
+
+ assert summary.sample_count == 4
+ assert all(("table-ledger" in entry.sample_id or "figure-caption" in entry.sample_id) for entry in entries)
+ assert any("010" in entry.sample_id for entry in entries)
+ assert any("011" in entry.sample_id for entry in entries)
+ table_entries = [entry for entry in entries if "table-ledger" in entry.sample_id]
+ assert len({entry.text for entry in table_entries}) == 2
+
+
+def test_eval_pack_feeds_benchmark_with_structured_references(tmp_path: Path) -> None:
+ summary = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ manifest = Path(summary.manifest_path)
+ entries = load_manifest(manifest)
+ inputs = [entry.image_path for entry in entries]
+
+ results = run_benchmark(
+ inputs,
+ tmp_path / "bench",
+ baselines=["ours"],
+ references_dir=tmp_path / "pack" / "references",
+ eval_manifest=manifest,
+ )
+
+ table_result = next(item for item in results if item.sample_id and "table-ledger" in item.sample_id)
+ figure_result = next(item for item in results if item.sample_id and "figure-caption" in item.sample_id)
+ multi_page_result = next(item for item in results if item.sample_id and "multi-page-brief" in item.sample_id)
+ assert table_result.metrics["table_cell_f1"] == 1.0
+ assert figure_result.metrics["figure_detection_f1"] == 1.0
+ assert multi_page_result.metrics["table_cell_f1"] == 1.0
+ assert multi_page_result.metrics["figure_detection_f1"] == 1.0
+ assert "table" in table_result.slices
+ assert "figure" in figure_result.slices
+ assert "multi_page" in multi_page_result.slices
+ assert (tmp_path / "bench" / "report.json").exists()
diff --git a/tests/test_experiments.py b/tests/test_experiments.py
new file mode 100644
index 0000000000000000000000000000000000000000..acbb8d82516cc191d4d774c5d1510ed2ea7df766
--- /dev/null
+++ b/tests/test_experiments.py
@@ -0,0 +1,115 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.evalpack import create_eval_pack
+from ocrtech.experiments import run_experiment
+from ocrtech.errors import BenchmarkError
+from ocrtech.models import write_model_card
+
+
+def test_run_experiment_writes_benchmark_and_validation_reports(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ config = tmp_path / "validation-config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 6,
+ "required_slices": {"nepali": 6, "english": 6, "multi_page": 1, "complex_table": 1},
+ "gates": [{"baseline": "ours", "metric": "quality_score", "direction": "higher", "min_absolute_margin": 0.0, "require_ci_above_zero": False}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = run_experiment(
+ pack.manifest_path,
+ tmp_path / "experiment",
+ baselines=["ours"],
+ references_dir=tmp_path / "pack" / "references",
+ validation_config=config,
+ )
+
+ assert report.input_count == 6
+ assert report.benchmark_status_counts["ok"] == 6
+ assert report.validation_status == "validated"
+ assert (tmp_path / "experiment" / "benchmark" / "report.json").exists()
+ assert (tmp_path / "experiment" / "validation" / "validation.json").exists()
+ assert (tmp_path / "experiment" / "experiment.json").exists()
+
+
+def test_run_experiment_can_run_preflight_before_benchmark(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ config = tmp_path / "validation-config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 6,
+ "required_slices": {"nepali": 6, "english": 6, "multi_page": 1, "complex_table": 1},
+ "gates": [
+ {
+ "baseline": "ours",
+ "metric": "quality_score",
+ "direction": "higher",
+ "min_absolute_margin": 0.0,
+ "require_ci_above_zero": False,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ report = run_experiment(
+ pack.manifest_path,
+ tmp_path / "experiment",
+ baselines=["ours"],
+ references_dir=tmp_path / "pack" / "references",
+ validation_config=config,
+ candidate_model_config=card,
+ run_preflight=True,
+ require_claim_ready_eval_pack=False,
+ )
+
+ payload = json.loads((tmp_path / "experiment" / "experiment.json").read_text(encoding="utf-8"))
+ assert report.preflight_passed is True
+ assert report.preflight_report == str(tmp_path / "experiment" / "preflight" / "preflight.json")
+ assert payload["preflight_passed"] is True
+ assert Path(payload["preflight_report"]).exists()
+
+
+def test_run_experiment_preflight_stops_impossible_claim_run_before_benchmark(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ config = tmp_path / "validation-config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 1,
+ "gates": [{"baseline": "tesseract", "metric": "cer", "direction": "lower"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ with pytest.raises(BenchmarkError, match="preflight failed"):
+ run_experiment(
+ pack.manifest_path,
+ tmp_path / "experiment",
+ baselines=["ours"],
+ references_dir=tmp_path / "pack" / "references",
+ validation_config=config,
+ candidate_model_config=card,
+ run_preflight=True,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert (tmp_path / "experiment" / "preflight" / "preflight.json").exists()
+ assert not (tmp_path / "experiment" / "benchmark" / "report.json").exists()
diff --git a/tests/test_external_outputs.py b/tests/test_external_outputs.py
new file mode 100644
index 0000000000000000000000000000000000000000..9a35398ac9f248d4a8c836bd2c1f5adef8cd6ede
--- /dev/null
+++ b/tests/test_external_outputs.py
@@ -0,0 +1,42 @@
+from __future__ import annotations
+
+from pathlib import Path
+
+from ocrtech.external_outputs import bundle_page_paths, document_from_markdown
+
+
+def test_document_from_markdown_parses_text_and_tables(tmp_path: Path) -> None:
+ document = document_from_markdown(
+ tmp_path / "sample.md",
+ "# नेपाल सरकार\n\n| नाम | उमेर |\n| --- | --- |\n| राम | ३२ |\n| Sita | 29 |\n",
+ metadata={"engine": "fixture"},
+ )
+
+ assert document.text.startswith("नेपाल सरकार")
+ assert len(document.tables) == 1
+ grid = {(cell.row, cell.col): cell.text for cell in document.tables[0].cells}
+ assert grid[(0, 0)] == "नाम"
+ assert grid[(1, 0)] == "राम"
+ assert document.pages[0].blocks[0].block_type == "title"
+ assert any(block.block_type == "table" for block in document.pages[0].blocks)
+
+
+def test_document_from_markdown_splits_pagebreaks(tmp_path: Path) -> None:
+ document = document_from_markdown(
+ tmp_path / "sample.md",
+ "Page one\n\n\n\nPage two\n",
+ )
+
+ assert len(document.pages) == 2
+ assert document.pages[0].text_lines[0].text == "Page one"
+ assert document.pages[1].text_lines[0].text == "Page two"
+
+
+def test_bundle_page_paths_accepts_single_file_and_sorted_directory(tmp_path: Path) -> None:
+ first = tmp_path / "b.png"
+ second = tmp_path / "a.png"
+ first.write_bytes(b"b")
+ second.write_bytes(b"a")
+
+ assert bundle_page_paths(first) == [first]
+ assert bundle_page_paths(tmp_path) == [second, first]
diff --git a/tests/test_language_registry.py b/tests/test_language_registry.py
new file mode 100644
index 0000000000000000000000000000000000000000..41b3a55244e8c132b9de7aa6dec05a9ab170305b
--- /dev/null
+++ b/tests/test_language_registry.py
@@ -0,0 +1,177 @@
+from __future__ import annotations
+
+import json
+import struct
+from copy import deepcopy
+from pathlib import Path
+
+from ocrtech.cli import main
+from ocrtech.language_registry import audit_font_renderability, audit_language_registry
+
+
+ROOT = Path(__file__).resolve().parents[1]
+REGISTRY = ROOT / "languages" / "nepal-v1.json"
+
+
+def test_nepal_language_registry_passes_core_gates(tmp_path: Path) -> None:
+ audit = audit_language_registry(REGISTRY, tmp_path / "audit")
+
+ assert audit.passed
+ assert audit.language_count >= 11
+ assert audit.counted_nepal_language_count >= 10
+ assert audit.first_target_ids == ["limbu"]
+ assert audit.primary_scripts["limbu"] == ["Limbu / Sirijonga"]
+ assert "english" in audit.primary_scripts
+ assert not audit.errors
+ assert (tmp_path / "audit" / "language-registry-audit.json").exists()
+ assert (tmp_path / "audit" / "language-registry-audit.md").exists()
+
+
+def test_language_registry_rejects_non_limbu_first(tmp_path: Path) -> None:
+ payload = json.loads(REGISTRY.read_text(encoding="utf-8"))
+ payload["languages"] = [payload["languages"][1], payload["languages"][0], *payload["languages"][2:]]
+ registry = tmp_path / "bad-order.json"
+ registry.write_text(json.dumps(payload, ensure_ascii=False), encoding="utf-8")
+
+ audit = audit_language_registry(registry, tmp_path / "audit")
+
+ assert not audit.passed
+ assert "first language entry must have id 'limbu'" in audit.errors
+
+
+def test_language_registry_rejects_too_few_counted_nepal_languages(tmp_path: Path) -> None:
+ payload = json.loads(REGISTRY.read_text(encoding="utf-8"))
+ reduced = deepcopy(payload)
+ counted = 0
+ for language in reduced["languages"]:
+ if language["counts_toward_nepal_language_target"]:
+ counted += 1
+ if counted > 3:
+ language["counts_toward_nepal_language_target"] = False
+ registry = tmp_path / "too-few.json"
+ registry.write_text(json.dumps(reduced, ensure_ascii=False), encoding="utf-8")
+
+ audit = audit_language_registry(registry, tmp_path / "audit", min_nepal_languages=10)
+
+ assert not audit.passed
+ assert any(error.startswith("registry counts 3 Nepal languages") for error in audit.errors)
+
+
+def test_language_registry_rejects_english_counting_toward_target(tmp_path: Path) -> None:
+ payload = json.loads(REGISTRY.read_text(encoding="utf-8"))
+ for language in payload["languages"]:
+ if language["id"] == "english":
+ language["counts_toward_nepal_language_target"] = True
+ registry = tmp_path / "english-counted.json"
+ registry.write_text(json.dumps(payload, ensure_ascii=False), encoding="utf-8")
+
+ audit = audit_language_registry(registry, tmp_path / "audit")
+
+ assert not audit.passed
+ assert "english must not count toward the Nepal-language target" in audit.errors
+
+
+def test_cli_audit_language_registry_writes_summary(tmp_path: Path, capsys) -> None:
+ exit_code = main(["audit-language-registry", str(REGISTRY), "--out", str(tmp_path / "audit")])
+
+ captured = capsys.readouterr()
+ payload = json.loads((tmp_path / "audit" / "language-registry-audit.json").read_text(encoding="utf-8"))
+ assert exit_code == 0
+ assert "passed=True" in captured.out
+ assert "first_targets=limbu" in captured.out
+ assert payload["counted_nepal_language_count"] >= 10
+
+
+def test_font_renderability_audit_scores_cmap_coverage(tmp_path: Path) -> None:
+ font = tmp_path / "single-a.ttf"
+ _write_minimal_cmap_font(font, 0x0041)
+ registry = tmp_path / "registry.json"
+ registry.write_text(
+ json.dumps(
+ {
+ "languages": [
+ {
+ "id": "fixture",
+ "scripts": [
+ {
+ "script": "Latin",
+ "primary": True,
+ "unicode_ranges": ["U+0041"],
+ }
+ ],
+ "font_candidates": [
+ {"name": "Fixture", "path": str(font), "status": "pending_render_audit"}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ audit = audit_font_renderability(registry, tmp_path / "audit")
+
+ assert audit.passed
+ assert audit.script_count == 1
+ assert audit.candidates[0].coverage_ratio == 1.0
+ assert (tmp_path / "audit" / "font-renderability-audit.json").exists()
+ assert (tmp_path / "audit" / "font-renderability-audit.md").exists()
+
+
+def test_cli_font_renderability_audit_fails_missing_coverage(tmp_path: Path, capsys) -> None:
+ font = tmp_path / "single-a.ttf"
+ _write_minimal_cmap_font(font, 0x0041)
+ registry = tmp_path / "registry.json"
+ registry.write_text(
+ json.dumps(
+ {
+ "languages": [
+ {
+ "id": "fixture",
+ "scripts": [
+ {
+ "script": "Latin",
+ "primary": True,
+ "unicode_ranges": ["U+0042"],
+ }
+ ],
+ "font_candidates": [
+ {"name": "Fixture", "path": str(font), "status": "pending_render_audit"}
+ ],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(["audit-font-renderability", str(registry), "--out", str(tmp_path / "audit")])
+
+ captured = capsys.readouterr()
+ payload = json.loads((tmp_path / "audit" / "font-renderability-audit.json").read_text(encoding="utf-8"))
+ assert exit_code == 1
+ assert "passed=False" in captured.out
+ assert payload["errors"] == ["fixture:Latin: no font candidate covers at least 95.00% of required codepoints"]
+ assert payload["candidates"][0]["missing_sample"] == ["U+0042"]
+
+
+def _write_minimal_cmap_font(path: Path, codepoint: int) -> None:
+ seg_count = 2
+ end_codes = [codepoint, 0xFFFF]
+ start_codes = [codepoint, 0xFFFF]
+ id_deltas = [1, 1]
+ id_range_offsets = [0, 0]
+ subtable = b"".join(
+ [
+ struct.pack(">HHHHHHH", 4, 32, 0, seg_count * 2, 0, 0, 0),
+ struct.pack(">HH", *end_codes),
+ struct.pack(">H", 0),
+ struct.pack(">HH", *start_codes),
+ struct.pack(">hh", *id_deltas),
+ struct.pack(">HH", *id_range_offsets),
+ ]
+ )
+ cmap = struct.pack(">HHHHL", 0, 1, 3, 1, 12) + subtable
+ offset_table = struct.pack(">LHHHH", 0x00010000, 1, 0, 0, 0)
+ table_record = b"cmap" + struct.pack(">LLL", 0, len(offset_table) + 16, len(cmap))
+ path.write_bytes(offset_table + table_record + cmap)
diff --git a/tests/test_manifest.py b/tests/test_manifest.py
new file mode 100644
index 0000000000000000000000000000000000000000..965ac8fad96b9cd3b71d3ba04159b0a4fd9bd67f
--- /dev/null
+++ b/tests/test_manifest.py
@@ -0,0 +1,307 @@
+from __future__ import annotations
+
+import json
+import sys
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+
+from ocrtech.errors import DataValidationError
+from ocrtech.manifest import (
+ ManifestEntry,
+ inspect_hf_dataset,
+ load_manifest,
+ normalize_manifest_images,
+ prepare_hf_correction_pairs,
+ prepare_hf_dataset,
+ prepare_local_dataset,
+ read_jsonl,
+ sha256_file,
+ write_manifest,
+)
+
+
+def test_prepare_local_dataset_verifies_fields_and_images(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"fake image bytes")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline.png,नेपाल\n", encoding="utf-8")
+
+ report = prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train")
+ entries = load_manifest(report.manifest_path)
+
+ assert len(entries) == 1
+ assert entries[0].sample_id == "local-train-00000000"
+ assert entries[0].text == "नेपाल"
+ assert entries[0].sha256
+ assert report.rejected_count == 0
+
+
+def test_prepare_local_dataset_fails_on_missing_image(tmp_path: Path) -> None:
+ labels = tmp_path / "labels.jsonl"
+ labels.write_text(json.dumps({"image_path": "missing.png", "text": "नेपाल"}, ensure_ascii=False) + "\n", encoding="utf-8")
+
+ with pytest.raises(DataValidationError, match="image does not exist"):
+ prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train")
+
+
+def test_prepare_local_dataset_fails_on_missing_text_field(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"fake image bytes")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,caption\nline.png,नेपाल\n", encoding="utf-8")
+
+ with pytest.raises(DataValidationError, match="Could not infer text field"):
+ prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train")
+
+
+def test_prepare_local_dataset_fails_on_empty_text_value(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"fake image bytes")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline.png,\n", encoding="utf-8")
+
+ with pytest.raises(DataValidationError, match="text field 'text' is empty"):
+ prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train")
+
+
+def test_prepare_hf_prashant_dataset_downloads_only_needed_files(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ image = tmp_path / "line_00001.png"
+ image.write_bytes(b"fake image bytes")
+ metadata = tmp_path / "metadata.jsonl"
+ metadata.write_text(
+ '{"file_name":"line_00001.png","text":"नेपाल सरकार"}\n{"file_name":"line_99999.png","text":"unused"}\n',
+ encoding="utf-8",
+ )
+ requested_files: list[str] = []
+
+ monkeypatch.setattr(
+ "ocrtech.manifest._list_dataset_files",
+ lambda *args, **kwargs: ["train/metadata.jsonl", "train/line_00001.png", "train/line_99999.png"],
+ )
+
+ def fake_download(dataset_id: str, dataset_file: str) -> Path:
+ requested_files.append(dataset_file)
+ if dataset_file == "train/metadata.jsonl":
+ return metadata
+ if dataset_file == "train/line_00001.png":
+ return image
+ raise AssertionError(f"unexpected dataset download: {dataset_file}")
+
+ monkeypatch.setattr("ocrtech.manifest._download_dataset_file", fake_download)
+
+ report = prepare_hf_dataset(
+ "prashant0919/nepali-synthetic-ocr-lines",
+ tmp_path / "manifests",
+ split="train",
+ limit=1,
+ )
+ entries = load_manifest(report.manifest_path)
+
+ assert len(entries) == 1
+ assert entries[0].text == "नेपाल सरकार"
+ assert Path(entries[0].image_path) == image
+ assert requested_files == ["train/metadata.jsonl", "train/line_00001.png"]
+
+
+def test_prepare_hf_dataset_accepts_non_hashable_image_objects(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ class FakeImage:
+ __hash__ = None
+
+ def save(self, path: Path) -> None:
+ Path(path).write_bytes(b"fake image bytes")
+
+ fake_module = SimpleNamespace(
+ load_dataset=lambda dataset_id, split, streaming=False: [{"id": 7, "image": FakeImage(), "text": "नेपाल"}]
+ )
+ monkeypatch.setitem(sys.modules, "datasets", fake_module)
+
+ report = prepare_hf_dataset("gauravgiri/nepali-ocr-dataset", tmp_path / "manifests", split="train")
+ entries = load_manifest(report.manifest_path)
+
+ assert len(entries) == 1
+ assert entries[0].sample_id == "gauravgiri__nepali-ocr-dataset-train-7"
+ assert entries[0].text == "नेपाल"
+ assert Path(entries[0].image_path).exists()
+ assert "nepali" in entries[0].metadata["slices"]
+ assert "real" in entries[0].metadata["slices"]
+
+
+def test_prepare_local_dataset_can_stamp_slice_metadata(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"fake image bytes")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline.png,नेपाल\n", encoding="utf-8")
+
+ report = prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train", slices=["nepali", "real"])
+ entries = load_manifest(report.manifest_path)
+
+ assert entries[0].metadata["slices"] == ["nepali", "real"]
+
+
+def test_normalize_manifest_images_converts_unsupported_suffix_and_updates_hash(tmp_path: Path) -> None:
+ source = tmp_path / "line.img"
+ source.write_bytes(b"raw image bytes")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample:1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="नेपाल",
+ sha256=sha256_file(source),
+ metadata={"slices": ["nepali"]},
+ )
+ ],
+ manifest,
+ )
+
+ class FakeImage:
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc, tb) -> None:
+ return None
+
+ def save(self, target: Path, format: str) -> None:
+ assert format == "PNG"
+ target.write_bytes(b"converted png bytes")
+
+ fake_pil = SimpleNamespace(Image=SimpleNamespace(open=lambda path: FakeImage()))
+ monkeypatch = pytest.MonkeyPatch()
+ monkeypatch.setitem(sys.modules, "PIL", fake_pil)
+ try:
+ report = normalize_manifest_images(manifest, tmp_path / "normalized")
+ finally:
+ monkeypatch.undo()
+
+ entries = load_manifest(report.manifest_path)
+ normalized = Path(entries[0].image_path)
+
+ assert report.sample_count == 1
+ assert report.copied_count == 0
+ assert report.converted_count == 1
+ assert report.unsupported_suffixes == {".img": 1}
+ assert normalized.suffix == ".png"
+ assert normalized.exists()
+ assert entries[0].sha256 == sha256_file(normalized)
+ assert entries[0].metadata["source_image_path"] == str(source)
+ assert entries[0].metadata["image_normalization"] == "converted_to_png"
+
+
+def test_normalize_manifest_images_resolves_paths_relative_to_cwd_before_manifest_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ image = tmp_path / "assets" / "line.png"
+ image.parent.mkdir()
+ image.write_bytes(b"png")
+ manifest_dir = tmp_path / "manifests"
+ manifest_dir.mkdir()
+ manifest = manifest_dir / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path="assets/line.png",
+ text="नेपाल",
+ sha256=sha256_file(image),
+ )
+ ],
+ manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+
+ report = normalize_manifest_images(manifest, tmp_path / "normalized")
+ entries = load_manifest(report.manifest_path)
+
+ assert report.copied_count == 1
+ assert Path(entries[0].image_path).exists()
+ assert entries[0].metadata["source_image_path"] == "assets/line.png"
+
+
+def test_prepare_local_dataset_can_skip_invalid_rows_with_reject_report(tmp_path: Path) -> None:
+ first = tmp_path / "line-a.png"
+ second = tmp_path / "line-b.png"
+ first.write_bytes(b"line-a")
+ second.write_bytes(b"line-b")
+ labels = tmp_path / "labels.csv"
+ labels.write_text("image_path,text\nline-a.png,नेपाल\nline-b.png,\nmissing.png,English\n", encoding="utf-8")
+
+ report = prepare_local_dataset(labels, tmp_path / "manifests", dataset="local", split="train", skip_invalid=True)
+ entries = load_manifest(report.manifest_path)
+ rejects = list(read_jsonl(Path(report.rejects_path or "")))
+
+ assert len(entries) == 1
+ assert report.sample_count == 1
+ assert report.rejected_count == 2
+ assert len(rejects) == 2
+ assert "text field 'text' is empty" in rejects[0]["reason"]
+ assert "image does not exist" in rejects[1]["reason"]
+
+
+def test_prepare_hf_correction_pairs_cfilt(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ fake_module = SimpleNamespace(load_dataset=lambda dataset_id, split, streaming=False: [{"ocr": "गलत पाठ", "correct": "सही पाठ", "font": "Kalimati"}])
+ monkeypatch.setitem(sys.modules, "datasets", fake_module)
+
+ pairs_path = prepare_hf_correction_pairs("cfilt/RoundTripOCR-nepali", tmp_path / "pairs.jsonl", split="train")
+ rows = list(read_jsonl(pairs_path))
+
+ assert rows[0]["noisy_text"] == "गलत पाठ"
+ assert rows[0]["clean_text"] == "सही पाठ"
+ assert rows[0]["font"] == "Kalimati"
+
+
+def test_inspect_hf_dataset_records_schema_without_writing_manifest(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ class FakeImage:
+ size = (120, 24)
+ mode = "RGB"
+
+ def save(self, path: Path) -> None:
+ Path(path).write_bytes(b"fake image bytes")
+
+ fake_module = SimpleNamespace(
+ load_dataset=lambda dataset_id, split, streaming=False: [
+ {"id": 1, "image": FakeImage(), "text": "नेपाल"},
+ {"id": 2, "image": FakeImage(), "text": "English"},
+ ]
+ )
+ monkeypatch.setitem(sys.modules, "datasets", fake_module)
+
+ report = inspect_hf_dataset("fixture/hf-ocr", tmp_path / "inspect", split="train", limit=2)
+
+ assert report.passed is True
+ assert report.inspection_mode == "datasets.load_dataset"
+ assert report.fields == ["id", "image", "text"]
+ assert report.inferred_image_field == "image"
+ assert report.inferred_text_field == "text"
+ assert report.inspected_count == 2
+ assert report.samples[0]["image_supported_by_prepare"] is True
+ assert report.samples[0]["text_preview"] == "नेपाल"
+ assert Path(report.output_json_path or "").exists()
+ assert Path(report.output_md_path or "").exists()
+
+
+def test_inspect_hf_prashant_dataset_checks_metadata_files(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ metadata = tmp_path / "metadata.jsonl"
+ metadata.write_text(
+ '{"file_name":"line_00001.png","text":"नेपाल सरकार"}\n{"file_name":"line_99999.png","text":"छैन"}\n',
+ encoding="utf-8",
+ )
+
+ monkeypatch.setattr(
+ "ocrtech.manifest._list_dataset_files",
+ lambda *args, **kwargs: ["train/metadata.jsonl", "train/line_00001.png"],
+ )
+ monkeypatch.setattr("ocrtech.manifest._download_dataset_file", lambda dataset_id, dataset_file: metadata)
+
+ report = inspect_hf_dataset("prashant0919/nepali-synthetic-ocr-lines", tmp_path / "inspect", split="train", limit=2)
+
+ assert report.passed is False
+ assert report.inferred_image_field == "file_name"
+ assert report.inferred_text_field == "text"
+ assert report.samples[0]["image_exists_in_repo"] is True
+ assert report.samples[1]["image_exists_in_repo"] is False
+ assert "train/line_99999.png" in report.issues[0]
diff --git a/tests/test_models_candidate.py b/tests/test_models_candidate.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac503f2761ea53c86e005267b1d5f2d9234b4ba2
--- /dev/null
+++ b/tests/test_models_candidate.py
@@ -0,0 +1,2291 @@
+from __future__ import annotations
+
+import json
+import importlib.util
+import sys
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+
+from ocrtech.benchmark import run_benchmark
+from ocrtech.experiments import run_experiment
+from ocrtech.manifest import sha256_file
+from ocrtech.models import ModelCard, audit_model_card, component_baseline_names, inspect_routed_calibration_collapse, model_admission_status, trained_recognizer_provenance_status, write_model_card
+from ocrtech.pipeline import parse_document
+
+
+def test_model_card_audit_passes_for_existing_artifact(tmp_path: Path) -> None:
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-test",
+ backend="sidecar",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ notes="test model card",
+ )
+
+ audit = audit_model_card(card, tmp_path / "audit")
+
+ assert audit.passed
+ assert audit.model_id == "ocrtech-test"
+ assert (tmp_path / "audit" / "model-audit.json").exists()
+
+
+def test_model_card_records_and_checks_admission_validation(tmp_path: Path) -> None:
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ validation = tmp_path / "validation.json"
+ model_path = tmp_path / "model.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(model_path)}},
+ "gates": [_passing_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ card_path = write_model_card(
+ model_path,
+ model_id="ocrtech-admitted",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ admission_validation_report=validation,
+ )
+
+ card = ModelCard.from_path(card_path)
+ status = model_admission_status(card, card_path)
+
+ assert status.passed
+ assert card.metrics["admission_validation"]["sha256"]
+
+
+def test_model_admission_status_requires_quantitative_gate_evidence(tmp_path: Path) -> None:
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ validation = tmp_path / "validation.json"
+ model_path = tmp_path / "model.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(model_path)}},
+ "gates": [],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ card_path = write_model_card(
+ model_path,
+ model_id="ocrtech-admission-without-gates",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ admission_validation_report=validation,
+ )
+
+ status = model_admission_status(ModelCard.from_path(card_path), card_path)
+
+ assert not status.passed
+ assert "admission validation missing gates" in status.details
+
+
+def test_model_card_records_fallback_model_card_provenance(tmp_path: Path) -> None:
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ candidate = write_model_card(
+ tmp_path / "candidate.json",
+ model_id="ocrtech-candidate",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=fallback,
+ )
+
+ payload = json.loads(candidate.read_text(encoding="utf-8"))
+
+ assert payload["provenance"]["fallback_model_card"] == {
+ "path": str(fallback),
+ "sha256": sha256_file(fallback),
+ }
+
+
+def test_trained_recognizer_provenance_requires_training_summary(tmp_path: Path) -> None:
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ image = tmp_path / "line.png"
+ image.write_bytes(b"line")
+ row = {
+ "sample_id": "s1",
+ "dataset": "fixture",
+ "split": "train",
+ "image_path": str(image),
+ "text": "नेपाल",
+ }
+ train_manifest.write_text(json.dumps(row, ensure_ascii=False) + "\n", encoding="utf-8")
+ eval_manifest.write_text(json.dumps({**row, "split": "eval"}, ensure_ascii=False) + "\n", encoding="utf-8")
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ card_path = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-trained-missing-summary",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ )
+
+ status = trained_recognizer_provenance_status(ModelCard.from_path(card_path), card_path)
+
+ assert not status.passed
+ assert "trained recognizer missing training_summary path/sha256 provenance" in status.details
+
+
+def test_trained_recognizer_provenance_rejects_training_summary_hash_mismatch(tmp_path: Path) -> None:
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ image = tmp_path / "line.png"
+ image.write_bytes(b"line")
+ row = {
+ "sample_id": "s1",
+ "dataset": "fixture",
+ "split": "train",
+ "image_path": str(image),
+ "text": "नेपाल",
+ }
+ train_manifest.write_text(json.dumps(row, ensure_ascii=False) + "\n", encoding="utf-8")
+ eval_manifest.write_text(json.dumps({**row, "split": "eval"}, ensure_ascii=False) + "\n", encoding="utf-8")
+ training_summary.write_text('{"backend": "paddleocr", "epochs": 1}\n', encoding="utf-8")
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ card_path = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-trained-stale-summary",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ )
+ training_summary.write_text('{"backend": "paddleocr", "epochs": 2}\n', encoding="utf-8")
+
+ status = trained_recognizer_provenance_status(ModelCard.from_path(card_path), card_path)
+
+ assert not status.passed
+ assert any("trained recognizer training_summary sha256 mismatch" in detail for detail in status.details)
+
+
+def test_model_admission_status_fails_on_not_validated_report(tmp_path: Path) -> None:
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ validation = tmp_path / "validation.json"
+ model_path = tmp_path / "model.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "not_validated",
+ "passed": False,
+ "provenance": {"candidate_model_config": {"path": str(model_path)}},
+ "missing_requirements": ["gate failed: cer vs tesseract"],
+ "gates": [
+ {
+ "gate": {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "nepali",
+ },
+ "passed": False,
+ "pairs": 12,
+ "candidate_mean": 0.908108,
+ "baseline_mean": 0.235433,
+ "absolute_improvement": -0.672676,
+ "relative_improvement": -2.857191,
+ "win_count": 0,
+ "loss_count": 12,
+ "tie_count": 0,
+ "reason": "absolute improvement -0.672676 < required 0.0",
+ }
+ ],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ card_path = write_model_card(
+ model_path,
+ model_id="ocrtech-rejected",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ admission_validation_report=validation,
+ )
+
+ status = model_admission_status(ModelCard.from_path(card_path), card_path)
+
+ assert not status.passed
+ assert any("claim_status=not_validated" in detail for detail in status.details)
+ assert any("missing_requirement=gate failed: cer vs tesseract" in detail for detail in status.details)
+ assert any(
+ "failed_gate=cer baseline=tesseract slice=nepali" in detail
+ and "candidate_mean=0.908108" in detail
+ and "loss_count=12" in detail
+ for detail in status.details
+ )
+
+
+def test_model_admission_status_rejects_report_for_different_model(tmp_path: Path) -> None:
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ other_artifact = tmp_path / "other.pdiparams"
+ other_artifact.write_bytes(b"other weights")
+ other_model = write_model_card(
+ tmp_path / "other-model.json",
+ model_id="ocrtech-other",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[other_artifact],
+ backend_kwargs={"lang": "ne"},
+ )
+ validation = tmp_path / "validation.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(other_model)}},
+ "gates": [_passing_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ card_path = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-current",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne"},
+ admission_validation_report=validation,
+ )
+
+ status = model_admission_status(ModelCard.from_path(card_path), card_path)
+
+ assert not status.passed
+ assert any("model_id mismatch" in detail for detail in status.details)
+
+
+def test_model_card_audit_fails_for_missing_artifact(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-missing",
+ backend="sidecar",
+ base_model="fixture",
+ artifact_paths=[tmp_path / "missing.pdmodel"],
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert "required artifact missing" in audit.issues[0]
+
+
+def test_nested_model_kwargs_resolve_relative_paths_from_model_card(tmp_path: Path) -> None:
+ from ocrtech.engines import _resolve_model_kwargs
+
+ config_dir = tmp_path / "candidate"
+ config_dir.mkdir()
+ card_path = config_dir / "model.json"
+ artifacts = config_dir / "artifacts"
+ artifacts.mkdir()
+ card = write_model_card(
+ card_path,
+ model_id="ocrtech-nested-paths",
+ backend="script_select_composite",
+ base_model="fixture",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "paddleocr",
+ "secondary_engine_kwargs": {
+ "text_recognition_model_dir": "artifacts",
+ "metadata": {"dict_path": "artifacts/nep_eng_dict.txt"},
+ },
+ },
+ )
+
+ resolved = _resolve_model_kwargs(ModelCard.from_path(card), card)
+
+ secondary = resolved["secondary_engine_kwargs"]
+ assert isinstance(secondary, dict)
+ assert secondary["text_recognition_model_dir"] == str(artifacts)
+ metadata = secondary["metadata"]
+ assert isinstance(metadata, dict)
+ assert metadata["dict_path"] == str(artifacts / "nep_eng_dict.txt")
+
+
+def test_paddle_candidate_requires_recorded_artifact(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-no-artifacts",
+ backend="paddleocr",
+ base_model="fixture",
+ paddleocr_kwargs={"lang": "devanagari"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert "requires at least one recorded artifact" in audit.issues[0]
+
+
+def test_hf_candidate_requires_recorded_artifact(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-hf-no-artifacts",
+ backend="hf_vision_encoder_decoder",
+ base_model="microsoft/trocr-small-printed",
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert "requires at least one recorded artifact" in audit.issues[0]
+
+
+def test_tesseract_candidate_audit_passes_without_artifacts(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-tess",
+ backend="tesseract",
+ base_model="tesseract-ocr",
+ backend_kwargs={"language": "nep+eng", "psm": 7},
+ )
+
+ audit = audit_model_card(card)
+
+ assert audit.passed
+ assert audit.backend == "tesseract"
+
+
+def test_surya_candidate_audit_passes_without_artifacts(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-surya",
+ backend="surya",
+ base_model="datalab-to/surya-ocr-2",
+ backend_kwargs={"mode": "block"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert audit.passed
+ assert audit.backend == "surya"
+
+
+def test_quality_select_candidate_audit_requires_named_engines(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-router",
+ backend="quality_select_composite",
+ base_model="tesseract-ocr",
+ backend_kwargs={"primary_engine": "tesseract"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert any("secondary_engine" in issue for issue in audit.issues)
+
+
+def test_quality_ranked_ensemble_audit_requires_alternatives(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-ensemble",
+ backend="quality_ranked_ensemble",
+ base_model="tesseract-ocr",
+ backend_kwargs={"primary_engine": "tesseract"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert any("alternative_engines" in issue for issue in audit.issues)
+
+
+def test_script_select_candidate_audit_requires_named_engines(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert any("secondary_engine" in issue for issue in audit.issues)
+
+
+def test_line_align_candidate_audit_requires_named_engines(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-line-align",
+ backend="line_align_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={"primary_engine": "surya"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert any("secondary_engine" in issue for issue in audit.issues)
+
+
+def test_table_cell_refine_candidate_audit_passes_with_defaults(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-table-refine",
+ backend="table_cell_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={"structure_engine": "surya", "crop_engine": "tesseract"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert audit.passed
+ assert audit.backend == "table_cell_refine_composite"
+
+
+def test_table_cell_refine_audit_requires_candidate_crop_model_config(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-table-refine-candidate-missing-config",
+ backend="table_cell_refine_composite",
+ base_model="surya+trained-candidate",
+ backend_kwargs={"structure_engine": "surya", "crop_engine": "candidate"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert "table_cell_refine_composite crop_engine=candidate requires backend_kwargs.crop_engine_kwargs.model_config" in audit.issues
+
+
+def test_figure_caption_refine_candidate_audit_passes_with_defaults(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={"primary_engine": "surya", "caption_engine": "tesseract"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert audit.passed
+ assert audit.backend == "figure_caption_refine_composite"
+
+
+def test_figure_caption_refine_audit_requires_candidate_caption_model_config(tmp_path: Path) -> None:
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-candidate-missing-config",
+ backend="figure_caption_refine_composite",
+ base_model="surya+trained-candidate",
+ backend_kwargs={"primary_engine": "surya", "caption_engine": "candidate"},
+ )
+
+ audit = audit_model_card(card)
+
+ assert not audit.passed
+ assert "figure_caption_refine_composite caption_engine=candidate requires backend_kwargs.caption_engine_kwargs.model_config" in audit.issues
+
+
+def test_component_baseline_names_normalizes_component_engines(tmp_path: Path) -> None:
+ card = ModelCard.from_path(
+ write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-ensemble",
+ backend="quality_ranked_ensemble",
+ base_model="tesseract+paddle",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "alternative_engines": [
+ {"engine": "paddleocr", "bias": 0.1},
+ {"engine": "surya", "bias": 0.2},
+ ],
+ },
+ )
+ )
+
+ names = component_baseline_names(card)
+
+ assert names == ["stock-paddle", "surya", "tesseract"]
+
+
+def test_inspect_routed_calibration_collapse_accepts_repo_relative_metrics_report(tmp_path: Path, monkeypatch) -> None:
+ monkeypatch.chdir(tmp_path)
+ report = tmp_path / "outputs" / "script-router" / "calibration.json"
+ report.parent.mkdir(parents=True)
+ report.write_text(
+ '{"selected_threshold":0.0,"metric":"cer","selected_trial":{"pairs":5,"secondary_picks":5}}' + "\n",
+ encoding="utf-8",
+ )
+ model_dir = tmp_path / "models"
+ model_dir.mkdir()
+ card = write_model_card(
+ model_dir / "model.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "surya", "primary_script_threshold": 0.0},
+ metrics_report=Path("outputs/script-router/calibration.json"),
+ )
+
+ reason, details = inspect_routed_calibration_collapse(ModelCard.from_path(card), card)
+
+ assert reason is not None
+ assert "collapses to the secondary engine" in reason
+ assert any("report=" in item for item in details)
+
+
+def test_candidate_engine_uses_explicit_model_config(tmp_path: Path) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text("नेपाल सरकार\nhello world\n", encoding="utf-8")
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["model_id"] == "ocrtech-sidecar"
+ assert document.metadata["quality"]["passed"]
+
+
+def test_candidate_engine_supports_hf_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ model_dir = tmp_path / "model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-hf",
+ backend="hf_vision_encoder_decoder",
+ base_model="microsoft/trocr-small-printed",
+ artifact_paths=[model_dir],
+ backend_kwargs={"model_dir": str(model_dir), "processor_dir": str(model_dir)},
+ )
+
+ class FakeEngine:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[TextLine(text="नेपाल", bbox=BBox(0, 0, 10, 10), confidence=None, page_index=0, line_id="p0-l0")])])
+
+ monkeypatch.setattr("ocrtech.engines.HuggingFaceVisionTextEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "hf_vision_encoder_decoder"
+ assert document.text == "नेपाल"
+
+
+def test_candidate_engine_supports_tesseract_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-tess",
+ backend="tesseract",
+ base_model="tesseract-ocr",
+ backend_kwargs={"language": "nep+eng", "psm": 7},
+ )
+
+ class FakeEngine:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[TextLine(text="नेपाल", bbox=BBox(0, 0, 10, 10), confidence=0.95, page_index=0, line_id="p0-l0")])])
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "tesseract"
+ assert document.text == "नेपाल"
+
+
+def test_candidate_engine_supports_surya_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-surya",
+ backend="surya",
+ base_model="datalab-to/surya-ocr-2",
+ backend_kwargs={"mode": "block"},
+ )
+
+ class FakeEngine:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[TextLine(text="नेपाल", bbox=BBox(0, 0, 10, 10), confidence=0.91, page_index=0, line_id="p0-l0")],
+ metadata={"surya_mode": "block"},
+ )
+ ],
+ metadata={"surya_mode": "block"},
+ )
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "surya"
+ assert document.text == "नेपाल"
+
+
+def test_surya_engine_converts_table_html_to_structured_table() -> None:
+ from ocrtech.engines import SuryaEngine
+
+ engine = object.__new__(SuryaEngine)
+ page_result = SimpleNamespace(
+ blocks=[
+ SimpleNamespace(
+ polygon=[[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0]],
+ confidence=0.88,
+ label="Table",
+ raw_label="Table",
+ reading_order=0,
+ html="",
+ skipped=False,
+ error=False,
+ ),
+ SimpleNamespace(
+ polygon=[[0.0, 70.0], [120.0, 70.0], [120.0, 90.0], [0.0, 90.0]],
+ confidence=0.93,
+ label="Text",
+ raw_label="Text",
+ reading_order=1,
+ html="नेपाल सरकार
",
+ skipped=False,
+ error=False,
+ ),
+ ]
+ )
+ table_result = SimpleNamespace(
+ html="",
+ mode="full",
+ error=False,
+ rows=[],
+ cols=[],
+ )
+
+ output = engine._convert_page_result(page_result, 120, 90, "full_page", page_index=0, table_results={0: table_result})
+
+ assert len(output.tables) == 1
+ assert output.tables[0].html.startswith("")
+ assert [cell.text for cell in output.tables[0].cells] == ["नाम", "उमेर", "राम", "३२"]
+ assert output.tables[0].metadata["surya_table_mode"] == "full"
+ assert output.pages[0].text_lines[0].text == "नेपाल सरकार"
+
+
+def test_candidate_engine_supports_text_correction_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ model_dir = tmp_path / "model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-corrected",
+ backend="text_correction_composite",
+ base_model="google/byt5-small",
+ artifact_paths=[model_dir],
+ backend_kwargs={"model_dir": str(model_dir), "tokenizer_dir": str(model_dir), "base_engine": "tesseract"},
+ )
+
+ class FakeEngine:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[TextLine(text="सही पाठ", bbox=BBox(0, 0, 10, 10), confidence=0.9, page_index=0, line_id="p0-l0")])])
+
+ monkeypatch.setattr("ocrtech.engines.TextCorrectionCompositeEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "text_correction_composite"
+ assert document.text == "सही पाठ"
+
+
+def test_candidate_engine_supports_quality_select_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-router",
+ backend="quality_select_composite",
+ base_model="tesseract-ocr",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "tesseract",
+ "primary_engine_kwargs": {"psm": 6},
+ "secondary_engine_kwargs": {"psm": 13},
+ "secondary_quality_margin": 0.02,
+ },
+ )
+
+ class FakeEngine:
+ def __init__(self, *, psm: int, **kwargs):
+ self.name = f"tesseract-psm-{psm}"
+ self.psm = psm
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ confidence = 0.80 if self.psm == 6 else 1.0
+ text = "default" if self.psm == 6 else "routed"
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text=text, bbox=BBox(0, 0, 10, 10), confidence=confidence, page_index=0, line_id="p0-l0")])],
+ metadata={"psm": self.psm},
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "quality_select_composite"
+ assert document.text == "routed"
+ routing = document.metadata["quality_select_composite"]
+ assert routing["chosen_engine"] == "tesseract-psm-13"
+ assert routing["secondary_quality_score"] > routing["primary_quality_score"]
+
+
+def test_candidate_engine_supports_quality_ranked_ensemble_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-ensemble",
+ backend="quality_ranked_ensemble",
+ base_model="tesseract-ocr",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "primary_engine_kwargs": {"psm": 6},
+ "alternative_engines": [
+ {"label": "psm7", "engine": "tesseract", "engine_kwargs": {"psm": 7}, "quality_bias": -0.05},
+ {"label": "psm13", "engine": "tesseract", "engine_kwargs": {"psm": 13}, "quality_bias": 0.05},
+ ],
+ },
+ )
+
+ class FakeEngine:
+ def __init__(self, *, psm: int, **kwargs):
+ self.name = f"tesseract-psm-{psm}"
+ self.psm = psm
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ confidence = {6: 0.8, 7: 0.7, 13: 0.85}[self.psm]
+ text = {6: "base", 7: "alt7", 13: "alt13"}[self.psm]
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text=text, bbox=BBox(0, 0, 10, 10), confidence=confidence, page_index=0, line_id="p0-l0")])],
+ metadata={"psm": self.psm},
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeEngine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "quality_ranked_ensemble"
+ assert document.text == "alt13"
+ routing = document.metadata["quality_ranked_ensemble"]
+ assert routing["chosen_engine"] == "psm13"
+
+
+def test_candidate_engine_supports_script_select_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "surya",
+ "primary_script_threshold": 0.2,
+ },
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="नेपाल सरकार", bbox=BBox(0, 0, 10, 10), confidence=0.9, page_index=0, line_id="p0-l0")])],
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="राउट गरिएको", bbox=BBox(0, 0, 10, 10), confidence=0.92, page_index=0, line_id="p0-l0")])],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "script_select_composite"
+ assert document.text == "राउट गरिएको"
+ routing = document.metadata["script_select_composite"]
+ assert routing["chosen_engine"] == "surya"
+
+
+def test_candidate_engine_supports_script_select_composite_latin_routing(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router-latin",
+ backend="script_select_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "secondary_engine": "tesseract",
+ "script": "latin",
+ "primary_script_threshold": 0.2,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="Invoice Total", bbox=BBox(0, 0, 10, 10), confidence=0.7, page_index=0, line_id="p0-l0")])],
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="Better English OCR", bbox=BBox(0, 0, 10, 10), confidence=0.95, page_index=0, line_id="p0-l0")])],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "script_select_composite"
+ assert document.text == "Better English OCR"
+ routing = document.metadata["script_select_composite"]
+ assert routing["chosen_engine"] == "tesseract"
+
+
+def test_candidate_engine_supports_script_select_composite_page_routing(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router-page",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "surya",
+ "primary_script_threshold": 0.2,
+ "routing_granularity": "page",
+ },
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(page_index=0, text_lines=[TextLine(text="Invoice Total", bbox=BBox(0, 0, 10, 10), confidence=0.97, page_index=0, line_id="p0-l0")]),
+ Page(page_index=1, text_lines=[TextLine(text="नेपाल सरकार", bbox=BBox(0, 20, 10, 10), confidence=0.91, page_index=1, line_id="p1-l0")]),
+ ],
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(page_index=0, text_lines=[TextLine(text="Wrong Page", bbox=BBox(0, 0, 10, 10), confidence=0.3, page_index=0, line_id="p0-l0")]),
+ Page(page_index=1, text_lines=[TextLine(text="राउट गरिएको", bbox=BBox(0, 20, 10, 10), confidence=0.95, page_index=1, line_id="p1-l0")]),
+ ],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "script_select_composite"
+ assert document.pages[0].blocks[0].text == "Invoice Total"
+ assert document.pages[1].blocks[0].text == "राउट गरिएको"
+ routing = document.metadata["script_select_composite"]
+ assert routing["chosen_engine"] == "mixed"
+ assert routing["routing_granularity"] == "page"
+ assert routing["selected_page_indexes"] == [0, 1]
+ assert routing["page_routing"][0]["chosen_engine"] == "tesseract"
+ assert routing["page_routing"][1]["chosen_engine"] == "surya"
+
+
+def test_candidate_engine_supports_script_select_composite_line_routing(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router-line",
+ backend="script_select_composite",
+ base_model="tesseract+nepali-recognizer",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "surya",
+ "primary_script_threshold": 0.2,
+ "routing_granularity": "line",
+ },
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="Invoice Total", bbox=BBox(0, 0, 100, 20), confidence=0.97, page_index=0, line_id="p0-l0"),
+ TextLine(text="नेपाल सरकार", bbox=BBox(0, 30, 100, 20), confidence=0.45, page_index=0, line_id="p0-l1"),
+ ],
+ )
+ ],
+ )
+
+ class FakeSecondary:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="Wrong English", bbox=BBox(0, 0, 100, 20), confidence=0.30, page_index=0, line_id="s0"),
+ TextLine(text="नेपाल सरकार", bbox=BBox(0, 30, 100, 20), confidence=0.95, page_index=0, line_id="s1"),
+ ],
+ )
+ ],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSecondary)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "script_select_composite"
+ assert document.text.splitlines() == ["Invoice Total", "नेपाल सरकार"]
+ routing = document.metadata["script_select_composite"]
+ assert routing["chosen_engine"] == "mixed"
+ assert routing["routing_granularity"] == "line"
+ assert routing["secondary_line_count"] == 1
+ assert routing["line_routing"][0]["chosen_engine"] == "tesseract"
+ assert routing["line_routing"][1]["chosen_engine"] == "surya"
+
+
+def test_script_select_composite_can_backfill_secondary_structure(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router-backfill",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={
+ "primary_engine": "tesseract",
+ "secondary_engine": "surya",
+ "primary_script_threshold": 0.9,
+ "secondary_structure_backfill": True,
+ },
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="Invoice Total", bbox=BBox(0, 0, 10, 10), confidence=0.95, page_index=0, line_id="p0-l0")])],
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="ignored", bbox=BBox(0, 0, 10, 10), confidence=0.8, page_index=0, line_id="p0-l0")])],
+ tables=[
+ Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 50),
+ cells=[TableCell(row=0, col=0, text="Item"), TableCell(row=1, col=0, text="Masks")],
+ )
+ ],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.text == "Invoice Total"
+ assert len(document.tables) == 1
+ routing = document.metadata["script_select_composite"]
+ assert routing["chosen_engine"] == "tesseract"
+ assert routing["secondary_structure_backfill"] is True
+ assert document.metadata["structure_backfill"]["secondary_tables_pages"] == [0]
+
+
+def test_candidate_engine_supports_line_align_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake-png")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-line-align",
+ backend="line_align_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "secondary_engine": "tesseract",
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="दोस्रो", bbox=BBox(0, 20, 40, 10), confidence=0.95, page_index=0, line_id="p0-l-surya-1"),
+ TextLine(text="पहिलो", bbox=BBox(0, 0, 40, 10), confidence=0.96, page_index=0, line_id="p0-l-surya-0"),
+ ],
+ )
+ ],
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="wrong one", bbox=BBox(0, 0, 40, 10), confidence=0.5, page_index=0, line_id="p0-l0"),
+ TextLine(text="wrong two", bbox=BBox(0, 20, 40, 10), confidence=0.5, page_index=0, line_id="p0-l1"),
+ ],
+ )
+ ],
+ )
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "line_align_composite"
+ assert document.pages[0].text_lines[0].text == "पहिलो"
+ assert document.pages[0].text_lines[0].line_id == "p0-l0"
+ assert document.pages[0].text_lines[1].text == "दोस्रो"
+ assert document.text == "पहिलो\nदोस्रो"
+ alignment = document.metadata["line_align_composite"]
+ assert alignment["primary_engine"] == "surya"
+ assert alignment["secondary_engine"] == "tesseract"
+ assert alignment["matched_line_count"] == 2
+
+
+def test_candidate_engine_supports_table_cell_refine_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ from PIL import Image
+
+ source = tmp_path / "page.png"
+ Image.new("RGB", (120, 80), "white").save(source)
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-table-refine",
+ backend="table_cell_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "structure_engine": "surya",
+ "crop_engine": "tesseract",
+ "crop_padding": 0,
+ "replacement_policy": "always",
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 10, 80, 40),
+ cells=[
+ TableCell(row=0, col=0, text="old-a"),
+ TableCell(row=0, col=1, text="old-b"),
+ ],
+ )
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="old-a old-b", bbox=BBox(10, 10, 80, 20), page_index=0)])],
+ tables=[table],
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+ calls: list[Path] = []
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ self.calls.append(input_path)
+ text = "new-a" if len(self.calls) == 1 else "new-b"
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[TextLine(text=text, bbox=BBox(0, 0, 10, 10), page_index=0)])])
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "table_cell_refine_composite"
+ assert [cell.text for cell in document.tables[0].cells] == ["new-a", "new-b"]
+ refine = document.metadata["table_cell_refine_composite"]
+ assert refine["attempted_cells"] == 2
+ assert refine["replaced_cells"] == 2
+ assert document.tables[0].metadata["table_cell_refine"]["attempted_cells"] == 2
+
+
+def test_table_cell_refine_supports_candidate_crop_engine(tmp_path: Path, monkeypatch) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ from PIL import Image
+
+ source = tmp_path / "page.png"
+ Image.new("RGB", (120, 80), "white").save(source)
+ leaf_card = write_model_card(
+ tmp_path / "leaf-crop.json",
+ model_id="ocrtech-leaf-crop",
+ backend="sidecar",
+ base_model="fixture",
+ )
+ card = write_model_card(
+ tmp_path / "composite.json",
+ model_id="ocrtech-table-refine-candidate-crop",
+ backend="table_cell_refine_composite",
+ base_model="surya+trained-candidate",
+ backend_kwargs={
+ "structure_engine": "surya",
+ "crop_engine": "candidate",
+ "crop_engine_kwargs": {"model_config": leaf_card.name},
+ "crop_padding": 0,
+ "replacement_policy": "always",
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 10, 80, 40),
+ cells=[TableCell(row=0, col=0, text="old")],
+ )
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="old", bbox=BBox(10, 10, 80, 20), page_index=0)])],
+ tables=[table],
+ )
+
+ class FakeCandidate:
+ name = "candidate"
+ seen_model_config: Path | None = None
+
+ def __init__(self, *, model_config: str | Path):
+ self.seen_model_config = Path(model_config)
+ FakeCandidate.seen_model_config = self.seen_model_config
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[TextLine(text="trained", bbox=BBox(0, 0, 10, 10), page_index=0)])])
+
+ def fake_create_engine(name: str, **kwargs: object):
+ if name == "surya":
+ return FakeSurya(**kwargs)
+ if name == "candidate":
+ return FakeCandidate(**kwargs)
+ raise AssertionError(f"unexpected engine request: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr("ocrtech.engines.create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert FakeCandidate.seen_model_config == leaf_card
+ assert document.tables[0].cells[0].text == "trained"
+ assert document.metadata["table_cell_refine_composite"]["crop_engine"] == "candidate"
+
+
+def test_table_cell_refine_can_deduplicate_overlapping_tables(tmp_path: Path, monkeypatch) -> None:
+ if importlib.util.find_spec("PIL") is None:
+ pytest.skip("Pillow not installed in local test environment")
+ from PIL import Image
+
+ source = tmp_path / "page.png"
+ Image.new("RGB", (120, 80), "white").save(source)
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-table-refine-dedup",
+ backend="table_cell_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "structure_engine": "surya",
+ "crop_engine": "tesseract",
+ "replacement_policy": "empty",
+ "deduplicate_tables": True,
+ "duplicate_iou_threshold": 0.9,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell
+
+ good = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 10, 80, 40),
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=0, col=1, text="रकम"),
+ TableCell(row=1, col=0, text="किरण"),
+ TableCell(row=1, col=1, text="२१००"),
+ ],
+ )
+ collapsed = Table(
+ table_id="p0-t1",
+ page_index=0,
+ bbox=BBox(10, 10, 80, 40),
+ cells=[TableCell(row=0, col=0, text="नामरकमकिरण२१००")],
+ )
+ return EngineOutput(pages=[Page(page_index=0)], tables=[collapsed, good])
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ raise AssertionError("non-empty cells should not be reread with replacement_policy=empty")
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert len(document.tables) == 1
+ assert [cell.text for cell in document.tables[0].cells] == ["नाम", "रकम", "किरण", "२१००"]
+ assert document.metadata["table_cell_refine_composite"]["dropped_duplicate_tables"] == 1
+
+
+def test_candidate_engine_supports_figure_caption_refine_composite_backend(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ lexicon_path = tmp_path / "names.txt"
+ lexicon_path.write_text("किरण\nमाया\nसीता\nराम\n", encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "min_caption_iou": 0.5,
+ "min_score_delta": 1,
+ "correct_structural_labels": True,
+ "table_name_lexicon_path": str(lexicon_path),
+ "table_name_max_distance": 2,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ lines = [
+ TextLine(text="वार्षिक प्रतिदिन", bbox=BBox(10, 0, 220, 8), confidence=0.9, page_index=0),
+ TextLine(text="[Figure: revenue chart]", bbox=BBox(10, 10, 250, 30), confidence=0.9, page_index=0),
+ TextLine(text="चतुर्थ १: Revenue growth from 2021 to 2025.", bbox=BBox(10, 50, 500, 30), confidence=0.9, page_index=0),
+ TextLine(text="नष्कर्षः अन्तिम दुई वर्षमा वृद्धि भएको छ।", bbox=BBox(10, 90, 500, 30), confidence=0.9, page_index=0),
+ ]
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 140, 300, 60),
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=0, col=1, text="रकम"),
+ TableCell(row=1, col=0, text="करिण"),
+ TableCell(row=1, col=1, text="२१००"),
+ ],
+ )
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], tables=[table], metadata={"engine": "surya"})
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ lines = [
+ TextLine(text="वार्षिक प्रतविदन", bbox=BBox(10, 0, 220, 8), confidence=0.8, page_index=0),
+ TextLine(text="[Figure: revenue chart]", bbox=BBox(10, 10, 250, 30), confidence=0.8, page_index=0),
+ TextLine(text="चत्रि १: Revenue growth from 2021 to 2025.", bbox=BBox(10, 38, 500, 42), confidence=0.8, page_index=0),
+ TextLine(text="नष्कर्षः अन्तिम दुई वर्षमा वृद्धि भएको छ।", bbox=BBox(10, 90, 500, 30), confidence=0.8, page_index=0),
+ ]
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.metadata["candidate_model"]["backend"] == "figure_caption_refine_composite"
+ assert document.metadata["figure_caption_refine_composite"]["replaced_captions"] == 1
+ assert document.figures[0].caption == "चित्र १: Revenue growth from 2021 to 2025."
+ assert document.figures[0].metadata["line_ids"] == ["p0-l1", "p0-l2"]
+ assert document.pages[0].text_lines[0].text == "वार्षिक प्रतिवेदन"
+ assert document.pages[0].text_lines[2].metadata["figure_caption_refine"]["original_text"].startswith("चतुर्थ")
+ assert document.pages[0].text_lines[2].metadata["structural_label_correction"]["corrected_text"].startswith("चित्र")
+ assert document.pages[0].text_lines[3].text.startswith("निष्कर्ष:")
+ assert [cell.text for cell in document.tables[0].cells] == ["नाम", "रकम", "किरण", "२१००"]
+ assert document.metadata["figure_caption_refine_composite"]["table_name_corrections"] == 1
+
+
+def test_figure_caption_refine_supports_candidate_caption_engine(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ leaf_card = write_model_card(
+ tmp_path / "leaf-caption.json",
+ model_id="ocrtech-leaf-caption",
+ backend="sidecar",
+ base_model="fixture",
+ )
+ card = write_model_card(
+ tmp_path / "composite.json",
+ model_id="ocrtech-figure-caption-candidate",
+ backend="figure_caption_refine_composite",
+ base_model="surya+trained-candidate",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "candidate",
+ "caption_engine_kwargs": {"model_config": leaf_card.name},
+ "min_caption_iou": 0.5,
+ "min_score_delta": 1,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ lines = [
+ TextLine(text="[Figure: revenue chart]", bbox=BBox(10, 10, 250, 30), confidence=0.9, page_index=0),
+ TextLine(text="चतुर्थ १: Revenue growth.", bbox=BBox(10, 50, 500, 30), confidence=0.9, page_index=0),
+ ]
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], metadata={"engine": "surya"})
+
+ class FakeCandidate:
+ name = "candidate"
+ seen_model_config: Path | None = None
+
+ def __init__(self, *, model_config: str | Path):
+ self.seen_model_config = Path(model_config)
+ FakeCandidate.seen_model_config = self.seen_model_config
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ lines = [
+ TextLine(text="[Figure: revenue chart]", bbox=BBox(10, 10, 250, 30), confidence=0.8, page_index=0),
+ TextLine(text="चित्र १: Revenue growth.", bbox=BBox(10, 50, 500, 30), confidence=0.8, page_index=0),
+ ]
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], metadata={"engine": "candidate"})
+
+ def fake_create_engine(name: str, **kwargs: object):
+ if name == "surya":
+ return FakeSurya(**kwargs)
+ if name == "candidate":
+ return FakeCandidate(**kwargs)
+ raise AssertionError(f"unexpected engine request: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr("ocrtech.engines.create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert FakeCandidate.seen_model_config == leaf_card
+ assert document.metadata["figure_caption_refine_composite"]["caption_engine"] == "candidate"
+ assert document.metadata["figure_caption_refine_composite"]["replaced_captions"] == 1
+ assert document.figures[0].caption == "चित्र १: Revenue growth."
+
+
+def test_figure_caption_refine_corrects_daily_ledger_structural_title(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-daily-ledger",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "correct_structural_labels": True,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="दैनकि हसिाब", bbox=BBox(10, 0, 220, 20), confidence=0.9, page_index=0),
+ ],
+ )
+ ],
+ metadata={"engine": "surya"},
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(text="दैनकि हसिाब", bbox=BBox(10, 0, 220, 20), confidence=0.8, page_index=0),
+ ],
+ )
+ ],
+ metadata={"engine": "tesseract"},
+ )
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.pages[0].text_lines[0].text == "दैनिक हिसाब"
+ assert document.pages[0].text_lines[0].metadata["structural_label_correction"] == {
+ "original_text": "दैनकि हसिाब",
+ "corrected_text": "दैनिक हिसाब",
+ }
+ assert document.text == "दैनिक हिसाब"
+
+
+def test_figure_caption_refine_preserves_table_name_suffix_when_using_lexicon(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ lexicon_path = tmp_path / "names.txt"
+ lexicon_path.write_text("किरण\nमाया\n", encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-suffixed-name",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "table_name_lexicon_path": str(lexicon_path),
+ "table_name_max_distance": 2,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 40, 300, 60),
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=0, col=1, text="रकम"),
+ TableCell(row=1, col=0, text="करिण-302"),
+ TableCell(row=1, col=1, text="२१००"),
+ TableCell(row=2, col=0, text="माया-302"),
+ TableCell(row=2, col=1, text="२९००"),
+ ],
+ )
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="दैनिक हिसाब", bbox=BBox(10, 0, 200, 20), page_index=0)])],
+ tables=[table],
+ metadata={"engine": "surya"},
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(pages=[], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert [cell.text for cell in document.tables[0].cells] == ["नाम", "रकम", "किरण-302", "२१००", "माया-302", "२९००"]
+ assert document.metadata["figure_caption_refine_composite"]["table_name_corrections"] == 1
+
+
+def test_figure_caption_refine_corrects_name_cells_below_grouped_header(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ lexicon_path = tmp_path / "names.txt"
+ lexicon_path.write_text("किरण\nमाया\n", encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-grouped-header-name",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "table_name_lexicon_path": str(lexicon_path),
+ "table_name_max_distance": 2,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 40, 300, 120),
+ cells=[
+ TableCell(row=0, col=0, text="Ledger Summary", colspan=2),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ TableCell(row=2, col=0, text="करिण-302"),
+ TableCell(row=2, col=1, text="२१००"),
+ TableCell(row=2, col=2, text="Paid"),
+ ],
+ )
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="समेकित हिसाब", bbox=BBox(10, 0, 200, 20), page_index=0)])],
+ tables=[table],
+ metadata={"engine": "surya"},
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(pages=[], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert [cell.text for cell in document.tables[0].cells if cell.col == 0] == ["Ledger Summary", "नाम", "किरण-302"]
+ assert document.metadata["figure_caption_refine_composite"]["table_name_corrections"] == 1
+
+
+def test_figure_caption_refine_infers_flat_repeated_header_colspan(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-infer-colspan",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "infer_table_header_colspans": True,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell, TextLine
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 40, 300, 120),
+ cells=[
+ TableCell(row=0, col=0, text="Ledger Summary"),
+ TableCell(row=0, col=1, text="Ledger Summary"),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ],
+ )
+ return EngineOutput(
+ pages=[Page(page_index=0, text_lines=[TextLine(text="समेकित हिसाब", bbox=BBox(10, 0, 200, 20), page_index=0)])],
+ tables=[table],
+ metadata={"engine": "surya"},
+ )
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(pages=[], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert document.tables[0].cells[0].text == "Ledger Summary"
+ assert document.tables[0].cells[0].colspan == 2
+ assert len(document.tables[0].cells) == 5
+ assert 'colspan="2"' in document.tables[0].html
+ assert document.metadata["figure_caption_refine_composite"]["inferred_table_header_colspans"] == 1
+
+
+def test_figure_caption_refine_normalizes_separator_and_duplicate_table_columns(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-normalize-grid",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "normalize_table_grids": True,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 40, 300, 120),
+ cells=[
+ TableCell(row=0, col=0, text="—"),
+ TableCell(row=0, col=1, text="Skull cap"),
+ TableCell(row=0, col=2, text="1D"),
+ TableCell(row=0, col=3, text="1D"),
+ TableCell(row=1, col=0, text="—"),
+ TableCell(row=1, col=1, text="Helmet"),
+ TableCell(row=1, col=2, text="2D"),
+ TableCell(row=1, col=3, text="2D"),
+ ],
+ )
+ return EngineOutput(pages=[Page(page_index=0)], tables=[table], metadata={"engine": "surya"})
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(pages=[], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert [cell.text for cell in document.tables[0].cells] == ["Skull cap", "1D", "Helmet", "2D"]
+ assert document.metadata["figure_caption_refine_composite"]["normalized_table_grid_dropped_columns"] == 2
+ assert document.metadata["figure_caption_refine_composite"]["normalized_table_grid_merged_rows"] == 0
+ assert document.tables[0].metadata["normalized_table_grid_dropped_columns"] == 2
+
+
+def test_figure_caption_refine_merges_sparse_bullet_table_rows(tmp_path: Path, monkeypatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-figure-caption-refine-normalize-row-fragments",
+ backend="figure_caption_refine_composite",
+ base_model="surya+tesseract",
+ backend_kwargs={
+ "primary_engine": "surya",
+ "caption_engine": "tesseract",
+ "normalize_table_grids": True,
+ },
+ )
+
+ class FakeSurya:
+ name = "surya"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, Table, TableCell
+
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(10, 40, 300, 120),
+ cells=[
+ TableCell(row=0, col=0, text="Type of Anomaly"),
+ TableCell(row=0, col=1, text="Variant"),
+ TableCell(row=0, col=2, text="Type"),
+ TableCell(row=1, col=0, text=""),
+ TableCell(row=1, col=1, text="Coronaries originating"),
+ TableCell(row=1, col=2, text="- left main"),
+ TableCell(row=2, col=0, text="- right coronary"),
+ TableCell(row=2, col=1, text=""),
+ TableCell(row=2, col=2, text=""),
+ ],
+ )
+ return EngineOutput(pages=[Page(page_index=0)], tables=[table], metadata={"engine": "surya"})
+
+ class FakeTesseract:
+ name = "tesseract"
+
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(pages=[], metadata={"engine": "tesseract"})
+
+ monkeypatch.setattr("ocrtech.engines.SuryaEngine", FakeSurya)
+ monkeypatch.setattr("ocrtech.engines.TesseractEngine", FakeTesseract)
+
+ document = parse_document(source, tmp_path / "out", engine_name="candidate", model_config=card)
+
+ assert [cell.text for cell in document.tables[0].cells] == [
+ "Type of Anomaly",
+ "Variant",
+ "Type",
+ "",
+ "Coronaries originating",
+ "- left main\n- right coronary",
+ ]
+ assert document.metadata["figure_caption_refine_composite"]["normalized_table_grid_dropped_columns"] == 0
+ assert document.metadata["figure_caption_refine_composite"]["normalized_table_grid_merged_rows"] == 1
+ assert document.tables[0].metadata["normalized_table_grid_merged_rows"] == 1
+
+
+def test_text_correction_composite_clears_generation_max_length(tmp_path: Path, monkeypatch) -> None:
+ model_dir = tmp_path / "model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+
+ class FakeTorch:
+ class cuda:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ class backends:
+ class mps:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ @staticmethod
+ def no_grad():
+ class _NoGrad:
+ def __enter__(self):
+ return None
+
+ def __exit__(self, exc_type, exc, tb):
+ return False
+
+ return _NoGrad()
+
+ class FakeTokenizer:
+ @classmethod
+ def from_pretrained(cls, source: str, use_fast: bool = False):
+ return cls()
+
+ def __call__(self, texts, padding: bool, truncation: bool, return_tensors: str):
+ return {"input_ids": SimpleNamespace(to=lambda device: [[1, 2, 3]])}
+
+ def batch_decode(self, generated_ids, skip_special_tokens: bool):
+ return ["सही पाठ"]
+
+ class FakeGenerationConfig:
+ def __init__(self) -> None:
+ self.max_length = 256
+
+ fake_model = SimpleNamespace(generation_config=FakeGenerationConfig())
+
+ def fake_from_pretrained(source: str):
+ fake_model.to = lambda device: fake_model
+ fake_model.eval = lambda: None
+ fake_model.generate = lambda **kwargs: [[1, 2, 3]]
+ return fake_model
+
+ monkeypatch.setitem(sys.modules, "torch", FakeTorch)
+ monkeypatch.setitem(sys.modules, "transformers", SimpleNamespace(AutoModelForSeq2SeqLM=SimpleNamespace(from_pretrained=fake_from_pretrained), AutoTokenizer=FakeTokenizer))
+ monkeypatch.setattr("ocrtech.engines.create_engine", lambda name, **kwargs: SimpleNamespace(name=name, recognize=lambda input_path: SimpleNamespace(pages=[], tables=[], figures=[], metadata={})))
+
+ from ocrtech.engines import TextCorrectionCompositeEngine
+
+ TextCorrectionCompositeEngine(model_dir=str(model_dir), tokenizer_dir=str(model_dir), base_engine="tesseract")
+
+ assert fake_model.generation_config.max_length is None
+
+
+def test_hf_engine_loads_processor_without_fast_tokenizer(tmp_path: Path, monkeypatch) -> None:
+ model_dir = tmp_path / "model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ calls: list[tuple[str, object]] = []
+
+ class FakeTorch:
+ class cuda:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ class backends:
+ class mps:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ @staticmethod
+ def no_grad():
+ class _NoGrad:
+ def __enter__(self):
+ return None
+
+ def __exit__(self, exc_type, exc, tb):
+ return False
+
+ return _NoGrad()
+
+ class FakeImage:
+ @staticmethod
+ def open(path: Path):
+ class _Image:
+ def convert(self, mode: str):
+ return self
+
+ return _Image()
+
+ class FakeProcessor:
+ @classmethod
+ def from_pretrained(cls, source: str, **kwargs):
+ calls.append(("processor", kwargs))
+ return cls()
+
+ def __call__(self, image, return_tensors: str):
+ return SimpleNamespace(pixel_values=SimpleNamespace(to=lambda device: "pixels"))
+
+ def batch_decode(self, generated_ids, skip_special_tokens: bool):
+ return ["नेपाल"]
+
+ class FakeModel:
+ @classmethod
+ def from_pretrained(cls, source: str):
+ calls.append(("model", source))
+ return cls()
+
+ def to(self, device: str):
+ return self
+
+ def eval(self):
+ return None
+
+ def generate(self, pixel_values, max_new_tokens: int):
+ return [[1, 2, 3]]
+
+ monkeypatch.setitem(sys.modules, "torch", FakeTorch)
+ monkeypatch.setitem(sys.modules, "transformers", SimpleNamespace(TrOCRProcessor=FakeProcessor, VisionEncoderDecoderModel=FakeModel))
+ monkeypatch.setitem(sys.modules, "PIL", SimpleNamespace(Image=FakeImage))
+
+ from ocrtech.engines import HuggingFaceVisionTextEngine
+
+ engine = HuggingFaceVisionTextEngine(model_dir=str(model_dir))
+ output = engine.recognize(tmp_path / "page.png")
+
+ assert calls[0] == ("processor", {"backend": "pil"})
+ assert output.pages[0].text_lines[0].text == "नेपाल"
+
+
+def test_huggingface_vision_text_engine_sanitizes_list_extra_special_tokens(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ model_dir = tmp_path / "model"
+ model_dir.mkdir()
+ (model_dir / "tokenizer_config.json").write_text(
+ json.dumps({"extra_special_tokens": ["", ""]}),
+ encoding="utf-8",
+ )
+ calls: list[tuple[str, object]] = []
+
+ class FakeTorch:
+ class cuda:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ class backends:
+ class mps:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ @staticmethod
+ def no_grad():
+ class _NoGrad:
+ def __enter__(self):
+ return None
+
+ def __exit__(self, exc_type, exc, tb):
+ return False
+
+ return _NoGrad()
+
+ class FakeImage:
+ @staticmethod
+ def open(path: Path):
+ class _Image:
+ def convert(self, mode: str):
+ return self
+
+ return _Image()
+
+ class FakeProcessor:
+ @classmethod
+ def from_pretrained(cls, source: str, **kwargs):
+ config = json.loads((Path(source) / "tokenizer_config.json").read_text(encoding="utf-8"))
+ calls.append(("processor", config.get("extra_special_tokens")))
+ if isinstance(config.get("extra_special_tokens"), list):
+ raise AttributeError("'list' object has no attribute 'keys'")
+ return cls()
+
+ def __call__(self, image, return_tensors: str):
+ return SimpleNamespace(pixel_values=SimpleNamespace(to=lambda device: "pixels"))
+
+ def batch_decode(self, generated_ids, skip_special_tokens: bool):
+ return ["नेपाल"]
+
+ class FakeModel:
+ generation_config = SimpleNamespace(max_length=128)
+
+ @classmethod
+ def from_pretrained(cls, source: str):
+ return cls()
+
+ def to(self, device: str):
+ return self
+
+ def eval(self):
+ return None
+
+ def generate(self, pixel_values, max_new_tokens: int):
+ return [[1, 2, 3]]
+
+ monkeypatch.setitem(sys.modules, "torch", FakeTorch)
+ monkeypatch.setitem(sys.modules, "transformers", SimpleNamespace(TrOCRProcessor=FakeProcessor, VisionEncoderDecoderModel=FakeModel))
+ monkeypatch.setitem(sys.modules, "PIL", SimpleNamespace(Image=FakeImage))
+
+ from ocrtech.engines import HuggingFaceVisionTextEngine
+
+ engine = HuggingFaceVisionTextEngine(model_dir=str(model_dir))
+ output = engine.recognize(tmp_path / "page.png")
+
+ assert calls == [("processor", ["", ""]), ("processor", {})]
+ assert output.pages[0].text_lines[0].text == "नेपाल"
+
+
+def test_benchmark_candidate_model_config(tmp_path: Path) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("hello world\n", encoding="utf-8")
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["candidate"], candidate_model_config=card)
+
+ assert results[0].status == "ok"
+ assert results[0].metrics["cer"] == 0
+ assert results[0].metrics["quality_score"] > 0
+
+
+def test_experiment_records_candidate_model_config(tmp_path: Path) -> None:
+ pack_dir = tmp_path / "pack"
+ inputs_dir = pack_dir / "inputs"
+ refs_dir = pack_dir / "references"
+ manifests_dir = pack_dir / "manifests"
+ inputs_dir.mkdir(parents=True)
+ refs_dir.mkdir()
+ manifests_dir.mkdir()
+ source = inputs_dir / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ refs_dir.joinpath("sample.txt.ref.txt").write_text("hello world\n", encoding="utf-8")
+ manifest = manifests_dir / "eval.jsonl"
+ manifest.write_text(
+ '{"sample_id":"s1","dataset":"fixture","split":"eval","image_path":"'
+ + str(source)
+ + '","text":"hello world","sha256":null,"metadata":{"slices":["english"]}}\n',
+ encoding="utf-8",
+ )
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback_card = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+
+ report = run_experiment(
+ manifest,
+ tmp_path / "experiment",
+ baselines=["candidate"],
+ references_dir=refs_dir,
+ candidate_model_config=card,
+ fallback_model_config=fallback_card,
+ low_confidence_threshold=0.73,
+ run_validation=False,
+ )
+
+ assert report.environment["candidate_model_config"] == str(card)
+ assert report.environment["fallback_model_config"] == str(fallback_card)
+ assert report.environment["fallback_model_config_sha256"]
+ assert report.environment["low_confidence_threshold"] == 0.73
+
+
+def _passing_validation_gate() -> dict[str, object]:
+ return {
+ "passed": True,
+ "pairs": 2,
+ "candidate_mean": 0.1,
+ "baseline_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ "improvement_ci_low": 0.01,
+ "win_count": 2,
+ "loss_count": 0,
+ "tie_count": 0,
+ "pair_win_rate": 1.0,
+ "sign_test_p_value": 0.0,
+ "gate": {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "min_pairs": 2,
+ "min_absolute_margin": 0.0,
+ "min_relative_improvement": 0.0,
+ "min_pair_win_rate": 0.5,
+ "max_p_value": 1.0,
+ "require_ci_above_zero": True,
+ },
+ }
diff --git a/tests/test_normalization_metrics.py b/tests/test_normalization_metrics.py
new file mode 100644
index 0000000000000000000000000000000000000000..b7ec93efb69b1302ea76ee736d75c1e38f7f9bcd
--- /dev/null
+++ b/tests/test_normalization_metrics.py
@@ -0,0 +1,76 @@
+from __future__ import annotations
+
+from ocrtech.metrics import cer, edit_distance, exact_line_accuracy, reading_order_pair_accuracy, table_cell_score, table_structure_similarity, table_teds_structure, table_teds_text, wer
+from ocrtech.normalization import normalize_ocr_text, script_counts, unsupported_characters
+from ocrtech.schemas import TableCell
+
+
+def test_normalization_preserves_nepali_graphemes() -> None:
+ text = "काठमाण्डौँ\u200d \u0000नेपाल"
+ normalized = normalize_ocr_text(text)
+ assert "काठमाण्डौँ" in normalized
+ assert "\u200d" in normalized
+ assert "\u0000" not in normalized
+
+
+def test_script_counts_and_supported_dictionary() -> None:
+ counts = script_counts("नेपाल English 123")
+ assert counts["devanagari"] > 0
+ assert counts["latin"] > 0
+ assert counts["digit"] == 3
+ assert unsupported_characters("नेपाल English 123") == []
+
+
+def test_ocr_metrics_are_deterministic() -> None:
+ assert edit_distance("kitten", "sitting") == 3
+ assert cer("नेपाल", "नेपाल") == 0
+ assert wer("hello brave world", "hello world") == 0.5
+ assert exact_line_accuracy(["a", "b"], ["a", "c"]) == 0.5
+ assert reading_order_pair_accuracy(["a", "b", "c"], ["a", "b", "c"]) == 1.0
+ assert reading_order_pair_accuracy(["b", "a", "c"], ["a", "b", "c"]) < 1.0
+
+
+def test_table_cell_score() -> None:
+ score = table_cell_score([["A", "B"], ["1", "2"]], [["A", "B"], ["1", "3"]])
+ assert score.precision == 0.75
+ assert score.recall == 0.75
+ assert score.f1 == 0.75
+ assert score.exact_match == 0.0
+ assert score.structure_similarity == 1.0
+
+
+def test_table_structure_similarity_scores_shape_not_text() -> None:
+ assert table_structure_similarity([["wrong", "text"], ["1", "2"]], [["A", "B"], ["1", "3"]]) == 1.0
+ assert table_structure_similarity([["A", "B"]], [["A", "B"], ["1", "3"]]) < 1.0
+ assert table_structure_similarity([["A", "B", "C"], ["1", "2", "3"]], [["A", "B"], ["1", "3"]]) < 1.0
+
+
+def test_table_teds_scores_tree_structure_and_text_separately() -> None:
+ reference = [
+ TableCell(row=0, col=0, text="Ledger Summary", colspan=2),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ]
+ same_structure_wrong_text = [
+ TableCell(row=0, col=0, text="Wrong", colspan=2),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ]
+ flattened = [
+ TableCell(row=0, col=0, text="Ledger Summary"),
+ TableCell(row=0, col=1, text="Ledger Summary"),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ]
+
+ assert table_teds_structure(reference, reference) == 1.0
+ assert table_teds_text(reference, reference) == 1.0
+ assert table_teds_structure(same_structure_wrong_text, reference) == 1.0
+ assert table_teds_text(same_structure_wrong_text, reference) < 1.0
+ assert table_teds_structure(flattened, reference) < 1.0
diff --git a/tests/test_oracle.py b/tests/test_oracle.py
new file mode 100644
index 0000000000000000000000000000000000000000..771b5ef8ee3e8475598ef85892581275cbb83f3f
--- /dev/null
+++ b/tests/test_oracle.py
@@ -0,0 +1,62 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+from ocrtech.oracle import build_benchmark_oracle
+
+
+def test_build_benchmark_oracle_selects_best_system_per_sample(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("surya", "s1", 0.10, 0.90),
+ _row("tesseract", "s1", 0.30, 0.80),
+ _row("surya", "s2", 0.50, 0.90),
+ _row("tesseract", "s2", 0.20, 0.70),
+ _row("surya", "s3", 0.40, 0.80),
+ _row("tesseract", "s3", 0.40, 0.90),
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ oracle, summary = build_benchmark_oracle(
+ report,
+ tmp_path / "oracle",
+ systems=["surya", "tesseract"],
+ metric="cer",
+ oracle_name="oracle",
+ )
+
+ assert oracle.sample_count == 3
+ assert oracle.chosen_counts == {"surya": 1, "tesseract": 2}
+ assert (tmp_path / "oracle" / "oracle-analysis.json").exists()
+ assert (tmp_path / "oracle" / "oracle-choices.json").exists()
+ assert (tmp_path / "oracle" / "oracle-summary" / "summary.json").exists()
+ oracle_report_rows = json.loads((tmp_path / "oracle" / "oracle-report.json").read_text(encoding="utf-8"))
+ oracle_metrics = [row["metrics"] for row in oracle_report_rows if row["baseline"] == "oracle"]
+ assert all("oracle_source_index" not in metrics for metrics in oracle_metrics)
+ choices = json.loads((tmp_path / "oracle" / "oracle-choices.json").read_text(encoding="utf-8"))
+ assert [choice["chosen_system"] for choice in choices] == ["surya", "tesseract", "tesseract"]
+ aggregate = summary.aggregate_metrics
+ assert aggregate["oracle"]["all"]["cer"] == (0.10 + 0.20 + 0.40) / 3
+ paired = [item for item in summary.paired_metrics if item.baseline == "surya" and item.slice_name == "all"]
+ assert paired
+ assert paired[0].win_count == 1
+ assert paired[0].loss_count == 0
+ assert paired[0].tie_count == 2
+
+
+def _row(baseline: str, sample_id: str, cer: float, quality: float) -> dict[str, object]:
+ return {
+ "baseline": baseline,
+ "input_path": f"{sample_id}.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": sample_id,
+ "slices": ["all"],
+ "metrics": {"cer": cer, "quality_score": quality},
+ "error": None,
+ }
diff --git a/tests/test_paper.py b/tests/test_paper.py
new file mode 100644
index 0000000000000000000000000000000000000000..50bb7d4af62821c16dd946370458c4edf01f5189
--- /dev/null
+++ b/tests/test_paper.py
@@ -0,0 +1,97 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.errors import BenchmarkError
+from ocrtech.paper import export_paper_benchmark_table
+
+
+def test_export_paper_benchmark_table_merges_multiple_summaries(tmp_path: Path) -> None:
+ first = tmp_path / "first-summary.json"
+ second = tmp_path / "second-summary.json"
+ _write_summary(
+ first,
+ {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "table_cell_f1": 1.0, "latency_seconds": 4.2}},
+ "tesseract": {"all": {"sample_count": 5, "cer": 0.73, "table_cell_f1": 0.0, "latency_seconds": 0.2}},
+ },
+ )
+ _write_summary(
+ second,
+ {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "reading_order_pair_accuracy": 0.78, "latency_seconds": 4.2}},
+ "surya": {"all": {"sample_count": 5, "cer": 0.19, "reading_order_pair_accuracy": 0.75, "latency_seconds": 3.8}},
+ },
+ )
+
+ table = export_paper_benchmark_table(
+ [first, second],
+ tmp_path / "paper-table",
+ systems=["candidate", "surya", "tesseract"],
+ display_names={"candidate": "Candidate", "surya": "Surya", "tesseract": "Tesseract"},
+ metrics=["cer", "table_cell_f1", "reading_order_pair_accuracy", "latency_seconds"],
+ )
+
+ assert [row.system for row in table.rows] == ["candidate", "surya", "tesseract"]
+ assert table.rows[0].display_name == "Candidate"
+ assert table.rows[0].metrics["cer"] == 0.22
+ assert table.rows[0].metrics["table_cell_f1"] == 1.0
+ assert table.rows[0].metrics["reading_order_pair_accuracy"] == 0.78
+ assert table.rows[0].metrics["latency_seconds"] == 4.2
+ assert (tmp_path / "paper-table" / "paper-table.json").exists()
+ assert (tmp_path / "paper-table" / "paper-table.md").exists()
+
+
+def test_export_paper_benchmark_table_rejects_conflicting_metric_values(tmp_path: Path) -> None:
+ first = tmp_path / "first-summary.json"
+ second = tmp_path / "second-summary.json"
+ _write_summary(first, {"candidate": {"all": {"sample_count": 5, "cer": 0.22}}})
+ _write_summary(second, {"candidate": {"all": {"sample_count": 5, "cer": 0.25}}})
+
+ with pytest.raises(BenchmarkError, match="conflicting aggregate value"):
+ export_paper_benchmark_table([first, second], tmp_path / "paper-table")
+
+
+def test_export_paper_benchmark_table_allows_source_preference_for_conflicting_system_metrics(tmp_path: Path) -> None:
+ first = tmp_path / "first-summary.json"
+ second = tmp_path / "second-summary.json"
+ _write_summary(
+ first,
+ {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "latency_seconds": 4.2}},
+ "tesseract": {"all": {"sample_count": 5, "cer": 0.73, "latency_seconds": 0.2}},
+ },
+ )
+ _write_summary(
+ second,
+ {
+ "candidate": {"all": {"sample_count": 5, "cer": 0.22, "latency_seconds": 5.1}},
+ "surya": {"all": {"sample_count": 5, "cer": 0.19, "latency_seconds": 3.8}},
+ },
+ )
+
+ table = export_paper_benchmark_table(
+ [first, second],
+ tmp_path / "paper-table",
+ systems=["candidate", "surya", "tesseract"],
+ metrics=["cer", "latency_seconds"],
+ source_preferences={"candidate": str(first)},
+ )
+
+ candidate = next(row for row in table.rows if row.system == "candidate")
+ assert candidate.metrics["latency_seconds"] == 4.2
+
+
+def _write_summary(path: Path, aggregate_metrics: dict[str, dict[str, dict[str, float | int]]]) -> None:
+ payload = {
+ "report_path": "outputs/example/report.json",
+ "candidate": "candidate",
+ "baselines": ["tesseract"],
+ "metrics": ["cer"],
+ "aggregate_metrics": aggregate_metrics,
+ "paired_metrics": [],
+ }
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
new file mode 100644
index 0000000000000000000000000000000000000000..47906b4221793055199fd07125a1142c3e9cdd3c
--- /dev/null
+++ b/tests/test_pipeline.py
@@ -0,0 +1,418 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech import pipeline
+from ocrtech.benchmark import _quality_metrics
+from ocrtech.engines import EngineOutput
+from ocrtech.pipeline import parse_document
+from ocrtech.schemas import BBox, Figure, Page, Table, TableCell, TextLine
+
+
+def test_parse_doc_exports_json_markdown_tables_and_figures(tmp_path: Path) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ sidecar = tmp_path / "page.ocr.json"
+ sidecar.write_text(
+ json.dumps(
+ {
+ "pages": [
+ {
+ "width": 800,
+ "height": 1000,
+ "lines": [
+ {"text": "नेपाल सरकार", "bbox": [10, 10, 200, 30], "confidence": 0.99},
+ {"text": "नाम उमेर जिल्ला", "bbox": [10, 80, 400, 20], "confidence": 0.95},
+ {"text": "राम ३२ काठमाडौं", "bbox": [10, 110, 420, 20], "confidence": 0.94},
+ {"text": "Sita 29 Lalitpur", "bbox": [10, 140, 420, 20], "confidence": 0.93},
+ {"text": "This is English text.", "bbox": [10, 220, 300, 20], "confidence": 0.98},
+ ],
+ }
+ ],
+ "figures": [
+ {
+ "figure_id": "fig-0",
+ "page_index": 0,
+ "bbox": [100, 300, 200, 120],
+ "caption": "चित्र १",
+ "summary": "A figure placeholder.",
+ "confidence": 0.8,
+ }
+ ],
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ assert len(document.pages) == 1
+ assert len(document.tables) == 1
+ assert len(document.figures) == 1
+ assert (tmp_path / "out" / "document.json").exists()
+ assert (tmp_path / "out" / "document.md").exists()
+ assert (tmp_path / "out" / "tables" / "p0-t0.csv").exists()
+ assert (tmp_path / "out" / "tables" / "p0-t0.html").exists()
+ assert (tmp_path / "out" / "figures" / "metadata.json").exists()
+ assert (tmp_path / "out" / "quality.json").exists()
+ exported = json.loads((tmp_path / "out" / "document.json").read_text(encoding="utf-8"))
+ assert exported["tables"][0]["csv_path"] == str(tmp_path / "out" / "tables" / "p0-t0.csv")
+ assert exported["tables"][0]["html_path"] == str(tmp_path / "out" / "tables" / "p0-t0.html")
+ assert exported["tables"][0]["html"].startswith("")
+ markdown = (tmp_path / "out" / "document.md").read_text(encoding="utf-8")
+ assert "# नेपाल सरकार" in markdown
+ assert "| नाम | उमेर | जिल्ला |" in markdown
+ assert "This is English text." in markdown
+ assert document.metadata["quality"]["passed"]
+
+
+def test_export_document_crops_figure_from_source_image_when_image_path_missing(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ try:
+ from PIL import Image
+ except ImportError:
+ pytest.skip("Pillow is not installed")
+ Image.new("RGB", (120, 100), "white").save(source)
+
+ class FigureEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="[Figure: chart]", bbox=BBox(10, 10, 60, 20), confidence=0.9, page_index=0)
+ figure = Figure(figure_id="fig-0", page_index=0, bbox=BBox(20, 30, 40, 35), summary="chart")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], figures=[figure], metadata={"engine": "figure-engine"})
+
+ monkeypatch.setattr(pipeline, "create_engine", lambda name, **kwargs: FigureEngine())
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ cropped = tmp_path / "out" / "figures" / "fig-0.png"
+ assert cropped.exists()
+ assert document.figures[0].image_path == str(cropped)
+ assert document.figures[0].metadata["export_source"] == "source_crop"
+ with Image.open(cropped) as image:
+ assert image.size == (40, 35)
+ metadata = json.loads((tmp_path / "out" / "figures" / "metadata.json").read_text(encoding="utf-8"))
+ assert metadata[0]["image_path"] == str(cropped)
+
+
+def test_export_document_records_warning_when_figure_image_cannot_be_created(tmp_path: Path) -> None:
+ source = tmp_path / "page.pdf"
+ source.write_bytes(b"%PDF-1.4\n")
+ sidecar = tmp_path / "page.ocr.json"
+ sidecar.write_text(
+ json.dumps(
+ {
+ "pages": [{"lines": [{"text": "[Figure: chart]", "bbox": [10, 10, 80, 20], "confidence": 0.9}]}],
+ "figures": [{"figure_id": "fig-0", "page_index": 0, "bbox": [20, 30, 40, 35], "summary": "chart"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ assert not (tmp_path / "out" / "figures" / "fig-0.png").exists()
+ warnings = document.figures[0].metadata["export_warnings"]
+ assert warnings == ["source image format cannot be cropped: .pdf"]
+ metadata = json.loads((tmp_path / "out" / "figures" / "metadata.json").read_text(encoding="utf-8"))
+ assert metadata[0]["metadata"]["export_warnings"] == warnings
+
+
+def test_export_document_copies_relative_figure_image_from_page_bundle(tmp_path: Path) -> None:
+ source = tmp_path / "bundle"
+ source.mkdir()
+ figure_image = source / "embedded-figure.png"
+ figure_image.write_bytes(b"figure bytes")
+ (source / "document.ocr.json").write_text(
+ json.dumps(
+ {
+ "pages": [{"lines": [{"text": "[Figure: chart]", "bbox": [10, 10, 80, 20], "confidence": 0.9}]}],
+ "figures": [
+ {
+ "figure_id": "fig-0",
+ "page_index": 0,
+ "bbox": [20, 30, 40, 35],
+ "image_path": "embedded-figure.png",
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ copied = tmp_path / "out" / "figures" / "embedded-figure.png"
+ assert copied.read_bytes() == b"figure bytes"
+ assert document.figures[0].image_path == str(copied)
+
+
+def test_export_document_crops_figure_from_page_bundle(tmp_path: Path) -> None:
+ source = tmp_path / "bundle"
+ source.mkdir()
+ try:
+ from PIL import Image
+ except ImportError:
+ pytest.skip("Pillow is not installed")
+ Image.new("RGB", (120, 100), "white").save(source / "page-0000.png")
+ Image.new("RGB", (160, 140), "white").save(source / "page-0001.png")
+ (source / "document.ocr.json").write_text(
+ json.dumps(
+ {
+ "pages": [
+ {"lines": [{"text": "page one", "bbox": [0, 0, 80, 20], "confidence": 0.9}]},
+ {"lines": [{"text": "[Figure: chart]", "bbox": [10, 10, 80, 20], "confidence": 0.9}]},
+ ],
+ "figures": [{"figure_id": "fig-1", "page_index": 1, "bbox": [30, 40, 50, 45], "summary": "chart"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ cropped = tmp_path / "out" / "figures" / "fig-1.png"
+ assert cropped.exists()
+ assert document.figures[0].image_path == str(cropped)
+ assert document.figures[0].metadata["export_source"] == "source_crop"
+ with Image.open(cropped) as image:
+ assert image.size == (50, 45)
+
+
+def test_export_document_records_warning_when_page_bundle_has_no_images(tmp_path: Path) -> None:
+ source = tmp_path / "bundle"
+ source.mkdir()
+ (source / "document.ocr.json").write_text(
+ json.dumps(
+ {
+ "pages": [{"lines": [{"text": "[Figure: chart]", "bbox": [10, 10, 80, 20], "confidence": 0.9}]}],
+ "figures": [{"figure_id": "fig-0", "page_index": 0, "bbox": [20, 30, 40, 35], "summary": "chart"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ warnings = document.figures[0].metadata["export_warnings"]
+ assert warnings == [f"page bundle has no croppable image files: {source}"]
+
+
+def test_fallback_triggers_on_low_confidence(tmp_path: Path) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ sidecar = tmp_path / "page.ocr.json"
+ sidecar.write_text(
+ json.dumps(
+ {
+ "pages": [
+ {
+ "lines": [
+ {"text": "low confidence", "bbox": [0, 0, 100, 20], "confidence": 0.2},
+ ]
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar", fallback_engine="paddleocr")
+
+ assert "fallback_error" in document.metadata
+ assert document.metadata["fallback"]["triggered"] is True
+ assert document.metadata["fallback"]["outcome"] == "error"
+ assert document.metadata["fallback"]["reason"] == "average_confidence_below_threshold"
+ assert document.pages[0].blocks[0].text == "low confidence"
+
+
+def test_fallback_success_records_decision_and_benchmark_metrics(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+
+ class PrimaryEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="primary text", bbox=BBox(0, 0, 100, 20), confidence=0.2, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "primary"})
+
+ class FallbackEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="fallback text", bbox=BBox(0, 0, 120, 20), confidence=0.95, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "fallback"})
+
+ def fake_create_engine(name: str, **kwargs: object) -> object:
+ if name == "sidecar":
+ return PrimaryEngine()
+ if name == "paddleocr":
+ return FallbackEngine()
+ raise AssertionError(f"unexpected engine request: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr(pipeline, "create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar", fallback_engine="paddleocr")
+ metrics = _quality_metrics(document)
+
+ assert document.pages[0].blocks[0].text == "fallback text"
+ assert document.metadata["fallback"] == {
+ "configured": True,
+ "triggered": True,
+ "outcome": "success",
+ "primary_engine": "sidecar",
+ "fallback_engine": "paddleocr",
+ "fallback_model_config": None,
+ "primary_average_confidence": 0.2,
+ "threshold": 0.8,
+ "reason": "average_confidence_below_threshold",
+ }
+ assert metrics["fallback_triggered"] == 1.0
+ assert metrics["fallback_succeeded"] == 1.0
+ assert metrics["fallback_failed"] == 0.0
+ assert metrics["fallback_primary_average_confidence"] == 0.2
+
+
+def test_fallback_not_triggered_records_reason(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+
+ class PrimaryEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="primary text", bbox=BBox(0, 0, 100, 20), confidence=0.99, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "primary"})
+
+ def fake_create_engine(name: str, **kwargs: object) -> object:
+ if name == "sidecar":
+ return PrimaryEngine()
+ raise AssertionError(f"fallback should not be constructed: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr(pipeline, "create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar", fallback_engine="paddleocr")
+ metrics = _quality_metrics(document)
+
+ assert document.metadata["fallback"]["triggered"] is False
+ assert document.metadata["fallback"]["outcome"] == "not_triggered"
+ assert document.metadata["fallback"]["reason"] == "confidence_above_threshold"
+ assert metrics["fallback_triggered"] == 0.0
+
+
+def test_fallback_model_config_uses_candidate_engine(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+ fallback_model = tmp_path / "fallback-model.json"
+ fallback_model.write_text("{}", encoding="utf-8")
+ calls: list[tuple[str, dict[str, object]]] = []
+
+ class PrimaryEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="primary text", bbox=BBox(0, 0, 100, 20), confidence=0.2, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "primary"})
+
+ class FallbackEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="model fallback", bbox=BBox(0, 0, 140, 20), confidence=0.96, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "fallback"})
+
+ def fake_create_engine(name: str, **kwargs: object) -> object:
+ calls.append((name, kwargs))
+ if name == "sidecar":
+ return PrimaryEngine()
+ if name == "candidate":
+ return FallbackEngine()
+ raise AssertionError(f"unexpected engine request: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr(pipeline, "create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar", fallback_model_config=fallback_model)
+
+ assert calls == [("sidecar", {}), ("candidate", {"model_config": fallback_model})]
+ assert document.pages[0].blocks[0].text == "model fallback"
+ assert document.metadata["fallback"]["fallback_engine"] == "candidate"
+ assert document.metadata["fallback"]["fallback_model_config"] == str(fallback_model)
+ assert document.metadata["fallback"]["outcome"] == "success"
+
+
+def test_build_document_does_not_duplicate_engine_supplied_table(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+
+ class TableEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ table_bbox = BBox(10, 20, 300, 50)
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=table_bbox,
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=0, col=1, text="रकम"),
+ TableCell(row=0, col=2, text="Remarks"),
+ TableCell(row=1, col=0, text="किरण"),
+ TableCell(row=1, col=1, text="२१००"),
+ TableCell(row=1, col=2, text="Paid"),
+ ],
+ )
+ lines = [
+ TextLine(text="नाम रकम Remarks", bbox=BBox(10, 20, 300, 20), confidence=0.9, page_index=0),
+ TextLine(text="किरण २१०० Paid", bbox=BBox(10, 50, 300, 20), confidence=0.9, page_index=0),
+ ]
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], tables=[table], metadata={"engine": "table-engine"})
+
+ monkeypatch.setattr(pipeline, "create_engine", lambda name, **kwargs: TableEngine())
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ assert len(document.tables) == 1
+ assert document.pages[0].blocks[0].table_id == "p0-t0"
+ assert (tmp_path / "out" / "tables" / "p0-t0.csv").exists()
+
+
+def test_figure_marker_uses_nearby_ocr_damaged_caption(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+
+ class FigureEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ lines = [
+ TextLine(text="वार्षिक प्रतिवेदन", bbox=BBox(10, 10, 200, 30), confidence=0.9, page_index=0),
+ TextLine(text="[Figure: revenue chart]", bbox=BBox(10, 60, 260, 30), confidence=0.9, page_index=0),
+ TextLine(text="चतुर्थ १: Revenue growth from 2021 to 2025.", bbox=BBox(10, 100, 500, 30), confidence=0.9, page_index=0),
+ TextLine(text="निष्कर्ष: अन्तिम दुई वर्षमा वृद्धि भएको छ।", bbox=BBox(10, 150, 500, 30), confidence=0.9, page_index=0),
+ ]
+ return EngineOutput(pages=[Page(page_index=0, text_lines=lines)], metadata={"engine": "figure-engine"})
+
+ monkeypatch.setattr(pipeline, "create_engine", lambda name, **kwargs: FigureEngine())
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar")
+
+ assert len(document.figures) == 1
+ assert document.figures[0].summary == "[Figure: revenue chart]"
+ assert document.figures[0].caption == "चतुर्थ १: Revenue growth from 2021 to 2025."
+ assert document.pages[0].blocks[1].text == "चतुर्थ १: Revenue growth from 2021 to 2025."
+ assert "निष्कर्ष" in document.pages[0].blocks[2].text
+
+
+def test_fallback_records_unexpected_runtime_failure(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"fake image bytes")
+
+ class PrimaryEngine:
+ def recognize(self, input_path: Path) -> EngineOutput:
+ line = TextLine(text="primary text", bbox=BBox(0, 0, 100, 20), confidence=0.2, page_index=0, line_id="p0-l0")
+ return EngineOutput(pages=[Page(page_index=0, text_lines=[line])], metadata={"engine": "primary"})
+
+ def fake_create_engine(name: str, **kwargs: object) -> object:
+ if name == "sidecar":
+ return PrimaryEngine()
+ if name == "paddleocr":
+ raise RuntimeError("paddle runtime missing")
+ raise AssertionError(f"unexpected engine request: {name}, kwargs={kwargs}")
+
+ monkeypatch.setattr(pipeline, "create_engine", fake_create_engine)
+
+ document = parse_document(source, tmp_path / "out", engine_name="sidecar", fallback_engine="paddleocr")
+
+ assert document.metadata["fallback_error"] == "RuntimeError: paddle runtime missing"
+ assert document.pages[0].blocks[0].text == "primary text"
diff --git a/tests/test_preflight.py b/tests/test_preflight.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e6b513bd7172fb518b74e4256a6b4f0f40c84bd
--- /dev/null
+++ b/tests/test_preflight.py
@@ -0,0 +1,795 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+from types import SimpleNamespace
+
+from ocrtech.evalpack import create_eval_pack
+from ocrtech.manifest import ManifestEntry, sha256_file, sha256_text, write_manifest
+from ocrtech.models import write_model_card
+from ocrtech.preflight import run_claim_preflight
+
+
+def test_preflight_passes_for_smoke_pack_with_candidate_model(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["ours"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert report.passed
+ assert any(check.name == "eval-pack" and check.status == "warn" for check in report.checks)
+ assert (tmp_path / "preflight" / "preflight.json").exists()
+
+
+def test_preflight_fails_without_candidate_model_config(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ candidate_check = next(check for check in report.checks if check.name == "baseline:candidate")
+ assert candidate_check.status == "fail"
+ assert "--candidate-model-config" in candidate_check.summary
+
+
+def test_preflight_audits_fallback_model_config(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=fallback,
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ fallback_model_config=fallback,
+ require_claim_ready_eval_pack=False,
+ )
+
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "pass"
+ assert "ocrtech-fallback" in fallback_check.summary
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "pass"
+
+
+def test_preflight_fails_when_fallback_model_card_audit_fails(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-bad-fallback", backend="paddleocr", base_model="fixture")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=fallback,
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ fallback_model_config=fallback,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ fallback_check = next(check for check in report.checks if check.name == "fallback-model")
+ assert fallback_check.status == "fail"
+ assert "fallback model card failed audit" in fallback_check.summary
+ assert any("paddleocr candidate requires at least one recorded artifact" in detail for detail in fallback_check.details)
+
+
+def test_preflight_requires_candidate_fallback_provenance_for_configured_fallback(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ fallback_model_config=fallback,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "fail"
+ assert "missing provenance.fallback_model_card" in provenance_check.summary
+
+
+def test_preflight_rejects_candidate_fallback_provenance_mismatch(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ fallback = write_model_card(tmp_path / "fallback.json", model_id="ocrtech-fallback", backend="sidecar", base_model="fixture")
+ other_fallback = write_model_card(tmp_path / "other-fallback.json", model_id="ocrtech-other-fallback", backend="sidecar", base_model="fixture")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-sidecar",
+ backend="sidecar",
+ base_model="fixture",
+ fallback_model_card=other_fallback,
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ fallback_model_config=fallback,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ provenance_check = next(check for check in report.checks if check.name == "candidate-fallback-provenance")
+ assert provenance_check.status == "fail"
+ assert "does not match configured fallback model" in provenance_check.summary
+
+
+def test_preflight_requires_trained_recognizer_when_requested(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ require_trained_recognizer=True,
+ )
+
+ assert not report.passed
+ trained_check = next(check for check in report.checks if check.name == "trained-recognizer")
+ assert trained_check.status == "fail"
+ assert "lacks trained local recognizer provenance" in trained_check.summary
+
+
+def test_preflight_accepts_trained_recognizer_when_requested(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ source = tmp_path / "source.txt"
+ source.write_text("नेपाल सरकार\n", encoding="utf-8")
+ entry = ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="train",
+ image_path=str(source),
+ text="नेपाल सरकार",
+ sha256=sha256_file(source),
+ )
+ write_manifest([entry], train_manifest)
+ write_manifest([ManifestEntry(**{**entry.to_dict(), "split": "eval"})], eval_manifest)
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "paddleocr"}\n', encoding="utf-8")
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-trained",
+ backend="paddleocr",
+ base_model="fixture-pretrained",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne", "text_recognition_model_dir": str(tmp_path)},
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ require_trained_recognizer=True,
+ )
+
+ trained_check = next(check for check in report.checks if check.name == "trained-recognizer")
+ assert trained_check.status == "pass"
+
+
+def test_preflight_requires_model_admission_when_requested(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ require_model_admission=True,
+ )
+
+ assert not report.passed
+ admission_check = next(check for check in report.checks if check.name == "model-admission")
+ assert admission_check.status == "fail"
+ assert "not passed admission validation" in admission_check.summary
+
+
+def test_preflight_accepts_model_admission_when_requested(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ validation = tmp_path / "validation.json"
+ artifact = tmp_path / "inference.pdiparams"
+ artifact.write_bytes(b"weights")
+ model_path = tmp_path / "model.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(model_path)}},
+ "gates": [_passing_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ card = write_model_card(
+ model_path,
+ model_id="ocrtech-admitted",
+ backend="paddleocr",
+ base_model="fixture",
+ artifact_paths=[artifact],
+ backend_kwargs={"lang": "ne", "text_recognition_model_dir": str(tmp_path)},
+ admission_validation_report=validation,
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ require_model_admission=True,
+ )
+
+ admission_check = next(check for check in report.checks if check.name == "model-admission")
+ assert admission_check.status == "pass"
+
+
+def test_preflight_fails_when_glm_hook_is_missing(tmp_path: Path, monkeypatch) -> None:
+ monkeypatch.delenv("OCRTECH_GLM_OCR_CMD", raising=False)
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["glm-ocr"],
+ references_dir=tmp_path / "pack" / "references",
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ glm_check = next(check for check in report.checks if check.name == "baseline:glm-ocr")
+ assert glm_check.status == "fail"
+ assert "OCRTECH_GLM_OCR_CMD" in glm_check.summary
+
+
+def test_preflight_fails_when_glm_hook_is_not_runnable(tmp_path: Path, monkeypatch) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ monkeypatch.setenv("OCRTECH_GLM_OCR_CMD", "missing-python scripts/run_glm_ocr.py --input {input}")
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["glm-ocr"],
+ references_dir=tmp_path / "pack" / "references",
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ glm_check = next(check for check in report.checks if check.name == "baseline:glm-ocr")
+ assert glm_check.status == "fail"
+ assert "not runnable" in glm_check.summary
+ assert any("executable not found" in detail for detail in glm_check.details)
+ assert any("{out}" in detail for detail in glm_check.details)
+
+
+def test_preflight_fails_when_paddle_runtime_is_missing(tmp_path: Path, monkeypatch) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ real_find_spec = __import__("importlib").util.find_spec
+
+ def fake_find_spec(name: str):
+ if name == "paddleocr":
+ return SimpleNamespace()
+ if name == "paddle":
+ return None
+ return real_find_spec(name)
+
+ monkeypatch.setattr("importlib.util.find_spec", fake_find_spec)
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["stock-paddle"],
+ references_dir=tmp_path / "pack" / "references",
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ paddle_check = next(check for check in report.checks if check.name == "baseline:stock-paddle")
+ assert paddle_check.status == "fail"
+ assert "dependencies are incomplete" in paddle_check.summary
+ assert "python module missing: paddle" in paddle_check.details
+
+
+def test_preflight_fails_when_surya_runtime_is_missing(tmp_path: Path, monkeypatch) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ real_find_spec = __import__("importlib").util.find_spec
+
+ def fake_find_spec(name: str):
+ if name == "surya":
+ return None
+ return real_find_spec(name)
+
+ monkeypatch.setattr("importlib.util.find_spec", fake_find_spec)
+ monkeypatch.setattr("shutil.which", lambda name: None if name == "llama-server" else None)
+ monkeypatch.delenv("LLAMA_CPP_BINARY", raising=False)
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["surya"],
+ references_dir=tmp_path / "pack" / "references",
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ surya_check = next(check for check in report.checks if check.name == "baseline:surya")
+ assert surya_check.status == "fail"
+ assert "dependencies are incomplete" in surya_check.summary
+ assert "python module missing: surya" in surya_check.details
+
+
+def test_preflight_fails_on_train_eval_leakage(tmp_path: Path) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ reference = tmp_path / "sample.ref.txt"
+ reference.write_text("hello world\n", encoding="utf-8")
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ sample_hash = sha256_text(f"{image_hash}\n{text_hash}")
+ entry = ManifestEntry(
+ sample_id="shared-sample",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={"reference_path": str(reference), "text_sha256": text_hash, "sample_sha256": sample_hash, "input_format": "text"},
+ )
+ eval_manifest = tmp_path / "eval.jsonl"
+ train_manifest = tmp_path / "train.jsonl"
+ write_manifest([entry], eval_manifest)
+ write_manifest([ManifestEntry(**{**entry.to_dict(), "split": "train"})], train_manifest)
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ eval_manifest,
+ tmp_path / "preflight",
+ baselines=["ours"],
+ candidate_model_config=card,
+ train_manifests=[train_manifest],
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ leakage_check = next(check for check in report.checks if check.name == "leakage")
+ assert leakage_check.status == "fail"
+ assert "leakage" in leakage_check.summary
+
+
+def test_preflight_fails_on_unsupported_ocr_image_suffix(tmp_path: Path) -> None:
+ source = tmp_path / "sample.img"
+ source.write_bytes(b"fake image bytes")
+ reference = tmp_path / "sample.ref.txt"
+ reference.write_text("hello world\n", encoding="utf-8")
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-img",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={"reference_path": str(reference), "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ manifest,
+ )
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ manifest,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ suffix_check = next(check for check in report.checks if check.name == "eval-input-suffixes")
+ assert suffix_check.status == "fail"
+ assert "normalize-manifest-images" in suffix_check.summary
+ assert any(".img" in detail for detail in suffix_check.details)
+
+
+def test_preflight_accepts_context_compatible_validation_config(tmp_path: Path, monkeypatch) -> None:
+ monkeypatch.setattr("shutil.which", lambda name: "/usr/bin/tesseract" if name == "tesseract" else None)
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ reference = tmp_path / "sample.ref.txt"
+ reference.write_text("hello world\n", encoding="utf-8")
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={
+ "reference_path": str(reference),
+ "text_sha256": text_hash,
+ "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}"),
+ "input_format": "text",
+ "slices": ["english"],
+ },
+ )
+ ],
+ manifest,
+ )
+ config = tmp_path / "validation.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "candidate",
+ "min_samples": 1,
+ "required_slices": {"english": 1},
+ "gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slices": ["english"],
+ "min_pairs": 1,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ manifest,
+ tmp_path / "preflight",
+ baselines=["candidate", "tesseract"],
+ candidate_model_config=card,
+ validation_config=config,
+ require_claim_ready_eval_pack=False,
+ )
+
+ validation_check = next(check for check in report.checks if check.name == "validation-config")
+ assert validation_check.status == "pass"
+
+
+def test_preflight_rejects_validation_config_that_cannot_match_run_context(tmp_path: Path) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ reference = tmp_path / "sample.ref.txt"
+ reference.write_text("hello world\n", encoding="utf-8")
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={
+ "reference_path": str(reference),
+ "text_sha256": text_hash,
+ "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}"),
+ "input_format": "text",
+ "slices": ["english"],
+ },
+ )
+ ],
+ manifest,
+ )
+ config = tmp_path / "validation.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "candidate",
+ "min_samples": 2,
+ "required_slices": {"nepali": 2},
+ "gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slices": ["nepali"],
+ "min_pairs": 2,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ manifest,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ candidate_model_config=card,
+ validation_config=config,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ validation_check = next(check for check in report.checks if check.name == "validation-config")
+ assert validation_check.status == "fail"
+ assert "cannot be satisfied" in validation_check.summary
+ assert "gate baselines not included in preflight baselines: tesseract" in validation_check.details
+ assert "validation min_samples 2 exceeds eval manifest sample count 1" in validation_check.details
+ assert "required slice 'nepali' count 2 exceeds eval manifest count 0" in validation_check.details
+ assert any("min_pairs 2 exceeds eval manifest capacity 0" in detail for detail in validation_check.details)
+
+
+def test_preflight_allows_text_input_format_with_txt_suffix(tmp_path: Path) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ reference = tmp_path / "sample.ref.txt"
+ reference.write_text("hello world\n", encoding="utf-8")
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-text",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={
+ "reference_path": str(reference),
+ "text_sha256": text_hash,
+ "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}"),
+ "input_format": "text",
+ },
+ )
+ ],
+ manifest,
+ )
+ card = write_model_card(tmp_path / "model.json", model_id="ocrtech-sidecar", backend="sidecar", base_model="fixture")
+
+ report = run_claim_preflight(
+ manifest,
+ tmp_path / "preflight",
+ baselines=["candidate"],
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ suffix_check = next(check for check in report.checks if check.name == "eval-input-suffixes")
+ assert suffix_check.status == "pass"
+
+
+def test_preflight_fails_when_quality_router_is_calibrated_on_same_eval_manifest(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-quality-router",
+ backend="quality_select_composite",
+ base_model="tesseract-ocr",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "tesseract", "secondary_quality_margin": 0.02},
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": str(pack.manifest_path),
+ "sha256": sha256_file(Path(pack.manifest_path)),
+ },
+ "metric": "cer",
+ "selected_threshold": 0.02,
+ }
+ },
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate", "tesseract"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ calibration_check = next(check for check in report.checks if check.name == "candidate-calibration")
+ assert calibration_check.status == "fail"
+ assert "matches the claim eval manifest" in calibration_check.summary
+
+
+def test_preflight_fails_when_script_router_collapses_to_secondary_engine(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ calibration = tmp_path / "calibration.json"
+ calibration.write_text(
+ json.dumps(
+ {
+ "eval_manifest": "other.jsonl",
+ "metric": "cer",
+ "selected_threshold": 0.0,
+ "selected_trial": {
+ "threshold": 0.0,
+ "pairs": 5,
+ "secondary_picks": 5,
+ "chosen_mean": 0.1,
+ "primary_mean": 0.5,
+ "absolute_improvement": 0.4,
+ "relative_improvement": 0.8,
+ },
+ }
+ ),
+ encoding="utf-8",
+ )
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "surya", "primary_script_threshold": 0.0},
+ metrics_report=calibration,
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": "different-eval.jsonl",
+ "sha256": "1234567890abcdef",
+ },
+ "metric": "cer",
+ "selected_threshold": 0.0,
+ }
+ },
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate", "tesseract", "surya"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ calibration_check = next(check for check in report.checks if check.name == "candidate-calibration")
+ assert calibration_check.status == "fail"
+ assert "collapses to the secondary engine" in calibration_check.summary
+
+
+def test_preflight_fails_when_composite_candidate_component_baseline_is_missing(tmp_path: Path) -> None:
+ pack = create_eval_pack(tmp_path / "pack", input_format="text", count_per_template=1, degradations=["clean"])
+ calibration = tmp_path / "calibration.json"
+ calibration.write_text(
+ json.dumps(
+ {
+ "eval_manifest": "separate-dev.jsonl",
+ "metric": "cer",
+ "selected_threshold": 0.4,
+ "selected_trial": {
+ "threshold": 0.4,
+ "pairs": 5,
+ "secondary_picks": 3,
+ "chosen_mean": 0.1,
+ "primary_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ },
+ }
+ ),
+ encoding="utf-8",
+ )
+ card = write_model_card(
+ tmp_path / "model.json",
+ model_id="ocrtech-script-router",
+ backend="script_select_composite",
+ base_model="tesseract+surya",
+ backend_kwargs={"primary_engine": "tesseract", "secondary_engine": "surya", "primary_script_threshold": 0.4},
+ metrics_report=calibration,
+ provenance={
+ "calibration": {
+ "eval_manifest": {
+ "path": "separate-dev.jsonl",
+ "sha256": "abcdef1234567890",
+ },
+ "metric": "cer",
+ "selected_threshold": 0.4,
+ }
+ },
+ )
+
+ report = run_claim_preflight(
+ pack.manifest_path,
+ tmp_path / "preflight",
+ baselines=["candidate", "tesseract"],
+ references_dir=tmp_path / "pack" / "references",
+ candidate_model_config=card,
+ require_claim_ready_eval_pack=False,
+ )
+
+ assert not report.passed
+ component_check = next(check for check in report.checks if check.name == "candidate-components")
+ assert component_check.status == "fail"
+ assert "component baselines" in component_check.summary
+ assert any("surya" in detail for detail in component_check.details)
+
+
+def _passing_validation_gate() -> dict[str, object]:
+ return {
+ "passed": True,
+ "pairs": 2,
+ "candidate_mean": 0.1,
+ "baseline_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ "improvement_ci_low": 0.01,
+ "win_count": 2,
+ "loss_count": 0,
+ "tie_count": 0,
+ "pair_win_rate": 1.0,
+ "sign_test_p_value": 0.0,
+ "gate": {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "min_pairs": 2,
+ "min_pair_win_rate": 0.5,
+ "require_ci_above_zero": True,
+ },
+ }
diff --git a/tests/test_public_benchmarks.py b/tests/test_public_benchmarks.py
new file mode 100644
index 0000000000000000000000000000000000000000..55bab10534464f20f3bdf67806757f64e784c50c
--- /dev/null
+++ b/tests/test_public_benchmarks.py
@@ -0,0 +1,204 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+import pytest
+
+from ocrtech.errors import DataValidationError
+from ocrtech.manifest import ManifestEntry, load_manifest, sha256_file, sha256_text, write_manifest
+from ocrtech.public_benchmarks import audit_public_benchmark_manifest, list_public_benchmarks, prepare_public_benchmark
+
+
+def test_list_public_benchmarks_includes_document_parsing_targets() -> None:
+ datasets = {spec.dataset for spec in list_public_benchmarks()}
+
+ assert "opendatalab/OmniDocBench" in datasets
+ assert "allenai/olmOCR-bench" in datasets
+ assert "PaddlePaddle/Real5-OmniDocBench" in datasets
+
+
+def test_audit_public_benchmark_manifest_passes_with_provenance_and_references(tmp_path: Path) -> None:
+ image = tmp_path / "page.png"
+ image.write_bytes(b"image")
+ reference = tmp_path / "page.ref.json"
+ reference.write_text('{"text":"hello"}\n', encoding="utf-8")
+ manifest = tmp_path / "public.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="omni-1",
+ dataset="opendatalab/OmniDocBench",
+ split="eval",
+ image_path=str(image),
+ text="hello",
+ sha256=sha256_file(image),
+ metadata={
+ "benchmark_name": "opendatalab/OmniDocBench",
+ "public_benchmark": True,
+ "source_url": "https://huggingface.co/datasets/opendatalab/OmniDocBench",
+ "reference_path": str(reference),
+ "slices": ["public", "document_parsing", "table"],
+ "text_sha256": sha256_text("hello"),
+ },
+ )
+ ],
+ manifest,
+ )
+
+ audit = audit_public_benchmark_manifest(manifest, tmp_path / "audit", min_samples=1)
+
+ assert audit.passed
+ assert audit.benchmark == "opendatalab/OmniDocBench"
+ assert audit.slice_counts["public"] == 1
+ assert (tmp_path / "audit" / "public-benchmark-audit.json").exists()
+
+
+def test_audit_public_benchmark_manifest_fails_without_required_metadata(tmp_path: Path) -> None:
+ image = tmp_path / "page.png"
+ image.write_bytes(b"image")
+ manifest = tmp_path / "public.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="omni-1",
+ dataset="opendatalab/OmniDocBench",
+ split="eval",
+ image_path=str(image),
+ text="hello",
+ sha256=sha256_file(image),
+ metadata={"slices": ["document_parsing"]},
+ )
+ ],
+ manifest,
+ )
+
+ audit = audit_public_benchmark_manifest(manifest, tmp_path / "audit", min_samples=1)
+
+ assert not audit.passed
+ assert any("metadata.public_benchmark" in issue for issue in audit.issues)
+ assert any("metadata.reference_path" in issue for issue in audit.issues)
+ assert any("required public benchmark slice missing: public" in issue for issue in audit.issues)
+
+
+def test_prepare_public_benchmark_converts_verified_omnidocbench_schema(tmp_path: Path) -> None:
+ root = tmp_path / "source"
+ images = root / "images"
+ images.mkdir(parents=True)
+ image = images / "page-1.png"
+ image.write_bytes(b"fake-png")
+ annotation = root / "OmniDocBench.json"
+ annotation.write_text(
+ json.dumps(
+ [
+ {
+ "page_info": {
+ "image_path": "page-1.png",
+ "page_no": 0,
+ "height": 640,
+ "width": 480,
+ "page_attribute": {
+ "language": "english",
+ "subset": "table_hard",
+ "data_source": "research_report",
+ },
+ },
+ "layout_dets": [
+ {
+ "category_type": "title",
+ "text": "Quarterly Result",
+ "ignore": False,
+ "order": 1,
+ },
+ {
+ "category_type": "table",
+ "html": "",
+ "ignore": False,
+ "order": 2,
+ "anno_id": "tbl-1",
+ },
+ ],
+ }
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ report = prepare_public_benchmark(
+ "opendatalab/OmniDocBench",
+ tmp_path / "prepared",
+ limit=1,
+ language="english",
+ require_tables=True,
+ annotation_path=annotation,
+ local_image_root=root,
+ )
+
+ manifest_path = Path(report.manifest_path)
+ entries = load_manifest(manifest_path)
+ assert report.sample_count == 1
+ assert len(entries) == 1
+ assert entries[0].metadata["public_benchmark"] is True
+ assert "public" in entries[0].metadata["slices"]
+ assert "table" in entries[0].metadata["slices"]
+ reference = json.loads(Path(entries[0].metadata["reference_path"]).read_text(encoding="utf-8"))
+ assert reference["text"] == "Quarterly Result\nRevenue\nNepal 42"
+ assert reference["tables"][0]["cells"][0]["text"] == "Revenue"
+ assert reference["tables"][0]["cells"][0]["colspan"] == 2
+
+ audit = audit_public_benchmark_manifest(manifest_path, tmp_path / "audit", min_samples=1)
+ assert audit.passed
+
+
+def test_prepare_public_benchmark_filters_omnidocbench_rows(tmp_path: Path) -> None:
+ root = tmp_path / "source"
+ images = root / "images"
+ images.mkdir(parents=True)
+ (images / "english.png").write_bytes(b"english")
+ (images / "chinese.png").write_bytes(b"chinese")
+ annotation = root / "OmniDocBench.json"
+ rows = []
+ for image_name, language in [("english.png", "english"), ("chinese.png", "simplified_chinese")]:
+ rows.append(
+ {
+ "page_info": {
+ "image_path": image_name,
+ "page_no": 0,
+ "height": 100,
+ "width": 100,
+ "page_attribute": {
+ "language": language,
+ "subset": "v1.5",
+ "data_source": "book",
+ },
+ },
+ "layout_dets": [{"category_type": "text_block", "text": language, "ignore": False, "order": 1}],
+ }
+ )
+ annotation.write_text(json.dumps(rows), encoding="utf-8")
+
+ report = prepare_public_benchmark(
+ "opendatalab/OmniDocBench",
+ tmp_path / "prepared",
+ language="english",
+ annotation_path=annotation,
+ local_image_root=root,
+ )
+
+ entries = load_manifest(report.manifest_path)
+ assert [entry.text for entry in entries] == ["english"]
+
+
+def test_prepare_public_benchmark_fails_on_missing_omnidocbench_schema(tmp_path: Path) -> None:
+ root = tmp_path / "source"
+ root.mkdir()
+ annotation = root / "OmniDocBench.json"
+ annotation.write_text(json.dumps([{"page_info": {}}]), encoding="utf-8")
+
+ with pytest.raises(DataValidationError, match="page_info.page_attribute"):
+ prepare_public_benchmark(
+ "opendatalab/OmniDocBench",
+ tmp_path / "prepared",
+ annotation_path=annotation,
+ local_image_root=root,
+ )
diff --git a/tests/test_public_table100_runner.py b/tests/test_public_table100_runner.py
new file mode 100644
index 0000000000000000000000000000000000000000..785c68647eaed3cfdb52720eb40a77999ff111a4
--- /dev/null
+++ b/tests/test_public_table100_runner.py
@@ -0,0 +1,213 @@
+from __future__ import annotations
+
+import json
+import importlib.util
+from pathlib import Path
+
+
+_SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "run_public_table100_claim.py"
+_SPEC = importlib.util.spec_from_file_location("run_public_table100_claim", _SCRIPT_PATH)
+assert _SPEC is not None and _SPEC.loader is not None
+_MODULE = importlib.util.module_from_spec(_SPEC)
+_SPEC.loader.exec_module(_MODULE)
+_load_existing_report = _MODULE._load_existing_report
+_write_interim_status = _MODULE._write_interim_status
+
+
+def test_load_existing_report_deduplicates_by_baseline_and_input_path(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": "page.png",
+ "status": "error",
+ "latency_seconds": 300.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {},
+ "error": "TimeoutExpired",
+ },
+ {
+ "baseline": "candidate",
+ "input_path": "page.png",
+ "status": "ok",
+ "latency_seconds": 0.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {"cer": 0.1},
+ "error": None,
+ },
+ {
+ "baseline": "surya",
+ "input_path": "page.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {"cer": 0.2},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ rows = _load_existing_report(report)
+
+ assert len(rows) == 2
+ by_key = {(row.baseline, row.input_path): row for row in rows}
+ assert by_key[("candidate", "page.png")].status == "ok"
+ assert by_key[("candidate", "page.png")].metrics["cer"] == 0.1
+ assert by_key[("surya", "page.png")].status == "ok"
+
+
+def test_write_interim_status_marks_incomplete_until_all_baselines_and_artifacts_exist(tmp_path: Path) -> None:
+ image = tmp_path / "page.png"
+ image.write_bytes(b"image")
+ entry = _MODULE.ManifestEntry(
+ sample_id="s1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image),
+ text="hello",
+ )
+ output_root = tmp_path / "run"
+ benchmark_dir = output_root / "benchmark"
+ benchmark_dir.mkdir(parents=True)
+ report = benchmark_dir / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": str(image),
+ "status": "error",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {},
+ "error": "TimeoutExpired",
+ }
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ status = _write_interim_status(output_root, report, [entry], ["candidate", "surya"])
+
+ assert status["status"] == "incomplete"
+ assert status["evidence_package_ready"] is False
+ assert status["paper_claim_ready"] is False
+ assert status["validation"] == {"present": False, "claim_status": None, "passed": None}
+ assert status["rows"] == 1
+ assert status["expected_rows"] == 2
+ assert status["baselines"] == {"candidate": 1}
+ assert status["baseline_progress"] == {
+ "candidate": {"expected": 1, "completed": 1, "ok": 0, "error": 1, "missing": 0},
+ "surya": {"expected": 1, "completed": 0, "ok": 0, "error": 0, "missing": 1},
+ }
+ assert status["current_phase"] == "surya"
+ assert status["row_statuses"] == {"error": 1}
+ assert status["last_result"] == {
+ "baseline": "candidate",
+ "sample_id": "s1",
+ "input_path": str(image),
+ "status": "error",
+ "error": "TimeoutExpired",
+ }
+ assert status["error_count"] == 1
+ assert status["recent_errors"] == [
+ {
+ "baseline": "candidate",
+ "sample_id": "s1",
+ "input_path": str(image),
+ "error": "TimeoutExpired",
+ }
+ ]
+ assert status["next"] == {"baseline": "surya", "sample_id": "s1", "input_path": str(image)}
+ assert status["final_artifacts"] == {"summary": False, "validation": False, "table_cell_analysis": False}
+ assert (output_root / "run-status.json").exists()
+ status_md = output_root / "run-status.md"
+ assert status_md.exists()
+ status_markdown = status_md.read_text(encoding="utf-8")
+ assert "Evidence package ready: `no`" in status_markdown
+ assert "Paper claim ready: `no`" in status_markdown
+ assert "| candidate | 1 | 1 | 0 | 1 | 0 |" in status_markdown
+ assert "- `candidate` / `s1`: TimeoutExpired" in status_markdown
+
+
+def test_write_interim_status_distinguishes_evidence_package_from_validated_claim(tmp_path: Path) -> None:
+ image = tmp_path / "page.png"
+ image.write_bytes(b"image")
+ entry = _MODULE.ManifestEntry(
+ sample_id="s1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image),
+ text="hello",
+ )
+ output_root = tmp_path / "run"
+ benchmark_dir = output_root / "benchmark"
+ benchmark_dir.mkdir(parents=True)
+ report = benchmark_dir / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": str(image),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {"cer": 0.2},
+ "error": None,
+ },
+ {
+ "baseline": "surya",
+ "input_path": str(image),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["public"],
+ "metrics": {"cer": 0.1},
+ "error": None,
+ },
+ ]
+ ),
+ encoding="utf-8",
+ )
+ (output_root / "summary").mkdir()
+ (output_root / "summary" / "summary.json").write_text("{}", encoding="utf-8")
+ (output_root / "table-cell-analysis").mkdir()
+ (output_root / "table-cell-analysis" / "table-cell-analysis.json").write_text("{}", encoding="utf-8")
+ (output_root / "validation").mkdir()
+ (output_root / "validation" / "validation.json").write_text(
+ json.dumps(
+ {
+ "claim_status": "not_validated",
+ "passed": False,
+ "missing_requirements": ["absolute improvement below threshold"],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ status = _write_interim_status(output_root, report, [entry], ["candidate", "surya"])
+
+ assert status["status"] == "complete"
+ assert status["evidence_package_ready"] is True
+ assert status["paper_claim_ready"] is False
+ assert status["validation"] == {
+ "present": True,
+ "claim_status": "not_validated",
+ "passed": False,
+ "missing_requirements": ["absolute improvement below threshold"],
+ }
+ status_markdown = (output_root / "run-status.md").read_text(encoding="utf-8")
+ assert "Evidence package ready: `yes`" in status_markdown
+ assert "Paper claim ready: `no`" in status_markdown
+ assert "- claim_status: `not_validated`" in status_markdown
+ assert "absolute improvement below threshold" in status_markdown
diff --git a/tests/test_references_validation.py b/tests/test_references_validation.py
new file mode 100644
index 0000000000000000000000000000000000000000..a29603525b4821cfcbfae1a15256757a0d260735
--- /dev/null
+++ b/tests/test_references_validation.py
@@ -0,0 +1,735 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+from ocrtech.benchmark import run_benchmark
+from ocrtech.references import load_reference, score_document
+from ocrtech.manifest import ManifestEntry, sha256_file, sha256_text, write_manifest
+from ocrtech.references import materialize_references
+from ocrtech.schemas import BBox, Block, Document, Page, Table, TableCell
+from ocrtech.validation import check_leakage, validate_claim
+
+
+def test_benchmark_scores_reference_json_structure(tmp_path: Path) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text(
+ "नेपाल सरकार\n"
+ "नाम उमेर जिल्ला\n"
+ "राम ३२ काठमाडौं\n"
+ "Sita 29 Lalitpur\n",
+ encoding="utf-8",
+ )
+ source.with_suffix(".ref.json").write_text(
+ json.dumps(
+ {
+ "text": "नेपाल सरकार",
+ "reading_order": ["p0-l0", "p0-l1", "p0-l2", "p0-l3"],
+ "tables": [
+ [
+ ["नाम", "उमेर", "जिल्ला"],
+ ["राम", "३२", "काठमाडौं"],
+ ["Sita", "29", "Lalitpur"],
+ ]
+ ],
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"])
+
+ assert results[0].metrics["reading_order_pair_accuracy"] == 1.0
+ assert results[0].metrics["table_cell_f1"] == 1.0
+ assert results[0].metrics["table_structure_similarity"] == 1.0
+ assert "text_cer" in results[0].metrics
+
+
+def test_benchmark_scores_document_reconstruction_markdown(tmp_path: Path) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text(
+ "नेपाल सरकार\n"
+ "नाम उमेर जिल्ला\n"
+ "राम ३२ काठमाडौं\n"
+ "Sita 29 Lalitpur\n",
+ encoding="utf-8",
+ )
+ source.with_suffix(".ref.json").write_text(
+ json.dumps(
+ {
+ "markdown": "# नेपाल सरकार\n\n| नाम | उमेर | जिल्ला |\n| --- | --- | --- |\n| राम | ३२ | काठमाडौं |\n| Sita | 29 | Lalitpur |\n",
+ "tables": [
+ [
+ ["नाम", "उमेर", "जिल्ला"],
+ ["राम", "३२", "काठमाडौं"],
+ ["Sita", "29", "Lalitpur"],
+ ]
+ ],
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"])
+
+ assert results[0].metrics["document_reconstruction_cer"] == 0
+ assert results[0].metrics["document_reconstruction_wer"] == 0
+ assert results[0].metrics["document_reconstruction_similarity"] == 1.0
+
+
+def test_structured_reference_table_scores_rowspan_colspan(tmp_path: Path) -> None:
+ source = tmp_path / "merged.png"
+ source.write_bytes(b"fake image bytes")
+ reference = source.with_suffix(".ref.json")
+ reference.write_text(
+ json.dumps(
+ {
+ "tables": [
+ {
+ "cells": [
+ {"row": 0, "col": 0, "text": "नाम", "rowspan": 1, "colspan": 2},
+ {"row": 1, "col": 0, "text": "राम"},
+ {"row": 1, "col": 1, "text": "१२"},
+ ]
+ }
+ ]
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+ loaded = load_reference(source)
+ assert loaded is not None
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 40),
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=1, col=0, text="राम"),
+ TableCell(row=1, col=1, text="१२"),
+ ],
+ )
+ document = Document(
+ source_path=str(source),
+ pages=[Page(page_index=0, blocks=[Block(block_id="p0-b0", block_type="table", page_index=0, bbox=table.bbox, order=0, table_id=table.table_id)])],
+ tables=[table],
+ )
+
+ metrics = score_document(document, "", loaded)
+
+ assert metrics["table_cell_f1"] == 1.0
+ assert metrics["table_exact_match"] == 0.0
+ assert metrics["table_structure_similarity"] < 1.0
+ assert metrics["table_teds_structure"] < 1.0
+ assert metrics["table_teds_text"] < 1.0
+
+
+def test_table_scoring_matches_best_predicted_table_not_first_table(tmp_path: Path) -> None:
+ source = tmp_path / "tables.png"
+ source.write_bytes(b"fake image bytes")
+ source.with_suffix(".ref.json").write_text(
+ json.dumps({"tables": [[["Name", "Value"], ["A", "1"]]]}),
+ encoding="utf-8",
+ )
+ loaded = load_reference(source)
+ assert loaded is not None
+ decoy = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 20, 20),
+ cells=[TableCell(row=0, col=0, text="wrong")],
+ )
+ correct = Table(
+ table_id="p0-t1",
+ page_index=0,
+ bbox=BBox(0, 30, 100, 40),
+ cells=[
+ TableCell(row=0, col=0, text="Name"),
+ TableCell(row=0, col=1, text="Value"),
+ TableCell(row=1, col=0, text="A"),
+ TableCell(row=1, col=1, text="1"),
+ ],
+ )
+ document = Document(source_path=str(source), pages=[Page(page_index=0)], tables=[decoy, correct])
+
+ metrics = score_document(document, "", loaded)
+
+ assert metrics["table_cell_f1"] == 1.0
+ assert metrics["table_exact_match"] == 1.0
+ assert metrics["table_teds_structure"] == 1.0
+ assert metrics["table_teds_text"] == 1.0
+
+
+def test_benchmark_scores_figure_caption_reference(tmp_path: Path) -> None:
+ source = tmp_path / "figure.txt"
+ source.write_text(
+ "वार्षिक प्रतिवेदन\n"
+ "[Figure: revenue chart]\n"
+ "चित्र १: Revenue growth from 2022 to 2026.\n"
+ "निष्कर्ष: राजस्व क्रमशः बढेको छ।\n",
+ encoding="utf-8",
+ )
+ source.with_suffix(".ref.json").write_text(
+ json.dumps(
+ {
+ "text": "वार्षिक प्रतिवेदन\nचित्र १: Revenue growth from 2022 to 2026.\nनिष्कर्ष: राजस्व क्रमशः बढेको छ।",
+ "reading_order": ["p0-l0", "p0-l1", "p0-l2", "p0-l3"],
+ "figures": [
+ {
+ "figure_id": "fig-revenue-chart",
+ "page_index": 0,
+ "caption": "चित्र १: Revenue growth from 2022 to 2026.",
+ "line_ids": ["p0-l1", "p0-l2"],
+ }
+ ],
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"])
+
+ assert results[0].metrics["figure_detection_f1"] == 1.0
+ assert results[0].metrics["figure_caption_cer"] == 0
+
+
+def test_benchmark_uses_manifest_reference_path_without_references_dir(tmp_path: Path) -> None:
+ source = tmp_path / "line.txt"
+ source.write_text("नेपाल सरकार\n", encoding="utf-8")
+ reference = tmp_path / "custom-reference.md"
+ reference.write_text("नेपाल सरकार\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("नेपाल सरकार")
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="नेपाल सरकार",
+ sha256=image_hash,
+ metadata={"reference_path": str(reference), "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ manifest,
+ )
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"], eval_manifest=manifest)
+
+ assert results[0].metrics["cer"] == 0
+ assert results[0].metrics["wer"] == 0
+
+
+def test_markdown_reference_path_scores_document_reconstruction(tmp_path: Path) -> None:
+ source = tmp_path / "title.txt"
+ source.write_text("नेपाल सरकार\n", encoding="utf-8")
+ reference = tmp_path / "document.md"
+ reference.write_text("# नेपाल सरकार\n", encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("# नेपाल सरकार")
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-md",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="# नेपाल सरकार",
+ sha256=image_hash,
+ metadata={"reference_path": str(reference), "text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ manifest,
+ )
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"], eval_manifest=manifest)
+
+ assert results[0].metrics["document_reconstruction_similarity"] == 1.0
+
+
+def test_materialize_references_writes_reference_pack_and_manifest(tmp_path: Path) -> None:
+ source = tmp_path / "sample.png"
+ source.write_bytes(b"png")
+ manifest = tmp_path / "eval.jsonl"
+ image_hash = sha256_file(source)
+ text_hash = sha256_text("hello world")
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="hello world",
+ sha256=image_hash,
+ metadata={"text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ manifest,
+ )
+
+ report = materialize_references(manifest, tmp_path / "references", rewritten_manifest_path=tmp_path / "eval-with-refs.jsonl")
+ rewritten_rows = [json.loads(line) for line in (tmp_path / "eval-with-refs.jsonl").read_text(encoding="utf-8").splitlines() if line.strip()]
+
+ assert Path(report.references_dir, "sample-1", "document.md").read_text(encoding="utf-8") == "hello world\n"
+ assert rewritten_rows[0]["metadata"]["reference_path"].endswith("sample-1/document.md")
+ assert Path(report.summary_json_path).exists()
+
+
+def test_validate_claim_passes_configured_paired_gate(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "s1", "a.png", ["nepali"], {"cer": 0.02}),
+ _row("tesseract", "s1", "a.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s2", "b.png", ["nepali"], {"cer": 0.03}),
+ _row("tesseract", "s2", "b.png", ["nepali"], {"cer": 0.09}),
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 2,
+ "required_slices": {"nepali": 2},
+ "bootstrap_iterations": 50,
+ "gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "nepali",
+ "min_absolute_margin": 0.01,
+ "min_pair_win_rate": 0.5,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+ candidate_model = tmp_path / "candidate-model.json"
+ fallback_model = tmp_path / "fallback-model.json"
+ candidate_model.write_text('{"model_id":"candidate"}\n', encoding="utf-8")
+ fallback_model.write_text('{"model_id":"fallback"}\n', encoding="utf-8")
+
+ validation = validate_claim(
+ report,
+ tmp_path / "validation",
+ config_path=config,
+ candidate_model_config=candidate_model,
+ fallback_model_config=fallback_model,
+ )
+
+ assert validation.passed
+ assert validation.claim_status == "validated"
+ assert validation.gates[0].absolute_improvement
+ assert validation.gates[0].win_count == 2
+ assert validation.gates[0].loss_count == 0
+ assert validation.gates[0].tie_count == 0
+ assert validation.gates[0].win_rate == 1.0
+ assert validation.gates[0].pair_win_rate == 1.0
+ assert (tmp_path / "validation" / "validation.json").exists()
+ payload = json.loads((tmp_path / "validation" / "validation.json").read_text(encoding="utf-8"))
+ assert payload["gates"][0]["gate"]["min_pair_win_rate"] == 0.5
+ assert payload["gates"][0]["pair_win_rate"] == 1.0
+ assert payload["provenance"]["benchmark_report"]["path"] == str(report)
+ assert payload["provenance"]["benchmark_report"]["sha256"]
+ assert payload["provenance"]["validation_config"]["path"] == str(config)
+ assert payload["provenance"]["validation_config"]["sha256"]
+ assert payload["provenance"]["candidate_model_config"]["path"] == str(candidate_model)
+ assert payload["provenance"]["candidate_model_config"]["sha256"]
+ assert payload["provenance"]["fallback_model_config"]["path"] == str(fallback_model)
+ assert payload["provenance"]["fallback_model_config"]["sha256"]
+
+
+def test_validate_claim_fails_with_missing_baseline_pairs(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(json.dumps([_row("ours", "s1", "a.png", ["nepali"], {"cer": 0.02})]), encoding="utf-8")
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 1,
+ "gates": [{"baseline": "tesseract", "metric": "cer", "direction": "lower"}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config)
+
+ assert not validation.passed
+ assert "no paired samples" in validation.missing_requirements[0]
+
+
+def test_validate_claim_can_require_pair_win_rate_over_all_pairs(tmp_path: Path) -> None:
+ rows = []
+ for index in range(1, 6):
+ metric = 0.09 if index == 1 else 0.10
+ rows.append(_row("ours", f"s{index}", f"{index}.png", ["nepali"], {"cer": metric}))
+ rows.append(_row("tesseract", f"s{index}", f"{index}.png", ["nepali"], {"cer": 0.10}))
+ report = tmp_path / "report.json"
+ report.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 5,
+ "required_slices": {"nepali": 5},
+ "bootstrap_iterations": 0,
+ "gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "nepali",
+ "min_pairs": 5,
+ "min_absolute_margin": 0.0,
+ "min_pair_win_rate": 0.5,
+ "require_ci_above_zero": False,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config)
+
+ assert not validation.passed
+ assert validation.gates[0].win_count == 1
+ assert validation.gates[0].tie_count == 4
+ assert validation.gates[0].win_rate == 1.0
+ assert validation.gates[0].pair_win_rate == 0.2
+ assert "paired win rate 0.200000 < required 0.500000" in validation.missing_requirements[0]
+
+
+def test_validate_claim_merges_eval_manifest_slices_when_report_already_has_slices(tmp_path: Path) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"image")
+ manifest = tmp_path / "hard-eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="s1",
+ dataset="fixture",
+ split="hard_eval",
+ image_path=str(source),
+ text="नेपाल",
+ metadata={"slices": ["hard_eval", "table"]},
+ )
+ ],
+ manifest,
+ )
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "s1", str(source), ["nepali"], {"cer": 0.01}),
+ _row("surya", "s1", str(source), ["nepali"], {"cer": 0.10}),
+ ]
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 1,
+ "required_slices": {"hard_eval": 1},
+ "bootstrap_iterations": 0,
+ "gates": [
+ {
+ "baseline": "surya",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "hard_eval",
+ "min_pairs": 1,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config, eval_manifest=manifest)
+
+ assert validation.passed
+ assert validation.slice_counts["hard_eval"] == 1
+ assert validation.gates[0].pairs == 1
+
+
+def test_validate_claim_can_require_full_eval_manifest_coverage(tmp_path: Path) -> None:
+ source_one = tmp_path / "page-1.png"
+ source_two = tmp_path / "page-2.png"
+ source_one.write_bytes(b"image one")
+ source_two.write_bytes(b"image two")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="s1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source_one),
+ text="नेपाल",
+ metadata={"slices": ["nepali"]},
+ ),
+ ManifestEntry(
+ sample_id="s2",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source_two),
+ text="सरकार",
+ metadata={"slices": ["nepali"]},
+ ),
+ ],
+ manifest,
+ )
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "s1", str(source_one), ["nepali"], {"cer": 0.01}),
+ _row("surya", "s1", str(source_one), ["nepali"], {"cer": 0.10}),
+ ]
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 1,
+ "required_slices": {"nepali": 1},
+ "require_full_eval_manifest_coverage": True,
+ "bootstrap_iterations": 0,
+ "gates": [
+ {
+ "baseline": "surya",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "nepali",
+ "min_pairs": 1,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config, eval_manifest=manifest)
+
+ assert not validation.passed
+ assert validation.gates[0].passed
+ assert "baseline 'ours' is missing successful rows for 1 eval manifest samples: s2" in validation.missing_requirements
+ assert "baseline 'surya' is missing successful rows for 1 eval manifest samples: s2" in validation.missing_requirements
+
+
+def test_validate_claim_gate_can_require_multiple_slices(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "hard-table", "a.png", ["hard_eval", "table"], {"cer": 0.01}),
+ _row("surya", "hard-table", "a.png", ["hard_eval", "table"], {"cer": 0.10}),
+ _row("ours", "other-table", "b.png", ["table"], {"cer": 0.90}),
+ _row("surya", "other-table", "b.png", ["table"], {"cer": 0.10}),
+ ]
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 2,
+ "bootstrap_iterations": 0,
+ "gates": [
+ {
+ "baseline": "surya",
+ "metric": "cer",
+ "direction": "lower",
+ "slices": ["hard_eval", "table"],
+ "min_pairs": 1,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config)
+
+ assert validation.passed
+ assert validation.gates[0].pairs == 1
+ assert validation.gates[0].candidate_mean == 0.01
+
+
+def test_validate_claim_supports_sign_test_gate(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "s1", "a.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s1", "a.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s2", "b.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s2", "b.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s3", "c.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s3", "c.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s4", "d.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s4", "d.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s5", "e.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s5", "e.png", ["nepali"], {"cer": 0.10}),
+ _row("ours", "s6", "f.png", ["nepali"], {"cer": 0.01}),
+ _row("tesseract", "s6", "f.png", ["nepali"], {"cer": 0.10}),
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 6,
+ "required_slices": {"nepali": 6},
+ "bootstrap_iterations": 50,
+ "gates": [
+ {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "direction": "lower",
+ "slice": "nepali",
+ "min_pairs": 6,
+ "max_p_value": 0.05,
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config)
+
+ assert validation.passed
+ assert validation.gates[0].sign_test_p_value is not None
+ assert validation.gates[0].sign_test_p_value <= 0.05
+
+
+def test_validate_claim_reports_aggregate_metrics(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ _row("ours", "s1", "a.png", ["nepali"], {"cer": 0.02, "quality_score": 0.90}),
+ _row("ours", "s2", "b.png", ["english"], {"cer": 0.04, "quality_score": 0.80}),
+ _row("tesseract", "s1", "a.png", ["nepali"], {"cer": 0.10, "quality_score": 0.50}),
+ _row("tesseract", "s2", "b.png", ["english"], {"cer": 0.20, "quality_score": 0.40}),
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ config = tmp_path / "config.json"
+ config.write_text(
+ json.dumps(
+ {
+ "candidate": "ours",
+ "min_samples": 2,
+ "gates": [{"baseline": "tesseract", "metric": "cer", "direction": "lower", "min_pairs": 2}],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ validation = validate_claim(report, tmp_path / "validation", config_path=config)
+
+ assert "ours" in validation.aggregate_metrics
+ assert validation.aggregate_metrics["ours"]["all"]["sample_count"] == 2
+ assert validation.aggregate_metrics["ours"]["nepali"]["cer"] == 0.02
+
+
+def test_leakage_check_fails_on_image_hash_and_warns_on_text_only(tmp_path: Path) -> None:
+ shared_image = tmp_path / "shared.png"
+ eval_image = tmp_path / "eval.png"
+ shared_image.write_bytes(b"same")
+ eval_image.write_bytes(b"different")
+ image_hash = sha256_file(shared_image)
+ text_hash = sha256_text("same label")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="train-1",
+ dataset="local",
+ split="train",
+ image_path=str(shared_image),
+ text="same label",
+ sha256=image_hash,
+ metadata={"text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ )
+ ],
+ train_manifest,
+ )
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="eval-1",
+ dataset="local",
+ split="eval",
+ image_path=str(shared_image),
+ text="same label",
+ sha256=image_hash,
+ metadata={"text_sha256": text_hash, "sample_sha256": sha256_text(f"{image_hash}\n{text_hash}")},
+ ),
+ ManifestEntry(
+ sample_id="eval-2",
+ dataset="local",
+ split="eval",
+ image_path=str(eval_image),
+ text="same label",
+ sha256=sha256_file(eval_image),
+ metadata={"text_sha256": text_hash},
+ ),
+ ],
+ eval_manifest,
+ )
+
+ report = check_leakage([train_manifest], eval_manifest)
+
+ assert not report.passed
+ assert image_hash in report.overlaps["image_sha256"]
+ assert text_hash in report.warnings["text_sha256"]
+
+
+def _row(baseline: str, sample_id: str, input_path: str, slices: list[str], metrics: dict[str, float]) -> dict[str, object]:
+ return {
+ "baseline": baseline,
+ "input_path": input_path,
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": sample_id,
+ "slices": slices,
+ "metrics": metrics,
+ "error": None,
+ }
diff --git a/tests/test_remote.py b/tests/test_remote.py
new file mode 100644
index 0000000000000000000000000000000000000000..6bbab05552c3837eae5216a1c354c9eb872ae456
--- /dev/null
+++ b/tests/test_remote.py
@@ -0,0 +1,230 @@
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+
+from ocrtech.errors import RemoteAuditError
+from ocrtech.remote import audit_remote_host, bootstrap_remote_host, sync_remote_workspace
+
+
+def test_audit_remote_host_passes_with_sufficient_probe(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.11.9",
+ "python_version_info": [3, 11, 9],
+ "system": "Linux",
+ "machine": "x86_64",
+ "platform": "Linux-6.8.0-x86_64",
+ "cwd": "/home/k2/ocr-tech",
+ "free_bytes_cwd": 40 * 1024**3,
+ "free_bytes_home": 40 * 1024**3,
+ "commands": {"python3": "/usr/bin/python3", "git": "/usr/bin/git", "uv": None, "nvidia-smi": None},
+ "python_candidates": {
+ "python3.11": {"candidate": "python3.11", "path": "/usr/local/bin/python3.11", "version": "3.11.9", "version_info": [3, 11, 9]},
+ "python3": {"candidate": "python3", "path": "/usr/bin/python3", "version": "3.9.6", "version_info": [3, 9, 6]},
+ },
+ "paths": {"~/ocr-tech": {"expanded": "/home/k2/ocr-tech", "exists": True, "is_dir": True, "is_file": False}},
+ },
+ )
+
+ report = audit_remote_host(
+ "100.97.238.103",
+ tmp_path / "audit",
+ user="k2",
+ workdir="~/ocr-tech",
+ require_paths=["~/ocr-tech"],
+ )
+
+ assert report.passed
+ assert any(check.name == "gpu" and check.status == "warn" for check in report.checks)
+ assert (tmp_path / "audit" / "remote-audit.json").exists()
+
+
+def test_audit_remote_host_prefers_newer_python_candidate(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.9.6",
+ "python_version_info": [3, 9, 6],
+ "system": "Linux",
+ "machine": "x86_64",
+ "platform": "Linux-6.8.0-x86_64",
+ "cwd": "/home/k2",
+ "free_bytes_cwd": 40 * 1024**3,
+ "free_bytes_home": 40 * 1024**3,
+ "commands": {"git": "/usr/bin/git", "uv": "/Users/k2/.local/bin/uv", "nvidia-smi": None},
+ "python_candidates": {
+ "python3.11": {"candidate": "python3.11", "path": "/Users/k2/.local/bin/python3.11", "version": "3.11.14", "version_info": [3, 11, 14]},
+ "python3": {"candidate": "python3", "path": "/usr/bin/python3", "version": "3.9.6", "version_info": [3, 9, 6]},
+ },
+ "paths": {},
+ },
+ )
+
+ report = audit_remote_host("100.97.238.103", tmp_path / "audit", user="k2")
+
+ assert report.passed
+ python_check = next(check for check in report.checks if check.name == "python")
+ assert "python3.11" in python_check.summary
+
+
+def test_audit_remote_host_fails_on_python_and_disk(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.9.6",
+ "python_version_info": [3, 9, 6],
+ "system": "Linux",
+ "machine": "x86_64",
+ "platform": "Linux-6.8.0-x86_64",
+ "cwd": "/home/k2/ocr-tech",
+ "free_bytes_cwd": int(0.8 * 1024**3),
+ "free_bytes_home": int(0.8 * 1024**3),
+ "commands": {"python3": "/usr/bin/python3", "git": "/usr/bin/git", "uv": None, "nvidia-smi": None},
+ "python_candidates": {
+ "python3": {"candidate": "python3", "path": "/usr/bin/python3", "version": "3.9.6", "version_info": [3, 9, 6]},
+ },
+ "paths": {},
+ },
+ )
+
+ report = audit_remote_host("100.97.238.103", tmp_path / "audit", user="k2")
+
+ assert not report.passed
+ statuses = {check.name: check.status for check in report.checks}
+ assert statuses["python"] == "fail"
+ assert statuses["disk"] == "fail"
+
+
+def test_audit_remote_host_requires_password_env_when_requested(tmp_path: Path) -> None:
+ with pytest.raises(RemoteAuditError):
+ audit_remote_host("100.97.238.103", tmp_path / "audit", user="k2", password_env="OCRTECH_REMOTE_PASSWORD")
+
+
+def test_audit_remote_host_can_fail_on_unsupported_paddle_training_platform(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.11.14",
+ "python_version_info": [3, 11, 14],
+ "system": "Darwin",
+ "machine": "arm64",
+ "platform": "macOS-14.6-arm64-arm-64bit",
+ "cwd": "/Users/k2/ocr-tech",
+ "free_bytes_cwd": 40 * 1024**3,
+ "free_bytes_home": 40 * 1024**3,
+ "commands": {"git": "/usr/bin/git", "uv": "/Users/k2/.local/bin/uv", "nvidia-smi": None},
+ "python_candidates": {
+ "python3.11": {"candidate": "python3.11", "path": "/Users/k2/.local/bin/python3.11", "version": "3.11.14", "version_info": [3, 11, 14]},
+ },
+ "paths": {},
+ },
+ )
+
+ report = audit_remote_host("100.97.238.103", tmp_path / "audit", user="k2", require_paddle_training=True)
+
+ assert not report.passed
+ platform_check = next(check for check in report.checks if check.name == "platform")
+ assert platform_check.status == "fail"
+ assert "arm64" in platform_check.summary
+
+
+def test_bootstrap_remote_host_writes_report(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.9.6",
+ "python_version_info": [3, 9, 6],
+ "system": "Darwin",
+ "machine": "arm64",
+ "platform": "macOS-14.6-arm64-arm-64bit",
+ "cwd": "/Users/k2",
+ "free_bytes_cwd": 40 * 1024**3,
+ "free_bytes_home": 40 * 1024**3,
+ "commands": {"git": "/usr/bin/git", "uv": "/Users/k2/.local/bin/uv", "nvidia-smi": None},
+ "python_candidates": {
+ "python3.11": {"candidate": "python3.11", "path": "/Users/k2/.local/bin/python3.11", "version": "3.11.14", "version_info": [3, 11, 14]},
+ },
+ "paths": {},
+ },
+ )
+ monkeypatch.setattr(
+ "ocrtech.remote._run_remote_json_script",
+ lambda *args, **kwargs: {
+ "workdir": "/Users/k2/ocr-tech",
+ "workdir_existed": False,
+ "venv_dir": "/Users/k2/ocr-tech/.venv",
+ "venv_existed": False,
+ "venv_recreated": False,
+ "python_command": "/Users/k2/.local/bin/python3.11",
+ "python_bin": "/Users/k2/ocr-tech/.venv/bin/python",
+ "pip_bin": "/Users/k2/ocr-tech/.venv/bin/pip",
+ },
+ )
+
+ report = bootstrap_remote_host("100.97.238.103", tmp_path / "bootstrap", user="k2", workdir="~/ocr-tech")
+
+ assert report.passed
+ assert report.python_command.endswith("python3.11")
+ assert (tmp_path / "bootstrap" / "remote-bootstrap.json").exists()
+
+
+def test_bootstrap_remote_host_can_recreate_venv(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(
+ "ocrtech.remote._probe_remote",
+ lambda *args, **kwargs: {
+ "python_version": "3.9.6",
+ "python_version_info": [3, 9, 6],
+ "system": "Darwin",
+ "machine": "arm64",
+ "platform": "macOS-14.6-arm64-arm-64bit",
+ "cwd": "/Users/k2",
+ "free_bytes_cwd": 40 * 1024**3,
+ "free_bytes_home": 40 * 1024**3,
+ "commands": {"git": "/usr/bin/git", "uv": "/Users/k2/.local/bin/uv", "nvidia-smi": None},
+ "python_candidates": {
+ "~/.local/bin/python3.11": {"candidate": "~/.local/bin/python3.11", "path": "/Users/k2/.local/bin/python3.11", "version": "3.11.14", "version_info": [3, 11, 14]},
+ },
+ "paths": {},
+ },
+ )
+ captured: dict[str, object] = {}
+
+ def fake_run_remote_json_script(*args, **kwargs):
+ captured["script"] = kwargs["script"]
+ return {
+ "workdir": "/Users/k2/ocr-tech",
+ "workdir_existed": True,
+ "venv_dir": "/Users/k2/ocr-tech/.venv",
+ "venv_existed": False,
+ "venv_recreated": True,
+ "python_command": "/Users/k2/.local/bin/python3.11",
+ "python_bin": "/Users/k2/ocr-tech/.venv/bin/python",
+ "pip_bin": "/Users/k2/ocr-tech/.venv/bin/pip",
+ }
+
+ monkeypatch.setattr("ocrtech.remote._run_remote_json_script", fake_run_remote_json_script)
+
+ report = bootstrap_remote_host("100.97.238.103", tmp_path / "bootstrap", user="k2", workdir="~/ocr-tech", recreate_venv=True)
+
+ assert report.passed
+ assert report.actions["venv_recreated"] is True
+ assert "shutil.rmtree" in str(captured["script"])
+
+
+def test_sync_remote_workspace_writes_report(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ local_root = tmp_path / "workspace"
+ local_root.mkdir()
+ (local_root / "README.md").write_text("hello\n", encoding="utf-8")
+ monkeypatch.setattr("ocrtech.remote._create_workspace_archive", lambda *args, **kwargs: None)
+ monkeypatch.setattr("ocrtech.remote._copy_file_to_remote", lambda *args, **kwargs: None)
+ payloads = iter([{"expanded_path": "/Users/k2/ocr-tech"}, {"workdir": "/Users/k2/ocr-tech"}])
+ monkeypatch.setattr("ocrtech.remote._run_remote_json_script", lambda *args, **kwargs: next(payloads))
+
+ report = sync_remote_workspace(local_root, tmp_path / "sync", host="100.97.238.103", user="k2", remote_workdir="~/ocr-tech")
+
+ assert report.passed
+ assert report.remote_workdir == "/Users/k2/ocr-tech"
+ assert (tmp_path / "sync" / "remote-sync.json").exists()
diff --git a/tests/test_source_audit.py b/tests/test_source_audit.py
new file mode 100644
index 0000000000000000000000000000000000000000..e6219db32dfccd0b49ea57f5b042b2f6bc9390df
--- /dev/null
+++ b/tests/test_source_audit.py
@@ -0,0 +1,510 @@
+from __future__ import annotations
+
+import csv
+import json
+import importlib.util
+from pathlib import Path
+
+from ocrtech.cli import main
+from ocrtech.manifest import ManifestEntry, load_manifest, sha256_file, write_manifest
+from ocrtech.source_audit import audit_gorkhapatra_language_pages, audit_gorkhapatra_source, prepare_gorkhapatra_language_page_pack
+
+
+def test_audit_gorkhapatra_source_parses_local_category_and_epaper_html(tmp_path: Path) -> None:
+ category = tmp_path / "category.html"
+ category.write_text(
+ """
+
+
+
+
+
+
+
+
+ समावेशीकरणको दिशामा नयाँ फड्को : गोरखापत्रद्वारा प्रकाशित संस्कृत भाषा
+
+ """,
+ encoding="utf-8",
+ )
+ epaper = tmp_path / "epaper.html"
+ epaper.write_text(
+ """
+
+
+
+ २०८३ असार १ सोमवार
+
+
+ """,
+ encoding="utf-8",
+ )
+
+ audit = audit_gorkhapatra_source(
+ tmp_path / "out",
+ category_html_paths=[category],
+ epaper_html_paths=[epaper],
+ )
+
+ assert audit.article_count == 3
+ assert audit.epaper_count == 1
+ assert audit.language_counts == {"बान्तावा": 1, "मगर": 1, "संस्कृत": 1}
+ assert audit.articles[1].article_url == "https://gorkhapatraonline.com/news/207983"
+ assert audit.articles[2].article_url == "https://gorkhapatraonline.com/news/210293"
+ assert audit.epapers[0].direct_pdf_url == "https://epaper.gorkhapatraonline.com/uploads/file/2026/6/gorkhapatra/sample.pdf"
+ assert (tmp_path / "out" / "gorkhapatra-source-audit.json").exists()
+ assert (tmp_path / "out" / "gorkhapatra-source-audit.md").exists()
+
+
+def test_cli_audit_gorkhapatra_source_downloads_local_article_image(tmp_path: Path, capsys) -> None:
+ image = tmp_path / "source.jpg"
+ image.write_bytes(b"not really a jpeg")
+ category = tmp_path / "category.html"
+ category.write_text(
+ f"""
+
+
+
+
+
+ """,
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "audit-gorkhapatra-source",
+ "--no-default-urls",
+ "--category-html",
+ str(category),
+ "--download-assets",
+ "--max-article-images",
+ "1",
+ "--out",
+ str(tmp_path / "audit"),
+ ]
+ )
+
+ captured = capsys.readouterr()
+ payload = json.loads((tmp_path / "audit" / "gorkhapatra-source-audit.json").read_text(encoding="utf-8"))
+ assert exit_code == 0
+ assert "articles=1 epapers=0 downloaded=1" in captured.out
+ assert payload["language_counts"] == {"लिम्बु": 1}
+ downloaded = payload["articles"][0]["downloaded_image"]
+ assert downloaded["sha256"]
+ assert Path(downloaded["path"]).read_bytes() == b"not really a jpeg"
+
+
+def test_prepare_gorkhapatra_pack_writes_pending_reference_manifest_from_article_images(tmp_path: Path, capsys) -> None:
+ image = tmp_path / "source.jpg"
+ image.write_bytes(b"article image")
+ audit = tmp_path / "source-audit.json"
+ audit.write_text(
+ json.dumps(
+ {
+ "articles": [
+ {
+ "article_url": "https://gorkhapatraonline.com/news/limbu",
+ "image_url": "https://gorkhapatraonline.com/storage/limbu.jpg",
+ "title": "समावेशीकरणको दिशामा नयाँ फड्को : गोरखापत्रद्वारा प्रकाशित लिम्बु भाषा",
+ "language": "लिम्बु",
+ "source_page": "fixture",
+ "downloaded_image": {
+ "url": "https://gorkhapatraonline.com/storage/limbu.jpg",
+ "path": str(image),
+ "sha256": "fixture",
+ "size_bytes": image.stat().st_size,
+ "kind": "image",
+ "warnings": [],
+ },
+ }
+ ],
+ "epapers": [],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "prepare-gorkhapatra-pack",
+ str(audit),
+ "--out",
+ str(tmp_path / "pack"),
+ "--no-epaper-pages",
+ ]
+ )
+
+ captured = capsys.readouterr()
+ entries = load_manifest(tmp_path / "pack" / "manifests" / "gorkhapatra-pack.jsonl")
+ reference = json.loads(Path(entries[0].metadata["reference_path"]).read_text(encoding="utf-8"))
+ assert exit_code == 0
+ assert "samples=1 article_images=1 epaper_pages=0" in captured.out
+ assert entries[0].metadata["language"] == "लिम्बु"
+ assert entries[0].metadata["reference_status"] == "pending_manual_label"
+ assert entries[0].metadata["claim_evidence_eligible"] is False
+ assert "language:लिम्बु" in entries[0].metadata["slices"]
+ assert Path(entries[0].image_path).read_bytes() == b"article image"
+ assert reference["metadata"]["reference_status"] == "pending_manual_label"
+
+
+def test_prepare_gorkhapatra_pack_renders_epaper_pdf_pages_when_pymupdf_available(tmp_path: Path) -> None:
+ if importlib.util.find_spec("fitz") is None:
+ return
+ import fitz
+
+ pdf = tmp_path / "sample.pdf"
+ document = fitz.open()
+ page = document.new_page(width=120, height=120)
+ page.insert_text((20, 40), "Gorkhapatra")
+ document.save(pdf)
+ document.close()
+ audit = tmp_path / "source-audit.json"
+ audit.write_text(
+ json.dumps(
+ {
+ "articles": [],
+ "epapers": [
+ {
+ "viewer_url": "https://epaper.gorkhapatraonline.com/pdf?file=/uploads/file/sample.pdf",
+ "direct_pdf_url": "https://epaper.gorkhapatraonline.com/uploads/file/sample.pdf",
+ "source_page": "fixture",
+ "date_label": "२०८३ असार १ सोमवार",
+ "downloaded_pdf": {
+ "url": "https://epaper.gorkhapatraonline.com/uploads/file/sample.pdf",
+ "path": str(pdf),
+ "sha256": "fixture",
+ "size_bytes": pdf.stat().st_size,
+ "kind": "pdf",
+ "warnings": [],
+ },
+ }
+ ],
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "prepare-gorkhapatra-pack",
+ str(audit),
+ "--out",
+ str(tmp_path / "pack"),
+ "--no-article-images",
+ "--max-epaper-pdfs",
+ "1",
+ "--max-pages-per-pdf",
+ "1",
+ ]
+ )
+
+ entries = load_manifest(tmp_path / "pack" / "manifests" / "gorkhapatra-pack.jsonl")
+ assert exit_code == 0
+ assert len(entries) == 1
+ assert Path(entries[0].image_path).suffix == ".png"
+ assert Path(entries[0].image_path).exists()
+ assert entries[0].metadata["source_kind"] == "epaper_page"
+ assert entries[0].metadata["pdf_page_index"] == 0
+
+
+def test_audit_gorkhapatra_language_pages_matches_publication_date_to_epaper(tmp_path: Path, capsys) -> None:
+ publication = tmp_path / "publication.html"
+ publication.write_text(
+ """
+
+
+
+
+
+ - गोरखापत्र अनलाइन
+ - १ असार २०८३, सोमबार
+
+
+
+
+
+ """,
+ encoding="utf-8",
+ )
+ epaper = tmp_path / "epaper.html"
+ epaper.write_text(
+ """
+
+
+ २०८३ असार १ सोमवार
+
+
+ """,
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "audit-gorkhapatra-language-pages",
+ "--no-default-urls",
+ "--publication-html",
+ str(publication),
+ "--epaper-html",
+ str(epaper),
+ "--out",
+ str(tmp_path / "out"),
+ ]
+ )
+
+ captured = capsys.readouterr()
+ payload = json.loads((tmp_path / "out" / "gorkhapatra-language-pages.json").read_text(encoding="utf-8"))
+ alignment = payload["alignments"][0]
+ assert exit_code == 0
+ assert "publication_items=1 aligned=1 language_page_hits=0" in captured.out
+ assert payload["status_counts"] == {"matched_epaper_not_downloaded": 1}
+ assert alignment["publication_item"]["date_key"] == "2083-03-01"
+ assert alignment["publication_item"]["language"] == "मगर"
+ assert alignment["epaper"]["direct_pdf_url"] == "https://epaper.gorkhapatraonline.com/uploads/file/2026/6/gorkhapatra/sample.pdf"
+ assert alignment["claim_evidence_eligible"] is False
+
+
+def test_audit_gorkhapatra_language_pages_finds_marker_in_downloaded_pdf(tmp_path: Path) -> None:
+ if importlib.util.find_spec("fitz") is None:
+ return
+ import fitz
+
+ pdf = tmp_path / "language-page.pdf"
+ document = fitz.open()
+ page = document.new_page(width=300, height=300)
+ page.insert_text((40, 80), "bhasa pristha")
+ page.insert_text((40, 120), "Sample language page body")
+ document.save(pdf)
+ document.close()
+ publication = tmp_path / "publication.html"
+ publication.write_text(
+ """
+
+
+
+
+
+
+ """,
+ encoding="utf-8",
+ )
+ epaper = tmp_path / "epaper.html"
+ epaper.write_text(
+ f"""
+
+
+ २०८३ असार १ सोमवार
+
+
+ """,
+ encoding="utf-8",
+ )
+
+ audit = audit_gorkhapatra_language_pages(
+ tmp_path / "out",
+ publication_html_paths=[publication],
+ epaper_html_paths=[epaper],
+ download_pdfs=True,
+ render_pages=True,
+ )
+
+ assert audit.language_page_hit_count == 1
+ assert audit.alignments[0].alignment_status == "language_page_found"
+ assert audit.alignments[0].page_hits[0].page_index == 0
+ assert audit.alignments[0].page_hits[0].rendered_page_path is not None
+ assert Path(audit.alignments[0].page_hits[0].rendered_page_path).exists()
+
+
+def test_prepare_gorkhapatra_language_page_pack_writes_pending_manifest(tmp_path: Path, capsys) -> None:
+ rendered = tmp_path / "page.png"
+ rendered.write_bytes(b"rendered page")
+ audit = tmp_path / "language-pages.json"
+ audit.write_text(
+ json.dumps(
+ {
+ "alignments": [
+ {
+ "publication_item": {
+ "article_url": "https://gorkhapatraonline.com/news/210290",
+ "image_url": "https://gorkhapatraonline.com/storage/media/365132/6.jpg",
+ "title": "समावेशीकरणको दिशामा नयाँ फड्को : गोरखापत्रद्वारा प्रकाशित मगर भाषा",
+ "language": "मगर",
+ "date_label": "१ असार २०८३, सोमबार",
+ "date_key": "2083-03-01",
+ "source_page": "fixture",
+ },
+ "epaper": {
+ "viewer_url": "https://epaper.gorkhapatraonline.com/pdf?file=/uploads/file/sample.pdf",
+ "direct_pdf_url": "https://epaper.gorkhapatraonline.com/uploads/file/sample.pdf",
+ "source_page": "fixture",
+ "date_label": "२०८३ असार १ सोमवार",
+ "thumbnail_url": None,
+ "downloaded_pdf": None,
+ },
+ "pdf_path": str(tmp_path / "sample.pdf"),
+ "pdf_sha256": "pdfhash",
+ "page_hits": [
+ {
+ "page_index": 5,
+ "marker": "efiff k[i7",
+ "text_chars": 120,
+ "text_preview": "efiff k[i7",
+ "rendered_page_path": str(rendered),
+ }
+ ],
+ "alignment_status": "language_page_found",
+ "claim_evidence_eligible": False,
+ "warnings": [],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ exit_code = main(
+ [
+ "prepare-gorkhapatra-language-page-pack",
+ str(audit),
+ "--out",
+ str(tmp_path / "pack"),
+ ]
+ )
+
+ captured = capsys.readouterr()
+ entries = load_manifest(tmp_path / "pack" / "manifests" / "gorkhapatra-language-page-pack.jsonl")
+ reference = json.loads(Path(entries[0].metadata["reference_path"]).read_text(encoding="utf-8"))
+ assert exit_code == 0
+ assert "samples=1 copied_pages=1 warnings=0" in captured.out
+ assert len(entries) == 1
+ assert Path(entries[0].image_path).read_bytes() == b"rendered page"
+ assert entries[0].metadata["candidate_language"] == "मगर"
+ assert entries[0].metadata["pdf_page_number"] == 6
+ assert entries[0].metadata["page_disambiguation_status"] == "candidate_requires_manual_review"
+ assert entries[0].metadata["reference_status"] == "pending_manual_label"
+ assert entries[0].metadata["claim_evidence_eligible"] is False
+ assert "language_page_candidate" in entries[0].metadata["slices"]
+ assert reference["metadata"]["source_kind"] == "gorkhapatra_language_page_candidate"
+
+
+def test_prepare_gorkhapatra_language_page_pack_records_missing_rendered_pages(tmp_path: Path) -> None:
+ audit = tmp_path / "language-pages.json"
+ audit.write_text(
+ json.dumps(
+ {
+ "alignments": [
+ {
+ "publication_item": {"language": "मगर", "date_key": "2083-03-01"},
+ "page_hits": [{"page_index": 5, "marker": "efiff k[i7"}],
+ }
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ summary = prepare_gorkhapatra_language_page_pack(audit, tmp_path / "pack")
+
+ assert summary.sample_count == 0
+ assert summary.warnings == ["alignment 1 page hit 1 has no rendered_page_path"]
+
+
+def test_prepare_gorkhapatra_language_page_review_writes_manual_review_artifacts(tmp_path: Path, capsys) -> None:
+ image_one = tmp_path / "page-one.png"
+ image_two = tmp_path / "page-two.png"
+ image_one.write_bytes(b"candidate one")
+ image_two.write_bytes(b"candidate two")
+ ref_one = tmp_path / "page-one.ref.json"
+ ref_two = tmp_path / "page-two.ref.json"
+ ref_one.write_text("{}", encoding="utf-8")
+ ref_two.write_text("{}", encoding="utf-8")
+ manifest = tmp_path / "manifest.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="gorkhapatra-language-page-0001-01",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image_one),
+ text="",
+ sha256=sha256_file(image_one),
+ metadata={
+ "source_kind": "language_page_candidate",
+ "candidate_language": "संस्कृत",
+ "date_label": "१ असार २०८३, सोमबार",
+ "date_key": "2083-03-01",
+ "pdf_page_index": 5,
+ "pdf_page_number": 6,
+ "reference_path": str(ref_one),
+ "article_url": "https://gorkhapatraonline.com/news/1",
+ "source_image_url": "https://gorkhapatraonline.com/storage/1.jpg",
+ "source_url": "https://epaper.gorkhapatraonline.com/uploads/file/sample.pdf",
+ "pdf_path": str(tmp_path / "sample.pdf"),
+ "pdf_sha256": "pdfhash",
+ "language_page_marker": "efiff k[i7",
+ "alignment_status": "language_page_found",
+ "page_disambiguation_status": "candidate_requires_manual_review",
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ },
+ ),
+ ManifestEntry(
+ sample_id="gorkhapatra-language-page-0002-01",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image_two),
+ text="",
+ sha256=sha256_file(image_two),
+ metadata={
+ "source_kind": "language_page_candidate",
+ "candidate_language": "मगर",
+ "date_key": "2083-03-01",
+ "pdf_page_index": 5,
+ "pdf_page_number": 6,
+ "reference_path": str(ref_two),
+ "source_url": "https://epaper.gorkhapatraonline.com/uploads/file/sample.pdf",
+ "language_page_marker": "efiff k[i7",
+ "alignment_status": "language_page_found",
+ "page_disambiguation_status": "candidate_requires_manual_review",
+ "reference_status": "pending_manual_label",
+ "claim_evidence_eligible": False,
+ },
+ ),
+ ],
+ manifest,
+ )
+
+ exit_code = main(
+ [
+ "prepare-gorkhapatra-language-page-review",
+ str(manifest),
+ "--out",
+ str(tmp_path / "review"),
+ ]
+ )
+
+ captured = capsys.readouterr()
+ payload = json.loads((tmp_path / "review" / "gorkhapatra-language-page-review.json").read_text(encoding="utf-8"))
+ with (tmp_path / "review" / "gorkhapatra-language-page-review.csv").open("r", encoding="utf-8", newline="") as handle:
+ csv_rows = list(csv.DictReader(handle))
+ markdown = (tmp_path / "review" / "gorkhapatra-language-page-review.md").read_text(encoding="utf-8")
+ assert exit_code == 0
+ assert "samples=2 pending_review=2 claim_eligible=0 warnings=0" in captured.out
+ assert payload["summary"]["sample_count"] == 2
+ assert payload["summary"]["page_candidate_counts"] == {"2083-03-01:page-6": 2}
+ assert payload["rows"][0]["review_decision"] == ""
+ assert payload["rows"][0]["claim_evidence_eligible"] is False
+ assert csv_rows[1]["candidate_language"] == "मगर"
+ assert csv_rows[1]["reviewer"] == ""
+ assert "Rows remain non-claim-ready" in markdown
diff --git a/tests/test_table_analysis.py b/tests/test_table_analysis.py
new file mode 100644
index 0000000000000000000000000000000000000000..56060ff1e75c3f9d217969570717054a6d9a2efe
--- /dev/null
+++ b/tests/test_table_analysis.py
@@ -0,0 +1,103 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+from ocrtech.manifest import ManifestEntry, sha256_file, sha256_text, write_manifest
+from ocrtech.schemas import BBox, Document, Page, Table, TableCell
+from ocrtech.table_analysis import analyze_table_cells
+
+
+def test_analyze_table_cells_reads_benchmark_documents(tmp_path: Path) -> None:
+ image = tmp_path / "sample.png"
+ image.write_bytes(b"image")
+ reference = tmp_path / "reference.json"
+ reference.write_text(
+ json.dumps({"text": "ignored", "tables": [[["नाम", "रकम"], ["राम", "१२"]]]}, ensure_ascii=False) + "\n",
+ encoding="utf-8",
+ )
+ text_hash = sha256_text("ignored")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(image),
+ text="ignored",
+ sha256=sha256_file(image),
+ metadata={"reference_path": str(reference), "text_sha256": text_hash},
+ )
+ ],
+ manifest,
+ )
+ benchmark_dir = tmp_path / "benchmark"
+ rows = []
+ for system, grid in {
+ "candidate": [["नाम", "रकम"], ["राम", ""]],
+ "surya": [["नाम", "रकम"], ["श्याम", "१२"]],
+ "tesseract": [["नाम", "रकम"], ["राम", "१२"]],
+ }.items():
+ output_dir = benchmark_dir / system / image.stem
+ output_dir.mkdir(parents=True)
+ document = _document(image, grid, duplicate_table=system == "surya")
+ (output_dir / "document.json").write_text(json.dumps(document.to_dict(), ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+ rows.append(
+ {
+ "baseline": system,
+ "input_path": str(image),
+ "status": "ok",
+ "latency_seconds": 0.1,
+ "sample_id": "sample-1",
+ "slices": ["table"],
+ "metrics": {},
+ }
+ )
+ report = benchmark_dir / "report.json"
+ report.write_text(json.dumps(rows, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+
+ analysis = analyze_table_cells(report, manifest, tmp_path / "analysis", candidate="candidate", baselines=["surya", "tesseract"])
+
+ assert analysis.systems["candidate"].reference_cells == 4
+ assert analysis.systems["candidate"].reference_tables == 1
+ assert analysis.systems["candidate"].predicted_tables == 1
+ assert analysis.systems["candidate"].exact_cells == 3
+ assert analysis.systems["candidate"].missing_cells == 1
+ assert analysis.systems["surya"].predicted_tables == 2
+ assert analysis.systems["surya"].duplicate_overlapping_tables == 1
+ assert analysis.systems["tesseract"].exact_cells == 4
+ assert analysis.paired["surya"].candidate_better == 1
+ assert analysis.paired["surya"].baseline_better == 1
+ assert analysis.paired["tesseract"].baseline_exact_candidate_not == 1
+ candidate_sample = next(item for item in analysis.samples if item.system == "candidate")
+ assert candidate_sample.reference_shapes == [[2, 2]]
+ assert candidate_sample.predicted_shapes == [[2, 2]]
+ assert candidate_sample.exact_cells == 3
+ surya_sample = next(item for item in analysis.samples if item.system == "surya")
+ assert surya_sample.predicted_tables == 2
+ assert surya_sample.duplicate_overlapping_tables == 1
+ assert (tmp_path / "analysis" / "table-cell-analysis.md").exists()
+
+
+def _document(image: Path, grid: list[list[str]], *, duplicate_table: bool = False) -> Document:
+ cells = [
+ TableCell(row=row_index, col=col_index, text=value, bbox=BBox(col_index * 10, row_index * 10, 10, 10))
+ for row_index, row in enumerate(grid)
+ for col_index, value in enumerate(row)
+ ]
+ tables = [Table(table_id="p0-t0", page_index=0, bbox=BBox(0, 0, 20, 20), cells=cells)]
+ if duplicate_table:
+ tables.append(
+ Table(
+ table_id="p0-t1",
+ page_index=0,
+ bbox=BBox(0, 0, 20, 20),
+ cells=[TableCell(row=0, col=0, text="".join(value for row in grid for value in row), bbox=BBox(0, 0, 20, 20))],
+ )
+ )
+ return Document(
+ source_path=str(image),
+ pages=[Page(page_index=0)],
+ tables=tables,
+ )
diff --git a/tests/test_tables.py b/tests/test_tables.py
new file mode 100644
index 0000000000000000000000000000000000000000..bac54c2def0c0abd4b61263df7ba32f316e38846
--- /dev/null
+++ b/tests/test_tables.py
@@ -0,0 +1,215 @@
+from __future__ import annotations
+
+from pathlib import Path
+
+from ocrtech.metrics import table_structure_similarity
+from ocrtech.schemas import BBox, Table, TableCell
+from ocrtech.tables import cells_to_html, infer_repeated_header_colspans, normalize_table_grid_structure, table_to_grid, write_table_files
+
+
+def test_infer_repeated_header_colspans_collapses_flat_merged_header() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 300, 100),
+ cells=[
+ TableCell(row=0, col=0, text="Ledger Summary"),
+ TableCell(row=0, col=1, text="Ledger Summary"),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ],
+ )
+ reference_cells = [
+ TableCell(row=0, col=0, text="Ledger Summary", colspan=2),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ]
+
+ inferred, count = infer_repeated_header_colspans(table)
+
+ assert count == 1
+ assert inferred.cells[0].colspan == 2
+ assert [cell.to_dict() for cell in inferred.cells] == [cell.to_dict() for cell in reference_cells]
+ assert table_structure_similarity(inferred.cells, reference_cells) == 1.0
+ assert 'colspan="2"' in inferred.html
+
+
+def test_infer_repeated_header_colspans_does_not_collapse_body_repeats() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 300, 100),
+ cells=[
+ TableCell(row=0, col=0, text="नाम"),
+ TableCell(row=0, col=1, text="रकम"),
+ TableCell(row=1, col=0, text="Paid"),
+ TableCell(row=1, col=1, text="Paid"),
+ ],
+ )
+
+ inferred, count = infer_repeated_header_colspans(table)
+
+ assert count == 0
+ assert inferred.cells == table.cells
+
+
+def test_cells_to_html_and_export_preserve_spans(tmp_path: Path) -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 300, 100),
+ cells=[
+ TableCell(row=0, col=0, text="Ledger Summary", colspan=2),
+ TableCell(row=0, col=2, text="Status"),
+ TableCell(row=1, col=0, text="नाम"),
+ TableCell(row=1, col=1, text="रकम"),
+ TableCell(row=1, col=2, text="Remarks"),
+ ],
+ )
+
+ html = cells_to_html(table.cells)
+ written = write_table_files(table, tmp_path)
+
+ assert 'colspan="2"' in html
+ assert 'colspan="2"' in Path(written.html_path or "").read_text(encoding="utf-8")
+
+
+def test_normalize_table_grid_structure_drops_separator_and_duplicate_columns() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 100),
+ cells=[
+ TableCell(row=0, col=0, text="—"),
+ TableCell(row=0, col=1, text="Skull cap"),
+ TableCell(row=0, col=2, text="1D"),
+ TableCell(row=0, col=3, text="1D"),
+ TableCell(row=1, col=0, text="—"),
+ TableCell(row=1, col=1, text="Helmet"),
+ TableCell(row=1, col=2, text="2D"),
+ TableCell(row=1, col=3, text="2D"),
+ ],
+ )
+
+ normalized, dropped = normalize_table_grid_structure(table)
+
+ assert dropped == 2
+ assert table_to_grid(normalized) == [["Skull cap", "1D"], ["Helmet", "2D"]]
+ assert normalized.metadata["normalized_table_grid_dropped_columns"] == 2
+
+
+def test_normalize_table_grid_structure_keeps_non_duplicate_content_columns() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 100),
+ cells=[
+ TableCell(row=0, col=0, text="Name"),
+ TableCell(row=0, col=1, text="Value"),
+ TableCell(row=1, col=0, text="A"),
+ TableCell(row=1, col=1, text="1"),
+ ],
+ )
+
+ normalized, dropped = normalize_table_grid_structure(table)
+
+ assert dropped == 0
+ assert normalized is table
+
+
+def test_normalize_table_grid_structure_merges_sparse_bullet_continuation_rows() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 100),
+ cells=[
+ TableCell(row=0, col=0, text="Type of Anomaly"),
+ TableCell(row=0, col=1, text="Variant"),
+ TableCell(row=0, col=2, text="Type"),
+ TableCell(row=0, col=3, text="Treatment"),
+ TableCell(row=0, col=4, text="Case Example"),
+ TableCell(row=1, col=0, text=""),
+ TableCell(row=1, col=1, text="Coronaries originating"),
+ TableCell(row=1, col=2, text="- left main"),
+ TableCell(row=1, col=3, text="Surgery"),
+ TableCell(row=1, col=4, text="None"),
+ TableCell(row=2, col=0, text="- right coronary"),
+ TableCell(row=2, col=1, text=""),
+ TableCell(row=2, col=2, text=""),
+ TableCell(row=2, col=3, text=""),
+ TableCell(row=2, col=4, text=""),
+ TableCell(row=3, col=0, text="- circumflex"),
+ TableCell(row=3, col=1, text=""),
+ TableCell(row=3, col=2, text=""),
+ TableCell(row=3, col=3, text=""),
+ TableCell(row=3, col=4, text=""),
+ TableCell(row=4, col=0, text="Anomalies of Origin"),
+ TableCell(row=4, col=1, text="Anomalous aortic"),
+ TableCell(row=4, col=2, text="- left main from right sinus"),
+ TableCell(row=4, col=3, text="Revascularization"),
+ TableCell(row=4, col=4, text="1,3,5"),
+ TableCell(row=5, col=0, text="- right coronary from left sinus"),
+ TableCell(row=5, col=1, text=""),
+ TableCell(row=5, col=2, text=""),
+ TableCell(row=5, col=3, text=""),
+ TableCell(row=5, col=4, text=""),
+ ],
+ )
+
+ normalized, changed = normalize_table_grid_structure(table)
+
+ assert changed == 3
+ assert table_to_grid(normalized) == [
+ ["Type of Anomaly", "Variant", "Type", "Treatment", "Case Example"],
+ ["", "Coronaries originating", "- left main\n- right coronary\n- circumflex", "Surgery", "None"],
+ ["Anomalies of Origin", "Anomalous aortic", "- left main from right sinus\n- right coronary from left sinus", "Revascularization", "1,3,5"],
+ ]
+ assert normalized.metadata["normalized_table_grid_merged_rows"] == 3
+
+
+def test_normalize_table_grid_structure_does_not_merge_non_bullet_single_cell_rows() -> None:
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 100),
+ cells=[
+ TableCell(row=0, col=0, text="Name"),
+ TableCell(row=0, col=1, text="Notes"),
+ TableCell(row=1, col=0, text="A"),
+ TableCell(row=1, col=1, text="- first"),
+ TableCell(row=2, col=0, text="continued prose"),
+ TableCell(row=2, col=1, text=""),
+ ],
+ )
+
+ normalized, changed = normalize_table_grid_structure(table)
+
+ assert changed == 0
+ assert normalized is table
+
+
+def test_normalize_table_grid_structure_skips_wide_sparse_tables() -> None:
+ cells = [TableCell(row=0, col=col, text=f"H{col}") for col in range(14)]
+ cells.extend(
+ [
+ TableCell(row=1, col=0, text="- legitimate sparse row"),
+ TableCell(row=1, col=1, text=""),
+ TableCell(row=2, col=0, text="- another sparse row"),
+ TableCell(row=2, col=1, text=""),
+ ]
+ )
+ table = Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 100),
+ cells=cells,
+ )
+
+ normalized, changed = normalize_table_grid_structure(table)
+
+ assert changed == 0
+ assert normalized is table
diff --git a/tests/test_training_benchmark.py b/tests/test_training_benchmark.py
new file mode 100644
index 0000000000000000000000000000000000000000..9a24e8b9c5f9238c4cc1c31c60e38eb8b3cf9f6d
--- /dev/null
+++ b/tests/test_training_benchmark.py
@@ -0,0 +1,1950 @@
+from __future__ import annotations
+
+import json
+import multiprocessing
+import os
+import signal
+import sys
+import time
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+
+from ocrtech.benchmark import derive_table_postprocess_benchmark, rescore_benchmark_report, run_benchmark, summarize_benchmark_report
+from ocrtech.calibration import calibrate_quality_router, calibrate_script_router, calibrate_tesseract_psm_ensemble
+from ocrtech.errors import DataValidationError, ValidationError
+from ocrtech.manifest import ManifestEntry, sha256_file, write_manifest
+from ocrtech.models import ModelCard, audit_model_card, model_admission_status
+from ocrtech.schemas import BBox, Document, Page, Table, TableCell, TextLine
+from ocrtech.training import (
+ _hf_text_corrector_metrics_factory,
+ bundle_recognizer_training,
+ finalize_hf_recognizer_run,
+ generate_correction_pairs,
+ package_hf_text_corrector_model,
+ package_hf_recognizer_model,
+ package_paddleocr_model,
+ run_hf_recognizer_training,
+ write_corrector_recipe,
+ write_hf_text_corrector_recipe,
+ write_hf_recognizer_recipe,
+ write_recognizer_export_recipe,
+ write_recognizer_recipe,
+)
+
+
+def test_train_recognizer_writes_paddle_recipe(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="train-1",
+ dataset="local",
+ split="train",
+ image_path=str(train_image),
+ text="नेपाल English",
+ metadata={"slices": ["nepali", "english"]},
+ )
+ ],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="काठमाडौं")],
+ eval_manifest,
+ )
+
+ config = write_recognizer_recipe(
+ train_manifest,
+ eval_manifest,
+ tmp_path / "run",
+ train_batch_size=4,
+ eval_batch_size=6,
+ learning_rate=0.0003,
+ epochs=2.5,
+ )
+
+ assert config.exists()
+ assert (tmp_path / "run" / "labels" / "train.txt").exists()
+ config_text = config.read_text(encoding="utf-8")
+ assert "Architecture:" in config_text
+ assert "algorithm: SVTR_LCNet" in config_text
+ assert "Loss:" in config_text
+ assert "PostProcess:" in config_text
+ assert "Metric:" in config_text
+ assert "character_dict_path" in config_text
+ assert "batch_size_per_card: 4" in config_text
+ assert "batch_size_per_card: 6" in config_text
+ assert "name: Cosine" in config_text
+ assert "learning_rate: 0.0003" in config_text
+ assert "epoch_num: 2.5" in config_text
+ dictionary = (tmp_path / "run" / "nep_eng_dict.txt").read_text(encoding="utf-8")
+ assert "क" in dictionary
+ assert "E" in dictionary
+ summary = json.loads((tmp_path / "run" / "recognizer-training-summary.json").read_text(encoding="utf-8"))
+ assert summary["backend"] == "paddleocr"
+ assert summary["manifests"]["train"]["sample_count"] == 1
+ assert summary["manifests"]["train"]["slice_counts"] == {"english": 1, "nepali": 1}
+ assert summary["manifests"]["train"]["contains_ascii"] is True
+ assert summary["manifests"]["train"]["contains_devanagari"] is True
+ assert summary["artifacts"]["dictionary"]["contains_ascii"] is True
+ assert summary["artifacts"]["dictionary"]["contains_devanagari"] is True
+ assert summary["artifacts"]["config"]["sha256"]
+
+
+def test_train_recognizer_writes_integral_epochs_as_integer(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="नेपाल")],
+ eval_manifest,
+ )
+
+ config = write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", epochs=20.0)
+
+ config_text = config.read_text(encoding="utf-8")
+ assert "epoch_num: 20\n" in config_text
+ assert "epoch_num: 20.0" not in config_text
+
+
+def test_train_recognizer_accepts_custom_dictionary_covering_labels(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल A")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="क B")],
+ eval_manifest,
+ )
+ dictionary = tmp_path / "dict.txt"
+ dictionary.write_text("\n".join(["न", "े", "प", "ा", "ल", " ", "A", "क", "B"]) + "\n", encoding="utf-8")
+
+ config = write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", dictionary_path=dictionary)
+
+ assert config.exists()
+ summary = json.loads((tmp_path / "run" / "recognizer-training-summary.json").read_text(encoding="utf-8"))
+ assert summary["artifacts"]["dictionary"]["path"] == str(dictionary)
+
+
+def test_train_recognizer_rejects_custom_dictionary_missing_label_characters(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल A")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="क B")],
+ eval_manifest,
+ )
+ dictionary = tmp_path / "dict.txt"
+ dictionary.write_text("\n".join(["न", "े", "प", "ा", "ल", " ", "क"]) + "\n", encoding="utf-8")
+
+ with pytest.raises(DataValidationError, match="dictionary_path is missing label characters"):
+ write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", dictionary_path=dictionary)
+
+
+def test_train_recognizer_writes_low_learning_rate_as_yaml_float(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="नेपाल")],
+ eval_manifest,
+ )
+
+ config = write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", learning_rate=0.00005)
+
+ config_text = config.read_text(encoding="utf-8")
+ assert "learning_rate: 0.00005" in config_text
+ assert "learning_rate: 5e-05" not in config_text
+
+
+def test_train_recognizer_rejects_stopped_family_when_failure_review_supplied(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="नेपाल")],
+ eval_manifest,
+ )
+
+ with pytest.raises(ValidationError, match="recognizer family is stopped"):
+ write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", failure_review=_stopped_ppocrv3_failure_review(tmp_path))
+
+
+def test_train_recognizer_paddle_labels_are_one_line_per_sample(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="train-1",
+ dataset="local",
+ split="train",
+ image_path=str(train_image),
+ text="पहिलो\tभाग\nदोस्रो भाग",
+ )
+ ],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="काठमाडौं")],
+ eval_manifest,
+ )
+
+ write_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run")
+
+ train_lines = (tmp_path / "run" / "labels" / "train.txt").read_text(encoding="utf-8").splitlines()
+ assert len(train_lines) == 1
+ assert train_lines[0].endswith("\tपहिलो भाग दोस्रो भाग")
+
+
+def test_bundle_recognizer_training_packages_recipe_manifests_and_images(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image = tmp_path / "data" / "train.png"
+ eval_image = tmp_path / "data" / "eval.png"
+ train_image.parent.mkdir()
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "data" / "train.jsonl"
+ eval_manifest = tmp_path / "data" / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path="data/train.png", text="नेपाल")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path="data/eval.png", text="English")],
+ eval_manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+ write_recognizer_recipe("data/train.jsonl", "data/eval.jsonl", "runs/recipe")
+
+ bundle = bundle_recognizer_training(
+ "runs/recipe",
+ "runs/bundle",
+ train_manifest="data/train.jsonl",
+ eval_manifest="data/eval.jsonl",
+ )
+
+ assert bundle.file_count >= 7
+ archive = Path(bundle.archive_path)
+ extract_dir = tmp_path / "extract"
+ extract_dir.mkdir()
+ import tarfile
+
+ with tarfile.open(archive, "r:gz") as handle:
+ handle.extractall(extract_dir)
+ assert (extract_dir / "runs" / "recipe" / "paddle_recognizer.yml").exists()
+ summary_path = extract_dir / "runs" / "recipe" / "recognizer-training-summary.json"
+ assert summary_path.exists()
+ train_label = extract_dir / "runs" / "recipe" / "labels" / "train.txt"
+ assert train_label.exists()
+ assert (extract_dir / "data" / "train.jsonl").exists()
+ rewritten = json.loads((extract_dir / "data" / "train.jsonl").read_text(encoding="utf-8").splitlines()[0])
+ rewritten_image = extract_dir / rewritten["image_path"]
+ assert rewritten_image.read_bytes() == b"train"
+ assert train_label.read_text(encoding="utf-8").split("\t", 1)[0] == rewritten["image_path"]
+ manifest = json.loads(Path(bundle.manifest_path).read_text(encoding="utf-8"))
+ assert manifest["recipe_backend"] == "paddleocr"
+ assert manifest["run_command"] == "python PaddleOCR/tools/train.py -c runs/recipe/paddle_recognizer.yml"
+ assert manifest["training_summary"]["present"] is True
+ assert manifest["training_summary"]["path"] == "runs/recipe/recognizer-training-summary.json"
+ assert manifest["training_summary"]["sha256"]
+ assert manifest["recognizer_corpus_audit"] == {"required": False, "present": False}
+ assert "python PaddleOCR/tools/train.py -c runs/recipe/paddle_recognizer.yml" in Path(bundle.readme_path).read_text(encoding="utf-8")
+
+
+def test_bundle_recognizer_training_writes_hf_run_command(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image = tmp_path / "data" / "train.png"
+ eval_image = tmp_path / "data" / "eval.png"
+ train_image.parent.mkdir()
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "data" / "train.jsonl"
+ eval_manifest = tmp_path / "data" / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path="data/train.png", text="नेपाल English")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path="data/eval.png", text="काठमाडौं")],
+ eval_manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+ write_hf_recognizer_recipe(
+ "data/train.jsonl",
+ "data/eval.jsonl",
+ "runs/hf-recipe",
+ base_model="microsoft/trocr-small-printed",
+ learning_rate=3e-5,
+ num_train_epochs=4,
+ )
+
+ bundle = bundle_recognizer_training(
+ "runs/hf-recipe",
+ "runs/hf-bundle",
+ train_manifest="data/train.jsonl",
+ eval_manifest="data/eval.jsonl",
+ )
+
+ manifest = json.loads(Path(bundle.manifest_path).read_text(encoding="utf-8"))
+ assert manifest["recipe_backend"] == "hf_vision_encoder_decoder"
+ assert "--backend hf-vision-encoder-decoder" in manifest["run_command"]
+ assert "--base-model microsoft/trocr-small-printed" in manifest["run_command"]
+ assert "--learning-rate 3e-05" in manifest["run_command"]
+ assert "--epochs 4" in manifest["run_command"]
+ readme = Path(bundle.readme_path).read_text(encoding="utf-8")
+ assert manifest["run_command"] in readme
+
+
+def test_bundle_recognizer_training_can_require_passing_corpus_audit(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image_en = tmp_path / "data" / "train-en.png"
+ train_image_ne = tmp_path / "data" / "train-ne.png"
+ train_image_mix = tmp_path / "data" / "train-mix.png"
+ eval_image = tmp_path / "data" / "eval-mix.png"
+ train_image_en.parent.mkdir()
+ for path in [train_image_en, train_image_ne, train_image_mix, eval_image]:
+ path.write_bytes(path.name.encode("utf-8"))
+ train_manifest = tmp_path / "data" / "train.jsonl"
+ eval_manifest = tmp_path / "data" / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(sample_id="train-en", dataset="local", split="train", image_path="data/train-en.png", text="Invoice", metadata={"slices": ["english", "real"]}),
+ ManifestEntry(sample_id="train-ne", dataset="local", split="train", image_path="data/train-ne.png", text="नेपाल", metadata={"slices": ["nepali", "synthetic"]}),
+ ManifestEntry(sample_id="train-mix", dataset="local", split="train", image_path="data/train-mix.png", text="नाम Ram", metadata={"slices": ["mixed_script", "real", "synthetic"]}),
+ ],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-mix", dataset="local", split="eval", image_path="data/eval-mix.png", text="बिल No", metadata={"slices": ["mixed_script", "hard_eval"]})],
+ eval_manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+ write_recognizer_recipe("data/train.jsonl", "data/eval.jsonl", "runs/recipe")
+
+ bundle = bundle_recognizer_training(
+ "runs/recipe",
+ "runs/bundle",
+ train_manifest="data/train.jsonl",
+ eval_manifest="data/eval.jsonl",
+ require_corpus_audit=True,
+ min_train_samples=3,
+ min_eval_samples=1,
+ min_train_english=2,
+ min_train_devanagari=2,
+ min_train_mixed=1,
+ min_eval_english=1,
+ min_eval_devanagari=1,
+ min_eval_mixed=1,
+ min_train_latin_only=1,
+ min_train_devanagari_only=1,
+ min_eval_latin_only=0,
+ min_eval_devanagari_only=0,
+ min_train_real=2,
+ min_train_synthetic=2,
+ )
+
+ manifest = json.loads(Path(bundle.manifest_path).read_text(encoding="utf-8"))
+ assert manifest["recognizer_corpus_audit"] == {
+ "required": True,
+ "present": True,
+ "passed": True,
+ "path": "recognizer-corpus-audit/recognizer-corpus-audit.json",
+ }
+ assert (tmp_path / "runs" / "bundle" / "recognizer-corpus-audit" / "recognizer-corpus-audit.json").exists()
+
+
+def test_bundle_recognizer_training_rejects_stopped_family_review(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image = tmp_path / "data" / "train.png"
+ eval_image = tmp_path / "data" / "eval.png"
+ train_image.parent.mkdir()
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "data" / "train.jsonl"
+ eval_manifest = tmp_path / "data" / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path="data/train.png", text="नेपाल")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path="data/eval.png", text="English")],
+ eval_manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+ write_recognizer_recipe("data/train.jsonl", "data/eval.jsonl", "runs/recipe")
+
+ with pytest.raises(ValidationError, match="recognizer family is stopped"):
+ bundle_recognizer_training(
+ "runs/recipe",
+ "runs/bundle",
+ train_manifest="data/train.jsonl",
+ eval_manifest="data/eval.jsonl",
+ failure_review=_stopped_ppocrv3_failure_review(tmp_path),
+ )
+
+
+def test_bundle_recognizer_training_rejects_failed_corpus_audit(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image = tmp_path / "data" / "train.png"
+ eval_image = tmp_path / "data" / "eval.png"
+ train_image.parent.mkdir()
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "data" / "train.jsonl"
+ eval_manifest = tmp_path / "data" / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-ne", dataset="local", split="train", image_path="data/train.png", text="नेपाल", metadata={"slices": ["nepali", "real"]})],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-ne", dataset="local", split="eval", image_path="data/eval.png", text="सरकार", metadata={"slices": ["nepali"]})],
+ eval_manifest,
+ )
+ monkeypatch.chdir(tmp_path)
+ write_recognizer_recipe("data/train.jsonl", "data/eval.jsonl", "runs/recipe")
+
+ with pytest.raises(DataValidationError, match="recognizer corpus audit failed"):
+ bundle_recognizer_training(
+ "runs/recipe",
+ "runs/bundle",
+ train_manifest="data/train.jsonl",
+ eval_manifest="data/eval.jsonl",
+ require_corpus_audit=True,
+ min_train_samples=1,
+ min_eval_samples=1,
+ min_train_english=1,
+ min_train_devanagari=1,
+ min_train_mixed=1,
+ min_eval_english=1,
+ min_eval_devanagari=1,
+ min_eval_mixed=0,
+ min_train_latin_only=1,
+ min_train_devanagari_only=1,
+ min_eval_latin_only=0,
+ min_eval_devanagari_only=1,
+ min_train_real=1,
+ min_train_synthetic=0,
+ )
+
+
+def test_train_hf_recognizer_writes_recipe(tmp_path: Path) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल English")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="काठमाडौं")],
+ eval_manifest,
+ )
+
+ config = write_hf_recognizer_recipe(
+ train_manifest,
+ eval_manifest,
+ tmp_path / "run",
+ base_model="microsoft/trocr-small-printed",
+ learning_rate=3e-5,
+ num_train_epochs=4,
+ )
+
+ assert config.exists()
+ payload = json.loads(config.read_text(encoding="utf-8"))
+ assert payload["base_model"] == "microsoft/trocr-small-printed"
+ assert payload["learning_rate"] == 3e-5
+ assert payload["num_train_epochs"] == 4
+ assert payload["train_manifest"] == str(train_manifest)
+ readme = (tmp_path / "run" / "README.md").read_text(encoding="utf-8")
+ assert "--base-model microsoft/trocr-small-printed" in readme
+ assert "--learning-rate 3e-05" in readme
+ assert "--epochs 4" in readme
+ summary = json.loads((tmp_path / "run" / "recognizer-training-summary.json").read_text(encoding="utf-8"))
+ assert summary["backend"] == "hf_vision_encoder_decoder"
+ assert summary["base_model"] == "microsoft/trocr-small-printed"
+ assert summary["manifests"]["train"]["contains_ascii"] is True
+ assert summary["manifests"]["train"]["contains_devanagari"] is True
+ assert summary["artifacts"]["dictionary"]["contains_ascii"] is True
+ assert summary["artifacts"]["dictionary"]["contains_devanagari"] is True
+ assert summary["artifacts"]["config"]["sha256"]
+
+
+def test_run_hf_recognizer_training_loads_processor_without_fast_tokenizer(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ train_image = tmp_path / "train.png"
+ eval_image = tmp_path / "eval.png"
+ train_image.write_bytes(b"train")
+ eval_image.write_bytes(b"eval")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(train_image), text="नेपाल English")],
+ train_manifest,
+ )
+ write_manifest(
+ [ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(eval_image), text="काठमाडौं")],
+ eval_manifest,
+ )
+ config = write_hf_recognizer_recipe(train_manifest, eval_manifest, tmp_path / "run", base_model="microsoft/trocr-small-printed")
+ calls: list[tuple[str, object]] = []
+
+ class FakeTorch:
+ class cuda:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ class backends:
+ class mps:
+ @staticmethod
+ def is_available() -> bool:
+ return False
+
+ class FakeTokenizer:
+ cls_token_id = 0
+ bos_token_id = 1
+ pad_token_id = 2
+
+ class FakeProcessor:
+ def __init__(self) -> None:
+ self.tokenizer = FakeTokenizer()
+
+ @classmethod
+ def from_pretrained(cls, source: str, **kwargs):
+ calls.append(("processor", kwargs))
+ return cls()
+
+ def save_pretrained(self, output_dir: str) -> None:
+ Path(output_dir).mkdir(parents=True, exist_ok=True)
+ Path(output_dir, "preprocessor_config.json").write_text("{}", encoding="utf-8")
+
+ class FakeGenerationConfig:
+ max_length = 0
+
+ class FakeModel:
+ def __init__(self) -> None:
+ self.config = SimpleNamespace(decoder=SimpleNamespace())
+ self.generation_config = FakeGenerationConfig()
+
+ @classmethod
+ def from_pretrained(cls, source: str):
+ calls.append(("model", source))
+ return cls()
+
+ class FakeArgs:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ class FakeTrainer:
+ def __init__(self, **kwargs):
+ self.kwargs = kwargs
+
+ def train(self) -> None:
+ return None
+
+ def save_model(self, output_dir: str) -> None:
+ Path(output_dir).mkdir(parents=True, exist_ok=True)
+ Path(output_dir, "config.json").write_text("{}", encoding="utf-8")
+
+ def evaluate(self, max_length: int):
+ return {"eval_cer": 0.1, "max_length": max_length}
+
+ class FakeImageModule:
+ class Image:
+ pass
+
+ monkeypatch.setitem(
+ sys.modules,
+ "transformers",
+ SimpleNamespace(
+ Seq2SeqTrainer=FakeTrainer,
+ Seq2SeqTrainingArguments=FakeArgs,
+ TrOCRProcessor=FakeProcessor,
+ VisionEncoderDecoderModel=FakeModel,
+ ),
+ )
+ monkeypatch.setitem(sys.modules, "torch", FakeTorch)
+ monkeypatch.setitem(sys.modules, "PIL", FakeImageModule)
+
+ final_model_dir = run_hf_recognizer_training(config)
+
+ assert calls[0] == ("processor", {"backend": "pil"})
+ assert final_model_dir.exists()
+ assert final_model_dir.parent.joinpath("training_metrics.json").exists()
+ assert json.loads((tmp_path / "run" / "training_metrics.json").read_text(encoding="utf-8"))["eval_cer"] == 0.1
+
+
+def test_train_corrector_writes_synthetic_pairs(tmp_path: Path) -> None:
+ image = tmp_path / "line.png"
+ image.write_bytes(b"line")
+ manifest = tmp_path / "train.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(image), text="This is a longer clean line for corruption.")],
+ manifest,
+ )
+
+ config = write_corrector_recipe(tmp_path / "corrector", clean_manifest=manifest, seed=1)
+
+ assert config.exists()
+ assert (tmp_path / "corrector" / "correction_pairs.jsonl").exists()
+
+
+def test_train_corrector_writes_hf_pairs(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ fake_module = SimpleNamespace(load_dataset=lambda dataset_id, split, streaming=False: [{"ocr": "गलत पाठ", "correct": "सही पाठ", "font": "Kalimati"}])
+ monkeypatch.setitem(sys.modules, "datasets", fake_module)
+
+ config = write_corrector_recipe(tmp_path / "corrector", hf_dataset="cfilt/RoundTripOCR-nepali", hf_split="train")
+ pairs = (tmp_path / "corrector" / "correction_pairs.jsonl").read_text(encoding="utf-8")
+
+ assert config.exists()
+ assert json.loads(pairs.splitlines()[0])["clean_text"] == "सही पाठ"
+
+
+def test_generate_correction_pairs_uses_engine_output(tmp_path: Path) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text("गलत पाठ\n", encoding="utf-8")
+ manifest = tmp_path / "train.jsonl"
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="train", image_path=str(source), text="सही पाठ")],
+ manifest,
+ )
+
+ pairs = generate_correction_pairs(manifest, tmp_path / "pairs.jsonl", engine_name="sidecar")
+ rows = [json.loads(line) for line in pairs.read_text(encoding="utf-8").splitlines() if line.strip()]
+
+ assert pairs.exists()
+ assert rows[0]["noisy_text"] == "गलत पाठ"
+ assert rows[0]["clean_text"] == "सही पाठ"
+
+
+def test_write_hf_text_corrector_recipe_splits_pairs(tmp_path: Path) -> None:
+ pairs_path = tmp_path / "pairs.jsonl"
+ pairs_path.write_text(
+ "\n".join(
+ json.dumps({"noisy_text": f"गलत {index}", "clean_text": f"सही {index}"}, ensure_ascii=False)
+ for index in range(6)
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+
+ config = write_hf_text_corrector_recipe(pairs_path, tmp_path / "corrector", eval_ratio=0.33, seed=5)
+ payload = json.loads(config.read_text(encoding="utf-8"))
+
+ assert config.exists()
+ assert payload["base_model"] == "google/byt5-small"
+ assert (tmp_path / "corrector" / "train_pairs.jsonl").exists()
+ assert (tmp_path / "corrector" / "eval_pairs.jsonl").exists()
+
+
+def test_hf_text_corrector_metrics_sanitizes_invalid_prediction_ids() -> None:
+ class FakeTokenizer:
+ pad_token_id = 0
+ vocab_size = 8
+
+ def batch_decode(self, rows, skip_special_tokens: bool = True):
+ return [" ".join(str(token) for token in row if not skip_special_tokens or token != self.pad_token_id) for row in rows]
+
+ metrics_fn = _hf_text_corrector_metrics_factory(FakeTokenizer())
+ eval_pred = SimpleNamespace(
+ predictions=[[3, 1_114_112, -7, 2]],
+ label_ids=[[3, -100, 2]],
+ )
+
+ metrics = metrics_fn(eval_pred)
+
+ assert metrics["cer"] == 0
+ assert metrics["wer"] == 0
+ assert metrics["exact_line_accuracy"] == 1
+
+
+def test_package_hf_text_corrector_model_writes_auditable_model_card(tmp_path: Path) -> None:
+ model_dir = tmp_path / "final-model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ (model_dir / "tokenizer.json").write_text("{}", encoding="utf-8")
+
+ card = package_hf_text_corrector_model(
+ model_dir,
+ tmp_path / "package",
+ model_id="ocrtech-hf-corrector",
+ base_model="google/byt5-small",
+ )
+ audit = audit_model_card(card)
+
+ assert card.exists()
+ assert audit.passed
+ assert (tmp_path / "package" / "artifacts" / "model" / "config.json").exists()
+
+
+def test_export_recognizer_writes_export_recipe(tmp_path: Path) -> None:
+ training_config = tmp_path / "paddle_recognizer.yml"
+ training_config.write_text("Global:\n save_model_dir: checkpoints\n", encoding="utf-8")
+
+ export_spec = write_recognizer_export_recipe(training_config, tmp_path / "checkpoints" / "best_accuracy", tmp_path / "export")
+
+ assert export_spec.exists()
+ text = export_spec.read_text(encoding="utf-8")
+ assert "export_model.py" in text
+ assert "Global.save_inference_dir" in text
+
+
+def test_export_recognizer_accepts_paddle_checkpoint_prefix_with_pdparams(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ training_config = tmp_path / "paddle_recognizer.yml"
+ training_config.write_text("Global:\n save_model_dir: checkpoints\n", encoding="utf-8")
+ checkpoint = tmp_path / "checkpoints" / "best_accuracy"
+ checkpoint.parent.mkdir()
+ checkpoint.with_name("best_accuracy.pdparams").write_bytes(b"params")
+ monkeypatch.setattr("ocrtech.training.subprocess.run", lambda *args, **kwargs: SimpleNamespace(returncode=0))
+
+ export_spec = write_recognizer_export_recipe(training_config, checkpoint, tmp_path / "export", run=True)
+
+ payload = json.loads(export_spec.read_text(encoding="utf-8"))
+ assert f"Global.pretrained_model={checkpoint}" in payload["command"]
+
+
+def test_export_recognizer_normalizes_pdparams_checkpoint_path(tmp_path: Path) -> None:
+ training_config = tmp_path / "paddle_recognizer.yml"
+ training_config.write_text("Global:\n save_model_dir: checkpoints\n", encoding="utf-8")
+ checkpoint_file = tmp_path / "checkpoints" / "best_accuracy.pdparams"
+ checkpoint_file.parent.mkdir()
+ checkpoint_file.write_bytes(b"params")
+
+ export_spec = write_recognizer_export_recipe(training_config, checkpoint_file, tmp_path / "export")
+
+ payload = json.loads(export_spec.read_text(encoding="utf-8"))
+ assert f"Global.pretrained_model={checkpoint_file.with_suffix('')}" in payload["command"]
+
+
+def test_package_paddleocr_model_writes_auditable_model_card(tmp_path: Path) -> None:
+ inference_dir = tmp_path / "inference"
+ inference_dir.mkdir()
+ (inference_dir / "inference.pdmodel").write_bytes(b"model")
+ (inference_dir / "inference.pdiparams").write_bytes(b"params")
+ (inference_dir / "inference.pdiparams.info").write_bytes(b"info")
+ dictionary = tmp_path / "nep_eng_dict.txt"
+ dictionary.write_text("क\nA\n", encoding="utf-8")
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "paddleocr"}\n', encoding="utf-8")
+
+ card = package_paddleocr_model(
+ inference_dir,
+ tmp_path / "package",
+ model_id="ocrtech-packaged",
+ dictionary_path=dictionary,
+ training_summary=training_summary,
+ )
+ audit = audit_model_card(card)
+
+ assert card.exists()
+ assert audit.passed
+ payload = json.loads(card.read_text(encoding="utf-8"))
+ assert payload["backend_kwargs"]["lang"] == "ne"
+ assert "rec_model_dir" not in payload["backend_kwargs"]
+ assert "rec_char_dict_path" not in payload["backend_kwargs"]
+ assert payload["backend_kwargs"]["text_recognition_model_name"] == "devanagari_PP-OCRv3_mobile_rec"
+ assert payload["backend_kwargs"]["text_recognition_model_dir"] == "artifacts"
+ assert payload["provenance"]["training_summary"] == {
+ "path": str(training_summary),
+ "sha256": sha256_file(training_summary),
+ }
+ assert all(artifact["sha256"] for artifact in payload["artifacts"])
+ assert (tmp_path / "package" / "artifacts" / "inference.pdmodel").exists()
+ assert (tmp_path / "package" / "artifacts" / "nep_eng_dict.txt").exists()
+
+
+def test_package_paddleocr_model_records_admission_validation(tmp_path: Path) -> None:
+ inference_dir = tmp_path / "inference"
+ inference_dir.mkdir()
+ (inference_dir / "inference.pdmodel").write_bytes(b"model")
+ (inference_dir / "inference.pdiparams").write_bytes(b"params")
+ (inference_dir / "inference.pdiparams.info").write_bytes(b"info")
+ dictionary = tmp_path / "nep_eng_dict.txt"
+ dictionary.write_text("क\nA\n", encoding="utf-8")
+ validation = tmp_path / "validation.json"
+ card_path = tmp_path / "package" / "model-card.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(card_path)}},
+ "gates": [_passing_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+
+ card = package_paddleocr_model(
+ inference_dir,
+ tmp_path / "package",
+ model_id="ocrtech-packaged-admitted",
+ dictionary_path=dictionary,
+ admission_validation_report=validation,
+ )
+
+ status = model_admission_status(ModelCard.from_path(card), card)
+ assert status.passed
+
+
+def test_package_hf_recognizer_model_writes_auditable_model_card(tmp_path: Path) -> None:
+ model_dir = tmp_path / "final-model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ (model_dir / "preprocessor_config.json").write_text("{}", encoding="utf-8")
+ training_summary = tmp_path / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "hf-vision-encoder-decoder"}\n', encoding="utf-8")
+
+ card = package_hf_recognizer_model(
+ model_dir,
+ tmp_path / "package",
+ model_id="ocrtech-hf-packaged",
+ base_model="microsoft/trocr-small-printed",
+ training_summary=training_summary,
+ )
+ audit = audit_model_card(card)
+
+ assert card.exists()
+ assert audit.passed
+ payload = json.loads(card.read_text(encoding="utf-8"))
+ assert payload["provenance"]["training_summary"]["sha256"] == sha256_file(training_summary)
+ assert (tmp_path / "package" / "artifacts" / "model" / "config.json").exists()
+
+
+def test_package_hf_recognizer_model_records_admission_validation(tmp_path: Path) -> None:
+ model_dir = tmp_path / "final-model"
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ (model_dir / "preprocessor_config.json").write_text("{}", encoding="utf-8")
+ validation = tmp_path / "validation.json"
+ card_path = tmp_path / "package" / "model-card.json"
+ validation.write_text(
+ json.dumps(
+ {
+ "claim_status": "validated",
+ "passed": True,
+ "provenance": {"candidate_model_config": {"path": str(card_path)}},
+ "gates": [_passing_validation_gate()],
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+
+ card = package_hf_recognizer_model(
+ model_dir,
+ tmp_path / "package",
+ model_id="ocrtech-hf-packaged-admitted",
+ base_model="microsoft/trocr-small-printed",
+ admission_validation_report=validation,
+ )
+
+ status = model_admission_status(ModelCard.from_path(card), card)
+ assert status.passed
+
+
+def test_package_hf_recognizer_model_uses_card_relative_paths(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.chdir(tmp_path)
+ model_dir = Path("final-model")
+ model_dir.mkdir()
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ (model_dir / "preprocessor_config.json").write_text("{}", encoding="utf-8")
+
+ card = package_hf_recognizer_model(model_dir, Path("package"), model_id="ocrtech-hf-relative", base_model="microsoft/trocr-small-printed")
+ payload = json.loads(card.read_text(encoding="utf-8"))
+ audit = audit_model_card(card)
+
+ assert payload["artifacts"][0]["path"] == "artifacts/model"
+ assert payload["backend_kwargs"]["model_dir"] == "artifacts/model"
+ assert audit.passed
+
+
+def test_finalize_hf_recognizer_run_requires_finished_artifacts(tmp_path: Path) -> None:
+ run_dir = tmp_path / "run"
+ run_dir.mkdir()
+
+ with pytest.raises(DataValidationError, match="missing final model directory"):
+ finalize_hf_recognizer_run(
+ run_dir,
+ model_id="ocrtech-hf-mixed-v2-full",
+ base_model="microsoft/trocr-small-printed",
+ )
+
+ (run_dir / "final-model").mkdir()
+ with pytest.raises(DataValidationError, match="missing training metrics report"):
+ finalize_hf_recognizer_run(
+ run_dir,
+ model_id="ocrtech-hf-mixed-v2-full",
+ base_model="microsoft/trocr-small-printed",
+ )
+
+
+def test_finalize_hf_recognizer_run_packages_audits_and_writes_report(tmp_path: Path) -> None:
+ run_dir = tmp_path / "run"
+ model_dir = run_dir / "final-model"
+ model_dir.mkdir(parents=True)
+ (model_dir / "config.json").write_text("{}", encoding="utf-8")
+ (model_dir / "preprocessor_config.json").write_text("{}", encoding="utf-8")
+ (run_dir / "training_metrics.json").write_text(json.dumps({"eval_cer": 0.1}, indent=2), encoding="utf-8")
+ training_summary = run_dir / "recognizer-training-summary.json"
+ training_summary.write_text('{"backend": "hf-vision-encoder-decoder"}\n', encoding="utf-8")
+ train_manifest = tmp_path / "train.jsonl"
+ eval_manifest = tmp_path / "eval.jsonl"
+ image = tmp_path / "page.png"
+ image.write_bytes(b"image")
+ write_manifest([ManifestEntry(sample_id="train-1", dataset="local", split="train", image_path=str(image), text="नेपाल")], train_manifest)
+ write_manifest([ManifestEntry(sample_id="eval-1", dataset="local", split="eval", image_path=str(image), text="English")], eval_manifest)
+
+ result = finalize_hf_recognizer_run(
+ run_dir,
+ output_dir=tmp_path / "finalized",
+ model_id="ocrtech-hf-mixed-v2-full",
+ base_model="microsoft/trocr-small-printed",
+ train_manifest=train_manifest,
+ eval_manifest=eval_manifest,
+ training_summary=training_summary,
+ )
+
+ assert result.audit_passed
+ assert Path(result.model_card_path).exists()
+ assert Path(result.audit_path).exists()
+ assert Path(result.report_json_path).exists()
+ assert Path(result.report_md_path).exists()
+ payload = json.loads(Path(result.report_json_path).read_text(encoding="utf-8"))
+ assert payload["audit_passed"] is True
+ model_card = json.loads(Path(result.model_card_path).read_text(encoding="utf-8"))
+ assert model_card["metrics"]["report"]["path"] == str(run_dir / "training_metrics.json")
+ assert model_card["provenance"]["training_summary"] == {
+ "path": str(training_summary),
+ "sha256": sha256_file(training_summary),
+ }
+
+
+def test_benchmark_writes_report(tmp_path: Path) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("hello world\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("hello world\n", encoding="utf-8")
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["ours"])
+
+ assert len(results) == 1
+ assert results[0].status == "ok"
+ assert results[0].metrics["cer"] == 0
+ assert (tmp_path / "bench" / "report.json").exists()
+
+
+def test_rescore_benchmark_recomputes_metrics_from_existing_documents(tmp_path: Path) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"image")
+ reference = tmp_path / "page.ref.json"
+ reference.write_text(json.dumps({"tables": [[["Name", "Value"], ["A", "1"]]]}), encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="",
+ metadata={"reference_path": str(reference), "slices": ["table"]},
+ )
+ ],
+ manifest,
+ )
+ benchmark_dir = tmp_path / "bench"
+ output_dir = benchmark_dir / "candidate" / source.stem
+ output_dir.mkdir(parents=True)
+ document = Document(
+ source_path=str(source),
+ pages=[Page(page_index=0)],
+ tables=[
+ Table(table_id="p0-t0", page_index=0, bbox=BBox(0, 0, 20, 20), cells=[TableCell(row=0, col=0, text="wrong")]),
+ Table(
+ table_id="p0-t1",
+ page_index=0,
+ bbox=BBox(0, 30, 100, 40),
+ cells=[
+ TableCell(row=0, col=0, text="Name"),
+ TableCell(row=0, col=1, text="Value"),
+ TableCell(row=1, col=0, text="A"),
+ TableCell(row=1, col=1, text="1"),
+ ],
+ ),
+ ],
+ )
+ (output_dir / "document.json").write_text(json.dumps(document.to_dict(), indent=2), encoding="utf-8")
+ report = benchmark_dir / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "sample-1",
+ "slices": ["table"],
+ "metrics": {"table_cell_f1": 0.0},
+ "error": None,
+ }
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ results = rescore_benchmark_report(report, tmp_path / "rescored", eval_manifest=manifest)
+
+ assert results[0].status == "ok"
+ assert results[0].metrics["table_cell_f1"] == 1.0
+ assert results[0].metrics["table_exact_match"] == 1.0
+ assert (tmp_path / "rescored" / "report.json").exists()
+ assert (tmp_path / "rescored" / "candidate" / source.stem / "document.json").exists()
+
+
+def test_derive_table_postprocess_benchmark_scores_candidate_from_same_baseline_document(tmp_path: Path) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"image")
+ reference = tmp_path / "page.ref.json"
+ reference.write_text(json.dumps({"tables": [[["Name", "Value"], ["A", "1"]]]}), encoding="utf-8")
+ manifest = tmp_path / "eval.jsonl"
+ write_manifest(
+ [
+ ManifestEntry(
+ sample_id="sample-1",
+ dataset="fixture",
+ split="eval",
+ image_path=str(source),
+ text="",
+ metadata={"reference_path": str(reference), "slices": ["table"]},
+ )
+ ],
+ manifest,
+ )
+ benchmark_dir = tmp_path / "bench"
+ output_dir = benchmark_dir / "surya" / source.stem
+ output_dir.mkdir(parents=True)
+ document = Document(
+ source_path=str(source),
+ pages=[Page(page_index=0)],
+ tables=[
+ Table(
+ table_id="p0-t0",
+ page_index=0,
+ bbox=BBox(0, 0, 100, 40),
+ cells=[
+ TableCell(row=0, col=0, text="—"),
+ TableCell(row=0, col=1, text="Name"),
+ TableCell(row=0, col=2, text="Value"),
+ TableCell(row=0, col=3, text="Value"),
+ TableCell(row=1, col=0, text="—"),
+ TableCell(row=1, col=1, text="A"),
+ TableCell(row=1, col=2, text="1"),
+ TableCell(row=1, col=3, text="1"),
+ ],
+ )
+ ],
+ )
+ (output_dir / "document.json").write_text(json.dumps(document.to_dict(), indent=2), encoding="utf-8")
+ report = benchmark_dir / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "surya",
+ "input_path": str(source),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "sample-1",
+ "slices": ["table"],
+ "metrics": {"table_cell_f1": 0.0},
+ "error": None,
+ }
+ ]
+ ),
+ encoding="utf-8",
+ )
+
+ results = derive_table_postprocess_benchmark(report, tmp_path / "derived", source_baseline="surya", eval_manifest=manifest)
+ by_baseline = {result.baseline: result for result in results}
+ candidate_document = json.loads((tmp_path / "derived" / "candidate" / source.stem / "document.json").read_text(encoding="utf-8"))
+
+ assert by_baseline["surya"].metrics["table_cell_f1"] < 1.0
+ assert by_baseline["candidate"].metrics["table_cell_f1"] == 1.0
+ assert by_baseline["candidate"].metrics["table_exact_match"] == 1.0
+ assert candidate_document["metadata"]["derived_table_postprocess"]["source_baseline"] == "surya"
+ assert candidate_document["metadata"]["derived_table_postprocess"]["normalized_table_grid_dropped_columns"] == 2
+
+
+def test_benchmark_external_command_materializes_document_from_markdown_stdout(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.png"
+ source.write_bytes(b"png")
+ source.with_suffix(".ref.json").write_text(
+ json.dumps(
+ {
+ "text": "नेपाल सरकार",
+ "tables": [[["नाम", "उमेर"], ["राम", "३२"]]],
+ },
+ ensure_ascii=False,
+ ),
+ encoding="utf-8",
+ )
+ script = tmp_path / "emit_markdown.py"
+ script.write_text(
+ "import argparse\n"
+ "parser = argparse.ArgumentParser()\n"
+ "parser.add_argument('--input')\n"
+ "parser.add_argument('--out')\n"
+ "parser.parse_args()\n"
+ "print('# नेपाल सरकार\\n\\n| नाम | उमेर |\\n| --- | --- |\\n| राम | ३२ |')\n",
+ encoding="utf-8",
+ )
+ monkeypatch.setenv("OCRTECH_GLM_OCR_CMD", f"{sys.executable} {script} --input {{input}} --out {{out}}")
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["glm-ocr"])
+ document_path = tmp_path / "bench" / "glm-ocr" / "page" / "document.json"
+
+ assert results[0].status == "ok"
+ assert results[0].metrics["table_cell_f1"] == 1.0
+ assert document_path.exists()
+ payload = json.loads(document_path.read_text(encoding="utf-8"))
+ assert payload["tables"][0]["cells"][0]["text"] == "नाम"
+ assert (tmp_path / "bench" / "report.md").exists()
+
+
+def test_benchmark_reuses_candidate_engine_per_baseline(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ first = tmp_path / "a.txt"
+ second = tmp_path / "b.txt"
+ first.write_text("नेपाल\n", encoding="utf-8")
+ second.write_text("English\n", encoding="utf-8")
+ create_calls: list[tuple[str, object]] = []
+
+ class FakeEngine:
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text=input_path.read_text(encoding="utf-8").strip(),
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ]
+ )
+
+ def fake_create_engine(name: str, **kwargs):
+ create_calls.append((name, kwargs.get("model_config")))
+ return FakeEngine()
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", fake_create_engine)
+
+ results = run_benchmark([first, second], tmp_path / "bench", baselines=["candidate"], candidate_model_config="model.json")
+
+ assert len(results) == 2
+ assert all(result.status == "ok" for result in results)
+ assert len(create_calls) == 1
+ assert create_calls[0][0] == "candidate"
+
+
+def test_benchmark_candidate_uses_fallback_parser_when_configured(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "page.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("नेपाल\n", encoding="utf-8")
+ primary_model = tmp_path / "primary.json"
+ fallback_model = tmp_path / "fallback.json"
+ primary_model.write_text("{}", encoding="utf-8")
+ fallback_model.write_text("{}", encoding="utf-8")
+ calls: list[dict[str, object]] = []
+
+ def fake_parse_document(input_path: Path, output_dir: Path, **kwargs: object) -> Document:
+ calls.append({"input_path": input_path, "output_dir": output_dir, **kwargs})
+ output_dir.mkdir(parents=True)
+ document = Document(
+ source_path=str(input_path),
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text="नेपाल",
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ],
+ metadata={
+ "quality": {"quality_score": 1.0, "metrics": {"line_count": 1, "low_confidence_line_count": 0}},
+ "fallback": {
+ "triggered": True,
+ "outcome": "success",
+ "primary_average_confidence": 0.42,
+ "threshold": 0.77,
+ },
+ },
+ )
+ (output_dir / "document.json").write_text(json.dumps(document.to_dict()), encoding="utf-8")
+ return document
+
+ monkeypatch.setattr("ocrtech.benchmark.parse_document", fake_parse_document)
+
+ results = run_benchmark(
+ [source],
+ tmp_path / "bench",
+ baselines=["candidate"],
+ candidate_model_config=primary_model,
+ fallback_model_config=fallback_model,
+ low_confidence_threshold=0.77,
+ )
+
+ assert results[0].status == "ok"
+ assert results[0].metrics["fallback_triggered"] == 1.0
+ assert results[0].metrics["fallback_succeeded"] == 1.0
+ report_md = (tmp_path / "bench" / "report.md").read_text(encoding="utf-8")
+ assert "fallback_failed" in report_md
+ assert "| candidate |" in report_md
+ assert "| 1 | 0 |" in report_md
+ assert calls[0]["engine_name"] == "candidate"
+ assert calls[0]["model_config"] == primary_model
+ assert calls[0]["fallback_model_config"] == fallback_model
+ assert calls[0]["low_confidence_threshold"] == 0.77
+
+
+def test_benchmark_checkpoints_report_after_each_sample(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ first = tmp_path / "first.txt"
+ second = tmp_path / "second.txt"
+ first.write_text("one\n", encoding="utf-8")
+ second.write_text("two\n", encoding="utf-8")
+ first.with_suffix(".ref.txt").write_text("one\n", encoding="utf-8")
+ second.with_suffix(".ref.txt").write_text("two\n", encoding="utf-8")
+ output_dir = tmp_path / "bench"
+
+ class FakeEngine:
+ calls = 0
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ self.calls += 1
+ if self.calls == 2:
+ checkpoint = json.loads((output_dir / "report.json").read_text(encoding="utf-8"))
+ assert len(checkpoint) == 1
+ assert checkpoint[0]["input_path"] == str(first)
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text=input_path.read_text(encoding="utf-8").strip(),
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ]
+ )
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", lambda name, **kwargs: FakeEngine())
+
+ results = run_benchmark([first, second], output_dir, baselines=["candidate"], candidate_model_config="model.json")
+
+ assert len(results) == 2
+ final_report = json.loads((output_dir / "report.json").read_text(encoding="utf-8"))
+ assert len(final_report) == 2
+
+
+def test_benchmark_resume_existing_scores_existing_document_without_rerun(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ first = tmp_path / "first.txt"
+ second = tmp_path / "second.txt"
+ first.write_text("one\n", encoding="utf-8")
+ second.write_text("two\n", encoding="utf-8")
+ first.with_suffix(".ref.txt").write_text("one\n", encoding="utf-8")
+ second.with_suffix(".ref.txt").write_text("two\n", encoding="utf-8")
+ output_dir = tmp_path / "bench"
+ existing_dir = output_dir / "candidate" / first.stem
+ existing_dir.mkdir(parents=True)
+ existing_document = Document(
+ source_path=str(first),
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text="one",
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ],
+ )
+ (existing_dir / "document.json").write_text(json.dumps(existing_document.to_dict(), ensure_ascii=False), encoding="utf-8")
+ engine_inputs: list[Path] = []
+
+ class FakeEngine:
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ engine_inputs.append(input_path)
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text=input_path.read_text(encoding="utf-8").strip(),
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ]
+ )
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", lambda name, **kwargs: FakeEngine())
+
+ results = run_benchmark(
+ [first, second],
+ output_dir,
+ baselines=["candidate"],
+ candidate_model_config="model.json",
+ resume_existing=True,
+ )
+
+ assert [result.status for result in results] == ["ok", "ok"]
+ assert results[0].latency_seconds == 0.0
+ assert engine_inputs == [second]
+ report = json.loads((output_dir / "report.json").read_text(encoding="utf-8"))
+ assert [row["input_path"] for row in report] == [str(first), str(second)]
+
+
+def test_benchmark_sample_timeout_records_error_and_continues(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ slow = tmp_path / "slow.txt"
+ fast = tmp_path / "fast.txt"
+ slow.write_text("slow\n", encoding="utf-8")
+ fast.write_text("fast\n", encoding="utf-8")
+ slow.with_suffix(".ref.txt").write_text("slow\n", encoding="utf-8")
+ fast.with_suffix(".ref.txt").write_text("fast\n", encoding="utf-8")
+
+ class FakeEngine:
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ if input_path == slow:
+ time.sleep(2)
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text=input_path.read_text(encoding="utf-8").strip(),
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ]
+ )
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", lambda name, **kwargs: FakeEngine())
+
+ results = run_benchmark(
+ [slow, fast],
+ tmp_path / "bench",
+ baselines=["candidate"],
+ candidate_model_config="model.json",
+ sample_timeout_seconds=1,
+ )
+
+ assert results[0].status == "error"
+ assert "TimeoutError" in str(results[0].error)
+ assert results[1].status == "ok"
+
+
+def test_benchmark_sample_timeout_uses_process_watchdog_when_available(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ if "fork" not in multiprocessing.get_all_start_methods():
+ pytest.skip("process watchdog requires fork start method")
+ source = tmp_path / "slow.txt"
+ source.write_text("slow\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("slow\n", encoding="utf-8")
+
+ def fail_if_signal_timer_is_used(*args, **kwargs):
+ raise AssertionError("signal timer should not be used when fork watchdog is available")
+
+ class FakeEngine:
+ def recognize(self, input_path: Path):
+ time.sleep(2)
+
+ monkeypatch.setattr(signal, "setitimer", fail_if_signal_timer_is_used)
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", lambda name, **kwargs: FakeEngine())
+
+ results = run_benchmark(
+ [source],
+ tmp_path / "bench",
+ baselines=["candidate"],
+ candidate_model_config="model.json",
+ sample_timeout_seconds=1,
+ )
+
+ assert results[0].status == "error"
+ assert "TimeoutError" in str(results[0].error)
+
+
+def test_benchmark_timeout_builds_engine_inside_watchdog_worker(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ if "fork" not in multiprocessing.get_all_start_methods():
+ pytest.skip("process watchdog requires fork start method")
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("नेपाल\n", encoding="utf-8")
+ pid_log = tmp_path / "engine-pids.txt"
+ parent_pid = os.getpid()
+
+ class FakeEngine:
+ def __init__(self) -> None:
+ with pid_log.open("a", encoding="utf-8") as handle:
+ handle.write(f"{os.getpid()}\n")
+
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import EngineOutput
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[
+ TextLine(
+ text=input_path.read_text(encoding="utf-8").strip(),
+ bbox=BBox(0, 0, 10, 10),
+ confidence=0.99,
+ page_index=0,
+ line_id="p0-l0",
+ )
+ ],
+ )
+ ]
+ )
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", lambda name, **kwargs: FakeEngine())
+
+ results = run_benchmark(
+ [source],
+ tmp_path / "bench",
+ baselines=["candidate"],
+ candidate_model_config="model.json",
+ sample_timeout_seconds=5,
+ )
+
+ assert results[0].status == "ok"
+ engine_pids = [int(line) for line in pid_log.read_text(encoding="utf-8").splitlines()]
+ assert engine_pids
+ assert parent_pid not in engine_pids
+
+
+def test_benchmark_supports_surya_baseline(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ source = tmp_path / "sample.txt"
+ source.write_text("नेपाल\n", encoding="utf-8")
+ source.with_suffix(".ref.txt").write_text("नेपाल\n", encoding="utf-8")
+ create_calls: list[str] = []
+
+ class FakeEngine:
+ def recognize(self, input_path: Path):
+ from ocrtech.engines import BBox, EngineOutput, Page, TextLine
+
+ return EngineOutput(
+ pages=[
+ Page(
+ page_index=0,
+ text_lines=[TextLine(text="नेपाल", bbox=BBox(0, 0, 10, 10), confidence=0.88, page_index=0, line_id="p0-l0")],
+ metadata={"surya_mode": "block"},
+ )
+ ],
+ metadata={"surya_mode": "block"},
+ )
+
+ def fake_create_engine(name: str, **kwargs):
+ create_calls.append(name)
+ return FakeEngine()
+
+ monkeypatch.setattr("ocrtech.benchmark.create_engine", fake_create_engine)
+
+ results = run_benchmark([source], tmp_path / "bench", baselines=["surya"])
+
+ assert len(results) == 1
+ assert results[0].status == "ok"
+ assert results[0].metrics["cer"] == 0
+ assert create_calls == ["surya"]
+
+
+def test_summarize_benchmark_report_writes_paired_and_aggregate_metrics(tmp_path: Path) -> None:
+ report = tmp_path / "report.json"
+ report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.10, "quality_score": 0.90},
+ "error": None,
+ },
+ {
+ "baseline": "candidate",
+ "input_path": "b.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s2",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.40, "quality_score": 0.80},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "a.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["english"],
+ "metrics": {"cer": 0.20, "quality_score": 0.70},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": "b.png",
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s2",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.30, "quality_score": 0.75},
+ "error": None,
+ },
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+
+ summary = summarize_benchmark_report(report, tmp_path / "summary", candidate="candidate", baselines=["tesseract"], metrics=["cer"])
+
+ assert (tmp_path / "summary" / "summary.json").exists()
+ assert (tmp_path / "summary" / "summary.md").exists()
+ assert summary.aggregate_metrics["candidate"]["all"]["sample_count"] == 2
+ assert summary.aggregate_metrics["candidate"]["all"]["latency_seconds"] == pytest.approx(1.0)
+ english = next(item for item in summary.paired_metrics if item.baseline == "tesseract" and item.slice_name == "english")
+ nepali = next(item for item in summary.paired_metrics if item.baseline == "tesseract" and item.slice_name == "nepali")
+ assert english.absolute_improvement == pytest.approx(0.10)
+ assert english.win_count == 1
+ assert nepali.absolute_improvement == pytest.approx(-0.10)
+ assert nepali.loss_count == 1
+
+
+def test_calibrate_quality_router_writes_model_card_with_calibration_provenance(tmp_path: Path) -> None:
+ eval_manifest = tmp_path / "eval.jsonl"
+ eval_image = tmp_path / "sample.txt"
+ eval_image.write_text("नेपाल\n", encoding="utf-8")
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(eval_image), text="नेपाल", metadata={"slices": ["nepali"]})],
+ eval_manifest,
+ )
+ benchmark_report = tmp_path / "report.json"
+ benchmark_report.write_text(
+ json.dumps(
+ [
+ {
+ "baseline": "candidate",
+ "input_path": str(eval_image),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.20, "quality_score": 0.95},
+ "error": None,
+ },
+ {
+ "baseline": "tesseract",
+ "input_path": str(eval_image),
+ "status": "ok",
+ "latency_seconds": 1.0,
+ "sample_id": "s1",
+ "slices": ["nepali"],
+ "metrics": {"cer": 0.40, "quality_score": 0.70},
+ "error": None,
+ },
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ experiment_report = tmp_path / "experiment.json"
+ experiment_report.write_text(
+ json.dumps(
+ {
+ "experiment_id": "calibration",
+ "output_dir": str(tmp_path / "exp"),
+ "eval_manifest": str(eval_manifest),
+ "references_dir": None,
+ "baselines": ["candidate", "tesseract"],
+ "input_count": 1,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1},
+ "benchmark_report": str(benchmark_report),
+ "benchmark_status_counts": {"ok": 2},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ },
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+
+ calibration, model_path = calibrate_quality_router(
+ experiment_report,
+ tmp_path / "calibrated",
+ model_id="ocrtech-quality-router",
+ primary_engine="tesseract",
+ secondary_engine="tesseract",
+ primary_engine_kwargs={"psm": 6},
+ secondary_engine_kwargs={"psm": 13},
+ threshold_start=0.0,
+ threshold_end=0.1,
+ threshold_step=0.05,
+ )
+
+ payload = json.loads(model_path.read_text(encoding="utf-8"))
+
+ assert (tmp_path / "calibrated" / "calibration.json").exists()
+ assert calibration.selected_threshold == 0.1
+ assert payload["backend"] == "quality_select_composite"
+ assert payload["provenance"]["calibration"]["eval_manifest"]["path"] == str(eval_manifest)
+
+
+def test_calibrate_tesseract_psm_ensemble_writes_ranked_model_card(tmp_path: Path) -> None:
+ eval_manifest = tmp_path / "eval.jsonl"
+ sample = tmp_path / "sample.txt"
+ sample.write_text("नेपाल\n", encoding="utf-8")
+ write_manifest(
+ [ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(sample), text="नेपाल", metadata={"slices": ["nepali"]})],
+ eval_manifest,
+ )
+ def write_experiment(path: Path, benchmark_path: Path, rows: list[dict[str, object]]) -> Path:
+ benchmark_path.write_text(json.dumps(rows, indent=2), encoding="utf-8")
+ payload = {
+ "experiment_id": path.stem,
+ "output_dir": str(path.parent / path.stem),
+ "eval_manifest": str(eval_manifest),
+ "references_dir": None,
+ "baselines": ["candidate", "tesseract"],
+ "input_count": 1,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1},
+ "benchmark_report": str(benchmark_path),
+ "benchmark_status_counts": {"ok": len(rows)},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ }
+ path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
+ return path
+
+ primary = write_experiment(
+ tmp_path / "primary-experiment.json",
+ tmp_path / "primary-report.json",
+ [
+ {"baseline": "tesseract", "input_path": str(sample), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.4, "quality_score": 0.7}, "error": None}
+ ],
+ )
+ psm7 = write_experiment(
+ tmp_path / "psm7-experiment.json",
+ tmp_path / "psm7-report.json",
+ [
+ {"baseline": "candidate", "input_path": str(sample), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.3, "quality_score": 0.6}, "error": None}
+ ],
+ )
+ psm13 = write_experiment(
+ tmp_path / "psm13-experiment.json",
+ tmp_path / "psm13-report.json",
+ [
+ {"baseline": "candidate", "input_path": str(sample), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.2, "quality_score": 0.9}, "error": None}
+ ],
+ )
+
+ calibration, model_path = calibrate_tesseract_psm_ensemble(
+ primary,
+ tmp_path / "ensemble",
+ model_id="ocrtech-psm-ensemble",
+ variant_experiment_reports={"psm7": psm7, "psm13": psm13},
+ bias_start=-0.04,
+ bias_end=0.04,
+ bias_step=0.04,
+ )
+
+ payload = json.loads(model_path.read_text(encoding="utf-8"))
+ assert (tmp_path / "ensemble" / "calibration.json").exists()
+ assert payload["backend"] == "quality_ranked_ensemble"
+ assert payload["backend_kwargs"]["alternative_engines"][0]["engine"] == "tesseract"
+ assert calibration.selected_biases["psm13"] >= calibration.selected_biases["psm7"]
+
+
+def test_calibrate_script_router_writes_model_card(tmp_path: Path) -> None:
+ eval_manifest = tmp_path / "eval.jsonl"
+ sample_nep = tmp_path / "nep.png"
+ sample_eng = tmp_path / "eng.png"
+ sample_nep.write_bytes(b"nep")
+ sample_eng.write_bytes(b"eng")
+ write_manifest(
+ [
+ ManifestEntry(sample_id="s1", dataset="fixture", split="eval", image_path=str(sample_nep), text="नेपाल", metadata={"slices": ["nepali"]}),
+ ManifestEntry(sample_id="s2", dataset="fixture", split="eval", image_path=str(sample_eng), text="hello", metadata={"slices": ["english"]}),
+ ],
+ eval_manifest,
+ )
+ output_dir = tmp_path / "experiment"
+ (output_dir / "benchmark" / "tesseract" / sample_nep.stem).mkdir(parents=True)
+ (output_dir / "benchmark" / "tesseract" / sample_eng.stem).mkdir(parents=True)
+ (output_dir / "benchmark" / "tesseract" / sample_nep.stem / "document.md").write_text("नेपाल सरकार\n", encoding="utf-8")
+ (output_dir / "benchmark" / "tesseract" / sample_eng.stem / "document.md").write_text("hello world\n", encoding="utf-8")
+ benchmark_report = tmp_path / "report.json"
+ benchmark_report.write_text(
+ json.dumps(
+ [
+ {"baseline": "tesseract", "input_path": str(sample_nep), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.40}, "error": None},
+ {"baseline": "surya", "input_path": str(sample_nep), "status": "ok", "latency_seconds": 1.0, "sample_id": "s1", "slices": ["nepali"], "metrics": {"cer": 0.20}, "error": None},
+ {"baseline": "tesseract", "input_path": str(sample_eng), "status": "ok", "latency_seconds": 1.0, "sample_id": "s2", "slices": ["english"], "metrics": {"cer": 0.10}, "error": None},
+ {"baseline": "surya", "input_path": str(sample_eng), "status": "ok", "latency_seconds": 1.0, "sample_id": "s2", "slices": ["english"], "metrics": {"cer": 0.50}, "error": None},
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ experiment_report = tmp_path / "experiment.json"
+ experiment_report.write_text(
+ json.dumps(
+ {
+ "experiment_id": "script-calibration",
+ "output_dir": str(output_dir),
+ "eval_manifest": str(eval_manifest),
+ "references_dir": None,
+ "baselines": ["surya", "tesseract"],
+ "input_count": 2,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1, "english": 1},
+ "benchmark_report": str(benchmark_report),
+ "benchmark_status_counts": {"ok": 4},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ },
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+
+ calibration, model_path = calibrate_script_router(
+ experiment_report,
+ tmp_path / "script-router",
+ model_id="ocrtech-script-router",
+ primary_engine="tesseract",
+ secondary_engine="surya",
+ threshold_start=0.0,
+ threshold_end=0.5,
+ threshold_step=0.25,
+ routing_granularity="page",
+ secondary_structure_backfill=True,
+ )
+
+ payload = json.loads(model_path.read_text(encoding="utf-8"))
+ assert (tmp_path / "script-router" / "calibration.json").exists()
+ assert calibration.selected_threshold in {0.0, 0.25}
+ assert payload["backend"] == "script_select_composite"
+ assert payload["backend_kwargs"]["primary_script_threshold"] == calibration.selected_threshold
+ assert payload["backend_kwargs"]["routing_granularity"] == "page"
+ assert payload["backend_kwargs"]["secondary_structure_backfill"] is True
+
+
+def test_calibrate_script_router_supports_latin_script(tmp_path: Path) -> None:
+ output_dir = tmp_path / "outputs"
+ (output_dir / "benchmark" / "surya" / "doc-nepali").mkdir(parents=True)
+ (output_dir / "benchmark" / "surya" / "doc-english").mkdir(parents=True)
+ (output_dir / "benchmark" / "surya" / "doc-nepali" / "document.md").write_text("नेपाल सरकार\n", encoding="utf-8")
+ (output_dir / "benchmark" / "surya" / "doc-english" / "document.md").write_text("Invoice Total\n", encoding="utf-8")
+ benchmark_report = output_dir / "benchmark" / "report.json"
+ benchmark_report.write_text(
+ json.dumps(
+ [
+ {"baseline": "surya", "input_path": "doc-nepali.png", "sample_id": "doc-nepali", "status": "ok", "metrics": {"cer": 0.1}},
+ {"baseline": "tesseract", "input_path": "doc-nepali.png", "sample_id": "doc-nepali", "status": "ok", "metrics": {"cer": 0.4}},
+ {"baseline": "surya", "input_path": "doc-english.png", "sample_id": "doc-english", "status": "ok", "metrics": {"cer": 0.4}},
+ {"baseline": "tesseract", "input_path": "doc-english.png", "sample_id": "doc-english", "status": "ok", "metrics": {"cer": 0.1}},
+ ],
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+ eval_manifest = tmp_path / "eval.jsonl"
+ eval_manifest.write_text(
+ "\n".join(
+ [
+ json.dumps({"sample_id": "doc-nepali", "dataset": "fixture", "split": "eval", "image_path": "doc-nepali.png", "text": "नेपाल सरकार"}),
+ json.dumps({"sample_id": "doc-english", "dataset": "fixture", "split": "eval", "image_path": "doc-english.png", "text": "Invoice Total"}),
+ ]
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ experiment_report = tmp_path / "experiment.json"
+ experiment_report.write_text(
+ json.dumps(
+ {
+ "experiment_id": "script-calibration-latin",
+ "output_dir": str(output_dir),
+ "eval_manifest": str(eval_manifest),
+ "references_dir": None,
+ "baselines": ["surya", "tesseract"],
+ "input_count": 2,
+ "datasets": ["fixture"],
+ "slice_counts": {"nepali": 1, "english": 1},
+ "benchmark_report": str(benchmark_report),
+ "benchmark_status_counts": {"ok": 4},
+ "validation_report": None,
+ "validation_status": None,
+ "environment": {},
+ },
+ indent=2,
+ ),
+ encoding="utf-8",
+ )
+
+ calibration, model_path = calibrate_script_router(
+ experiment_report,
+ tmp_path / "script-router-latin",
+ model_id="ocrtech-script-router-latin",
+ primary_engine="surya",
+ secondary_engine="tesseract",
+ primary_baseline="surya",
+ secondary_baseline="tesseract",
+ script="latin",
+ threshold_start=0.0,
+ threshold_end=0.5,
+ threshold_step=0.25,
+ )
+
+ payload = json.loads(model_path.read_text(encoding="utf-8"))
+ assert calibration.selected_threshold in {0.0, 0.25}
+ assert payload["backend_kwargs"]["script"] == "latin"
+ assert payload["backend_kwargs"]["primary_engine"] == "surya"
+ assert payload["backend_kwargs"]["secondary_engine"] == "tesseract"
+
+
+def _stopped_ppocrv3_failure_review(tmp_path: Path) -> Path:
+ review = tmp_path / "recognizer-failure-review.json"
+ review.write_text(
+ json.dumps(
+ {
+ "families": [
+ {
+ "backend": "paddleocr",
+ "base_model": "PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "family_key": "paddleocr::PaddlePaddle/devanagari_PP-OCRv3_mobile_rec",
+ "recommendation": "stop_family",
+ "rejected_count": 4,
+ "total_wins": 0,
+ "total_losses": 545,
+ "total_ties": 7,
+ }
+ ]
+ }
+ )
+ + "\n",
+ encoding="utf-8",
+ )
+ return review
+
+
+def _passing_validation_gate() -> dict[str, object]:
+ return {
+ "passed": True,
+ "pairs": 2,
+ "candidate_mean": 0.1,
+ "baseline_mean": 0.2,
+ "absolute_improvement": 0.1,
+ "relative_improvement": 0.5,
+ "improvement_ci_low": 0.01,
+ "win_count": 2,
+ "loss_count": 0,
+ "tie_count": 0,
+ "pair_win_rate": 1.0,
+ "sign_test_p_value": 0.0,
+ "gate": {
+ "baseline": "tesseract",
+ "metric": "cer",
+ "min_pairs": 2,
+ "min_pair_win_rate": 0.5,
+ "require_ci_above_zero": True,
+ },
+ }
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.json
new file mode 100644
index 0000000000000000000000000000000000000000..1225b062c6dd014221baf4873832b6295cb32b92
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.json
@@ -0,0 +1,21 @@
+{
+ "manifest_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/manifests/ocrtech-eval-pack.jsonl",
+ "sample_count": 5,
+ "input_format": "image",
+ "slices": {
+ "clean": 5,
+ "english": 5,
+ "figure": 2,
+ "form": 2,
+ "image": 5,
+ "mixed_script": 5,
+ "multi_page": 1,
+ "nepali": 5,
+ "reading_order": 5,
+ "table": 2
+ },
+ "claim_ready": false,
+ "warnings": [
+ "missing claim slices: scan"
+ ]
+}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.md b/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.md
new file mode 100644
index 0000000000000000000000000000000000000000..1b8e441d61fca270555b26791946cb1a76e0153d
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/eval-pack.md
@@ -0,0 +1,23 @@
+# OCR Eval Pack
+
+Manifest: `~/ocr-tech/outputs/multipage-eval-pack-repro/manifests/ocrtech-eval-pack.jsonl`
+Samples: `5`
+Input format: `image`
+Claim ready: `no`
+
+## Slices
+
+- `clean`: 5
+- `english`: 5
+- `figure`: 2
+- `form`: 2
+- `image`: 5
+- `mixed_script`: 5
+- `multi_page`: 1
+- `nepali`: 5
+- `reading_order`: 5
+- `table`: 2
+
+## Warnings
+
+- missing claim slices: scan
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-figure-caption-000-clean.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-figure-caption-000-clean.png
new file mode 100644
index 0000000000000000000000000000000000000000..509983520f7997e5cde1240f21b57cbc97d5cf68
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-figure-caption-000-clean.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-form-notice-000-clean.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-form-notice-000-clean.png
new file mode 100644
index 0000000000000000000000000000000000000000..ed2fb16300641629f59e13594cf35e8be177be10
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-form-notice-000-clean.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-mixed-paragraph-000-clean.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-mixed-paragraph-000-clean.png
new file mode 100644
index 0000000000000000000000000000000000000000..e63877e8003e91c3370902a5a22ac73182a4452f
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-mixed-paragraph-000-clean.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0001.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0001.png
new file mode 100644
index 0000000000000000000000000000000000000000..d37a893debb7f51361caf2cf39dadfec1bdc513f
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0001.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0002.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0002.png
new file mode 100644
index 0000000000000000000000000000000000000000..84d1fee1491982e40f64cf9835b58bd4ebfb2402
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean/page-0002.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-table-ledger-000-clean.png b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-table-ledger-000-clean.png
new file mode 100644
index 0000000000000000000000000000000000000000..833172ea4fe439b5df0cb03af578c5e25f23ea96
Binary files /dev/null and b/~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-table-ledger-000-clean.png differ
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/manifests/ocrtech-eval-pack.jsonl b/~/ocr-tech/outputs/multipage-eval-pack-repro/manifests/ocrtech-eval-pack.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..eda18b647b098437243a050149f0791a158fb0f7
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/manifests/ocrtech-eval-pack.jsonl
@@ -0,0 +1,5 @@
+{"sample_id": "eval-mixed-paragraph-000-clean", "dataset": "ocrtech-eval-pack", "split": "eval", "image_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-mixed-paragraph-000-clean.png", "text": "नेपाल सरकार\nDepartment of Records\nयो कागजात नेपाली र English दुबै भाषामा लेखिएको छ।\nThe quick brown fox jumps over the lazy dog.\nरकम रु. १२,५००.०० paid on 2026-06-14.", "sha256": "e6be30fb9cd937e73c73aee5ba2aad82fa1acbbbd6ebce74732a79974a0266c5", "metadata": {"slices": ["clean", "english", "image", "mixed_script", "nepali", "reading_order"], "script": "mixed_script", "document_type": "paragraph", "degradation": "clean", "input_format": "image", "reference_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-mixed-paragraph-000-clean.json", "text_sha256": "782f98e312109609a38685195b0857e0bc6d6dbf0b0cb4f6471b4bba610750fb", "sample_sha256": "7f9459c3349c014c1ae4cf375adcc06006c1055fe35e6cae09fa82db8e5f74b2", "claim_evidence_eligible": true}}
+{"sample_id": "eval-table-ledger-000-clean", "dataset": "ocrtech-eval-pack", "split": "eval", "image_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-table-ledger-000-clean.png", "text": "दैनिक हिसाब", "sha256": "655d524625c0049cfd50baaedfdb5816d8e48a078dd233db142fa23df1acacea", "metadata": {"slices": ["clean", "english", "image", "mixed_script", "nepali", "reading_order", "table"], "script": "mixed_script", "document_type": "table", "degradation": "clean", "input_format": "image", "reference_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-table-ledger-000-clean.json", "text_sha256": "b4aa9889c7e5ce31e8d0afa1e2c01554aaf8e46813749e4fdf045ab8d63dd9e3", "sample_sha256": "dff14a3f05820945b877461ba37cb569dd83d4fe801ca80bd053048c057c42e0", "claim_evidence_eligible": true}}
+{"sample_id": "eval-form-notice-000-clean", "dataset": "ocrtech-eval-pack", "split": "eval", "image_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-form-notice-000-clean.png", "text": "निवेदन फाराम\nनाम: आशा गुरुङ\nAddress: Pokhara-08\nमिति: २०८३-०२-०१\nPhone: 9800000000\nहस्ताक्षर: __________", "sha256": "4b252e684f315b5ec5353a3eb80c0319eec96f4dbca801c0ccb5b73df87b070d", "metadata": {"slices": ["clean", "english", "form", "image", "mixed_script", "nepali", "reading_order"], "script": "mixed_script", "document_type": "form", "degradation": "clean", "input_format": "image", "reference_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-form-notice-000-clean.json", "text_sha256": "92660301fa7eeee3dc0d9d1ecb238723e357d98d75a3776ec837cf8765dbea54", "sample_sha256": "40735d15286b759b764f778e31d1e5c235464178abfa2ee1b7c772a88f36c5bf", "claim_evidence_eligible": true}}
+{"sample_id": "eval-figure-caption-000-clean", "dataset": "ocrtech-eval-pack", "split": "eval", "image_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-figure-caption-000-clean.png", "text": "वार्षिक प्रतिवेदन\nचित्र १: Revenue growth from 2022 to 2026.\nनिष्कर्ष: राजस्व क्रमशः बढेको छ।", "sha256": "a91097b3b0266887c86228e8210555f67b9497aa53c3b40f0d3a8a04bcf9deab", "metadata": {"slices": ["clean", "english", "figure", "image", "mixed_script", "nepali", "reading_order"], "script": "mixed_script", "document_type": "figure", "degradation": "clean", "input_format": "image", "reference_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-figure-caption-000-clean.json", "text_sha256": "23c030483f978ea3040486b9a68c199328b3c83ce733cbbf92087b82219618b8", "sample_sha256": "92222da61563f3836274e6f228ce6fdcafe72a1a0bb9fa3b17b03e94e6a1486d", "claim_evidence_eligible": true}}
+{"sample_id": "eval-multi-page-brief-000-clean", "dataset": "ocrtech-eval-pack", "split": "eval", "image_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/inputs/eval-multi-page-brief-000-clean", "text": "Procurement Status Report\nनेपाल सरकार - Ministry of Health\nFY 2025/26 mixed-script status summary.\nचित्र २: Delivery trend by month.\nनिष्कर्ष: April पछि आपूर्ति बढेको छ।\nApproved by: Sita Rana\nमिति: २०८३-०२-१५", "sha256": "46675dfed9ca90b3f1cbf969b560f8069ccab2ee7d8066098d29e60573d3639c", "metadata": {"slices": ["clean", "english", "figure", "form", "image", "mixed_script", "multi_page", "nepali", "reading_order", "table"], "script": "mixed_script", "document_type": "multi_page_report", "degradation": "clean", "input_format": "image", "reference_path": "~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-multi-page-brief-000-clean.json", "text_sha256": "b530b012afafdd971cbe1e23f670b89d6fd218a082e341c4a28b7ad99608ae6c", "sample_sha256": "e4a531d0fcdd26024ebe6fd0debdca77a264d4335e619a034a4d5b240faa62d6", "claim_evidence_eligible": true}}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-figure-caption-000-clean.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-figure-caption-000-clean.json
new file mode 100644
index 0000000000000000000000000000000000000000..db118e3bcf6594722c468e3cd0bfc48390dae26d
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-figure-caption-000-clean.json
@@ -0,0 +1,33 @@
+{
+ "text": "वार्षिक प्रतिवेदन\nचित्र १: Revenue growth from 2022 to 2026.\nनिष्कर्ष: राजस्व क्रमशः बढेको छ।",
+ "reading_order": [
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3"
+ ],
+ "tables": [],
+ "figures": [
+ {
+ "figure_id": "fig-revenue-chart",
+ "page_index": 0,
+ "caption": "चित्र १: Revenue growth from 2022 to 2026.",
+ "line_ids": [
+ "p0-l1",
+ "p0-l2"
+ ]
+ }
+ ],
+ "metadata": {
+ "template": "figure-caption",
+ "document_type": "figure",
+ "slices": [
+ "nepali",
+ "english",
+ "mixed_script",
+ "figure",
+ "reading_order"
+ ],
+ "page_count": 1
+ }
+}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-form-notice-000-clean.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-form-notice-000-clean.json
new file mode 100644
index 0000000000000000000000000000000000000000..67b8610a4d632c868dc11b1100556ab462713a64
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-form-notice-000-clean.json
@@ -0,0 +1,25 @@
+{
+ "text": "निवेदन फाराम\nनाम: आशा गुरुङ\nAddress: Pokhara-08\nमिति: २०८३-०२-०१\nPhone: 9800000000\nहस्ताक्षर: __________",
+ "reading_order": [
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3",
+ "p0-l4",
+ "p0-l5"
+ ],
+ "tables": [],
+ "figures": [],
+ "metadata": {
+ "template": "form-notice",
+ "document_type": "form",
+ "slices": [
+ "nepali",
+ "english",
+ "mixed_script",
+ "form",
+ "reading_order"
+ ],
+ "page_count": 1
+ }
+}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-mixed-paragraph-000-clean.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-mixed-paragraph-000-clean.json
new file mode 100644
index 0000000000000000000000000000000000000000..24efc63dd4b74c166ba9d252a37bc228637aa18b
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-mixed-paragraph-000-clean.json
@@ -0,0 +1,23 @@
+{
+ "text": "नेपाल सरकार\nDepartment of Records\nयो कागजात नेपाली र English दुबै भाषामा लेखिएको छ।\nThe quick brown fox jumps over the lazy dog.\nरकम रु. १२,५००.०० paid on 2026-06-14.",
+ "reading_order": [
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3",
+ "p0-l4"
+ ],
+ "tables": [],
+ "figures": [],
+ "metadata": {
+ "template": "mixed-paragraph",
+ "document_type": "paragraph",
+ "slices": [
+ "nepali",
+ "english",
+ "mixed_script",
+ "reading_order"
+ ],
+ "page_count": 1
+ }
+}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-multi-page-brief-000-clean.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-multi-page-brief-000-clean.json
new file mode 100644
index 0000000000000000000000000000000000000000..e509632eb955d8499bb63164fc6a0f9916569f62
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-multi-page-brief-000-clean.json
@@ -0,0 +1,61 @@
+{
+ "text": "Procurement Status Report\nनेपाल सरकार - Ministry of Health\nFY 2025/26 mixed-script status summary.\nचित्र २: Delivery trend by month.\nनिष्कर्ष: April पछि आपूर्ति बढेको छ।\nApproved by: Sita Rana\nमिति: २०८३-०२-१५",
+ "reading_order": [
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3",
+ "p0-l4",
+ "p0-l5",
+ "p1-l0",
+ "p1-l1",
+ "p1-l2",
+ "p1-l3",
+ "p1-l4"
+ ],
+ "tables": [
+ [
+ [
+ "Item",
+ "Qty",
+ "Vendor"
+ ],
+ [
+ "Masks",
+ "५००",
+ "Himalayan Trade"
+ ],
+ [
+ "Gloves",
+ "८००",
+ "Pokhara Supply"
+ ]
+ ]
+ ],
+ "figures": [
+ {
+ "figure_id": "fig-delivery-trend",
+ "page_index": 1,
+ "caption": "चित्र २: Delivery trend by month.",
+ "line_ids": [
+ "p1-l0",
+ "p1-l1"
+ ]
+ }
+ ],
+ "metadata": {
+ "template": "multi-page-brief",
+ "document_type": "multi_page_report",
+ "slices": [
+ "nepali",
+ "english",
+ "mixed_script",
+ "multi_page",
+ "table",
+ "figure",
+ "form",
+ "reading_order"
+ ],
+ "page_count": 2
+ }
+}
diff --git a/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-table-ledger-000-clean.json b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-table-ledger-000-clean.json
new file mode 100644
index 0000000000000000000000000000000000000000..cd958ec39de6e8249ac355c1a70ad494963957bc
--- /dev/null
+++ b/~/ocr-tech/outputs/multipage-eval-pack-repro/references/eval-table-ledger-000-clean.json
@@ -0,0 +1,47 @@
+{
+ "text": "दैनिक हिसाब",
+ "reading_order": [
+ "p0-l0",
+ "p0-l1",
+ "p0-l2",
+ "p0-l3",
+ "p0-l4"
+ ],
+ "tables": [
+ [
+ [
+ "नाम",
+ "रकम",
+ "Remarks"
+ ],
+ [
+ "राम",
+ "१५००",
+ "Paid"
+ ],
+ [
+ "सीता",
+ "२३००",
+ "Pending"
+ ],
+ [
+ "Total",
+ "३८००",
+ "Verified"
+ ]
+ ]
+ ],
+ "figures": [],
+ "metadata": {
+ "template": "table-ledger",
+ "document_type": "table",
+ "slices": [
+ "nepali",
+ "english",
+ "mixed_script",
+ "table",
+ "reading_order"
+ ],
+ "page_count": 1
+ }
+}