Add source: nkjp1m

#8
by 1am - opened
AGENTS.md DELETED
@@ -1,74 +0,0 @@
1
- # AGENTS.md
2
-
3
- Guidance for agents and contributors adding a source and cutting a release.
4
- Read this before opening a PR — several recent contributions added data but
5
- skipped the doc/version bump, forcing a maintainer cleanup release.
6
-
7
- ## How the docs are actually maintained
8
-
9
- `src/make_docs.py` is a **scaffolding/assembly helper, not a round-trip source
10
- of truth.** It regenerates the README source table + release totals, `LICENSE`,
11
- a `CHANGELOG` stub, and *template* datasheets — but it does **not** reproduce the
12
- committed docs on its own:
13
-
14
- - It iterates `SOURCES` in `src/sources.py`; any source in `data/` but missing
15
- from `SOURCES` is silently dropped from the table and totals.
16
- - It stamps every regenerated datasheet's "Added" with the single global `ADDED`
17
- constant, overwriting real per-source add dates.
18
- - It cannot reproduce hand-written README narrative (audit notes, policy notes,
19
- the phrase-frequency section).
20
-
21
- So datasheets and the README narrative are **hand/contributor-maintained**.
22
- Never run `make_docs.py` and commit the result blind — `git diff` first and
23
- restore anything it dropped or restamped.
24
-
25
- ## Add a source
26
-
27
- 1. Produce the artifact under `data/<key>/`:
28
- - `<key>.parquet` — built by `src/build_dynaword.py` (LFS-tracked automatically).
29
- - `<key>.stats.json` — doc/token/char counts (drives all totals).
30
- - `<key>.md` — datasheet (see below).
31
- 2. Add the ingestion script: `src/fetch_<key>.py` or `src/clean_<key>.py`, so the
32
- source is reproducible. `build_source` (build_dynaword.py) expects a
33
- `<file_key|speakleash_key>.jsonl.zst` intermediate.
34
- 3. Register the source in `src/sources.py` (`SOURCES`) — required, or make_docs
35
- never sees it. Copy an existing entry's shape: `pretty`, `license`,
36
- `license_spdx`, `traceable`, `upstream`, `domain`, `created`, `is_ocr`, and the
37
- `speakleash_key`/`file_key`. If the datasheet is hand-authored (rich provenance
38
- or a fixed add date), add `"custom_datasheet": True` so make_docs leaves it
39
- alone.
40
- 4. Add a contract test: `src/test_<key>_contract.py` (canonical schema, non-empty
41
- text, positive token counts, uniform source/license, stats-file consistency).
42
- Run `python3 -m pytest src/` before committing.
43
-
44
- ## Cut the release (the part that gets skipped)
45
-
46
- 1. In `src/make_docs.py`: bump `VERSION` and `RELEASE_DATE`. Add a row for the new
47
- version to the version table and a row for yourself to the Contributors table
48
- (both are literal rows in the template).
49
- 2. Regenerate the phrase-frequency report and charts (registry-independent — it
50
- globs `data/*/*.parquet`):
51
- ```bash
52
- python3 src/pattern_frequency_report.py
53
- ```
54
- Writes `artifacts/pattern_frequency_hf_snippet.md` + 10 PNGs. Splice the tables
55
- and chart embeds into the README "Results" section by hand.
56
- 3. Update `README.md` by hand: header totals, version table, source table row,
57
- Contributors row. The document/token totals must equal the sum of the
58
- per-source `stats.json` files.
59
- 4. Prepend the release notes to `CHANGELOG.md` under a new `## vX.Y.Z (date)`
60
- heading. History is append-only — never rewrite earlier releases.
61
-
62
- ## Do not commit
63
-
64
- `*.log` (fetch/build logs), `.DS_Store`, `src/__pycache__/`. Only `logs/` is in
65
- `.gitignore` — root-level logs and OS cruft are not, so check `git status`
66
- before staging. `*.parquet` is LFS-tracked; commit the pointer, not the blob.
67
-
68
- ## Known drift / cleanup opportunities
69
-
70
- - `biblioteka_nauki`, `europeana`, `parlamint_pl` are in `SOURCES` but have no
71
- `data/` shard (make_docs skips them with `! no stats`). Intentional placeholders
72
- or stale — confirm before relying on `build_dynaword.py --all`.
73
- - The global `ADDED` datasheet stamp is a footgun: give datasheets a per-source
74
- add date (or `custom_datasheet`) before making make_docs regenerate them.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
CHANGELOG.md CHANGED
@@ -1,32 +1,5 @@
1
  # Changelog
2
 
3
- ## v0.2.3 (2026-07-26)
4
-
5
- - Added the community contribution `european_hplt_v3_pl` by Arkadiusz Słota
6
- (`Maggio33`): HPLT v3.0 Polish WDS quality bins 10+9, 110,590 documents and
7
- 512,383,778 cl100k-proxy tokens under CC0-1.0 packaging.
8
- - Added the reviewed `global_voices` contribution by Dawid Majewski
9
- (`dawidmajewski`): 2,040 documents / 3,715,020 tokens with CC-BY-3.0 and
10
- per-document author attribution metadata.
11
- - Added `nkjp1m` from contributor `1am`: 18,381 documents / 2,601,201 tokens
12
- from the manually annotated 1-million-word NKJP subcorpus under the upstream
13
- version-unspecified CC-BY statement.
14
- - Revalidated the contributed parquet against the canonical schema, non-empty
15
- text, positive token counts, uniform source/license metadata, and stats-file
16
- consistency.
17
- - Updated the complete 16-source release totals from per-source parquet stats:
18
- 2,710,974 documents and 6,881,277,362 cl100k-proxy tokens.
19
- - Recomputed the full-corpus phrase-frequency report and charts. Updated the
20
- Arrow reporting path to use 64-bit string offsets for large row groups.
21
- - Fixed `src/test_hplt_v3_contract.py` to resolve its fixture relative to the
22
- repository instead of a contributor-local Windows path.
23
- - Added public contributor credit for Arkadiusz Słota (`Maggio33`) and Paweł
24
- Puzio (`ppuzio`, author of the `govpl` contribution released in v0.2.2), plus
25
- Dawid Majewski (`dawidmajewski`) for Global Voices Polish.
26
- - HPLT caveat: CC0 applies to the HPLT packaging; underlying web documents can
27
- carry independent rights. Downstream near-dedup and web-content review remain
28
- recommended before training.
29
-
30
  ## v0.2.2 (2026-07-19)
31
 
32
  - Added `govpl` — gov.pl Polish government press releases (CC-BY-SA-4.0),
 
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## v0.2.2 (2026-07-19)
4
 
5
  - Added `govpl` — gov.pl Polish government press releases (CC-BY-SA-4.0),
