Datasets:
|
Download docs/generation-recipe.md from hahouari/SMedDV: direct link, hf CLI and curl.
- Browser
- Download file 4.58 kB
-
https://huggingface.co/datasets/hahouari/SMedDV/resolve/main/docs/generation-recipe.md
- Command line
-
hf download hf://datasets/hahouari/SMedDV/docs/generation-recipe.md
-
curl -L -o generation-recipe.md https://huggingface.co/datasets/hahouari/SMedDV/resolve/main/docs/generation-recipe.md
4.58 kB
SMedDV v5 generation recipe
This note describes the synthetic text-line generation process and its biases. SMedDV contains line crops only; it does not contain full ID-card photographs, real people, or authentic personal records.
Pipeline overview
- Language configuration. YAML language definitions draw character sets from Unicode CLDR 48.2.3, with project-maintained script overrides. The family contains 53 language IDs across RTL and Latin scripts, plus a separate MRZ stream.
- Text/value sampling. A global seed of
0and stable sample indices feed deterministic per-index sampling. Source-backed names and places are mixed with generated dates, synthetic identifier-like numbers, short labels, authority labels, mixed-script values, generic text, coverage lines, and MRZ lines. The source table and licences are in../ATTRIBUTION.md. - Coverage supplement. The first 3.5M requested indices were followed by a deterministic source-backed coverage supplement. The final request range is 3,528,113 indices; 155 indices without a source-backed value are explicitly listed in the source
skips.jsonl, leaving 3,527,958 rendered samples. Coverage targets are recorded in the source coverage plans. - Rendering. A script-eligible font is chosen only after character coverage checks. Pillow/RAQM shapes RTL and Latin text; generated card-stock backgrounds use flat, gradient, noise, guilloche, CC0 security-pattern, and CC0 material-texture layers. Per-line degradation is assigned to clean/light/medium/heavy tiers, then rendered at 48 px high with proportional width.
- Encoding and labels. The original v5 images are WebP q85, method 6. Canonical
textis logical Unicode order;text_visualis the separately stored visual left-to-right order used by the Paddle lists. The dictionary contains 503 non-space code points. - Split. A fixed index manifest selects exactly 141,118 of 3,527,958 rows for validation. Selection begins with a deterministic 3.5% hash base, then fills coverage/group requirements and the remaining budget up to 4%. The manifest is shipped at
../splits/validation_indices.json. It is not a text-disjoint split. - HF packaging. Each Parquet row stores the unmodified WebP bytes as an HF-compatible
Imagestruct and retains both logical and visual labels. Train and validation shards are split by the fixed manifest; shard checksums and a whole-package checksum accompany the files.
Composition controls and biases
- Category and language proportions are generator targets, not estimates of real document-field prevalence. The dataset intentionally gives substantial weight to Arabic-script examples, MRZ, rare characters, coverage rows, and longer text.
- A language may have far fewer rows than another. See the measured per-language train/validation table in the README.
- Wikipedia-derived spans are short (one to six words before normalization/filtering). Row-level article IDs and URLs were not retained, so attribution is at the source-dataset/shard level; this limitation is disclosed in
ATTRIBUTION.md. - Name/place corpora, curated document headings, identifier formats, and language-specific alphabets produce source and vocabulary biases. Synthetic identifier-like values are not real IDs and are not guaranteed to match every issuer's unpublished validation rule.
- Backgrounds and fonts are generated or permissively licensed assets. They do not model the full range of real camera capture, lighting, lamination, wear, glare, document layouts, or jurisdiction-specific design. No real-card images were used.
- Validation uses the same synthetic generation family. It is useful for controlled OCR comparisons and regression tests, but not a substitute for an independent, consented real-world evaluation set.
- In the stored 10,000-example RTL round-trip QA, 17 rows (0.17%) were mismatches, all Arabic generic examples with digit spans/ranges or punctuation. See
VALIDATION.md.
Reproducing the source generation
Exact recorded commands, seeds, run logs, source-file hashes, the relevant source-code commit, and packaging command are summarized in reproducibility.json. The original generation run used seed 0, 12 workers, 10,000-row chunks, 48 px output, WebP q85, and the v5 realism profile. The data source is read-only for this release workflow; do not regenerate or alter files under data/synth/v5/ while packaging.
Training models is outside the scope of this release package.