File size: 11,562 Bytes
cfe406c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c0bb29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2fb895
 
 
 
 
 
 
 
 
3c0bb29
 
 
 
 
 
 
 
 
 
 
 
 
cfe406c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0ea96e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
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
---

# 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** · 2,490,773 documents · **6.22B tokens** (tiktoken proxy;
> canonical Llama-3 count at release) · 11 sources

## 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

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%.

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% |

![Overall pattern counts](artifacts/pattern_frequency_overall.png)

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).