README.md CHANGED
@@ -19,89 +19,30 @@ A continuously developed, **openly-licensed**, human-text Polish corpus — a Po
19
  edition in the [Dynaword](https://huggingface.co/datasets/danish-foundation-models/danish-dynaword)
20
  family (Enevoldsen et al., [arXiv:2508.02271](https://arxiv.org/abs/2508.02271)).
21
 
22
- > **v0.2.3 stable** · 2,710,974 documents · **6.88B tokens**
23
- > (6,881,277,362 tiktoken cl100k-proxy tokens) · 16 sources
24
- > Updated: **2026-07-26**
25
 
26
- > **v0.3-dev experimental track** · quality/diversity workflow, source-gate
27
- > validation and candidate-data audits. This is development work, not a released
28
- > corpus version, and it does not replace the v0.2.3 stable parquets.
 
29
 
30
- > **Europeana validation artifact (2026-07-10)** · first reproducible
31
- > direct-ingestion shard:
32
  > 1,000 API records → 810 quality-gated parquet documents, each preserving
33
  > per-record rights and creator metadata. Stored separately under
34
- > the legacy path `previews/v0.3.1/europeana.parquet`; it is not a release of the
35
- > full dataset and does not alter stable totals.
36
 
37
- ## Releases
38
-
39
- ### Stable releases
40
 
41
  | version | status | documents | tokens | notes |
42
  |---|---|---:|---:|---|
43
- | `v0.2.3` | stable release | 2,710,974 | 6.88B | Adds community-contributed HPLT v3 Polish WDS 10+9, Global Voices Polish and the NKJP manually annotated 1M-word subcorpus. |
44
- | `v0.2.2` | previous stable | 2,579,963 | 6.36B | Added community-contributed `govpl`: 88,190 docs / 80.7M tokens fetched directly across 133 ministry/agency subsites. |
45
  | `v0.2.1` | previous stable | 2,491,773 | 6.28B | 12-source stable corpus with `license` and `author` metadata columns; adds `1000_novels`. |
46
  | `v0.2.0` | previous stable | 2,490,773 | 6.22B | Provenance-first corpus from 11 open/official sources. |
47
-
48
- ![Stable dataset size by version](artifacts/dataset_size_by_version.png)
49
-
50
- ### Development and validation artifacts
51
-
52
- | name | type | scope | notes |
53
- |---|---|---|---|
54
- | `v0.3-dev` | experimental development track | workflow and candidate audits | Quality remix, legal-source caps, source QA, deduplication and direct-upstream ingestion. Not a corpus release. |
55
- | `Europeana validation artifact 2026-07-10` | reproducible sample | 810 documents / 140,042 tokens | Stored at the legacy path `previews/v0.3.1/europeana.parquet`; preserves per-record rights and creator metadata. Not a corpus release. |
56
-
57
- ### Version details
58
-
59
- #### v0.2.3 — current stable
60
-
61
- Community expansion release. Adds `european_hplt_v3_pl` from
62
- [PR #5](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/5)
63
- and `global_voices` from
64
- [PR #7](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/7),
65
- plus `nkjp1m` from
66
- [PR #8](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/8).
67
- The complete 16-source release contains **2,710,974 documents /
68
- 6,881,277,362 cl100k-proxy tokens**, summed from the released per-source parquet
69
- statistics.
70
-
71
- #### v0.2.2 — previous stable
72
-
73
- Added `govpl` from
74
- [PR #9](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/9):
75
- 88,190 Polish government press releases collected directly from 133 gov.pl
76
- ministry and agency subsites. Result: 13 sources, 2,579,963 documents and
77
- 6.36B proxy tokens.
78
-
79
- #### v0.2.1 — previous stable
80
-
81
- Introduced the canonical eight-column release schema:
82
- `id, text, source, added, created, token_count, license, author`. Added the
83
- CC-BY-4.0 `1000_novels` source from
84
- [PR #1](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/1)
85
- and recomputed all release statistics from parquet files.
86
-
87
- #### v0.2.0 — initial stable corpus
88
-
89
- The provenance-first baseline: 11 reviewed open or official sources,
90
- 2,490,773 documents and 6.22B proxy tokens. This version established the
91
- per-source datasheet, traceable-license and exclusion-policy workflow.
92
-
93
- #### v0.3-dev — experimental quality workflow
94
-
95
- Candidate-only work on a better-balanced training mixture: legal-source caps,
96
- temperature sampling, source QA, deduplication and direct-upstream ingestion.
97
- It is a workflow and validation track, not a replacement for the stable corpus.
98
-
99
- #### Europeana validation artifact — 2026-07-10
100
-
101
- A separate reproducible 810-document Europeana sample preserving per-record
102
- rights and creator metadata. It validates the direct-ingestion contract without
103
- changing stable-release totals. `v0.3.1-preview` remains only as the legacy
104
- storage-path label.
105
 
106
  ## What this dataset contributes
107
  The raw texts come from existing open corpora (redistributed via SpeakLeash and,
@@ -126,18 +67,10 @@ as the redistributing aggregator; this release does not claim ownership of them
126
 
127
  ## Contributors
128
 
129
- | contributor | contribution | release / PR |
130
- |---|---|---|
131
- | [Kacper Wikieł](https://huggingface.co/kacperwikiel) | Project maintainer; corpus curation, source and license review, release engineering, documentation, validation and reproducible build workflow. | all releases |
132
- | [Bart Kobyliński](https://huggingface.co/bartoszkobylinski1) | Added `1000_novels`; expanded Biblioteka Nauki and Europeana ingestion with per-document license and author metadata. | `v0.2.1`, [PR #1](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/1) |
133
- | [Paweł Puzio](https://huggingface.co/ppuzio) | Built `govpl`: subsite discovery, direct ingestion pipeline, dataset artifact, contract tests and documentation. | `v0.2.2`, [PR #9](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/9) |
134
- | [Arkadiusz Słota](https://huggingface.co/Maggio33) | Built `european_hplt_v3_pl`: HPLT v3 WDS 10+9 cleaning pipeline, 110,590-document artifact, validation and documentation. | `v0.2.3`, [PR #5](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/5) |
135
- | [Dawid Majewski](https://huggingface.co/dawidmajewski) | Added the reviewed Global Voices Polish corpus with per-document author attribution and documentation. | `v0.2.3`, [PR #7](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/7) |
136
- | [1am](https://huggingface.co/1am) | Added `nkjp1m`: the manually annotated 1-million-word NKJP subcorpus, direct fetch/build pipeline, source documentation and release artifact. | `v0.2.3`, [PR #8](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/8) |
137
-
138
- Contributions are credited when they add a verifiable dataset artifact, pipeline,
139
- validation, documentation or release work. A merged discussion with no resulting
140
- files is not listed as a data contribution.
141
 
142
  ## Guiding principles
143
  1. **Open & traceable licensing** — every source is *openly licensed* with a documented
@@ -153,7 +86,6 @@ files is not listed as a data contribution.
153
  | [parliamentary](data/parliamentary/parliamentary.md) | Polish Parliamentary Corpus (Sejm/Senat) | `public-domain (official documents)` | 324,622 | 1,646.8M |
154
  | [wikisource](data/wikisource/wikisource.md) | Polish Wikisource | `CC-BY-SA-3.0` | 632,005 | 801.9M |
155
  | [wikipedia](data/wikipedia/wikipedia.md) | Polish Wikipedia | `CC-BY-SA-3.0` | 1,171,897 | 707.2M |
156
- | [european_hplt_v3_pl](data/european_hplt_v3_pl/european_hplt_v3_pl.md) | HPLT v3.0 Polish — top WDS quality bins 10+9 | `CC0-1.0` | 110,590 | 512.4M |
157
  | [dziennik_ustaw](data/dziennik_ustaw/dziennik_ustaw.md) | Dziennik Ustaw + Monitor Polski (Polish primary legislation) | `public-domain (official documents)` | 35,442 | 486.1M |
158
  | [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 |
159
  | [govpl](data/govpl/govpl.md) | gov.pl — Polish government press releases | `CC-BY-SA-4.0` | 88,190 | 80.7M |
@@ -163,9 +95,7 @@ files is not listed as a data contribution.
163
  | [wikivoyage](data/wikivoyage/wikivoyage.md) | Polish Wikivoyage (travel guides) | `CC-BY-SA-3.0` | 13,645 | 17.1M |
164
  | [wikibooks](data/wikibooks/wikibooks.md) | Polish Wikibooks (open textbooks) | `CC-BY-SA-3.0` | 9,112 | 15.6M |
165
  | [wikinews](data/wikinews/wikinews.md) | Polish Wikinews | `CC-BY-2.5` | 24,386 | 12.1M |
166
- | [global_voices](data/global_voices/global_voices.md) | Global Voices Polish | `CC-BY-3.0` | 2,040 | 3.7M |
167
- | [nkjp1m](data/nkjp1m/nkjp1m.md) | NKJP manually annotated 1-million-word subcorpus | `CC-BY` | 18,381 | 2.6M |
168
- | **total** | | | **2,710,974** | **6,881.3M** |
169
 
170
  ## Method
171
  Only **human-authored** text — no synthetic, machine-translated, or auto-transcribed
@@ -216,10 +146,9 @@ Current v0.3 source-ingestion status:
216
  - Europeana release policy: split conservatively at pre-1929 records for
217
  US-sensitive downstream reuse, and keep later/unknown records separately
218
  labeled or held until legal review.
219
- - `european_hplt_v3_pl`: WDS bins 10+9 are included in v0.2.3 after contract
220
- validation. HPLT packaging is CC0, while underlying crawled web documents can
221
- carry independent rights; downstream near-dedup and web-content review remain
222
- recommended before training.
223
 
224
  Current review artifacts:
225
 
@@ -287,19 +216,19 @@ python3 src/make_docs.py
287
 
288
  Raw counts and token-normalized shares are regenerated from the current parquet files with `src/pattern_frequency_report.py`.
289
 
290
- - Total token count (tiktoken proxy): **6,881,277,362**
291
 
292
  | Pattern | Count | Share of all tokens |
293
  |---|---:|---:|
294
- | `w roku` | 460,249 | 0.0067% |
295
- | `klasyfikacji` | 134,093 | 0.0019% |
296
- | `ustawa` | 598,176 | 0.0087% |
297
- | `artykuł` | 2,096,271 | 0.0305% |
298
- | `parlament` | 1,216,808 | 0.0177% |
299
- | `rozporządzenie` | 1,497,273 | 0.0218% |
300
- | `w pobliżu` | 89,774 | 0.0013% |
301
- | `mieszkańców` | 288,911 | 0.0042% |
302
- | `Dz.U.` | 944,565 | 0.0137% |
303
 
304
  ### Per-source shares
305
 
@@ -341,24 +270,6 @@ Raw counts and token-normalized shares are regenerated from the current parquet
341
  | `eurlex` | `w pobliżu` | 6,088 | 0.00026% |
342
  | `eurlex` | `mieszkańców` | 9,441 | 0.00040% |
343
  | `eurlex` | `Dz.U.` | 915,707 | 0.03851% |
344
- | `european_hplt_v3_pl` | `w roku` | 21,067 | 0.00411% |
345
- | `european_hplt_v3_pl` | `klasyfikacji` | 3,576 | 0.00070% |
346
- | `european_hplt_v3_pl` | `ustawa` | 5,754 | 0.00112% |
347
- | `european_hplt_v3_pl` | `artykuł` | 56,295 | 0.01099% |
348
- | `european_hplt_v3_pl` | `parlament` | 10,618 | 0.00207% |
349
- | `european_hplt_v3_pl` | `rozporządzenie` | 2,661 | 0.00052% |
350
- | `european_hplt_v3_pl` | `w pobliżu` | 9,877 | 0.00193% |
351
- | `european_hplt_v3_pl` | `mieszkańców` | 33,939 | 0.00662% |
352
- | `european_hplt_v3_pl` | `Dz.U.` | 1,482 | 0.00029% |
353
- | `global_voices` | `w roku` | 160 | 0.00431% |
354
- | `global_voices` | `klasyfikacji` | 5 | 0.00013% |
355
- | `global_voices` | `ustawa` | 157 | 0.00423% |
356
- | `global_voices` | `artykuł` | 1,047 | 0.02818% |
357
- | `global_voices` | `parlament` | 366 | 0.00985% |
358
- | `global_voices` | `rozporządzenie` | 26 | 0.00070% |
359
- | `global_voices` | `w pobliżu` | 105 | 0.00283% |
360
- | `global_voices` | `mieszkańców` | 508 | 0.01367% |
361
- | `global_voices` | `Dz.U.` | 1 | 0.00003% |
362
  | `govpl` | `w roku` | 3,372 | 0.00418% |
363
  | `govpl` | `klasyfikacji` | 526 | 0.00065% |
364
  | `govpl` | `ustawa` | 4,727 | 0.00586% |
@@ -368,15 +279,6 @@ Raw counts and token-normalized shares are regenerated from the current parquet
368
  | `govpl` | `w pobliżu` | 892 | 0.00111% |
369
  | `govpl` | `mieszkańców` | 13,105 | 0.01625% |
370
  | `govpl` | `Dz.U.` | 3,114 | 0.00386% |
371
- | `nkjp1m` | `w roku` | 109 | 0.00419% |
372
- | `nkjp1m` | `klasyfikacji` | 9 | 0.00035% |
373
- | `nkjp1m` | `ustawa` | 79 | 0.00304% |
374
- | `nkjp1m` | `artykuł` | 153 | 0.00588% |
375
- | `nkjp1m` | `parlament` | 216 | 0.00830% |
376
- | `nkjp1m` | `rozporządzenie` | 20 | 0.00077% |
377
- | `nkjp1m` | `w pobliżu` | 77 | 0.00296% |
378
- | `nkjp1m` | `mieszkańców` | 159 | 0.00611% |
379
- | `nkjp1m` | `Dz.U.` | 2 | 0.00008% |
380
  | `parliamentary` | `w roku` | 198,192 | 0.01203% |
381
  | `parliamentary` | `klasyfikacji` | 12,637 | 0.00077% |
382
  | `parliamentary` | `ustawa` | 459,179 | 0.02788% |
@@ -460,4 +362,4 @@ Raw counts and token-normalized shares are regenerated from the current parquet
460
  ![rozporządzenie by source](artifacts/pattern_frequency_rozporządzenie.png)
461
  ![w pobliżu by source](artifacts/pattern_frequency_w_pobliżu.png)
462
  ![mieszkańców by source](artifacts/pattern_frequency_mieszkańców.png)
463
- ![Dz.U. by source](artifacts/pattern_frequency_dzu.png)
 
19
  edition in the [Dynaword](https://huggingface.co/datasets/danish-foundation-models/danish-dynaword)
20
  family (Enevoldsen et al., [arXiv:2508.02271](https://arxiv.org/abs/2508.02271)).
21
 
22
+ > **v0.2.2 stable** · 2,579,963 documents · **6.36B tokens**
23
+ > (tiktoken proxy; canonical Llama-3 count at release) · 13 sources
24
+ > Updated: **2026-07-19**
25
 
26
+ > **v0.3.0-preview validation release** · live source-gate validation for
27
+ > SpeakLeash shards and direct Europeana candidate data, plus the quality/diversity
28
+ > remix workflow. This is candidate-only metadata and audit work: it does not
29
+ > replace the v0.2.1 stable parquets.
30
 
31
+ > **v0.3.1-preview** · first reproducible Europeana direct-ingestion shard:
 
32
  > 1,000 API records → 810 quality-gated parquet documents, each preserving
33
  > per-record rights and creator metadata. Stored separately under
34
+ > `previews/v0.3.1/europeana.parquet`; the paged Search API run took 59.4 s and
35
+ > does not alter v0.2.1 stable totals.
36
 
37
+ ## Versions
 
 
38
 
39
  | version | status | documents | tokens | notes |
40
  |---|---|---:|---:|---|
41
+ | `v0.2.2` | stable release | 2,579,963 | 6.36B | Adds `govpl` (gov.pl government press releases, CC-BY-SA-4.0): 88,190 docs / 80.7M tokens fetched directly across 133 ministry/agency subsites. |
 
42
  | `v0.2.1` | previous stable | 2,491,773 | 6.28B | 12-source stable corpus with `license` and `author` metadata columns; adds `1000_novels`. |
43
  | `v0.2.0` | previous stable | 2,490,773 | 6.22B | Provenance-first corpus from 11 open/official sources. |
44
+ | `v0.3.0-preview` | validation release, candidate-only | candidate-only | TBD | Live source gates validated; Biblioteka Nauki, Europeana, and HPLT/Common Corpus expansion remain subject to per-source QA, dedup, and legal review. |
45
+ | `v0.3.1-preview` | reproducible Europeana shard | 810 | 140,042 | 1,000 direct API records sampled; 810 passed short/language/OCR gates, with per-record rights and author metadata. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ## What this dataset contributes
48
  The raw texts come from existing open corpora (redistributed via SpeakLeash and,
 
67
 
68
  ## Contributors
69
 
70
+ - **Kacper Wikieł** corpus curation, release engineering, documentation, and
71
+ reproducible build workflow.
72
+ - **Bart Kobyliński** source expansion work for Biblioteka Nauki and Europeana,
73
+ including per-document license/author metadata collection and rebuild planning.
 
 
 
 
 
 
 
 
74
 
75
  ## Guiding principles
76
  1. **Open & traceable licensing** — every source is *openly licensed* with a documented
 
86
  | [parliamentary](data/parliamentary/parliamentary.md) | Polish Parliamentary Corpus (Sejm/Senat) | `public-domain (official documents)` | 324,622 | 1,646.8M |
87
  | [wikisource](data/wikisource/wikisource.md) | Polish Wikisource | `CC-BY-SA-3.0` | 632,005 | 801.9M |
88
  | [wikipedia](data/wikipedia/wikipedia.md) | Polish Wikipedia | `CC-BY-SA-3.0` | 1,171,897 | 707.2M |
 
89
  | [dziennik_ustaw](data/dziennik_ustaw/dziennik_ustaw.md) | Dziennik Ustaw + Monitor Polski (Polish primary legislation) | `public-domain (official documents)` | 35,442 | 486.1M |
90
  | [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 |
91
  | [govpl](data/govpl/govpl.md) | gov.pl — Polish government press releases | `CC-BY-SA-4.0` | 88,190 | 80.7M |
 
95
  | [wikivoyage](data/wikivoyage/wikivoyage.md) | Polish Wikivoyage (travel guides) | `CC-BY-SA-3.0` | 13,645 | 17.1M |
96
  | [wikibooks](data/wikibooks/wikibooks.md) | Polish Wikibooks (open textbooks) | `CC-BY-SA-3.0` | 9,112 | 15.6M |
97
  | [wikinews](data/wikinews/wikinews.md) | Polish Wikinews | `CC-BY-2.5` | 24,386 | 12.1M |
98
+ | **total** | | | **2,579,963** | **6,362.6M** |
 
 
99
 
100
  ## Method
101
  Only **human-authored** text — no synthetic, machine-translated, or auto-transcribed
 
146
  - Europeana release policy: split conservatively at pre-1929 records for
147
  US-sensitive downstream reuse, and keep later/unknown records separately
148
  labeled or held until legal review.
149
+ - `ashtok897/european-hplt-v1`: candidate workflow exists, but web-crawl
150
+ provenance, dedup, QA, and final mix weighting are still pending before stable
151
+ inclusion.
 
152
 
153
  Current review artifacts:
154
 
 
216
 
217
  Raw counts and token-normalized shares are regenerated from the current parquet files with `src/pattern_frequency_report.py`.
218
 
219
+ - Total token count (tiktoken proxy): **6,362,577,363**
220
 
221
  | Pattern | Count | Share of all tokens |
222
  |---|---:|---:|
223
+ | `w roku` | 438,913 | 0.0069% |
224
+ | `klasyfikacji` | 130,503 | 0.0021% |
225
+ | `ustawa` | 592,186 | 0.0093% |
226
+ | `artykuł` | 2,038,776 | 0.0320% |
227
+ | `parlament` | 1,205,608 | 0.0189% |
228
+ | `rozporządzenie` | 1,494,566 | 0.0235% |
229
+ | `w pobliżu` | 79,715 | 0.0013% |
230
+ | `mieszkańców` | 254,305 | 0.0040% |
231
+ | `Dz.U.` | 943,080 | 0.0148% |
232
 
233
  ### Per-source shares
234
 
 
270
  | `eurlex` | `w pobliżu` | 6,088 | 0.00026% |
271
  | `eurlex` | `mieszkańców` | 9,441 | 0.00040% |
272
  | `eurlex` | `Dz.U.` | 915,707 | 0.03851% |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  | `govpl` | `w roku` | 3,372 | 0.00418% |
274
  | `govpl` | `klasyfikacji` | 526 | 0.00065% |
275
  | `govpl` | `ustawa` | 4,727 | 0.00586% |
 
279
  | `govpl` | `w pobliżu` | 892 | 0.00111% |
280
  | `govpl` | `mieszkańców` | 13,105 | 0.01625% |
281
  | `govpl` | `Dz.U.` | 3,114 | 0.00386% |
 
 
 
 
 
 
 
 
 
282
  | `parliamentary` | `w roku` | 198,192 | 0.01203% |
283
  | `parliamentary` | `klasyfikacji` | 12,637 | 0.00077% |
284
  | `parliamentary` | `ustawa` | 459,179 | 0.02788% |
 
362
  ![rozporządzenie by source](artifacts/pattern_frequency_rozporządzenie.png)
363
  ![w pobliżu by source](artifacts/pattern_frequency_w_pobliżu.png)
364
  ![mieszkańców by source](artifacts/pattern_frequency_mieszkańców.png)
365
+ ![Dz.U. by source](artifacts/pattern_frequency_dzu.png)
artifacts/dataset_size_by_version.png DELETED

Git LFS Details

  • SHA256: 0c4503a693cd7b7e64843ebd180ab113629c62129f52be4ec67444f79d75e705
  • Pointer size: 130 Bytes
  • Size of remote file: 98 kB
artifacts/pattern_frequency_artykul.png CHANGED

Git LFS Details

  • SHA256: d989fb8983f829e85d944c902e394d1acec4189270ea3578115b1e084bb44ce8
  • Pointer size: 130 Bytes
  • Size of remote file: 62.2 kB

Git LFS Details

  • SHA256: f980030ed6ceeebcd54a7a5054df5e72ed3221e6080ccf82dc268d6d4fee4149
  • Pointer size: 130 Bytes
  • Size of remote file: 53.5 kB
artifacts/pattern_frequency_dzu.png CHANGED

Git LFS Details

  • SHA256: a39f680a40193961fdb66f33d959e6ccf440ac65fe9cbd56517f232cea148ef3
  • Pointer size: 130 Bytes
  • Size of remote file: 64.6 kB

Git LFS Details

  • SHA256: fb55b01d95a4bff496bb8fa665f2a8866f59aa72584f10f840ad41ee84e25b0c
  • Pointer size: 130 Bytes
  • Size of remote file: 56 kB
artifacts/pattern_frequency_hf_snippet.md CHANGED
@@ -1,18 +1,18 @@
1
  ## Phrase frequency in corpus (token-normalized)
2
 
3
- - Total token count (tiktoken proxy): **6,881,277,362**
4
 
5
  | Pattern | Count | Share of all tokens |
6
  |---|---:|---:|
7
- | `w roku` | 460,249 | 0.0067% |
8
- | `klasyfikacji` | 134,093 | 0.0019% |
9
- | `ustawa` | 598,176 | 0.0087% |
10
- | `artykuł` | 2,096,271 | 0.0305% |
11
- | `parlament` | 1,216,808 | 0.0177% |
12
- | `rozporządzenie` | 1,497,273 | 0.0218% |
13
- | `w pobliżu` | 89,774 | 0.0013% |
14
- | `mieszkańców` | 288,911 | 0.0042% |
15
- | `Dz.U.` | 944,565 | 0.0137% |
16
 
17
  ### Per-source shares
18
 
@@ -54,24 +54,6 @@
54
  | `eurlex` | `w pobliżu` | 6,088 | 0.00026% |
55
  | `eurlex` | `mieszkańców` | 9,441 | 0.00040% |
56
  | `eurlex` | `Dz.U.` | 915,707 | 0.03851% |
57
- | `european_hplt_v3_pl` | `w roku` | 21,067 | 0.00411% |
58
- | `european_hplt_v3_pl` | `klasyfikacji` | 3,576 | 0.00070% |
59
- | `european_hplt_v3_pl` | `ustawa` | 5,754 | 0.00112% |
60
- | `european_hplt_v3_pl` | `artykuł` | 56,295 | 0.01099% |
61
- | `european_hplt_v3_pl` | `parlament` | 10,618 | 0.00207% |
62
- | `european_hplt_v3_pl` | `rozporządzenie` | 2,661 | 0.00052% |
63
- | `european_hplt_v3_pl` | `w pobliżu` | 9,877 | 0.00193% |
64
- | `european_hplt_v3_pl` | `mieszkańców` | 33,939 | 0.00662% |
65
- | `european_hplt_v3_pl` | `Dz.U.` | 1,482 | 0.00029% |
66
- | `global_voices` | `w roku` | 160 | 0.00431% |
67
- | `global_voices` | `klasyfikacji` | 5 | 0.00013% |
68
- | `global_voices` | `ustawa` | 157 | 0.00423% |
69
- | `global_voices` | `artykuł` | 1,047 | 0.02818% |
70
- | `global_voices` | `parlament` | 366 | 0.00985% |
71
- | `global_voices` | `rozporządzenie` | 26 | 0.00070% |
72
- | `global_voices` | `w pobliżu` | 105 | 0.00283% |
73
- | `global_voices` | `mieszkańców` | 508 | 0.01367% |
74
- | `global_voices` | `Dz.U.` | 1 | 0.00003% |
75
  | `govpl` | `w roku` | 3,372 | 0.00418% |
76
  | `govpl` | `klasyfikacji` | 526 | 0.00065% |
77
  | `govpl` | `ustawa` | 4,727 | 0.00586% |
@@ -81,15 +63,6 @@
81
  | `govpl` | `w pobliżu` | 892 | 0.00111% |
82
  | `govpl` | `mieszkańców` | 13,105 | 0.01625% |
83
  | `govpl` | `Dz.U.` | 3,114 | 0.00386% |
84
- | `nkjp1m` | `w roku` | 109 | 0.00419% |
85
- | `nkjp1m` | `klasyfikacji` | 9 | 0.00035% |
86
- | `nkjp1m` | `ustawa` | 79 | 0.00304% |
87
- | `nkjp1m` | `artykuł` | 153 | 0.00588% |
88
- | `nkjp1m` | `parlament` | 216 | 0.00830% |
89
- | `nkjp1m` | `rozporządzenie` | 20 | 0.00077% |
90
- | `nkjp1m` | `w pobliżu` | 77 | 0.00296% |
91
- | `nkjp1m` | `mieszkańców` | 159 | 0.00611% |
92
- | `nkjp1m` | `Dz.U.` | 2 | 0.00008% |
93
  | `parliamentary` | `w roku` | 198,192 | 0.01203% |
94
  | `parliamentary` | `klasyfikacji` | 12,637 | 0.00077% |
95
  | `parliamentary` | `ustawa` | 459,179 | 0.02788% |
 
1
  ## Phrase frequency in corpus (token-normalized)
2
 
3
+ - Total token count (tiktoken proxy): **6,362,577,363**
4
 
5
  | Pattern | Count | Share of all tokens |
6
  |---|---:|---:|
7
+ | `w roku` | 438,913 | 0.0069% |
8
+ | `klasyfikacji` | 130,503 | 0.0021% |
9
+ | `ustawa` | 592,186 | 0.0093% |
10
+ | `artykuł` | 2,038,776 | 0.0320% |
11
+ | `parlament` | 1,205,608 | 0.0189% |
12
+ | `rozporządzenie` | 1,494,566 | 0.0235% |
13
+ | `w pobliżu` | 79,715 | 0.0013% |
14
+ | `mieszkańców` | 254,305 | 0.0040% |
15
+ | `Dz.U.` | 943,080 | 0.0148% |
16
 
17
  ### Per-source shares
18
 
 
54
  | `eurlex` | `w pobliżu` | 6,088 | 0.00026% |
55
  | `eurlex` | `mieszkańców` | 9,441 | 0.00040% |
56
  | `eurlex` | `Dz.U.` | 915,707 | 0.03851% |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  | `govpl` | `w roku` | 3,372 | 0.00418% |
58
  | `govpl` | `klasyfikacji` | 526 | 0.00065% |
59
  | `govpl` | `ustawa` | 4,727 | 0.00586% |
 
63
  | `govpl` | `w pobliżu` | 892 | 0.00111% |
64
  | `govpl` | `mieszkańców` | 13,105 | 0.01625% |
65
  | `govpl` | `Dz.U.` | 3,114 | 0.00386% |
 
 
 
 
 
 
 
 
 
66
  | `parliamentary` | `w roku` | 198,192 | 0.01203% |
67
  | `parliamentary` | `klasyfikacji` | 12,637 | 0.00077% |
68
  | `parliamentary` | `ustawa` | 459,179 | 0.02788% |
artifacts/pattern_frequency_klasyfikacji.png CHANGED

Git LFS Details

  • SHA256: 1335b851098916c5dea5b50accc1ea3ed7cd65e75dc408d00e48c041d3e3a0e4
  • Pointer size: 130 Bytes
  • Size of remote file: 63.2 kB

Git LFS Details

  • SHA256: df83d98e08ef8b6e5a90e953bc6c0d3719925236a2120183b9ea9fa5f8f45261
  • Pointer size: 130 Bytes
  • Size of remote file: 54.7 kB
artifacts/pattern_frequency_mieszkańców.png CHANGED

Git LFS Details

  • SHA256: 862ca15a50925e0c9af34257a2e507b327008216004efa5f4fb8a1fe7d1acf73
  • Pointer size: 130 Bytes
  • Size of remote file: 61.9 kB

Git LFS Details

  • SHA256: 9719b64ff1588c0c7ea3abf74d636939fef2d97ce241e7802d0bdbec22ab6cf1
  • Pointer size: 130 Bytes
  • Size of remote file: 53.3 kB
artifacts/pattern_frequency_overall.png CHANGED

Git LFS Details

  • SHA256: 861ec86effa9a593df854d5ef675bff5a85262e802c7a6e0dc1a1ffdfed84a96
  • Pointer size: 130 Bytes
  • Size of remote file: 42.2 kB

Git LFS Details

  • SHA256: afeb4d10d132b3656739502dc1ab5cc9a548b38fcd966821d9f7a645b18fdf2e
  • Pointer size: 130 Bytes
  • Size of remote file: 42.2 kB
artifacts/pattern_frequency_parlament.png CHANGED

Git LFS Details

  • SHA256: 67f963d281bb0d9a5a449f374886dcd7d50a6b0c0242b0edcfab9adad29dd862
  • Pointer size: 130 Bytes
  • Size of remote file: 62.7 kB

Git LFS Details

  • SHA256: 7182ca813e5e34540a33ce35cdc7e7150028fd36ad00a75e80058a1cd53619b7
  • Pointer size: 130 Bytes
  • Size of remote file: 54.1 kB
artifacts/pattern_frequency_rozporządzenie.png CHANGED

Git LFS Details

  • SHA256: 5eb6042099e15e6aab88516f630351bcbba61f624f9ccc32e87feb771cf66565
  • Pointer size: 130 Bytes
  • Size of remote file: 60.9 kB

Git LFS Details

  • SHA256: dfa81f8a1e0f277ea334bd0ccf9cfedd303965f339f01f56c8c1332f7eaccd05
  • Pointer size: 130 Bytes
  • Size of remote file: 52.1 kB
artifacts/pattern_frequency_ustawa.png CHANGED

Git LFS Details

  • SHA256: a6c5f61b055525f560111d573c19d00814270ef157e39f548d6abbacf60e09ba
  • Pointer size: 130 Bytes
  • Size of remote file: 61.3 kB

Git LFS Details

  • SHA256: 3847ae1472bf8f57e2158aee907017a8c783cd1aff7009bab074cf5eaef9b6b2
  • Pointer size: 130 Bytes
  • Size of remote file: 52.8 kB
artifacts/pattern_frequency_w_pobliżu.png CHANGED

Git LFS Details

  • SHA256: df05fd9247ba23d945b08027e4be1fd29ebca866f77e21ff1ff36c92537f6220
  • Pointer size: 130 Bytes
  • Size of remote file: 63.9 kB

Git LFS Details

  • SHA256: a3e1daedbd3fc84a33ce8165bcbb4894e01dc5feb227194f05440b4ee1454b1a
  • Pointer size: 130 Bytes
  • Size of remote file: 55.4 kB
artifacts/pattern_frequency_w_roku.png CHANGED

Git LFS Details

  • SHA256: d6cad92b1c70a149e79069a50320819ce5cdf2f4c8eb42998955b9ff0902234f
  • Pointer size: 130 Bytes
  • Size of remote file: 66 kB

Git LFS Details

  • SHA256: df33a8fc14f059c83f546a295e0a7aa048600cf4844d4791e7dc786039d674f4
  • Pointer size: 130 Bytes
  • Size of remote file: 57.5 kB
data/biblioteka_nauki/biblioteka_nauki.md DELETED
@@ -1,60 +0,0 @@
1
- # biblioteka_nauki
2
-
3
- Biblioteka Nauki — Polish open-access scholarly corpus (scientific articles, books, chapters)
4
-
5
- ## Dataset description
6
- - **Source (upstream):** https://bibliotekanauki.pl (operated by ICM, University of Warsaw — Centrum Otwartej Nauki)
7
- - **Domain:** academic (scientific articles, books, chapters)
8
- - **Language:** Polish (pl)
9
- - **License:** per-document — CC BY 4.0 28,335 · CC BY-SA 4.0 13,733 · Public Domain 3
10
- - **Created (range):** per-document publication year, from each item's bibliotekanauki.pl metadata
11
- - **Added:** 2026-06-27
12
-
13
- ## Licensing — traceable basis
14
- The SpeakLeash blob carries no per-document license field, and ~53% of the upstream collection is
15
- all-rights-reserved, so a per-item gate was mandatory. Each item's license was recovered from the
16
- bibliotekanauki.pl API (`bibliotekanauki.pl/api/{type}/<id>` → `license.iconId`). Only openly-licensed
17
- items are kept; all-rights-reserved and unknown items are gated out. Recovery yielded 43,576 clean ids.
18
-
19
- | license | documents |
20
- |---|---:|
21
- | CC BY 4.0 | 28,335 |
22
- | CC BY-SA 4.0 | 13,733 |
23
- | Public Domain | 3 |
24
-
25
- The per-document license is carried in the parquet `license` column.
26
-
27
- ## Attribution
28
- Per-document attribution (author · year · title · publisher) was re-fetched 1:1 from
29
- bibliotekanauki.pl (43,576 / 43,576 ok) and is carried in the parquet `attribution` column,
30
- satisfying the CC BY / CC BY-SA attribution requirement that applies to every document here.
31
-
32
- ## Provenance
33
- Pulled from SpeakLeash's public redistribution (`speakleash-ds-pub`, key `biblioteka_nauki_pl_corpus`)
34
- of the upstream source above. SpeakLeash credited as intermediate aggregator; upstream license and
35
- attribution recovered per document and preserved.
36
-
37
- ## Statistics
38
- | documents | characters | tokens (tiktoken proxy) |
39
- |---:|---:|---:|
40
- | 42,071 | 1,748,333,935 | 673,488,831 |
41
-
42
- ## Filters applied (build_dynaword.py)
43
- Minimal, per Dynaword guidelines (heavy filtering left to downstream use):
44
- - drop documents < 200 chars: **0**
45
- - drop non-Polish (diacritic ratio): **925**
46
- - exact cross-source dedup (sha1): **180**
47
- - OCR alpha-ratio < 0.70 (OCR source): **400**
48
- - read 43,576 → kept 42,071
49
-
50
- Token counts are a fast tiktoken (cl100k) proxy (~1% off Llama-3); the canonical
51
- Llama-3 count is computed at release.
52
-
53
- ## Limitations
54
- - **Mixed license.** Roughly one third of the documents are CC BY-SA 4.0 (share-alike); the exact
55
- per-document license is in the `license` column. Downstream redistribution must respect share-alike
56
- for those documents.
57
- - **OCR / extraction noise.** Text is extracted from publisher PDFs; some layout and hyphenation
58
- artefacts remain after the alpha-ratio filter.
59
- - **Per-document dates.** `created` is the publication year from upstream metadata; finer-grained
60
- dates are not available.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/biblioteka_nauki/biblioteka_nauki.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cc93cdd5ca3e6576a1da0aa294df1308e879b8516ac30911289e430c69a07b26
3
- size 1076638904
 
 
 
 
data/biblioteka_nauki/biblioteka_nauki.stats.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "read": 43576,
3
- "kept": 42071,
4
- "drop_short": 0,
5
- "drop_lang": 925,
6
- "drop_dup": 180,
7
- "drop_ocr": 400,
8
- "chars": 1748333935,
9
- "tokens": 673488831,
10
- "secs": 484.1,
11
- "license": "CC-BY-4.0 / CC-BY-SA-4.0"
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
data/biblioteka_nauki/recover_attribution.py DELETED
@@ -1,125 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Targeted attribution pass for the CLEAN (CC-BY/CC-BY-SA/PD) Biblioteka Nauki ids ONLY.
3
- The first recovery pass stored the license correctly but parsed the wrong attribution fields.
4
- CC-BY/CC-BY-SA legally REQUIRE attribution, so re-fetch just the ~43.6k clean ids and extract:
5
- authors = contributors[role=AUTHOR] firstName+lastName ; year = dates[PUBLISHED].date.year ;
6
- title = mainTitle.text ; publisher = publishingCompanyInfo.name
7
-
8
- licenses.jsonl -> attribution.jsonl {type,id,license,authors,year,title,publisher}
9
- Resumable, threaded, polite. ~43.6k calls.
10
- """
11
- import json, os, random, sys, threading, time
12
- from concurrent.futures import ThreadPoolExecutor, as_completed
13
- import requests
14
-
15
- HERE = os.path.dirname(os.path.abspath(__file__))
16
- LIC = os.path.join(HERE, "licenses.jsonl")
17
- OUT = os.path.join(HERE, "attribution.jsonl")
18
- PROG = os.path.join(HERE, "attribution_progress.txt")
19
- CLEAN = {"cc-by", "cc-by-sa", "cc0", "public-domain"}
20
- WORKERS = 8
21
- UA = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 "
22
- "(KHTML, like Gecko) Chrome/124 Safari/537.36")
23
- HEADERS = {"User-Agent": UA, "Accept": "application/json", "Referer": "https://bibliotekanauki.pl/"}
24
- _local = threading.local()
25
- _wlock = threading.Lock()
26
-
27
-
28
- def session():
29
- s = getattr(_local, "s", None)
30
- if s is None:
31
- s = requests.Session()
32
- s.headers.update(HEADERS)
33
- s.mount("https://", requests.adapters.HTTPAdapter(pool_connections=4, pool_maxsize=4))
34
- _local.s = s
35
- return s
36
-
37
-
38
- def parse(d):
39
- authors = []
40
- for c in (d.get("contributors") or []):
41
- if c.get("role") == "AUTHOR":
42
- nm = f"{c.get('firstName','') or ''} {c.get('lastName','') or ''}".strip()
43
- if nm:
44
- authors.append(nm)
45
- year = None
46
- dates = d.get("dates") or []
47
- for dt in dates:
48
- if dt.get("type") == "PUBLISHED":
49
- year = (dt.get("date") or {}).get("year")
50
- break
51
- if not year and dates:
52
- year = (dates[0].get("date") or {}).get("year")
53
- title = (d.get("mainTitle") or {}).get("text")
54
- pub = (d.get("publishingCompanyInfo") or {}).get("name")
55
- return authors[:20], (str(year) if year else None), title, pub
56
-
57
-
58
- def fetch(item):
59
- typ, _id, lic = item
60
- url = f"https://bibliotekanauki.pl/api/{typ}/{_id}"
61
- for attempt in range(4):
62
- try:
63
- r = session().get(url, timeout=25)
64
- if r.status_code == 200:
65
- a, y, t, p = parse(r.json())
66
- return {"type": typ, "id": _id, "license": lic,
67
- "authors": a, "year": y, "title": t, "publisher": p, "status": "ok"}
68
- if r.status_code in (403, 404, 410):
69
- return {"type": typ, "id": _id, "license": lic, "status": f"http{r.status_code}"}
70
- time.sleep((2 ** attempt) + random.random())
71
- except Exception as e:
72
- if attempt == 3:
73
- return {"type": typ, "id": _id, "license": lic, "status": f"err:{type(e).__name__}"}
74
- time.sleep((2 ** attempt) + random.random())
75
- return {"type": typ, "id": _id, "license": lic, "status": "err:retries"}
76
-
77
-
78
- def main():
79
- best = {}
80
- for l in open(LIC, encoding="utf-8"):
81
- try:
82
- r = json.loads(l)
83
- except Exception:
84
- continue
85
- best[(r["type"], r["id"])] = r
86
- clean = [(t, i, r["iconId"]) for (t, i), r in best.items()
87
- if r.get("status") == "ok" and r.get("iconId") in CLEAN]
88
- done = set()
89
- if os.path.exists(OUT):
90
- for l in open(OUT, encoding="utf-8"):
91
- try:
92
- r = json.loads(l)
93
- done.add((r["type"], r["id"]))
94
- except Exception:
95
- pass
96
- todo = [c for c in clean if (c[0], c[1]) not in done]
97
- print(f"clean={len(clean)} done={len(done)} todo={len(todo)} workers={WORKERS}", flush=True)
98
-
99
- out = open(OUT, "a", encoding="utf-8")
100
- n = len(done)
101
- t0 = time.time()
102
- counts = {}
103
- with ThreadPoolExecutor(max_workers=WORKERS) as ex:
104
- futs = [ex.submit(fetch, c) for c in todo]
105
- for fut in as_completed(futs):
106
- res = fut.result()
107
- with _wlock:
108
- out.write(json.dumps(res, ensure_ascii=False) + "\n")
109
- n += 1
110
- counts[res.get("status")] = counts.get(res.get("status"), 0) + 1
111
- time.sleep(random.uniform(0.02, 0.10))
112
- if n % 500 == 0:
113
- out.flush()
114
- rate = (n - len(done)) / max(time.time() - t0, 1)
115
- eta = (len(clean) - n) / max(rate, 0.1) / 60
116
- msg = f"{n}/{len(clean)} {rate:.1f}/s ETA {eta:.0f}m " + \
117
- " ".join(f"{k}={v}" for k, v in sorted(counts.items()))
118
- print(msg, flush=True)
119
- open(PROG, "w").write(msg + "\n")
120
- out.flush(); out.close()
121
- print(f"DONE attribution: {n}/{len(clean)} counts={counts}", flush=True)
122
-
123
-
124
- if __name__ == "__main__":
125
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/biblioteka_nauki/recover_licenses.py DELETED
@@ -1,171 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Pass 2: recover the per-item license for every Biblioteka Nauki doc via the public API.
3
- index.jsonl -> GET bibliotekanauki.pl/api/{type}/{id} -> licenses.jsonl
4
-
5
- Resumable (skips ids already in licenses.jsonl), polite (modest concurrency + jitter + backoff),
6
- keep-alive sessions, and a circuit-breaker if the host starts blocking us.
7
-
8
- Output line: {type,id, iconId, cc(bool), restricted(bool), authors, year, source, status}
9
- status: "ok" | "http404" | "http403" | "err:<Type>"
10
- """
11
- import json, os, random, sys, threading, time
12
- from concurrent.futures import ThreadPoolExecutor, as_completed
13
- import requests
14
-
15
- HERE = os.path.dirname(os.path.abspath(__file__))
16
- INDEX = os.path.join(HERE, "index.jsonl")
17
- OUT = os.path.join(HERE, "licenses.jsonl")
18
- PROG = os.path.join(HERE, "recover_progress.txt")
19
-
20
- WORKERS = 8
21
- TIMEOUT = 25
22
- MAX_RETRY = 4
23
- UA = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 "
24
- "(KHTML, like Gecko) Chrome/124 Safari/537.36")
25
- HEADERS = {"User-Agent": UA, "Accept": "application/json", "Referer": "https://bibliotekanauki.pl/"}
26
-
27
- _local = threading.local()
28
- _write_lock = threading.Lock()
29
- _recent = [] # rolling window of recent statuses for the circuit breaker
30
- _recent_lock = threading.Lock()
31
- _stop = threading.Event()
32
-
33
-
34
- def session():
35
- s = getattr(_local, "s", None)
36
- if s is None:
37
- s = requests.Session()
38
- s.headers.update(HEADERS)
39
- a = requests.adapters.HTTPAdapter(pool_connections=4, pool_maxsize=4)
40
- s.mount("https://", a)
41
- _local.s = s
42
- return s
43
-
44
-
45
- def load_done():
46
- done = set()
47
- if os.path.exists(OUT):
48
- with open(OUT, encoding="utf-8") as f:
49
- for line in f:
50
- try:
51
- r = json.loads(line)
52
- done.add((r["type"], r["id"]))
53
- except Exception:
54
- pass
55
- return done
56
-
57
-
58
- def fetch(item):
59
- if _stop.is_set():
60
- return None
61
- typ, _id = item["type"], item["id"]
62
- url = f"https://bibliotekanauki.pl/api/{typ}/{_id}"
63
- for attempt in range(MAX_RETRY):
64
- try:
65
- r = session().get(url, timeout=TIMEOUT)
66
- if r.status_code == 200:
67
- d = r.json()
68
- lic = d.get("license") or {}
69
- authors = []
70
- for c in (d.get("contributors") or []):
71
- nm = (c.get("name") or "").strip()
72
- if nm:
73
- authors.append(nm)
74
- year = None
75
- for dt in (d.get("dates") or []):
76
- y = str(dt.get("year") or dt.get("value") or "")[:4]
77
- if y.isdigit():
78
- year = y
79
- break
80
- insts = d.get("publicationInstitutions") or d.get("journal") or None
81
- if isinstance(insts, list):
82
- insts = "; ".join(x.get("name", "") if isinstance(x, dict) else str(x) for x in insts) or None
83
- return {
84
- "type": typ, "id": _id,
85
- "iconId": lic.get("iconId"),
86
- "cc": bool(lic.get("creativeCommons")),
87
- "restricted": bool(d.get("restricted")),
88
- "authors": authors[:12],
89
- "year": year,
90
- "source": insts,
91
- "status": "ok",
92
- }
93
- if r.status_code in (403,):
94
- return {"type": typ, "id": _id, "status": "http403"}
95
- if r.status_code in (404, 410):
96
- return {"type": typ, "id": _id, "status": "http404"}
97
- # 429 / 5xx -> backoff & retry
98
- time.sleep((2 ** attempt) + random.random())
99
- except Exception as e:
100
- if attempt == MAX_RETRY - 1:
101
- return {"type": typ, "id": _id, "status": f"err:{type(e).__name__}"}
102
- time.sleep((2 ** attempt) + random.random())
103
- return {"type": typ, "id": _id, "status": "err:retries"}
104
-
105
-
106
- def note(status):
107
- with _recent_lock:
108
- _recent.append(status)
109
- if len(_recent) > 200:
110
- _recent.pop(0)
111
- # circuit breaker: >60% 403 over a full window => host is blocking us
112
- if len(_recent) == 200 and sum(1 for s in _recent if s == "http403") > 120:
113
- _stop.set()
114
-
115
-
116
- def main():
117
- if not os.path.exists(INDEX):
118
- sys.exit(f"missing {INDEX} — run build_index.py first")
119
- items = []
120
- with open(INDEX, encoding="utf-8") as f:
121
- for line in f:
122
- try:
123
- r = json.loads(line)
124
- items.append({"type": r["type"], "id": r["id"]})
125
- except Exception:
126
- pass
127
- done = load_done()
128
- todo = [it for it in items if (it["type"], it["id"]) not in done]
129
- total = len(items)
130
- print(f"index={total} done={len(done)} todo={len(todo)} workers={WORKERS}", flush=True)
131
-
132
- n = len(done)
133
- t0 = time.time()
134
- out = open(OUT, "a", encoding="utf-8")
135
- counts = {}
136
- try:
137
- with ThreadPoolExecutor(max_workers=WORKERS) as ex:
138
- futs = [ex.submit(fetch, it) for it in todo]
139
- for fut in as_completed(futs):
140
- res = fut.result()
141
- if res is None:
142
- continue
143
- with _write_lock:
144
- out.write(json.dumps(res, ensure_ascii=False) + "\n")
145
- n += 1
146
- st = res.get("status", "?")
147
- counts[st] = counts.get(st, 0) + 1
148
- note(st)
149
- # politeness jitter (per completed task; with 8 workers ~ a few hundred req/min)
150
- time.sleep(random.uniform(0.02, 0.12))
151
- if n % 500 == 0:
152
- out.flush()
153
- rate = (n - len(done)) / max(time.time() - t0, 1)
154
- eta = (total - n) / max(rate, 0.1) / 60
155
- msg = (f"{n}/{total} {rate:.1f}/s ETA {eta:.0f}m "
156
- + " ".join(f"{k}={v}" for k, v in sorted(counts.items())))
157
- print(msg, flush=True)
158
- with open(PROG, "w") as p:
159
- p.write(msg + "\n")
160
- if _stop.is_set():
161
- print("!! circuit breaker tripped (sustained 403) — stopping. Re-run later to resume.", flush=True)
162
- break
163
- finally:
164
- out.flush()
165
- out.close()
166
- print(f"FINISHED pass: wrote {n}/{total}. counts={counts}", flush=True)
167
- print("Next: build_parquet.py to assemble the CC-BY/SA subset.", flush=True)
168
-
169
-
170
- if __name__ == "__main__":
171
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pattern_frequency_report.md CHANGED
@@ -1,18 +1,18 @@
1
  ## Pattern frequency on corpus
2
 
3
- - total tokens (tiktoken proxy): `6,881,277,362`
4
 
5
  | pattern | count | share of all tokens |
6
  |---|---:|---:|
7
- | `w roku` | 460,249 | 0.0067% |
8
- | `klasyfikacji` | 134,093 | 0.0019% |
9
- | `ustawa` | 598,176 | 0.0087% |
10
- | `artykuł` | 2,096,271 | 0.0305% |
11
- | `parlament` | 1,216,808 | 0.0177% |
12
- | `rozporządzenie` | 1,497,273 | 0.0218% |
13
- | `w pobliżu` | 89,774 | 0.0013% |
14
- | `mieszkańców` | 288,911 | 0.0042% |
15
- | `Dz.U.` | 944,565 | 0.0137% |
16
 
17
  | source | pattern | count | per-token share |
18
  |---|---|---:|---:|
@@ -52,24 +52,6 @@
52
  | eurlex | `w pobliżu` | 6,088 | 0.00026% |
53
  | eurlex | `mieszkańców` | 9,441 | 0.00040% |
54
  | eurlex | `Dz.U.` | 915,707 | 0.03851% |
55
- | european_hplt_v3_pl | `w roku` | 21,067 | 0.00411% |
56
- | european_hplt_v3_pl | `klasyfikacji` | 3,576 | 0.00070% |
57
- | european_hplt_v3_pl | `ustawa` | 5,754 | 0.00112% |
58
- | european_hplt_v3_pl | `artykuł` | 56,295 | 0.01099% |
59
- | european_hplt_v3_pl | `parlament` | 10,618 | 0.00207% |
60
- | european_hplt_v3_pl | `rozporządzenie` | 2,661 | 0.00052% |
61
- | european_hplt_v3_pl | `w pobliżu` | 9,877 | 0.00193% |
62
- | european_hplt_v3_pl | `mieszkańców` | 33,939 | 0.00662% |
63
- | european_hplt_v3_pl | `Dz.U.` | 1,482 | 0.00029% |
64
- | global_voices | `w roku` | 160 | 0.00431% |
65
- | global_voices | `klasyfikacji` | 5 | 0.00013% |
66
- | global_voices | `ustawa` | 157 | 0.00423% |
67
- | global_voices | `artykuł` | 1,047 | 0.02818% |
68
- | global_voices | `parlament` | 366 | 0.00985% |
69
- | global_voices | `rozporządzenie` | 26 | 0.00070% |
70
- | global_voices | `w pobliżu` | 105 | 0.00283% |
71
- | global_voices | `mieszkańców` | 508 | 0.01367% |
72
- | global_voices | `Dz.U.` | 1 | 0.00003% |
73
  | govpl | `w roku` | 3,372 | 0.00418% |
74
  | govpl | `klasyfikacji` | 526 | 0.00065% |
75
  | govpl | `ustawa` | 4,727 | 0.00586% |
@@ -79,15 +61,6 @@
79
  | govpl | `w pobliżu` | 892 | 0.00111% |
80
  | govpl | `mieszkańców` | 13,105 | 0.01625% |
81
  | govpl | `Dz.U.` | 3,114 | 0.00386% |
82
- | nkjp1m | `w roku` | 109 | 0.00419% |
83
- | nkjp1m | `klasyfikacji` | 9 | 0.00035% |
84
- | nkjp1m | `ustawa` | 79 | 0.00304% |
85
- | nkjp1m | `artykuł` | 153 | 0.00588% |
86
- | nkjp1m | `parlament` | 216 | 0.00830% |
87
- | nkjp1m | `rozporządzenie` | 20 | 0.00077% |
88
- | nkjp1m | `w pobliżu` | 77 | 0.00296% |
89
- | nkjp1m | `mieszkańców` | 159 | 0.00611% |
90
- | nkjp1m | `Dz.U.` | 2 | 0.00008% |
91
  | parliamentary | `w roku` | 198,192 | 0.01203% |
92
  | parliamentary | `klasyfikacji` | 12,637 | 0.00077% |
93
  | parliamentary | `ustawa` | 459,179 | 0.02788% |
 
1
  ## Pattern frequency on corpus
2
 
3
+ - total tokens (tiktoken proxy): `6,362,577,363`
4
 
5
  | pattern | count | share of all tokens |
6
  |---|---:|---:|
7
+ | `w roku` | 438,913 | 0.0069% |
8
+ | `klasyfikacji` | 130,503 | 0.0021% |
9
+ | `ustawa` | 592,186 | 0.0093% |
10
+ | `artykuł` | 2,038,776 | 0.0320% |
11
+ | `parlament` | 1,205,608 | 0.0189% |
12
+ | `rozporządzenie` | 1,494,566 | 0.0235% |
13
+ | `w pobliżu` | 79,715 | 0.0013% |
14
+ | `mieszkańców` | 254,305 | 0.0040% |
15
+ | `Dz.U.` | 943,080 | 0.0148% |
16
 
17
  | source | pattern | count | per-token share |
18
  |---|---|---:|---:|
 
52
  | eurlex | `w pobliżu` | 6,088 | 0.00026% |
53
  | eurlex | `mieszkańców` | 9,441 | 0.00040% |
54
  | eurlex | `Dz.U.` | 915,707 | 0.03851% |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  | govpl | `w roku` | 3,372 | 0.00418% |
56
  | govpl | `klasyfikacji` | 526 | 0.00065% |
57
  | govpl | `ustawa` | 4,727 | 0.00586% |
 
61
  | govpl | `w pobliżu` | 892 | 0.00111% |
62
  | govpl | `mieszkańców` | 13,105 | 0.01625% |
63
  | govpl | `Dz.U.` | 3,114 | 0.00386% |
 
 
 
 
 
 
 
 
 
64
  | parliamentary | `w roku` | 198,192 | 0.01203% |
65
  | parliamentary | `klasyfikacji` | 12,637 | 0.00077% |
66
  | parliamentary | `ustawa` | 459,179 | 0.02788% |
src/make_docs.py CHANGED
@@ -13,8 +13,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parent))
13
  from sources import SOURCES, EXCLUDED, ADDED
14
 
15
  ROOT = Path(__file__).resolve().parent.parent
16
- VERSION = "0.2.3"
17
- RELEASE_DATE = "2026-07-26"
18
  CONTACT = "k.wikiel@gmail.com" # notice-and-takedown / data-removal requests
19
 
20
  # Dupochron: documented good-faith provenance + no-warranty + takedown + PII.
@@ -120,10 +119,7 @@ def main():
120
  st = load_stats(name)
121
  if not st:
122
  print(f" ! no stats for {name}"); continue
123
- # Sources with a hand-authored datasheet (rich provenance, per-source add
124
- # date) opt out of template regeneration to avoid clobbering it.
125
- if not cfg.get("custom_datasheet"):
126
- (ROOT / "data" / name / f"{name}.md").write_text(datasheet(name, cfg, st))
127
  rows.append((name, cfg, st))
128
  tot_doc += st["kept"]; tot_tok += st["tokens"]; tot_chr += st["chars"]
129
  rows.sort(key=lambda r: -r[2]["tokens"])
@@ -170,81 +166,21 @@ family (Enevoldsen et al., [arXiv:2508.02271](https://arxiv.org/abs/2508.02271))
170
 
171
  > **v{VERSION} stable** · {tot_doc:,} documents · **{tot_tok/1e9:.2f}B tokens**
172
  > (tiktoken proxy; canonical Llama-3 count at release) · {len(rows)} sources
173
- > Updated: **{RELEASE_DATE}**
174
 
175
- > **v0.3-dev experimental track** · quality/diversity workflow, source-gate
176
- > validation and candidate-data audits. This is development work, not a released
177
- > corpus version, and it does not replace the v{VERSION} stable parquets.
 
 
178
 
179
- > **Europeana validation artifact (2026-07-10)** · a separate reproducible
180
- > 810-document direct-ingestion sample stored under the legacy path
181
- > `previews/v0.3.1/europeana.parquet`. It is not a full dataset release.
182
-
183
- ## Releases
184
-
185
- ### Stable releases
186
 
187
  | version | status | documents | tokens | notes |
188
  |---|---|---:|---:|---|
189
- | `v0.2.3` | stable release | {tot_doc:,} | {tot_tok/1e9:.2f}B | Adds community-contributed `european_hplt_v3_pl`, `global_voices` and `nkjp1m`. |
190
- | `v0.2.2` | previous stable | 2,579,963 | 6.36B | Added community-contributed `govpl`: 88,190 docs / 80.7M tokens. |
191
- | `v0.2.1` | previous stable | 2,491,773 | 6.28B | 12-source corpus with `license` and `author` metadata columns; added `1000_novels`. |
192
  | `v0.2.0` | previous stable | 2,490,773 | 6.22B | Provenance-first corpus from 11 open/official sources. |
193
-
194
- ![Stable dataset size by version](artifacts/dataset_size_by_version.png)
195
-
196
- ### Development and validation artifacts
197
-
198
- | name | type | scope | notes |
199
- |---|---|---|---|
200
- | `v0.3-dev` | experimental development track | workflow and candidate audits | Quality remix, legal-source caps, source QA, deduplication and direct-upstream ingestion. Not a corpus release. |
201
- | `Europeana validation artifact 2026-07-10` | reproducible sample | 810 documents / 140,042 tokens | Stored at the legacy path `previews/v0.3.1/europeana.parquet`; preserves per-record rights and creator metadata. Not a corpus release. |
202
-
203
- ### Version details
204
-
205
- #### v0.2.3 — current stable
206
-
207
- Community expansion release. Adds `european_hplt_v3_pl` from
208
- [PR #5](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/5)
209
- and `global_voices` from
210
- [PR #7](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/7),
211
- plus `nkjp1m` from
212
- [PR #8](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/8).
213
- The complete 16-source release contains **2,710,974 documents /
214
- 6,881,277,362 cl100k-proxy tokens**, summed from the released per-source parquet
215
- statistics.
216
-
217
- #### v0.2.2 — previous stable
218
-
219
- Added `govpl` from
220
- [PR #9](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/9):
221
- 88,190 Polish government press releases collected directly from 133 gov.pl
222
- ministry and agency subsites.
223
-
224
- #### v0.2.1 — previous stable
225
-
226
- Introduced the canonical eight-column release schema:
227
- `id, text, source, added, created, token_count, license, author`. Added
228
- `1000_novels` from
229
- [PR #1](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/1)
230
- and recomputed all release statistics from parquet files.
231
-
232
- #### v0.2.0 — initial stable corpus
233
-
234
- The provenance-first baseline: 11 reviewed open or official sources,
235
- 2,490,773 documents and 6.22B proxy tokens.
236
-
237
- #### v0.3-dev — experimental quality workflow
238
-
239
- Candidate-only work on a better-balanced training mixture: legal-source caps,
240
- temperature sampling, source QA, deduplication and direct-upstream ingestion.
241
- It is not a replacement for the stable corpus.
242
-
243
- #### Europeana validation artifact — 2026-07-10
244
-
245
- A separate reproducible 810-document Europeana sample preserving per-record
246
- rights and creator metadata. It does not change stable-release totals.
247
- `v0.3.1-preview` remains only as the legacy storage-path label.
248
 
249
  ## What this dataset contributes
250
  The raw texts come from existing open corpora (redistributed via SpeakLeash and,
@@ -269,18 +205,10 @@ as the redistributing aggregator; this release does not claim ownership of them
269
 
270
  ## Contributors
271
 
272
- | contributor | contribution | release / PR |
273
- |---|---|---|
274
- | [Kacper Wikieł](https://huggingface.co/kacperwikiel) | Project maintainer; corpus curation, source and license review, release engineering, documentation, validation and reproducible build workflow. | all releases |
275
- | [Bart Kobyliński](https://huggingface.co/bartoszkobylinski1) | Added `1000_novels`; expanded Biblioteka Nauki and Europeana ingestion with per-document license and author metadata. | `v0.2.1`, [PR #1](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/1) |
276
- | [Paweł Puzio](https://huggingface.co/ppuzio) | Built `govpl`: subsite discovery, direct ingestion pipeline, dataset artifact, contract tests and documentation. | `v0.2.2`, [PR #9](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/9) |
277
- | [Arkadiusz Słota](https://huggingface.co/Maggio33) | Built `european_hplt_v3_pl`: HPLT v3 WDS 10+9 cleaning pipeline, 110,590-document artifact, validation and documentation. | `v0.2.3`, [PR #5](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/5) |
278
- | [Dawid Majewski](https://huggingface.co/dawidmajewski) | Added the reviewed Global Voices Polish corpus with per-document author attribution and documentation. | `v0.2.3`, [PR #7](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/7) |
279
- | [1am](https://huggingface.co/1am) | Added `nkjp1m`: the manually annotated 1-million-word NKJP subcorpus, direct fetch/build pipeline, source documentation and release artifact. | `v0.2.3`, [PR #8](https://huggingface.co/datasets/SlayerLab/polish-dynaword/discussions/8) |
280
-
281
- Contributions are credited when they add a verifiable dataset artifact, pipeline,
282
- validation, documentation or release work. A merged discussion with no resulting
283
- files is not listed as a data contribution.
284
 
285
  ## Guiding principles
286
  1. **Open & traceable licensing** — every source is *openly licensed* with a documented
@@ -333,10 +261,9 @@ Current v0.3 source-ingestion status:
333
  - Europeana release policy: split conservatively at pre-1929 records for
334
  US-sensitive downstream reuse, and keep later/unknown records separately
335
  labeled or held until legal review.
336
- - `european_hplt_v3_pl`: WDS bins 10+9 are included in v{VERSION} after contract
337
- validation. HPLT packaging is CC0, while underlying crawled web documents can
338
- carry independent rights; downstream near-dedup and web-content review remain
339
- recommended before training.
340
 
341
  Current review artifacts:
342
 
@@ -371,19 +298,23 @@ python3 src/make_docs.py
371
  """
372
  (ROOT / "README.md").write_text(readme)
373
 
374
- # CHANGELOG is append-only release history. Documentation regeneration must
375
- # never erase earlier releases or hand-reviewed legal/release notes.
376
- changelog_path = ROOT / "CHANGELOG.md"
377
- changelog = changelog_path.read_text() if changelog_path.exists() else "# Changelog\n"
378
- heading = f"## v{VERSION} ({RELEASE_DATE})"
379
- if heading not in changelog:
380
- entry = (
381
- f"{heading}\n\n"
382
- f"- Current release totals after parquet recount: {len(rows)} sources, "
383
- f"{tot_doc:,} docs, {tot_tok:,} tokens (tiktoken cl100k proxy).\n\n"
384
- )
385
- changelog = changelog.replace("# Changelog\n", f"# Changelog\n\n{entry}", 1)
386
- changelog_path.write_text(changelog)
 
 
 
 
387
 
388
  (ROOT / "LICENSE").write_text(
389
  "Polish DynaWord is released under Creative Commons Attribution-ShareAlike 4.0\n"
 
13
  from sources import SOURCES, EXCLUDED, ADDED
14
 
15
  ROOT = Path(__file__).resolve().parent.parent
16
+ VERSION = "0.2.2"
 
17
  CONTACT = "k.wikiel@gmail.com" # notice-and-takedown / data-removal requests
18
 
19
  # Dupochron: documented good-faith provenance + no-warranty + takedown + PII.
 
119
  st = load_stats(name)
120
  if not st:
121
  print(f" ! no stats for {name}"); continue
122
+ (ROOT / "data" / name / f"{name}.md").write_text(datasheet(name, cfg, st))
 
 
 
123
  rows.append((name, cfg, st))
124
  tot_doc += st["kept"]; tot_tok += st["tokens"]; tot_chr += st["chars"]
125
  rows.sort(key=lambda r: -r[2]["tokens"])
 
166
 
167
  > **v{VERSION} stable** · {tot_doc:,} documents · **{tot_tok/1e9:.2f}B tokens**
168
  > (tiktoken proxy; canonical Llama-3 count at release) · {len(rows)} sources
169
+ > Updated: **{ADDED}**
170
 
171
+ > **v0.3.0-preview in progress** · quality/diversity remix workflow, legal-style
172
+ > downweighting, and filtered contemporary Polish web candidates. Biblioteka
173
+ > Nauki and Europeana are prepared as source-ingestion PR targets with
174
+ > per-document `license` and `author` metadata, but they are not part of this
175
+ > stable parquet release yet.
176
 
177
+ ## Versions
 
 
 
 
 
 
178
 
179
  | version | status | documents | tokens | notes |
180
  |---|---|---:|---:|---|
181
+ | `v0.2.1` | stable release | {tot_doc:,} | {tot_tok/1e9:.2f}B | 12-source stable corpus with `license` and `author` metadata columns; adds `1000_novels`. |
 
 
182
  | `v0.2.0` | previous stable | 2,490,773 | 6.22B | Provenance-first corpus from 11 open/official sources. |
183
+ | `v0.3.0-preview` | workflow + candidate data in progress | candidate-only | TBD | Biblioteka Nauki, Europeana, and HPLT/Common Corpus style expansion pending per-source QA, dedup, and legal review. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
  ## What this dataset contributes
186
  The raw texts come from existing open corpora (redistributed via SpeakLeash and,
 
205
 
206
  ## Contributors
207
 
208
+ - **Kacper Wikieł** corpus curation, release engineering, documentation, and
209
+ reproducible build workflow.
210
+ - **Bart Kobyliński** source expansion work for Biblioteka Nauki and Europeana,
211
+ including per-document license/author metadata collection and rebuild planning.
 
 
 
 
 
 
 
 
212
 
213
  ## Guiding principles
214
  1. **Open & traceable licensing** — every source is *openly licensed* with a documented
 
261
  - Europeana release policy: split conservatively at pre-1929 records for
262
  US-sensitive downstream reuse, and keep later/unknown records separately
263
  labeled or held until legal review.
264
+ - `ashtok897/european-hplt-v1`: candidate workflow exists, but web-crawl
265
+ provenance, dedup, QA, and final mix weighting are still pending before stable
266
+ inclusion.
 
267
 
268
  Current review artifacts:
269
 
 
298
  """
299
  (ROOT / "README.md").write_text(readme)
300
 
301
+ (ROOT / "CHANGELOG.md").write_text(
302
+ f"# Changelog\n\n## v{VERSION} ({ADDED})\n\n"
303
+ f"- Released a stable metadata-schema update: "
304
+ f"`id, text, source, added, created, token_count, license, author`.\n"
305
+ f"- Current release totals after parquet recount: {len(rows)} sources, "
306
+ f"{tot_doc:,} docs, {tot_tok/1e9:.2f}B tokens (tiktoken proxy).\n"
307
+ f"- Added `1000_novels` as a stable CC-BY-4.0 literature source.\n"
308
+ f"- Added source registry entries and PR contract for future "
309
+ f"`biblioteka_nauki` and `europeana` ingestion with per-document "
310
+ f"license/author metadata. These sources are not included in v{VERSION} "
311
+ f"parquets yet.\n"
312
+ f"- Credited Bart Kobyliński for source expansion work on Biblioteka "
313
+ f"Nauki and Europeana metadata/rebuild preparation.\n"
314
+ f"- Kept raw SpeakLeash Europeana excluded unless a direct rebuild "
315
+ f"preserves per-record rights metadata.\n"
316
+ f"- Sources: {', '.join(n for n, _, _ in rows)}.\n"
317
+ f"- Excluded (see README): {', '.join(EXCLUDED)}.\n")
318
 
319
  (ROOT / "LICENSE").write_text(
320
  "Polish DynaWord is released under Creative Commons Attribution-ShareAlike 4.0\n"
src/pattern_frequency_report.py CHANGED
@@ -45,10 +45,7 @@ def count_patterns_for_source(parquet_path: Path) -> dict[str, int]:
45
 
46
  for rg in range(pf.num_row_groups):
47
  table = pf.read_row_group(rg, columns=["text"])
48
- # A single large source row group can exceed Arrow's 2 GiB utf8
49
- # offset limit after lower-casing. Use 64-bit string offsets before
50
- # applying any text kernels so community-contributed web shards scale.
51
- text = pc.cast(table["text"], "large_string")
52
  text = pc.utf8_lower(text)
53
  text = pc.replace_substring_regex(text, pattern="\\r?\\n", replacement=" ")
54
 
 
45
 
46
  for rg in range(pf.num_row_groups):
47
  table = pf.read_row_group(rg, columns=["text"])
48
+ text = table["text"]
 
 
 
49
  text = pc.utf8_lower(text)
50
  text = pc.replace_substring_regex(text, pattern="\\r?\\n", replacement=" ")
51
 
src/plot_version_growth.py DELETED
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Plot stable Polish DynaWord corpus growth across released versions."""
3
-
4
- from pathlib import Path
5
-
6
- import matplotlib.pyplot as plt
7
- from matplotlib.ticker import FuncFormatter
8
-
9
-
10
- ROOT = Path(__file__).resolve().parent.parent
11
- OUTPUT = ROOT / "artifacts" / "dataset_size_by_version.png"
12
-
13
- VERSIONS = ["v0.2.0", "v0.2.1", "v0.2.2", "v0.2.3"]
14
- DOCUMENTS = [2_490_773, 2_491_773, 2_579_963, 2_710_974]
15
- TOKENS = [6_221_393_871, 6_281_911_234, 6_362_577_363, 6_881_277_362]
16
-
17
-
18
- def millions(value, _position):
19
- return f"{value / 1_000_000:.1f}M"
20
-
21
-
22
- def billions(value, _position):
23
- return f"{value / 1_000_000_000:.1f}B"
24
-
25
-
26
- def main():
27
- plt.style.use("seaborn-v0_8-whitegrid")
28
- fig, axes = plt.subplots(1, 2, figsize=(12, 4.8))
29
-
30
- panels = [
31
- (axes[0], DOCUMENTS, "Documents", millions, lambda v: f"{v / 1_000_000:.3f}M", "#2563eb"),
32
- (axes[1], TOKENS, "Tokens (cl100k proxy)", billions, lambda v: f"{v / 1_000_000_000:.3f}B", "#0f766e"),
33
- ]
34
-
35
- for axis, values, ylabel, formatter, labeler, color in panels:
36
- axis.plot(VERSIONS, values, marker="o", linewidth=2.5, color=color)
37
- axis.fill_between(VERSIONS, values, alpha=0.12, color=color)
38
- axis.set_ylabel(ylabel)
39
- axis.yaxis.set_major_formatter(FuncFormatter(formatter))
40
- axis.spines[["top", "right"]].set_visible(False)
41
- axis.grid(axis="x", visible=False)
42
- padding = (max(values) - min(values)) * 0.3 or max(values) * 0.02
43
- axis.set_ylim(min(values) - padding, max(values) + padding)
44
-
45
- for version, value in zip(VERSIONS, values):
46
- axis.annotate(
47
- labeler(value),
48
- (version, value),
49
- xytext=(0, 9),
50
- textcoords="offset points",
51
- ha="center",
52
- fontsize=9,
53
- fontweight="bold",
54
- color=color,
55
- )
56
-
57
- fig.suptitle("Polish DynaWord — stable dataset growth by version", fontsize=15)
58
- fig.tight_layout()
59
- OUTPUT.parent.mkdir(parents=True, exist_ok=True)
60
- fig.savefig(OUTPUT, dpi=180, bbox_inches="tight")
61
- plt.close(fig)
62
- print(OUTPUT)
63
-
64
-
65
- if __name__ == "__main__":
66
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/sources.py CHANGED
@@ -288,41 +288,6 @@ SOURCES = {
288
  "containment dedup vs existing sources is left to downstream per "
289
  "Dynaword guidelines. Parity with the accepted european-hplt-v1 CC0 basis.",
290
  },
291
- "1000_novels": {
292
- "speakleash_key": "1000_novels_corpus_CLARIN-PL",
293
- "pretty": "1000 Novels Corpus (CLARIN-PL)",
294
- "license": "CC-BY-4.0",
295
- "license_spdx": "CC-BY-4.0",
296
- "traceable": "The 1000 Novels Corpus is released under Creative Commons "
297
- "Attribution 4.0 International by CLARIN-PL / Wrocław University "
298
- "of Technology, with attribution to the corpus authors and "
299
- "maintainers.",
300
- "upstream": "https://clarin-pl.eu/dspace/handle/11321/312",
301
- "domain": "literature",
302
- "created": "unknown",
303
- "is_ocr": False,
304
- # Datasheet is contributor-committed (added 2026-07-02); skip regeneration
305
- # so the global ADDED stamp does not overwrite the real add date.
306
- "custom_datasheet": True,
307
- },
308
- "global_voices": {
309
- # Data contributed directly (PR #7): no in-repo fetch/build script and a
310
- # hand-authored datasheet. Registered for the source table + release totals;
311
- # the datasheet stays contributor-owned via custom_datasheet.
312
- "file_key": "global_voices",
313
- "pretty": "Global Voices Polish",
314
- "license": "CC-BY-3.0",
315
- "license_spdx": "CC-BY-3.0",
316
- "traceable": "CC BY 3.0 verified from the article-level license link published "
317
- "with each retained Global Voices article; each record carries "
318
- "CC-BY-3.0 metadata and per-document author/translator attribution "
319
- "in global_voices.attribution.jsonl.",
320
- "upstream": "https://pl.globalvoices.org/",
321
- "domain": "civic media, news and public-interest journalism",
322
- "created": "2008-11-04, 2023-05-24",
323
- "is_ocr": False,
324
- "custom_datasheet": True,
325
- },
326
  }
327
 
328
  ADDED = "2026-07-19"
 
288
  "containment dedup vs existing sources is left to downstream per "
289
  "Dynaword guidelines. Parity with the accepted european-hplt-v1 CC0 basis.",
290
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  }
292
 
293
  ADDED = "2026-07-19"
src/test_hplt_v3_contract.py CHANGED
@@ -11,8 +11,7 @@ from pathlib import Path
11
  import pyarrow as pa, pyarrow.parquet as pq
12
  import pyarrow.compute as pc
13
 
14
- ROOT = Path(__file__).resolve().parent.parent
15
- D = ROOT / "data" / "european_hplt_v3_pl"
16
  PARQUET = D / "european_hplt_v3_pl.parquet"
17
  STATS = D / "european_hplt_v3_pl.stats.json"
18
  ACCEPTED = {"cc0-1.0", "cc-by-3.0", "cc-by-4.0", "cc-by-sa-3.0", "cc-by-sa-4.0",
 
11
  import pyarrow as pa, pyarrow.parquet as pq
12
  import pyarrow.compute as pc
13
 
14
+ D = Path(r"C:\ProjektyPublic\datasets\hplt_v3_pl\data\european_hplt_v3_pl")
 
15
  PARQUET = D / "european_hplt_v3_pl.parquet"
16
  STATS = D / "european_hplt_v3_pl.stats.json"
17
  ACCEPTED = {"cc0-1.0", "cc-by-3.0", "cc-by-4.0", "cc-by-sa-3.0", "cc-by-sa-4.0",