| --- |
| license: cc-by-sa-4.0 |
| language: |
| - pl |
| pretty_name: Polish DynaWord |
| task_categories: |
| - text-generation |
| size_categories: |
| - 1M<n<10M |
| tags: |
| - polish |
| - pretraining |
| - dynaword |
| - v0.2 |
| - v0.3-preview |
| --- |
| |
| # Polish DynaWord |
|
|
| A continuously developed, **openly-licensed**, human-text Polish corpus — a Polish |
| edition in the [Dynaword](https://huggingface.co/datasets/danish-foundation-models/danish-dynaword) |
| family (Enevoldsen et al., [arXiv:2508.02271](https://arxiv.org/abs/2508.02271)). |
|
|
| > **v0.2.0 stable** · 2,490,773 documents · **6.22B tokens** (tiktoken proxy; |
| > canonical Llama-3 count at release) · 11 sources |
|
|
| > **v0.3.0-preview in progress** · quality/diversity remix workflow, legal-style |
| > downweighting, and filtered contemporary Polish web candidates. Current local |
| > HPLT candidate run: **565,827 documents / 496.5M tokens** from |
| > `ashtok897/european-hplt-v1`; not yet merged into the stable parquet release. |
|
|
| ## Versions |
|
|
| | version | status | documents | tokens | notes | |
| |---|---|---:|---:|---| |
| | `v0.2.0` | stable release | 2,490,773 | 6.22B | Provenance-first corpus from 11 open/official sources. | |
| | `v0.3.0-preview` | workflow + candidate data in progress | +565,827 candidate docs | +496.5M candidate tokens | Filtered European HPLT Polish web candidate, generated locally with chunked/parallel filtering; pending dedup, QA, and final mix weighting. | |
|
|
| If the current HPLT candidate is merged as-is, the working corpus would be |
| approximately **3,056,600 documents / 6.72B tokens** before dedup and mix |
| reweighting. The final v0.3 release is expected to be a **training mix**, not a |
| raw append: legal/parliamentary/official-document sources should be capped and |
| sampled rather than allowed to dominate by raw token count. |
|
|
| ## What this dataset contributes |
| The raw texts come from existing open corpora (redistributed via SpeakLeash and, |
| where applicable, fetched from upstream). **The value added here is the curation, |
| not the bytes**, following the Dynaword methodology: |
|
|
| 1. **License review per source** — each source vetted for an *openly-licensed, |
| traceable* legal basis (documented in its datasheet); sources that fail the |
| review are **excluded with a stated reason** (see table below), not silently |
| kept. This is the core editorial work. |
| 2. **Filtering & normalization** — minimal, reproducible gates (short-doc, |
| non-Polish, exact cross-source dedup, OCR garble) applied uniformly to one |
| clean schema: `id, text, source, added, created, token_count`. |
| 3. **Documentation** — a datasheet per source (Gebru et al. 2021) + this card, |
| so provenance and licensing are auditable rather than assumed. |
| 4. **Reproducibility & versioning** — `src/` rebuilds the corpus from sources; |
| new sources and removals are tracked in the CHANGELOG. |
|
|
| Credit for the underlying texts belongs to the upstream sources and to SpeakLeash |
| as the redistributing aggregator; this release does not claim ownership of them |
| (see Disclaimer). |
|
|
| ## Guiding principles |
| 1. **Open & traceable licensing** — every source is *openly licensed* with a documented |
| legal basis (see each datasheet's "traceable basis"), not a vague "public domain". |
| 2. **Reproducibility** — `src/build_dynaword.py` rebuilds the corpus from sources. |
| 3. **Documented** — a datasheet per source under `data/<source>/`. |
| 4. **Extensibility** — versioned; new sources via PR. |
|
|
| ## Sources |
| | source | description | license | documents | tokens | |
| |---|---|---|---:|---:| |
| | [eurlex](data/eurlex/eurlex.md) | EUR-Lex (EU legal acts, Polish) | `CC-BY-4.0` | 243,060 | 2,378.1M | |
| | [parliamentary](data/parliamentary/parliamentary.md) | Polish Parliamentary Corpus (Sejm/Senat) | `public-domain (official documents)` | 324,622 | 1,646.8M | |
| | [wikisource](data/wikisource/wikisource.md) | Polish Wikisource | `CC-BY-SA-3.0` | 632,005 | 801.9M | |
| | [wikipedia](data/wikipedia/wikipedia.md) | Polish Wikipedia | `CC-BY-SA-3.0` | 1,171,897 | 707.2M | |
| | [dziennik_ustaw](data/dziennik_ustaw/dziennik_ustaw.md) | Dziennik Ustaw + Monitor Polski (Polish primary legislation) | `public-domain (official documents)` | 35,442 | 486.1M | |
| | [wolne_lektury](data/wolne_lektury/wolne_lektury.md) | Wolne Lektury (school readings) | `CC-BY-SA-4.0 / Wolna Sztuka 1.3` | 6,141 | 103.0M | |
| | [wikiquote](data/wikiquote/wikiquote.md) | Polish Wikiquote (quotations) | `CC-BY-SA-3.0` | 30,363 | 31.9M | |
| | [eltec_pol](data/eltec_pol/eltec_pol.md) | ELTeC-pol (European Literary Text Collection, Polish) | `CC-BY-4.0` | 100 | 21.5M | |
| | [wikivoyage](data/wikivoyage/wikivoyage.md) | Polish Wikivoyage (travel guides) | `CC-BY-SA-3.0` | 13,645 | 17.1M | |
| | [wikibooks](data/wikibooks/wikibooks.md) | Polish Wikibooks (open textbooks) | `CC-BY-SA-3.0` | 9,112 | 15.6M | |
| | [wikinews](data/wikinews/wikinews.md) | Polish Wikinews | `CC-BY-2.5` | 24,386 | 12.1M | |
| | **total** | | | **2,490,773** | **6,221.4M** | |
|
|
| ## Method |
| Only **human-authored** text — no synthetic, machine-translated, or auto-transcribed |
| data. Gates are intentionally minimal (drop short docs, non-Polish, exact duplicates, |
| OCR garble); heavy quality filtering and mix-weighting are left to downstream training. |
| Evaluation-set decontamination is applied/marked separately. Schema: |
| `id, text, source, added, created, token_count`. |
|
|
| ## v0.3 quality roadmap and current status |
|
|
| The v0.2 raw corpus is intentionally provenance-first, but its token mix is too |
| heavy in legal/parliamentary language for natural general pretraining. The v0.3 |
| workflow therefore separates **source inclusion** from **training mix**: |
|
|
| - cap `eurlex + parliamentary + dziennik_ustaw` to roughly **10-20%** of training |
| tokens combined; |
| - use source-level temperature sampling (`sqrt`, alpha `0.5`) instead of raw |
| token-proportional sampling; |
| - add traceably licensed contemporary/natural Polish: open web, guides, |
| technical documentation/blogs, Q&A, and dialogue/instruction data; |
| - run aggressive exact, normalized, and near-duplicate removal; |
| - reserve the final **5-15%** of training for higher-quality sources rather than |
| the largest sources; |
| - evaluate per-source perplexity and style contamination, not only global loss; |
| - treat GPT-2 124M as a cheap dataset probe, not proof of final model quality. |
|
|
| Primary v0.3 web candidate: `ashtok897/european-hplt-v1`. Its card reports |
| Polish `pl` coverage of **1,891,358 documents** and **~1.98B estimated tokens** |
| with HPLT WDS quality scores, language confidence, URL provenance, MIME type, |
| and web-register metadata. The helper `src/filter_european_hplt.py` streams this |
| dataset and filters for Polish, non-machine-translated, non-boilerplate, |
| domain-filtered natural web text. The dataset card marks it `CC0-1.0`, inherited |
| from HPLT v3, but because it is web-crawl derived it remains subject to |
| source/provenance review before a final release. |
|
|
| Current review artifacts: |
|
|
| - `configs/source_candidates_v0_3.json` — candidate decisions and license policy. |
| - `artifacts/source_license_review_v0_3.md` — source-by-source license review. |
| - `artifacts/source_candidate_audit_v0_3.md` — generated Hugging Face metadata audit. |
| - `artifacts/training_mix_v0_3.md` — example 1B-token training mix with legal sources capped at 15%. |
|
|
| Current HPLT filtering status (2026-06-16): |
|
|
| - input: `ashtok897/european-hplt-v1`, actual HF train parquet files split |
| across workers; |
| - filter output generated locally under `data/european_hplt_pl_parallel_500m_v2/`; |
| - kept **565,827** documents and **496,457,232** estimated tokens; |
| - compressed parquet output size: about **1.0 GB**; |
| - this is a candidate source snapshot, not yet a stable release artifact. |
|
|
| Reproduce the chunked/parallel candidate run: |
|
|
| ```bash |
| python3 src/launch_hplt_parallel.py \ |
| --workers 4 \ |
| --out-dir data/european_hplt_pl_parallel_500m_v2 \ |
| --screen-prefix hplt2 \ |
| --target-total-tokens 500000000 |
| ``` |
|
|
| Monitor progress: |
|
|
| ```bash |
| screen -ls |
| tail -f logs/filter_european_hplt_hplt2_w0.log |
| find data/european_hplt_pl_parallel_500m_v2 -maxdepth 2 -name '*.parquet' -ls |
| ``` |
|
|
| TVP Info-derived news data is currently **blocked**: the HF upload |
| `WiktorS/polish-news` has an `apache-2.0` tag, but its README says the articles |
| were obtained from `tvp.info.pl`, and no upstream TVP Info open license has been |
| verified. It should only be included with explicit permission or authoritative |
| upstream open-license evidence. |
|
|
| ## Excluded sources (transparency) |
| Sources we reviewed and **deliberately left out** — part of the curation: |
|
|
| | source | reason | |
| |---|---| |
| | `open_subtitles_corpus` | Derivative of copyrighted film/TV dialogue; OpenSubtitles uploads largely unlicensed. Same copyright lesson as Danish Gigaword's OpenSubtitles (paper 2508.02271). Not openly licensed. | |
| | `europeana_eu_pl_corpus` | Aggregated items with mixed per-record rights (PD / CC-BY-NC / rights-reserved). Needs per-record edm:rights filter before any inclusion. | |
| | `1000_novels_corpus_CLARIN-PL` | CC-BY-4.0 label, but 'novels' likely include in-copyright contemporary works; verify titles/years on CLARIN handle 11321/312 before inclusion. | |
| | `project_gutenberg_pl_corpus` | Only 31 PL books (4.3MB) — PG is ~99% English; Polish PD literature already covered by wolne_lektury + wikisource (so near-redundant after dedup). Dropped to avoid the PD-in-EU per-work check (PG claims PD-in-US only) for negligible token gain. | |
| |
| ## Personal & sensitive data |
| This corpus contains **only** text that its upstream sources already published |
| under open licenses or as official public-domain record. It therefore includes |
| names and statements of **public figures acting in a public capacity** — e.g. |
| parliamentary speakers (PPC), authorities named in legal acts (EUR-Lex), and |
| people described in encyclopedic articles (Wikipedia/Wikisource). No private, |
| non-public personal data was collected or added. If you are a data subject and |
| want content concerning you removed, contact **k.wikiel@gmail.com** — it will be dropped |
| from the next version (see retroactive-removal policy below). |
| |
| ## Disclaimer & legal |
| - **Provenance in good faith.** Per-source licenses are reproduced *as documented |
| by the upstream sources and by SpeakLeash* (the intermediate aggregator), to the |
| best of our knowledge. We make no independent legal warranty about the copyright |
| status of any individual document. |
| - **No ownership claim.** This release is a *curated, license-reviewed, documented |
| aggregation*. We claim no ownership of the underlying texts; rights remain with |
| the original authors/rightsholders under their respective licenses. |
| - **Provided "as is"**, without warranty of any kind, express or implied. This is |
| not legal advice. |
| - **Your compliance is yours.** Downstream users must satisfy each upstream |
| license themselves — in particular **CC-BY-SA-4.0 attribution and share-alike** |
| for derivatives of this dataset, and attribution to the upstream sources and to |
| SpeakLeash. |
| - **Notice-and-takedown.** Any source or rightsholder raising a substantiated |
| objection can have material removed: contact **k.wikiel@gmail.com**; it is dropped from |
| the next version and recorded in the CHANGELOG. Removal is retroactive |
| going-forward (prior immutable snapshots/commits may persist). |
| |
| ## License & attribution |
| Released under **CC-BY-SA-4.0** (copyleft inherited from CC-BY-SA sources such as |
| Wikipedia/Wikisource/Wolne Lektury). Attribution due to each upstream (see datasheets) |
| and to **SpeakLeash** as the intermediate aggregator. Retroactive-removal policy: a |
| source that raises an objection is dropped from subsequent versions, recorded in the |
| CHANGELOG. |
| |
| ## Reproduce |
| ```bash |
| python3 src/build_dynaword.py --all --speakleash-dir <speakleash_zst_dir> --out . |
| python3 src/make_docs.py |
| ``` |
| |
| ## Corpus phrase frequency (normalized by tokens) |
| |
| To show how frequent legal and discourse markers are across the corpus, we can report counts normalized by token count per source and globally. Raw counts + percentages are generated from the current parquet data and source token counts: |
| |
| ```bash |
| python3 src/pattern_frequency_report.py --data-root . \ |
| --out-md pattern_frequency_report.md \ |
| --out-hf artifacts/pattern_frequency_hf_snippet.md \ |
| --out-png artifacts/pattern_frequency.png |
| ``` |
| |
| `pattern_frequency_report.md` contains full source-by-source breakdown. |
| `artifacts/pattern_frequency_hf_snippet.md` is the exact block for Hugging Face model card. |
|
|
| | pattern | count | share of all corpus tokens | |
| |---|---:|---:| |
| | `w roku` | 434,882 | 0.0070% | |
| | `klasyfikacji` | 129,963 | 0.0021% | |
| | `ustawa` | 586,803 | 0.0094% | |
| | `artykuł` | 2,035,630 | 0.0327% | |
| | `parlament` | 1,201,401 | 0.0193% | |
| | `rozporządzenie` | 1,490,399 | 0.0240% | |
| | `w pobliżu` | 77,561 | 0.0012% | |
| | `mieszkańców` | 240,332 | 0.0039% | |
| | `Dz.U.` | 939,966 | 0.0151% | |
|
|
|  |
|
|
| Per-source normalized shares: |
| - [w roku](artifacts/pattern_frequency_w_roku.png) |
| - [klasyfikacji](artifacts/pattern_frequency_klasyfikacji.png) |
| - [ustawa](artifacts/pattern_frequency_ustawa.png) |
| - [artykuł](artifacts/pattern_frequency_artykul.png) |
| - [parlament](artifacts/pattern_frequency_parlament.png) |
| - [rozporządzenie](artifacts/pattern_frequency_rozporządzenie.png) |
| - [w pobliżu](artifacts/pattern_frequency_w_pobliżu.png) |
| - [mieszkańców](artifacts/pattern_frequency_mieszkańców.png) |
| - [Dz.U.](artifacts/pattern_frequency_dzu.png) |
|
|
| ### Hugging Face Model Card block |
|
|
| Wklej dokładnie `artifacts/pattern_frequency_hf_snippet.md` do sekcji **Results** w model card (`README.md` repozytorium na HF). |
|
|