polish-dynaword / PAPER.md
kacperwikiel's picture
Squash: collapse LFS history to reclaim private storage
cfe406c
|
Raw
History Blame Contribute Delete
13.6 kB
# Polish DynaWord: An Openly-Licensed, Traceable, Continuously-Developed Pretraining Corpus for Polish
**Kacper Wikieł**
SlayerLab · `k.wikiel@gmail.com`
---
## Abstract
We present **Polish DynaWord**, an openly-licensed, human-authored text corpus for
Polish, built as a Polish edition of the *Dynaword* family (Enevoldsen et al.,
2025, arXiv:2508.02271). The corpus follows four principles inherited from
Dynaword — **open and traceable licensing, reproducibility, per-source
documentation, and versioned extensibility** — and explicitly treats *curation*,
not raw text collection, as its contribution. Version 0.2.0 comprises **2,490,773
documents and ≈6.22 billion tokens** (tiktoken `cl100k` proxy) drawn from eleven
openly-licensed Polish sources, each vetted for a *documented* legal basis rather
than a vague "public domain" claim. Five sources are openly-licensed corpora
redistributed via SpeakLeash; the remaining six are fetched *directly* from
upstream — Polish primary legislation (Dziennik Ustaw / Monitor Polski) via the
Sejm ELI API, four Wikimedia sibling projects (Wikinews, Wikivoyage, Wikibooks,
Wikiquote) via the official dumps, and the ELTeC-pol literary collection via
GitHub — each with full per-document provenance. Beyond scale, this broadens the
*register* coverage from encyclopedic/legal/literary-classic text toward
news, travel, instructional and quotation prose. We report the construction
pipeline, the per-source legal review (including the sources we deliberately
*exclude* and why), and the dataset statistics. The corpus exceeds the 4.8B-token
Danish Dynaword in scale while maintaining a comparably conservative licensing
posture.
---
## 1. Introduction
Large-language-model pretraining for languages other than English is constrained
less by modeling technique than by the availability of **legally clean** text.
Many widely-used corpora are assembled from web crawls of uncertain provenance,
mixing public-domain works, openly-licensed material, and in-copyright content
without per-document accounting. The *Dynaword* project (Enevoldsen et al., 2025)
proposed an alternative: a continuously-developed corpus where every source is
*openly licensed* and that license is *traceable* to a documented legal basis,
with the whole pipeline reproducible and each source individually documented as a
datasheet (Gebru et al., 2021).
Polish is comparatively well-served for raw text — the SpeakLeash project has
aggregated 800+ Polish datasets — but most of that material carries "conditional"
licensing (web-crawl or non-commercial terms) that is unsuitable for an
openly-licensed release. **Polish DynaWord** addresses this gap. Its contribution
is not the collection of new text but the *curation*: a per-source license
review, a uniform minimal-filtering pipeline, transparent documentation of both
included and excluded sources, and a reproducible build.
## 2. Related work
**Dynaword and the Danish lineage.** Polish DynaWord directly adapts the Danish
Dynaword (Enevoldsen et al., 2025), itself a successor to the Danish Gigaword
project. A key lesson carried over is the treatment of *derivative* content: the
Danish effort excluded OpenSubtitles because subtitle text is a derivative work of
copyrighted film/TV dialogue. We apply the same reasoning (§6).
**SpeakLeash / Bielik.** SpeakLeash is the principal open aggregator of Polish
text and the redistribution channel for most of our included sources. We use
SpeakLeash as an *intermediate aggregator* and preserve upstream
license/attribution; SpeakLeash is credited accordingly. Crucially, SpeakLeash's
redistribution does not itself confer a license — the right to redistribute flows
from each source's upstream license, which we document per source.
**Datasheets for Datasets.** Following Gebru et al. (2021), each source ships a
datasheet recording provenance, licensing basis, domain, time range, and the
filters applied.
## 3. Design principles
1. **Open & traceable licensing.** Every source must be openly licensed *and*
carry a documented legal basis (statutory exemption or explicit upstream
license), not an unexplained "public domain" assertion.
2. **Reproducibility.** A single command rebuilds the corpus from source archives
(`src/build_dynaword.py`).
3. **Documented.** One datasheet per source; aggregate statistics in the dataset
card.
4. **Extensibility.** Versioned; new sources and removals are tracked in a
changelog, and sources can be added via native fetchers (§8).
## 4. Sources and licensing
Version 0.2.0 includes eleven sources. For each we record the upstream origin and
the *traceable basis* for its license.
| Source | Domain | License | Traceable basis |
|---|---|---|---|
| Polish Wikipedia | encyclopedic | CC-BY-SA-3.0 | Wikimedia dumps released under CC-BY-SA 3.0; attribution + share-alike preserved |
| Polish Wikisource | source texts | CC-BY-SA-3.0 | Wikimedia dumps; underlying works public-domain, community-transcribed |
| EUR-Lex (PL) | EU legislation | CC-BY-4.0 | Commission Decision 2011/833/EU; normative acts outside copyright (PL art. 4 *pr. aut.*) |
| Polish Parliamentary Corpus (Sejm/Senat) | political/spoken | public-domain / CC-BY-4.0 | Official documents outside copyright (PL art. 4 *pr. aut.*); redistributed by IPI PAN |
| Wolne Lektury | literature | CC-BY-SA-4.0 / Wolna Sztuka 1.3 | Published under CC-BY-SA 4.0 or Free Art License; PD classics + cleared works |
| Polish Wikinews | news | CC-BY-2.5 | Wikinews released under CC-BY 2.5; attribution preserved |
| Polish Wikivoyage | travel | CC-BY-SA-3.0 | Wikivoyage released under CC-BY-SA 3.0 |
| Polish Wikibooks | instructional | CC-BY-SA-3.0 | Wikibooks released under CC-BY-SA 3.0 |
| Polish Wikiquote | quotations | CC-BY-SA-3.0 | Wikiquote released under CC-BY-SA 3.0 |
| ELTeC-pol | literature (1840–1920) | CC-BY-4.0 | COST Action CA16204 release under CC-BY 4.0 |
| Dziennik Ustaw + Monitor Polski | national legislation | public-domain (CC0) | Normative acts not subject to copyright (PL art. 4 *pr. aut.*); fetched directly from the Sejm ELI API |
Because two included sources (Wikipedia/Wikisource, Wolne Lektury) are
share-alike, the **aggregate corpus is released under CC-BY-SA-4.0**, with
attribution due to each upstream source and to SpeakLeash as the aggregator.
## 5. Construction methodology
**Provenance.** Source archives are obtained from SpeakLeash's public
redistribution bucket (`speakleash-ds-pub`) in `jsonl.zst` form. The build streams
each archive, applies gates, and writes one Parquet file per source.
**Filters (intentionally minimal).** Consistent with Dynaword guidelines, heavy
quality filtering and mixture-weighting are deferred to downstream training; the
build applies only:
- drop documents shorter than 200 characters;
- drop non-Polish text (diacritic-to-letter ratio threshold);
- exact cross-source deduplication (SHA-1 over normalized text), with earlier
sources winning duplicates;
- for OCR-bearing sources, an alpha-character-ratio gate against OCR garble.
**Schema.** Every document is stored as
`(id, text, source, added, created, token_count)`. Token counts are a fast
tiktoken `cl100k` proxy (within ≈1% of a Llama-3 tokenizer); a canonical Llama-3
recount is planned for a tagged release.
## 6. Statistics
| Source | Documents | Characters | Tokens (proxy) |
|---|---:|---:|---:|
| Polish Wikipedia | 1,171,897 | 1.85 B | 707.2 M |
| Polish Wikisource | 632,005 | 1.97 B | 801.9 M |
| EUR-Lex (PL) | 243,060 | 5.98 B | 2,378.1 M |
| Polish Parliamentary Corpus | 324,622 | 4.49 B | 1,646.8 M |
| Wolne Lektury | 6,141 | 0.26 B | 103.0 M |
| Polish Wikinews | 24,386 | 0.03 B | 12.1 M |
| Polish Wikivoyage | 13,645 | 0.05 B | 17.1 M |
| Polish Wikibooks | 9,112 | 0.04 B | 15.6 M |
| Polish Wikiquote | 30,363 | 0.08 B | 31.9 M |
| ELTeC-pol | 100 | 0.05 B | 21.5 M |
| Dziennik Ustaw + Monitor Polski | 35,442 | 1.23 B | 486.1 M |
| **Total (v0.2.0)** | **2,490,773** | **16.0 B** | **6.22 B** |
For comparison, the Danish Dynaword reports ≈4.8 B tokens; Polish DynaWord v0.2.0
is larger while remaining within a strictly openly-licensed source set. The full
build completes in ≈4 minutes on 14 CPU cores. The five sources added in v0.2.0
contribute modest volume (≈98 M tokens) but broaden register coverage — news,
travel, instructional, quotation and modern literary prose — addressing the
encyclopedic/legal skew of the earlier versions.
## 7. Excluded sources (curation as contribution)
Transparency about what is *left out* is part of the editorial contribution. Each
exclusion records a stated legal reason:
- **OpenSubtitles (PL)** — subtitle text is a derivative work of copyrighted
film/TV dialogue and largely unlicensed; excluded on the Danish Gigaword
precedent.
- **Europeana (PL)** — an aggregation of items with *mixed per-record rights*
(PD / CC-BY-NC / rights-reserved). The SpeakLeash redistribution does not carry
the `edm:rights` field, so per-record filtering is impossible without external
enrichment; excluded pending that work (≈203k docs / ≈5.2B tokens forgone).
- **1000 Novels (CLARIN-PL)** — labelled CC-BY-4.0, but the collection likely
includes in-copyright contemporary works; excluded pending per-title verification.
- **Project Gutenberg (PL)** — only 31 Polish books (4.3 MB), near-redundant with
Wikisource/Wolne Lektury, and claiming public domain *in the US only*; dropped
to avoid a per-work PD-in-EU check for negligible token gain.
## 8. Native sources fetched directly from upstream
Beyond the SpeakLeash-redistributed corpora, six sources are fetched *directly*
from their publishers. Direct sourcing strengthens provenance (each document
records its upstream URL/identifier), keeps the data fresh, and distinguishes the
corpus from a mirror of any single aggregator. Each is implemented as a small,
reproducible fetcher under `src/`.
**Polish primary legislation** (`src/fetch_eli.py`). We fetch **Dziennik Ustaw**
and **Monitor Polski** from the Sejm ELI API (`api.sejm.gov.pl/eli/acts`),
retrieving each act's HTML and converting it to plain text. For v0.2.0 we include
acts marked in force over 1990–2025: **35,442 documents (≈486 M tokens)**.
Normative acts and their official drafts are **not subject to copyright** under
Polish law (art. 4 of the Act on Copyright and Related Rights). This adds Polish
*national* law, complementing the EU law present via EUR-Lex.
**Wikimedia sibling projects** (`src/fetch_wikimedia.py`). We fetch the Polish
**Wikinews**, **Wikivoyage**, **Wikibooks** and **Wikiquote** from the official
Wikimedia dumps, keeping mainspace pages and stripping wikitext to plain text with
`mwparserfromhell`. These contribute the **news, travel, instructional and
quotation** registers (≈77 k documents, ≈77 M tokens combined) under CC-BY /
CC-BY-SA, compatible with the aggregate license.
**ELTeC-pol** (`src/fetch_eltec.py`). We fetch the Polish part of the European
Literary Text Collection (COST Action CA16204) from GitHub — **100 novels**
(1840–1920, ≈21.5 M tokens) released CC-BY-4.0 — adding modern narrative literary
prose distinct from the older texts in Wikisource and Wolne Lektury.
## 9. Ethics, licensing and limitations
**Personal data.** The corpus contains only text its sources already published
openly or as official record; it therefore includes names and statements of
public figures acting in a public capacity (parliamentary speakers, authorities
named in legislation, people described in encyclopedic articles). No private,
non-public personal data is collected. A notice-and-takedown procedure allows
data subjects and rightsholders to request removal from subsequent versions.
**License compliance.** The release is CC-BY-SA-4.0; downstream users must satisfy
attribution and share-alike obligations for derivatives, and attribute the
upstream sources and SpeakLeash. Per-source licenses are reproduced in good faith
as documented by upstream and by SpeakLeash; we make no independent legal warranty
about any individual document's copyright status.
**Limitations.** (i) Token counts are a tiktoken proxy pending a canonical Llama-3
recount. (ii) Evaluation-set decontamination (n-gram overlap against Polish
benchmarks) is *not yet applied* and is required before the corpus is used to
train models reported on those benchmarks. (iii) Deduplication is exact-match
only; near-duplicate removal is left to downstream use. (iv) Gutenberg-style
PD-in-EU edge cases are handled by exclusion rather than per-work adjudication.
## 10. Availability
The dataset, per-source datasheets, build/fetch code, and documentation are
released at `huggingface.co/datasets/SlayerLab/polish-dynaword` (CC-BY-SA-4.0).
The corpus is versioned; this paper describes v0.2.0.
## References
- Enevoldsen, K. et al. (2025). *Dynaword: A Continuously Developed, Openly
Licensed Corpus.* arXiv:2508.02271.
- Gebru, T. et al. (2021). *Datasheets for Datasets.* Communications of the ACM.
- SpeakLeash / Bielik project. *Open Polish text datasets.* speakleash.org.
- Strømberg-Derczynski, L. et al. (2021). *The Danish Gigaword Corpus.* NoDaLiDa.
- Sejm RP. *ELI API — Internetowy System Aktów Prawnych.* api.sejm.gov.pl/eli.
- Ustawa z dnia 4 lutego 1994 r. o prawie autorskim i prawach pokrewnych, art. 4.
---
*Draft — generated alongside the v0.2.0 corpus release. Numbers reflect the
eleven-source build (five SpeakLeash-redistributed + six fetched directly from
upstream). Evaluation-set decontamination (§9) is still pending.*