--- license: other task_categories: - image-to-text tags: - structured-image-understanding - svg - mermaid - graphviz - plantuml - vega-lite - diagram-to-code pretty_name: StructCrawl Sample (image → structured text) size_categories: - 10K/", "svg", split="train") ex = ds[0] ex["image"] # PIL.Image — the rendered diagram ex["target_text"] # the SVG/Mermaid/DOT/PlantUML/Vega source to reproduce it ex["stage"] # token-length band, e.g. "stage_0-2048" ex["source"] # crawl origin, e.g. "commoncrawl_inline" ex["token_count"] # target_text length in SFT tokenizer tokens ``` ## Fields | Field | Type | Notes | |-------|------|-------| | `id` | string | unique sample id | | `format` | string | svg \| mermaid \| dot \| plantuml \| vega | | `source` | string | crawl origin (commoncrawl_inline, github_repos, github_search, thestack_*, web_linked, wikimedia, ...) | | `stage` | string | token-length band (2048-token steps to 8192, 4096-steps to 32768, then `stage_32768_plus`) | | `token_count` | int64 | `target_text` length (SFT tokenizer) | | `image` | Image | rendered diagram (native dimensions, white background) | | `target_text` | string | the structured-text code that renders to `image` | | `provenance` | string | original url / repo / path when available | ## Sampling & processing - **Stratified:** up to 500 samples drawn uniformly at random (seed 42, reservoir sampling) from every (format × stage × source) cell. - **Washed:** samples whose code cannot be reproduced from the image alone were removed upstream — base64-embedded rasters/fonts, external image/data references, scripts, ``, PlantUML `!include`/sprites. - **Deduplicated:** exact content-level dedup (whitespace-normalized SHA-256), filename-independent. Near-duplicate template families may still remain. - **Render-validated:** every `target_text` was executed and produced a non-blank image; the paired `image` is that render. ## Caveats - Licensing is mixed (public web, license-filtered source corpora, CC-BY Commons) — intended for research; per-sample `provenance` retained for attribution. - SVG length is heavy-tailed; use `stage` / `token_count` to filter. - This is a small representative slice of a ~860K-pair processed corpus.