Add eight CC BY-SA 4.0 Polish academic books from ROCK

#33
artifacts/rock_pollub_pl_ontology_manifest.json ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "actors": [
3
+ {
4
+ "id": "actor:piotrsty",
5
+ "type": "Contributor"
6
+ },
7
+ {
8
+ "id": "actor:politechnika-lubelska",
9
+ "type": "Organization"
10
+ },
11
+ {
12
+ "id": "actor:codex",
13
+ "type": "Agent"
14
+ }
15
+ ],
16
+ "claims": [
17
+ {
18
+ "falsification_condition": "A retained record lacks Polish book metadata or either rights assertion.",
19
+ "id": "claim:pilot-eligibility",
20
+ "statement": "Retained pilot records have Polish book metadata and CC BY-SA 4.0 evidence at item and matched PDF-bitstream level.",
21
+ "supported_by": [
22
+ "evidence:inventory:33db1ffd21efb1535b0255b31f539a669f129a41b9d8e7d449fe733321c48775",
23
+ "evidence:qa:84834c8c5f4e947e34c34d32d89932767e5a82b3d53ab217d5f5a8dbeed087ea"
24
+ ]
25
+ },
26
+ {
27
+ "falsification_condition": "The recorded comparison contains a match, or a rerun against the pinned target version finds one.",
28
+ "id": "claim:no-title-overlap-detected",
29
+ "statement": "No exact or near title match was detected against the current Biblioteka Nauki attribution column.",
30
+ "supported_by": [
31
+ "evidence:overlap:2557b13a55ad40599070cb1101af5fd74c46247e527a525b5f06543ab0645101"
32
+ ]
33
+ },
34
+ {
35
+ "falsification_condition": "The pinned registry or recorded discussion list contains this source.",
36
+ "id": "claim:not-registered-at-audit",
37
+ "statement": "The source key and a matching ROCK/Pollub proposal were absent from the pinned DynaWord registry and discussion list at audit time.",
38
+ "supported_by": [
39
+ "evidence:target-audit:cddb52e9a3f5dc34073ecc22828028965a8578f2dad4c73036ca3cfa0178c303"
40
+ ]
41
+ },
42
+ {
43
+ "falsification_condition": "A controlled ablation and target-wide overlap analysis establish those properties.",
44
+ "id": "claim:training-value-untested",
45
+ "statement": "Training benefit and full-corpus novelty remain untested hypotheses.",
46
+ "supported_by": [
47
+ "evidence:qa:84834c8c5f4e947e34c34d32d89932767e5a82b3d53ab217d5f5a8dbeed087ea"
48
+ ]
49
+ }
50
+ ],
51
+ "evidence": [
52
+ {
53
+ "artifact": "artifacts/inventory.json",
54
+ "content_address": "33db1ffd21efb1535b0255b31f539a669f129a41b9d8e7d449fe733321c48775",
55
+ "id": "evidence:inventory:33db1ffd21efb1535b0255b31f539a669f129a41b9d8e7d449fe733321c48775",
56
+ "observation_type": "source_inventory",
57
+ "produced_by": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0"
58
+ },
59
+ {
60
+ "id": "evidence:qa:84834c8c5f4e947e34c34d32d89932767e5a82b3d53ab217d5f5a8dbeed087ea",
61
+ "observation_type": "pilot_qa",
62
+ "payload": {
63
+ "benchmark_overlap": "pending",
64
+ "biblioteka_nauki_overlap": {
65
+ "candidate_records": 8,
66
+ "method": "normalized title substring; fallback SequenceMatcher >= 0.90 over attribution",
67
+ "observed_at": "2026-09-08T16:37:35.661794+00:00",
68
+ "records_with_exact_title_match": 0,
69
+ "records_with_fuzzy_title_match": 0,
70
+ "results": [
71
+ {
72
+ "exact_title_matches": [],
73
+ "fuzzy_title_matches": [],
74
+ "item_id": "513c690d-72b3-4604-b62e-e21e44b91645",
75
+ "title": "Modelowanie i analiza eksperymentalna parametrów pracy modułów fotowoltaicznych w warunkach rzeczywistych"
76
+ },
77
+ {
78
+ "exact_title_matches": [],
79
+ "fuzzy_title_matches": [],
80
+ "item_id": "e9e7a67e-c405-4968-b87a-0ff169c7b3d1",
81
+ "title": "Ćwiczenia i zadania ze wstępu do matematyki finansowej"
82
+ },
83
+ {
84
+ "exact_title_matches": [],
85
+ "fuzzy_title_matches": [],
86
+ "item_id": "a6c38c5d-ba8f-47ac-a3e6-b50df14a595b",
87
+ "title": "Dobór architektury i parametrów procesu uczenia sieci neuronowych w doskonaleniu procesów produkcyjnych"
88
+ },
89
+ {
90
+ "exact_title_matches": [],
91
+ "fuzzy_title_matches": [],
92
+ "item_id": "903f22e1-a2ab-4231-a402-2bc9535c12f2",
93
+ "title": "Wyzwania współczesnego publikowania"
94
+ },
95
+ {
96
+ "exact_title_matches": [],
97
+ "fuzzy_title_matches": [],
98
+ "item_id": "0e26bff5-e51a-4d36-9524-fdef6e3e6ab7",
99
+ "title": "Symulacje Monte Carlo. Teoria i zastosowania"
100
+ },
101
+ {
102
+ "exact_title_matches": [],
103
+ "fuzzy_title_matches": [],
104
+ "item_id": "032a14e5-5c8e-4153-9cf7-2dfd9e361e6d",
105
+ "title": "Zastosowanie uczenia maszynowego do obrazowania stanu zawilgocenia murów z wykorzystaniem tomografii impedancyjnej"
106
+ },
107
+ {
108
+ "exact_title_matches": [],
109
+ "fuzzy_title_matches": [],
110
+ "item_id": "da87b1d3-7018-46fa-81bd-380f0780a1b3",
111
+ "title": "Zarządzanie współprac�� instytucji państwa z diasporą. Przegląd teorii, analiza porównawcza wybranych państw"
112
+ },
113
+ {
114
+ "exact_title_matches": [],
115
+ "fuzzy_title_matches": [],
116
+ "item_id": "a257b1ce-1af7-4dfc-ae38-ec67ef877689",
117
+ "title": "Komputerowa grafika inżynierska. Ćwiczenia do programu AutoCAD 2023"
118
+ }
119
+ ],
120
+ "target": "SlayerLab/polish-dynaword:data/biblioteka_nauki",
121
+ "target_revision": "02bcb0b5f991a30f8454c6444f701633b71f69d4",
122
+ "target_rows": 42071,
123
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate"
124
+ },
125
+ "cross_source_dedup": "pending target integration",
126
+ "exact_dedup": true,
127
+ "license_gate": "CC-BY-SA-4.0 in item and matched PDF bitstream metadata",
128
+ "limitations": [
129
+ "PDF extraction may flatten tables and equations",
130
+ "third-party figures and quoted material are not included as images but textual excerpts require review",
131
+ "isolated PDF extraction replacement characters are represented as [UNREADABLE_GLYPH]",
132
+ "pattern checks are not comprehensive de-identification",
133
+ "pilot yield must not be extrapolated without a full inventory run"
134
+ ],
135
+ "near_dedup": "exact 5-word-shingle Jaccard >= 0.90 within pilot",
136
+ "pii_pattern_matches": {
137
+ "email": 2,
138
+ "labelled_phone": 0
139
+ },
140
+ "scope": "pilot target 20; acquired 8; not a completeness claim",
141
+ "target_reached": false
142
+ },
143
+ "produced_by": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0"
144
+ },
145
+ {
146
+ "artifact": "artifacts/overlap_audit.json",
147
+ "content_address": "2557b13a55ad40599070cb1101af5fd74c46247e527a525b5f06543ab0645101",
148
+ "id": "evidence:overlap:2557b13a55ad40599070cb1101af5fd74c46247e527a525b5f06543ab0645101",
149
+ "observation_type": "metadata_overlap_audit",
150
+ "produced_by": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0"
151
+ },
152
+ {
153
+ "artifact": "artifacts/target_audit.json",
154
+ "content_address": "cddb52e9a3f5dc34073ecc22828028965a8578f2dad4c73036ca3cfa0178c303",
155
+ "id": "evidence:target-audit:cddb52e9a3f5dc34073ecc22828028965a8578f2dad4c73036ca3cfa0178c303",
156
+ "observation_type": "target_registry_audit",
157
+ "produced_by": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0"
158
+ }
159
+ ],
160
+ "objects": [
161
+ {
162
+ "id": "object:source:rock-pollub",
163
+ "type": "Source"
164
+ },
165
+ {
166
+ "id": "object:dataset:rock-pollub-pl-pilot",
167
+ "type": "Dataset"
168
+ }
169
+ ],
170
+ "pending": [
171
+ "Biblioteka Nauki text overlap",
172
+ "full collection inventory",
173
+ "cross-source deduplication",
174
+ "benchmark contamination check",
175
+ "legal review of third-party textual excerpts",
176
+ "controlled training ablation"
177
+ ],
178
+ "protocols": [
179
+ {
180
+ "id": "protocol:rock-pilot-v1",
181
+ "procedure": "item+PDF rights gate, matched repository text, normalization, PII patterns, exact/near dedup"
182
+ }
183
+ ],
184
+ "relations": [
185
+ {
186
+ "predicate": "DERIVED_FROM",
187
+ "source": "version:dataset:18ea2bb4ce1035ac7d39295f627d43da02a2959baddd52fab901970ed0fae9eb",
188
+ "target": "version:source:ae3d159ce612b8088f43097ff3d16a55ba8e8807ad3b3b4e8b2866ace23e543d"
189
+ },
190
+ {
191
+ "predicate": "GENERATED_BY",
192
+ "source": "version:dataset:18ea2bb4ce1035ac7d39295f627d43da02a2959baddd52fab901970ed0fae9eb",
193
+ "target": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0"
194
+ },
195
+ {
196
+ "predicate": "VALIDATED_AGAINST",
197
+ "source": "version:dataset:18ea2bb4ce1035ac7d39295f627d43da02a2959baddd52fab901970ed0fae9eb",
198
+ "target": "hf:dataset:SlayerLab/polish-dynaword@02bcb0b5f991a30f8454c6444f701633b71f69d4"
199
+ }
200
+ ],
201
+ "runs": [
202
+ {
203
+ "actor": "actor:codex",
204
+ "finished_at": "2026-09-08T16:46:45.891136+00:00",
205
+ "id": "run:324c1f246ff79d11e768795cddc0709ebec0a8ef3b2c3b47c75539b4b2f1bea0",
206
+ "protocol": "protocol:rock-pilot-v1",
207
+ "started_at": "2026-09-08T16:26:05.196224+00:00",
208
+ "stats": {
209
+ "acquired": 8,
210
+ "added": "2026-09-08",
211
+ "author_coverage": 1.0,
212
+ "characters": 3380937,
213
+ "discovered_collection_items": 771,
214
+ "kept": 8,
215
+ "pilot_limit": 20,
216
+ "rejected": 0,
217
+ "sample_count": 8,
218
+ "tokens": 1177858
219
+ },
220
+ "success": true
221
+ }
222
+ ],
223
+ "schema": "slayer-research-ontology-profile-v1",
224
+ "versions": [
225
+ {
226
+ "content_address": "ae3d159ce612b8088f43097ff3d16a55ba8e8807ad3b3b4e8b2866ace23e543d",
227
+ "id": "version:source:ae3d159ce612b8088f43097ff3d16a55ba8e8807ad3b3b4e8b2866ace23e543d",
228
+ "object": "object:source:rock-pollub"
229
+ },
230
+ {
231
+ "content_address": "18ea2bb4ce1035ac7d39295f627d43da02a2959baddd52fab901970ed0fae9eb",
232
+ "id": "version:dataset:18ea2bb4ce1035ac7d39295f627d43da02a2959baddd52fab901970ed0fae9eb",
233
+ "object": "object:dataset:rock-pollub-pl-pilot"
234
+ }
235
+ ]
236
+ }
data/rock_pollub_pl/NOTICE.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Notice and attribution
2
+
3
+ Source collection: https://rock.pollub.pl/collections/a42db069-319d-4d51-88d1-490ee7e6bad8
4
+ Publisher policy: https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20
5
+
6
+ The eight retained books expose `CC-BY-SA-4.0` in both the item record and the metadata of the matched original PDF bitstream. Per-record authors, titles, source URLs, license evidence and source-file checksums are preserved in `artifacts/attribution.jsonl` and `artifacts/inventory.json`.
7
+
8
+ Transformations: PDF text extraction with pdfplumber, Unicode and whitespace normalization, page-number-only removal, line-wrap repair, limited email and labelled-phone redaction, and within-source exact/near deduplication. Images are excluded. Isolated unreadable PDF glyphs are represented as `[UNREADABLE_GLYPH]`. Attribution and ShareAlike obligations remain applicable.
data/rock_pollub_pl/rock_pollub_pl.attribution.jsonl ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {"author": "Gułkowski, Sławomir", "authors": ["Gułkowski, Sławomir"], "editors": [], "eisbn": ["978-83-7947-674-9"], "extracted_text": {"bytes": 312627, "extractor": "pdfplumber", "page_count": 171, "page_failures": [], "sha256": "a0e3089beb113db20ca75e48d146354245d20cf13d2ac5835e25b98c0cf374f2"}, "handle": "20.500.14629/24876", "id": "rock_pollub_pl_513c690d-72b3-4604-b62e-e21e44b91645", "isbn": ["978-83-7947-673-2"], "issued": ["2026"], "landing_url": "https://rock.pollub.pl/entities/publication/513c690d-72b3-4604-b62e-e21e44b91645", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 12633380, "checksum": {"checkSumAlgorithm": "MD5", "value": "f69d32dda85d12c91d9cd96a7bb3fe52"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/425c2883-2d3b-4260-b2ff-c07f6628f56d/content", "id": "425c2883-2d3b-4260-b2ff-c07f6628f56d", "name": "modelowanie_i_analiza_9788379476749.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "a98b86ec1cffd62336b4c708ed4cf18efea78088d55f35a0b2850fa326e577fc"}, "publisher": "Politechnika Lubelska", "subtype": ["Monograph"], "text_sha256": "4c8de49a4349d0cddc8110c7e8facf31dd3309a56d5029b62af92d65a75b2ae1", "title": "Modelowanie i analiza eksperymentalna parametrów pracy modułów fotowoltaicznych w warunkach rzeczywistych", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
2
+ {"author": "Szuster, Janusz J.", "authors": ["Szuster, Janusz J."], "editors": [], "eisbn": ["978-83-7947-647-3"], "extracted_text": {"bytes": 304945, "extractor": "pdfplumber", "page_count": 213, "page_failures": [], "sha256": "f557c50de3c272fafce1beeb75ee3bca816e2b966b631352001ee4221868ee46"}, "handle": "20.500.14629/24871", "id": "rock_pollub_pl_e9e7a67e-c405-4968-b87a-0ff169c7b3d1", "isbn": ["978-83-7947-646-6"], "issued": ["2026"], "landing_url": "https://rock.pollub.pl/entities/publication/e9e7a67e-c405-4968-b87a-0ff169c7b3d1", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 5813455, "checksum": {"checkSumAlgorithm": "MD5", "value": "20e8f6af489fbea09a84c4bb83eea9e0"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/b1a29ec6-ad9b-46ea-acc4-59d1c3fe2b0f/content", "id": "b1a29ec6-ad9b-46ea-acc4-59d1c3fe2b0f", "name": "MatematykaFinansowa_9788379476473.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "2d4ff03c21d753c44e3e80cec8b1af4ce3358591dd88b322c7756b7d022db957"}, "publisher": "Politechnika Lubelska", "subtype": ["Handbook"], "text_sha256": "9b67845bb49aa6b20c8a41f2566e09411d9b85e1542d71f3f8ba9daba4f9d42c", "title": "Ćwiczenia i zadania ze wstępu do matematyki finansowej", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
3
+ {"author": "Kulisz, Monika", "authors": ["Kulisz, Monika"], "editors": [], "eisbn": ["978-83-7947-636-7"], "extracted_text": {"bytes": 482449, "extractor": "pdfplumber", "page_count": 257, "page_failures": [], "sha256": "cb4cdd675df2221667c5cd3e458d60b55fec8da89a5e6f44c48a6ac44f644d28"}, "handle": "20.500.14629/18535", "id": "rock_pollub_pl_a6c38c5d-ba8f-47ac-a3e6-b50df14a595b", "isbn": ["978-83-7947-635-0"], "issued": ["2025"], "landing_url": "https://rock.pollub.pl/entities/publication/a6c38c5d-ba8f-47ac-a3e6-b50df14a595b", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 24706728, "checksum": {"checkSumAlgorithm": "MD5", "value": "553e78c2bdb6dae7c5967edf1dc80626"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/5710059d-e91e-48cd-b9f7-35a335e6f38e/content", "id": "5710059d-e91e-48cd-b9f7-35a335e6f38e", "name": "Dobor_architektury_9788379476367.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "845881788fccb341b0c77a5c51afc64da148bccfb8a3f5da0bc42494c799d0e2"}, "publisher": "Politechnika Lubelska", "subtype": ["Monograph"], "text_sha256": "eac5c74faf081d523cd7c2f3abcf3842629c770d6437aafffe099c8a52f92910", "title": "Dobór architektury i parametrów procesu uczenia sieci neuronowych w doskonaleniu procesów produkcyjnych", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
4
+ {"author": "Weinper, Katarzyna", "authors": [], "editors": ["Weinper, Katarzyna"], "eisbn": ["978-83-7947-652-7"], "extracted_text": {"bytes": 749850, "extractor": "pdfplumber", "page_count": 324, "page_failures": [], "sha256": "ea82e63ee099d5c4f3fee69434d835da9b3ee5cb0cb50eda15b06309dfa9131a"}, "handle": "20.500.14629/18743", "id": "rock_pollub_pl_903f22e1-a2ab-4231-a402-2bc9535c12f2", "isbn": ["978-83-7947-651-0"], "issued": ["2025"], "landing_url": "https://rock.pollub.pl/entities/publication/903f22e1-a2ab-4231-a402-2bc9535c12f2", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 11242006, "checksum": {"checkSumAlgorithm": "MD5", "value": "df8dc6047586f20b0a7e5aef3f2ef09a"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/028ebc18-0b71-4cfd-8799-58ca0c40b941/content", "id": "028ebc18-0b71-4cfd-8799-58ca0c40b941", "name": "Wyzwania_Wspolczesnego_9788379476527.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "899458fc20d68bb3e146cc9d6eef32229c17b1cde5e4629e90a1760bf949e412"}, "publisher": "Politechnika Lubelska", "subtype": ["Monograph"], "text_sha256": "28a7eb8b790116c641427e8ad681942cc058b9f0fac83658e720b875eca33983", "title": "Wyzwania współczesnego publikowania", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
5
+ {"author": "Wlaź, Paweł", "authors": ["Wlaź, Paweł"], "editors": [], "eisbn": ["978-83-7947-640-4"], "extracted_text": {"bytes": 179984, "extractor": "pdfplumber", "page_count": 124, "page_failures": [], "sha256": "bf16f790920e72199c9eddbe70922d941e89b8defd35e6c35e5401c304e5b9db"}, "handle": "20.500.14629/18557", "id": "rock_pollub_pl_0e26bff5-e51a-4d36-9524-fdef6e3e6ab7", "isbn": ["978-83-7947-639-8"], "issued": ["2025"], "landing_url": "https://rock.pollub.pl/entities/publication/0e26bff5-e51a-4d36-9524-fdef6e3e6ab7", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 3165127, "checksum": {"checkSumAlgorithm": "MD5", "value": "afb17dc3ebbcbed87c25aebc7c007ff7"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/a8f29876-c98e-4feb-be00-cd21541930ca/content", "id": "a8f29876-c98e-4feb-be00-cd21541930ca", "name": "Symulacje_MC_9788379476404.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "64d4df1dc99517c83a4a6d99ec1d613d8debc9a17e08e944fb564c26e172e454"}, "publisher": "Politechnika Lubelska", "subtype": ["Handbook"], "text_sha256": "aee9a79540fd25dd17e81c4f9eda021b45630fb722c3c1a293582384d8c72db5", "title": "Symulacje Monte Carlo. Teoria i zastosowania", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
6
+ {"author": "Kłosowski, Grzegorz", "authors": ["Kłosowski, Grzegorz"], "editors": [], "eisbn": ["978-83-7947-628-2"], "extracted_text": {"bytes": 420051, "extractor": "pdfplumber", "page_count": 223, "page_failures": [], "sha256": "6c036af4551875a4db4a2b97d765ca2279e6cf55654f5822d79d13656fa4b921"}, "handle": "20.500.14629/18428", "id": "rock_pollub_pl_032a14e5-5c8e-4153-9cf7-2dfd9e361e6d", "isbn": ["978-83-7947-627-5"], "issued": ["2025"], "landing_url": "https://rock.pollub.pl/entities/publication/032a14e5-5c8e-4153-9cf7-2dfd9e361e6d", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 44067073, "checksum": {"checkSumAlgorithm": "MD5", "value": "549565d7f323947cc6630a8db3fc97a2"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/99e482b2-ba18-42f0-82aa-4c47a831d550/content", "id": "99e482b2-ba18-42f0-82aa-4c47a831d550", "name": "Zastosowanie_uczenia_9788379476282.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "7879b3aaf589868bea40ec5af397e0a459785de150bd66ba51b3b63283111bc5"}, "publisher": "Politechnika Lubelska", "subtype": ["Monograph"], "text_sha256": "ed64bc684dd91eb110bcfe32b242560a33310a127c4c6eca060cc53c6adc2060", "title": "Zastosowanie uczenia maszynowego do obrazowania stanu zawilgocenia murów z wykorzystaniem tomografii impedancyjnej", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
7
+ {"author": "Zienkiewicz, Tadeusz; Zienkiewicz, Konrad", "authors": ["Zienkiewicz, Tadeusz", "Zienkiewicz, Konrad"], "editors": ["Zienkiewicz, Tadeusz"], "eisbn": ["978-83-7947-662-6"], "extracted_text": {"bytes": 1022411, "extractor": "pdfplumber", "page_count": 393, "page_failures": [], "sha256": "a9df4a08b74e654091b368e7ba1b9d4732bcaa2448301a2a65105b3655e636ef"}, "handle": "20.500.14629/18744", "id": "rock_pollub_pl_da87b1d3-7018-46fa-81bd-380f0780a1b3", "isbn": [], "issued": ["2025"], "landing_url": "https://rock.pollub.pl/entities/publication/da87b1d3-7018-46fa-81bd-380f0780a1b3", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 3569880, "checksum": {"checkSumAlgorithm": "MD5", "value": "bf6b100ecbc6a12ae37dbfe4be44d09d"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/8086c994-dd9a-449f-aeb9-e4edd06cbd95/content", "id": "8086c994-dd9a-449f-aeb9-e4edd06cbd95", "name": "Zarzadzanie_Wspolpraca_Instytucji__9788379476626.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "c75ae222fb9362de9ed22e9f45550c3443d0617d31bb0befbee0c891347aa803"}, "publisher": "Politechnika Lubelska", "subtype": ["Monograph"], "text_sha256": "30863bfbfde1222ee44de8c1a8815a72ff9febec8a8b62ef85a6075d78358529", "title": "Zarządzanie współpracą instytucji państwa z diasporą. Przegląd teorii, analiza porównawcza wybranych państw", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
8
+ {"author": "Montusiewicz, Jerzy; Dziedzic, Krzysztof; Barszcz, Marcin; Urzędowski, Arkadiusz", "authors": ["Montusiewicz, Jerzy", "Dziedzic, Krzysztof", "Barszcz, Marcin", "Urzędowski, Arkadiusz"], "editors": [], "eisbn": [], "extracted_text": {"bytes": 182501, "extractor": "pdfplumber", "page_count": 153, "page_failures": [], "sha256": "09794f0d77aa5ec1fa00b027703d4e0d620778b5d53bcac2799da6963cb29b3b"}, "handle": "20.500.14629/211", "id": "rock_pollub_pl_a257b1ce-1af7-4dfc-ae38-ec67ef877689", "isbn": ["978–83–7947–568–1"], "issued": ["2023"], "landing_url": "https://rock.pollub.pl/entities/publication/a257b1ce-1af7-4dfc-ae38-ec67ef877689", "license": "CC-BY-SA-4.0", "license_evidence": {"item": ["CC-BY-SA-4.0"], "pdf_bitstream": ["CC-BY-SA 4.0"]}, "license_policy_url": "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "pdf": {"bytes": 12577248, "checksum": {"checkSumAlgorithm": "MD5", "value": "55c99ba8c2962c763c847386deabd2ca"}, "content_url": "https://rock.pollub.pl/server/api/core/bitstreams/75143e05-fdbc-4af3-ad39-07ad2cfa0c15/content", "id": "75143e05-fdbc-4af3-ad39-07ad2cfa0c15", "name": "AutoCAD2023.pdf", "rights": ["CC-BY-SA 4.0"], "sha256": "e6831f3e9c05555815d61e97a146b878fc49bf992374411fda4ded824f31d8ee"}, "publisher": "Politechnika Lubelska", "subtype": ["Handbook"], "text_sha256": "bebc8b603695bdbfebc2a136c26f4f1aab5428cee5243fe6781102d2c3821514", "title": "Komputerowa grafika inżynierska. Ćwiczenia do programu AutoCAD 2023", "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization", "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]}
data/rock_pollub_pl/rock_pollub_pl.decisions.jsonl ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {"characters": 291633, "id": "rock_pollub_pl_513c690d-72b3-4604-b62e-e21e44b91645", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.7548699907074988, "reason": "include", "replacement_characters": 0, "selected": true}
2
+ {"characters": 247687, "id": "rock_pollub_pl_e9e7a67e-c405-4968-b87a-0ff169c7b3d1", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.6617666651863037, "reason": "include", "replacement_characters": 0, "selected": true}
3
+ {"characters": 452020, "id": "rock_pollub_pl_a6c38c5d-ba8f-47ac-a3e6-b50df14a595b", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.7953696739082341, "reason": "include", "replacement_characters": 1, "selected": true}
4
+ {"characters": 716909, "id": "rock_pollub_pl_903f22e1-a2ab-4231-a402-2bc9535c12f2", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.8020348468215631, "reason": "include", "replacement_characters": 0, "selected": true}
5
+ {"characters": 152666, "id": "rock_pollub_pl_0e26bff5-e51a-4d36-9524-fdef6e3e6ab7", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.7383372853156565, "reason": "include", "replacement_characters": 0, "selected": true}
6
+ {"characters": 391855, "id": "rock_pollub_pl_032a14e5-5c8e-4153-9cf7-2dfd9e361e6d", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.8003240994755714, "reason": "include", "replacement_characters": 1, "selected": true}
7
+ {"characters": 959348, "id": "rock_pollub_pl_da87b1d3-7018-46fa-81bd-380f0780a1b3", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.8103201340910702, "reason": "include", "replacement_characters": 0, "selected": true}
8
+ {"characters": 168819, "id": "rock_pollub_pl_a257b1ce-1af7-4dfc-ae38-ec67ef877689", "language": "pl", "language_confidence": 1.0, "letter_ratio": 0.7856935534507372, "reason": "include", "replacement_characters": 0, "selected": true}
data/rock_pollub_pl/rock_pollub_pl.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - pl
5
+ task_categories:
6
+ - text-generation
7
+ configs:
8
+ - config_name: default
9
+ data_files:
10
+ - split: train
11
+ path: data/train-00000-of-00001.parquet
12
+ ---
13
+
14
+ # ROCK Politechnika Lubelska PL books
15
+
16
+ A fail-closed Polish academic-book subset extracted from the official ROCK repository of Lublin University of Technology.
17
+
18
+ - Retained books: 8
19
+ - Text characters: 3,380,937
20
+ - Tokens: 1,177,858 (`cl100k_base` proxy)
21
+ - Author coverage: 100.0%
22
+ - License: CC BY-SA 4.0, confirmed for every retained item and matched PDF bitstream
23
+ - Source period: 2023-2026
24
+
25
+ The acquisition target was 20 books, but only eight passed the conservative per-file rights gate. The other inspected candidates are not included. See `NOTICE.md` and `artifacts/` for attribution, decisions, the source inventory, deterministic complete-record samples, QA, checksums, overlap audit and Slayer ontology manifest.
26
+
27
+ ## Limitations
28
+
29
+ PDF extraction can flatten tables and equations. Two isolated unreadable glyphs were marked explicitly. Pattern-based PII checks are not comprehensive de-identification. No title overlap was detected against the pinned `biblioteka_nauki` attribution column, but target-wide text deduplication, benchmark checks and controlled training ablations remain pending.
data/rock_pollub_pl/rock_pollub_pl.overlap_audit.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "candidate_records": 8,
3
+ "method": "normalized title substring; fallback SequenceMatcher >= 0.90 over attribution",
4
+ "observed_at": "2026-09-08T16:37:35.661794+00:00",
5
+ "records_with_exact_title_match": 0,
6
+ "records_with_fuzzy_title_match": 0,
7
+ "results": [
8
+ {
9
+ "exact_title_matches": [],
10
+ "fuzzy_title_matches": [],
11
+ "item_id": "513c690d-72b3-4604-b62e-e21e44b91645",
12
+ "title": "Modelowanie i analiza eksperymentalna parametrów pracy modułów fotowoltaicznych w warunkach rzeczywistych"
13
+ },
14
+ {
15
+ "exact_title_matches": [],
16
+ "fuzzy_title_matches": [],
17
+ "item_id": "e9e7a67e-c405-4968-b87a-0ff169c7b3d1",
18
+ "title": "Ćwiczenia i zadania ze wstępu do matematyki finansowej"
19
+ },
20
+ {
21
+ "exact_title_matches": [],
22
+ "fuzzy_title_matches": [],
23
+ "item_id": "a6c38c5d-ba8f-47ac-a3e6-b50df14a595b",
24
+ "title": "Dobór architektury i parametrów procesu uczenia sieci neuronowych w doskonaleniu procesów produkcyjnych"
25
+ },
26
+ {
27
+ "exact_title_matches": [],
28
+ "fuzzy_title_matches": [],
29
+ "item_id": "903f22e1-a2ab-4231-a402-2bc9535c12f2",
30
+ "title": "Wyzwania współczesnego publikowania"
31
+ },
32
+ {
33
+ "exact_title_matches": [],
34
+ "fuzzy_title_matches": [],
35
+ "item_id": "0e26bff5-e51a-4d36-9524-fdef6e3e6ab7",
36
+ "title": "Symulacje Monte Carlo. Teoria i zastosowania"
37
+ },
38
+ {
39
+ "exact_title_matches": [],
40
+ "fuzzy_title_matches": [],
41
+ "item_id": "032a14e5-5c8e-4153-9cf7-2dfd9e361e6d",
42
+ "title": "Zastosowanie uczenia maszynowego do obrazowania stanu zawilgocenia murów z wykorzystaniem tomografii impedancyjnej"
43
+ },
44
+ {
45
+ "exact_title_matches": [],
46
+ "fuzzy_title_matches": [],
47
+ "item_id": "da87b1d3-7018-46fa-81bd-380f0780a1b3",
48
+ "title": "Zarządzanie współpracą instytucji państwa z diasporą. Przegląd teorii, analiza porównawcza wybranych państw"
49
+ },
50
+ {
51
+ "exact_title_matches": [],
52
+ "fuzzy_title_matches": [],
53
+ "item_id": "a257b1ce-1af7-4dfc-ae38-ec67ef877689",
54
+ "title": "Komputerowa grafika inżynierska. Ćwiczenia do programu AutoCAD 2023"
55
+ }
56
+ ],
57
+ "target": "SlayerLab/polish-dynaword:data/biblioteka_nauki",
58
+ "target_revision": "02bcb0b5f991a30f8454c6444f701633b71f69d4",
59
+ "target_rows": 42071,
60
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate"
61
+ }
data/rock_pollub_pl/rock_pollub_pl.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8fdae22e9c2f5307977f94c9e46d95fe5d198423f550a8087ee8d76fb09c1d9
3
+ size 1267933
data/rock_pollub_pl/rock_pollub_pl.qa.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "benchmark_overlap": "pending",
3
+ "biblioteka_nauki_overlap": {
4
+ "candidate_records": 8,
5
+ "method": "normalized title substring; fallback SequenceMatcher >= 0.90 over attribution",
6
+ "observed_at": "2026-09-08T16:37:35.661794+00:00",
7
+ "records_with_exact_title_match": 0,
8
+ "records_with_fuzzy_title_match": 0,
9
+ "results": [
10
+ {
11
+ "exact_title_matches": [],
12
+ "fuzzy_title_matches": [],
13
+ "item_id": "513c690d-72b3-4604-b62e-e21e44b91645",
14
+ "title": "Modelowanie i analiza eksperymentalna parametrów pracy modułów fotowoltaicznych w warunkach rzeczywistych"
15
+ },
16
+ {
17
+ "exact_title_matches": [],
18
+ "fuzzy_title_matches": [],
19
+ "item_id": "e9e7a67e-c405-4968-b87a-0ff169c7b3d1",
20
+ "title": "Ćwiczenia i zadania ze wstępu do matematyki finansowej"
21
+ },
22
+ {
23
+ "exact_title_matches": [],
24
+ "fuzzy_title_matches": [],
25
+ "item_id": "a6c38c5d-ba8f-47ac-a3e6-b50df14a595b",
26
+ "title": "Dobór architektury i parametrów procesu uczenia sieci neuronowych w doskonaleniu procesów produkcyjnych"
27
+ },
28
+ {
29
+ "exact_title_matches": [],
30
+ "fuzzy_title_matches": [],
31
+ "item_id": "903f22e1-a2ab-4231-a402-2bc9535c12f2",
32
+ "title": "Wyzwania współczesnego publikowania"
33
+ },
34
+ {
35
+ "exact_title_matches": [],
36
+ "fuzzy_title_matches": [],
37
+ "item_id": "0e26bff5-e51a-4d36-9524-fdef6e3e6ab7",
38
+ "title": "Symulacje Monte Carlo. Teoria i zastosowania"
39
+ },
40
+ {
41
+ "exact_title_matches": [],
42
+ "fuzzy_title_matches": [],
43
+ "item_id": "032a14e5-5c8e-4153-9cf7-2dfd9e361e6d",
44
+ "title": "Zastosowanie uczenia maszynowego do obrazowania stanu zawilgocenia murów z wykorzystaniem tomografii impedancyjnej"
45
+ },
46
+ {
47
+ "exact_title_matches": [],
48
+ "fuzzy_title_matches": [],
49
+ "item_id": "da87b1d3-7018-46fa-81bd-380f0780a1b3",
50
+ "title": "Zarządzanie współpracą instytucji państwa z diasporą. Przegląd teorii, analiza porównawcza wybranych państw"
51
+ },
52
+ {
53
+ "exact_title_matches": [],
54
+ "fuzzy_title_matches": [],
55
+ "item_id": "a257b1ce-1af7-4dfc-ae38-ec67ef877689",
56
+ "title": "Komputerowa grafika inżynierska. Ćwiczenia do programu AutoCAD 2023"
57
+ }
58
+ ],
59
+ "target": "SlayerLab/polish-dynaword:data/biblioteka_nauki",
60
+ "target_revision": "02bcb0b5f991a30f8454c6444f701633b71f69d4",
61
+ "target_rows": 42071,
62
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate"
63
+ },
64
+ "cross_source_dedup": "pending target integration",
65
+ "exact_dedup": true,
66
+ "license_gate": "CC-BY-SA-4.0 in item and matched PDF bitstream metadata",
67
+ "limitations": [
68
+ "PDF extraction may flatten tables and equations",
69
+ "third-party figures and quoted material are not included as images but textual excerpts require review",
70
+ "isolated PDF extraction replacement characters are represented as [UNREADABLE_GLYPH]",
71
+ "pattern checks are not comprehensive de-identification",
72
+ "pilot yield must not be extrapolated without a full inventory run"
73
+ ],
74
+ "near_dedup": "exact 5-word-shingle Jaccard >= 0.90 within pilot",
75
+ "pii_pattern_matches": {
76
+ "email": 2,
77
+ "labelled_phone": 0
78
+ },
79
+ "scope": "pilot target 20; acquired 8; not a completeness claim",
80
+ "target_reached": false
81
+ }
data/rock_pollub_pl/rock_pollub_pl.sample.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/rock_pollub_pl/rock_pollub_pl.stats.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "acquired": 8,
3
+ "added": "2026-09-08",
4
+ "author_coverage": 1.0,
5
+ "characters": 3380937,
6
+ "discovered_collection_items": 771,
7
+ "kept": 8,
8
+ "pilot_limit": 20,
9
+ "rejected": 0,
10
+ "sample_count": 8,
11
+ "tokens": 1177858
12
+ }
src/fetch_rock_pollub_pl.py ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build an auditable pilot from Polish CC BY-SA books in the ROCK repository."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import ast
7
+ from collections import Counter
8
+ from datetime import datetime, timezone
9
+ import hashlib
10
+ import json
11
+ import os
12
+ from pathlib import Path
13
+ import pprint
14
+ import re
15
+ import shutil
16
+ import subprocess
17
+ import sys
18
+ from difflib import SequenceMatcher
19
+ import unicodedata
20
+
21
+ import requests
22
+
23
+ SOURCE = "rock_pollub_pl"
24
+ OWN_REPO = "PiotrSty/rock-pollub-pl-books"
25
+ TARGET = "SlayerLab/polish-dynaword"
26
+ COLLECTION_ID = "a42db069-319d-4d51-88d1-490ee7e6bad8"
27
+ API = "https://rock.pollub.pl/server/api"
28
+ COLLECTION_URL = "https://rock.pollub.pl/collections/a42db069-319d-4d51-88d1-490ee7e6bad8"
29
+ POLICY_URL = "https://wpl.pollub.pl/pl/i/Polityka-publikacyjna/20"
30
+ LICENSE = "CC-BY-SA-4.0"
31
+ LICENSE_URL = "https://creativecommons.org/licenses/by-sa/4.0/"
32
+ FIELDS = ["id", "text", "source", "added", "created", "token_count", "license", "author"]
33
+ UA = "ROCKPollubCorpusResearch/0.1 (PiotrSty; open research pilot)"
34
+ BOOK_SUBTYPES = {"Monograph", "Handbook", "Workbook"}
35
+ MAX_PDF_BYTES = 50 * 1024 * 1024
36
+ EMAIL_RE = re.compile(r"(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b")
37
+ PHONE_RE = re.compile(r"(?i)(?:\btelefon|\btel\.)\s*:?[ \t]*(?:\+48[ \t]*)?\d(?:[ .-]?\d){8}\b")
38
+
39
+
40
+ def now():
41
+ return datetime.now(timezone.utc).isoformat()
42
+
43
+
44
+ def digest(value):
45
+ if not isinstance(value, bytes):
46
+ value = json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode("utf-8")
47
+ return hashlib.sha256(value).hexdigest()
48
+
49
+
50
+ def save(path, value):
51
+ path.parent.mkdir(parents=True, exist_ok=True)
52
+ path.write_text(json.dumps(value, ensure_ascii=False, sort_keys=True, indent=2) + "\n", encoding="utf-8")
53
+
54
+
55
+ def write_lines(path, rows):
56
+ path.parent.mkdir(parents=True, exist_ok=True)
57
+ path.write_text("".join(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n" for row in rows), encoding="utf-8")
58
+
59
+
60
+ def read_lines(path):
61
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line]
62
+
63
+
64
+ def load(path):
65
+ return json.loads(path.read_text(encoding="utf-8"))
66
+
67
+
68
+ def values(metadata, key):
69
+ return [str(item.get("value", "")).strip() for item in metadata.get(key, []) if str(item.get("value", "")).strip()]
70
+
71
+
72
+ def request_json(url, params=None, attempts=3):
73
+ response = None
74
+ for attempt in range(attempts):
75
+ response = requests.get(url, params=params, headers={"User-Agent": UA}, timeout=(15, 30))
76
+ if response.status_code not in (429, 500, 502, 503, 504):
77
+ response.raise_for_status()
78
+ return response.json()
79
+ import time
80
+ time.sleep(2 ** attempt)
81
+ response.raise_for_status()
82
+
83
+
84
+ def download(url, path, attempts=3):
85
+ response = None
86
+ for attempt in range(attempts):
87
+ response = requests.get(url, headers={"User-Agent": UA}, timeout=(15, 120), stream=True)
88
+ if response.status_code not in (429, 500, 502, 503, 504):
89
+ response.raise_for_status()
90
+ with path.open("wb") as handle:
91
+ for block in response.iter_content(1024 * 1024):
92
+ if block:
93
+ handle.write(block)
94
+ return
95
+ import time
96
+ time.sleep(2 ** attempt)
97
+ response.raise_for_status()
98
+
99
+
100
+ def embedded(payload, name):
101
+ return payload.get("_embedded", {}).get(name, [])
102
+
103
+
104
+ def normalize(text):
105
+ text = unicodedata.normalize("NFKC", text or "").replace("\u00ad", "").replace("\u200b", "")
106
+ text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", "", text)
107
+ lines = [re.sub(r"[ \t\xa0]+", " ", line).strip() for line in text.splitlines()]
108
+ lines = [line for line in lines if not re.fullmatch(r"\d{1,4}", line)]
109
+ text = "\n".join(lines)
110
+ text = re.sub(r"(?<=\w)-\n(?=[a-ząćęłńóśźż])", "", text)
111
+ text = re.sub(r"(?<![.!?:;\n])\n(?!\n)(?=[a-ząćęłńóśźż])", " ", text)
112
+ return re.sub(r"\n{3,}", "\n\n", text).strip()
113
+
114
+
115
+ def normalize_title(text):
116
+ text = unicodedata.normalize("NFKD", text or "").casefold()
117
+ text = "".join(character for character in text if not unicodedata.combining(character))
118
+ return " ".join(re.findall(r"\w+", text))
119
+
120
+
121
+ def item_objects(payload):
122
+ search = payload.get("_embedded", {}).get("searchResult", {})
123
+ objects = search.get("_embedded", {}).get("objects", [])
124
+ return [item.get("_embedded", {}).get("indexableObject", {}) for item in objects]
125
+
126
+
127
+ def bundle(item_id, name):
128
+ payload = request_json(f"{API}/core/items/{item_id}/bundles", {"size": 20})
129
+ return next((item for item in embedded(payload, "bundles") if item.get("name") == name), None)
130
+
131
+
132
+ def bitstreams(bundle_id):
133
+ return embedded(request_json(f"{API}/core/bundles/{bundle_id}/bitstreams", {"size": 100}), "bitstreams")
134
+
135
+
136
+ def choose_pdf(item_id):
137
+ original = bundle(item_id, "ORIGINAL")
138
+ if not original:
139
+ raise ValueError("missing ORIGINAL bundle")
140
+ pdfs = [item for item in bitstreams(original["uuid"]) if item.get("name", "").casefold().endswith(".pdf")]
141
+ if not pdfs:
142
+ raise ValueError("no PDF in ORIGINAL bundle")
143
+ return max(pdfs, key=lambda item: (int(item.get("sizeBytes", 0)), item.get("name", "")))
144
+
145
+
146
+ def extract_pdf(path):
147
+ import pdfplumber
148
+ pages, failures = [], []
149
+ with pdfplumber.open(path) as document:
150
+ for index, page in enumerate(document.pages, 1):
151
+ try:
152
+ pages.append(page.extract_text() or "")
153
+ except Exception as error:
154
+ pages.append("")
155
+ failures.append({"page": index, "error": str(error)})
156
+ return "\n\n".join(pages), len(pages), failures
157
+
158
+
159
+ def candidate(item):
160
+ metadata = item.get("metadata", {})
161
+ return (
162
+ LICENSE in values(metadata, "dc.rights")
163
+ and "pl" in values(metadata, "dc.language")
164
+ and bool(BOOK_SUBTYPES & set(values(metadata, "dc.subtype")))
165
+ and "Book" in values(metadata, "dc.type")
166
+ )
167
+
168
+
169
+ def acquire(out, limit):
170
+ if (out / "inventory.json").exists():
171
+ raise ValueError("inventory exists; use a fresh directory for an immutable acquisition")
172
+ out.mkdir(parents=True, exist_ok=True)
173
+ raw = out / "raw_text"
174
+ raw.mkdir(exist_ok=True)
175
+ temp_pdf = out / ".current.pdf"
176
+ selected, rejected, pages = [], [], []
177
+ page = 0
178
+ while len(selected) < limit:
179
+ payload = request_json(f"{API}/discover/search/objects", [
180
+ ("scope", COLLECTION_ID), ("f.license", f"{LICENSE},equals"),
181
+ ("page", page), ("size", 100), ("sort", "dc.date.issued,DESC"),
182
+ ])
183
+ items = item_objects(payload)
184
+ if not items:
185
+ break
186
+ pages.append({"page": page, "sha256": digest(payload), "items": len(items)})
187
+ for item in items:
188
+ if len(selected) >= limit:
189
+ break
190
+ if not candidate(item):
191
+ continue
192
+ item_id = item["uuid"]
193
+ metadata = item["metadata"]
194
+ try:
195
+ print(f"Inspecting candidate {item_id}: {item.get('name', '')}", flush=True)
196
+ pdf = choose_pdf(item_id)
197
+ pdf_rights = values(pdf.get("metadata", {}), "dc.rights")
198
+ if LICENSE.replace("-", " ") not in pdf_rights and "CC-BY-SA 4.0" not in pdf_rights:
199
+ raise ValueError("original PDF bitstream lacks CC-BY-SA 4.0 evidence")
200
+ if int(pdf.get("sizeBytes", 0)) > MAX_PDF_BYTES:
201
+ raise ValueError(f"PDF exceeds pilot limit of {MAX_PDF_BYTES} bytes")
202
+ download(pdf["_links"]["content"]["href"], temp_pdf)
203
+ if temp_pdf.stat().st_size != int(pdf.get("sizeBytes", 0)):
204
+ raise ValueError("downloaded PDF byte count differs from repository metadata")
205
+ pdf_bytes = temp_pdf.read_bytes()
206
+ repository_checksum = pdf.get("checkSum") or {}
207
+ if repository_checksum.get("checkSumAlgorithm") == "MD5" and hashlib.md5(pdf_bytes).hexdigest() != repository_checksum.get("value"):
208
+ raise ValueError("downloaded PDF MD5 differs from repository metadata")
209
+ decoded, page_count, page_failures = extract_pdf(temp_pdf)
210
+ path = raw / f"{item_id}.txt"
211
+ path.write_text(decoded, encoding="utf-8")
212
+ selected.append({
213
+ "item_id": item_id, "title": item.get("name", ""), "handle": item.get("handle"),
214
+ "landing_url": f"https://rock.pollub.pl/entities/publication/{item_id}",
215
+ "metadata": metadata, "authors": values(metadata, "dc.contributor.author"),
216
+ "editors": values(metadata, "dc.contributor.editor"), "issued": values(metadata, "dc.date.issued"),
217
+ "subtype": values(metadata, "dc.subtype"), "isbn": values(metadata, "dc.identifier.isbn"),
218
+ "eisbn": values(metadata, "dc.identifier.eisbn"), "item_license": values(metadata, "dc.rights"),
219
+ "pdf": {"id": pdf["uuid"], "name": pdf["name"], "bytes": pdf.get("sizeBytes"),
220
+ "checksum": pdf.get("checkSum"), "sha256": digest(pdf_bytes), "rights": pdf_rights,
221
+ "content_url": pdf["_links"]["content"]["href"]},
222
+ "extracted_text": {"extractor": "pdfplumber", "bytes": path.stat().st_size,
223
+ "sha256": digest(path.read_bytes()), "page_count": page_count,
224
+ "page_failures": page_failures},
225
+ "observed_at": now(), "decoded_characters": len(decoded),
226
+ })
227
+ print(f"Acquired {len(selected)}/{limit}: {item.get('name', '')}", flush=True)
228
+ except Exception as error:
229
+ rejected.append({"item_id": item_id, "title": item.get("name", ""), "reason": str(error)})
230
+ print(f"Skipped {item_id}: {error}", flush=True)
231
+ finally:
232
+ temp_pdf.unlink(missing_ok=True)
233
+ page += 1
234
+ collection = request_json(f"{API}/core/collections/{COLLECTION_ID}")
235
+ inventory = {"source": SOURCE, "collection_id": COLLECTION_ID, "collection_url": COLLECTION_URL,
236
+ "collection_sha256": digest(collection), "collection_archived_items": collection.get("archivedItemsCount"),
237
+ "policy_url": POLICY_URL, "license": LICENSE, "limit": limit, "query_pages": pages,
238
+ "selected": selected, "acquisition_rejections": rejected, "observed_at": now(),
239
+ "target_reached": len(selected) == limit}
240
+ save(out / "inventory.json", inventory)
241
+ print(json.dumps({"selected": len(selected), "target": limit, "target_reached": len(selected) == limit,
242
+ "rejected_during_acquisition": len(rejected)}, ensure_ascii=False, indent=2))
243
+
244
+
245
+ def shingles(text):
246
+ words = re.findall(r"\w+", text.casefold())
247
+ return {" ".join(words[index:index + 5]) for index in range(max(0, len(words) - 4))}
248
+
249
+
250
+ def audit_overlap(out):
251
+ import pyarrow.parquet as pq
252
+ from huggingface_hub import HfApi, HfFileSystem
253
+
254
+ inventory = json.loads((out / "inventory.json").read_text(encoding="utf-8"))
255
+ fs = HfFileSystem()
256
+ revision = HfApi().dataset_info("SlayerLab/polish-dynaword").sha
257
+ remote = f"datasets/SlayerLab/polish-dynaword@{revision}/data/biblioteka_nauki/biblioteka_nauki.parquet"
258
+ with fs.open(remote, "rb") as handle:
259
+ table = pq.read_table(handle, columns=["id", "attribution"])
260
+ target = []
261
+ for row in table.to_pylist():
262
+ parts = row["attribution"].split(" | ")
263
+ title = parts[2] if len(parts) >= 4 else row["attribution"]
264
+ target.append((row["id"], row["attribution"], normalize_title(title)))
265
+ results = []
266
+ for record in inventory["selected"]:
267
+ title = normalize_title(record["title"])
268
+ exact = [{"id": row_id, "attribution": attribution} for row_id, attribution, normalized in target
269
+ if title and title in normalized]
270
+ fuzzy = []
271
+ if not exact:
272
+ ranked = sorted(((SequenceMatcher(None, title, normalized).ratio(), row_id, attribution)
273
+ for row_id, attribution, normalized in target), reverse=True)[:3]
274
+ fuzzy = [{"score": score, "id": row_id, "attribution": attribution}
275
+ for score, row_id, attribution in ranked if score >= 0.90]
276
+ results.append({"item_id": record["item_id"], "title": record["title"],
277
+ "exact_title_matches": exact, "fuzzy_title_matches": fuzzy})
278
+ report = {"target": "SlayerLab/polish-dynaword:data/biblioteka_nauki", "target_revision": revision,
279
+ "method": "normalized title substring; fallback SequenceMatcher >= 0.90 over attribution",
280
+ "target_rows": table.num_rows, "candidate_records": len(results),
281
+ "records_with_exact_title_match": sum(bool(row["exact_title_matches"]) for row in results),
282
+ "records_with_fuzzy_title_match": sum(bool(row["fuzzy_title_matches"]) for row in results),
283
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate",
284
+ "observed_at": now(), "results": results}
285
+ save(out / "overlap_audit.json", report)
286
+ print(json.dumps({key: report[key] for key in ("target_rows", "candidate_records",
287
+ "records_with_exact_title_match", "records_with_fuzzy_title_match")}, ensure_ascii=False, indent=2))
288
+
289
+
290
+ def build(out):
291
+ import pyarrow as pa
292
+ import pyarrow.parquet as pq
293
+ import tiktoken
294
+ from langid.langid import LanguageIdentifier, model
295
+
296
+ inventory = json.loads((out / "inventory.json").read_text(encoding="utf-8"))
297
+ encoder = tiktoken.get_encoding("cl100k_base")
298
+ identifier = LanguageIdentifier.from_modelstring(model, norm_probs=True)
299
+ identifier.set_languages(["pl", "en", "de", "uk", "ru"])
300
+ rows, attribution, decisions, seen, features = [], [], [], {}, {}
301
+ pii = Counter()
302
+ added = inventory["observed_at"][:10]
303
+ for record in inventory["selected"]:
304
+ path = out / "raw_text" / f"{record['item_id']}.txt"
305
+ payload = path.read_bytes()
306
+ if digest(payload) != record["extracted_text"]["sha256"]:
307
+ raise ValueError("text checksum mismatch: " + record["item_id"])
308
+ text = normalize(payload.decode("utf-8-sig"))
309
+ letters = len(re.findall(r"[A-Za-zĄĆĘŁŃÓŚŹŻąćęłńóśźż]", text))
310
+ replacement = text.count("\ufffd")
311
+ if replacement:
312
+ text = text.replace("\ufffd", "[UNREADABLE_GLYPH]")
313
+ language, confidence = identifier.classify(text[:30000]) if text else ("unknown", 0.0)
314
+ reason = ""
315
+ if len(text) < 5000:
316
+ reason = "too_little_extractable_text"
317
+ elif letters / max(len(text), 1) < 0.55:
318
+ reason = "low_letter_ratio"
319
+ elif replacement > 5 or replacement / max(len(text), 1) > 0.00001:
320
+ reason = "excessive_unreadable_glyphs"
321
+ elif language != "pl" and confidence >= 0.95:
322
+ reason = "non_polish"
323
+ text, emails = EMAIL_RE.subn("[REDACTED:EMAIL]", text)
324
+ text, phones = PHONE_RE.subn("[REDACTED:PHONE]", text)
325
+ pii.update(email=emails, labelled_phone=phones)
326
+ normalized_key = " ".join(text.casefold().split())
327
+ if not reason and normalized_key in seen:
328
+ reason = "normalized_duplicate"
329
+ current_features = shingles(text)
330
+ duplicate_of = None
331
+ duplicate_score = 0.0
332
+ if not reason:
333
+ for other_id, other_features in features.items():
334
+ score = len(current_features & other_features) / max(len(current_features | other_features), 1)
335
+ if score >= 0.90:
336
+ reason, duplicate_of, duplicate_score = "near_duplicate", other_id, score
337
+ break
338
+ row_id = f"{SOURCE}_{record['item_id']}"
339
+ decision = {"id": row_id, "selected": not bool(reason), "reason": reason or "include",
340
+ "language": language, "language_confidence": float(confidence), "characters": len(text),
341
+ "letter_ratio": letters / max(len(text), 1), "replacement_characters": replacement}
342
+ if duplicate_of:
343
+ decision.update(duplicate_of=duplicate_of, jaccard=duplicate_score)
344
+ decisions.append(decision)
345
+ if reason:
346
+ continue
347
+ seen[normalized_key] = row_id
348
+ features[row_id] = current_features
349
+ author = "; ".join(record["authors"] or record["editors"] or ["Politechnika Lubelska"])
350
+ created = record["issued"][0] if record["issued"] else "unknown"
351
+ row = {"id": row_id, "text": text, "source": SOURCE, "added": added, "created": created,
352
+ "token_count": len(encoder.encode_ordinary(text)), "license": LICENSE, "author": author}
353
+ rows.append(row)
354
+ attribution.append({"id": row_id, "title": record["title"], "author": author,
355
+ "authors": record["authors"], "editors": record["editors"], "publisher": "Politechnika Lubelska",
356
+ "subtype": record["subtype"], "issued": record["issued"], "isbn": record["isbn"], "eisbn": record["eisbn"],
357
+ "landing_url": record["landing_url"], "handle": record["handle"], "license": LICENSE,
358
+ "license_url": LICENSE_URL, "license_policy_url": POLICY_URL,
359
+ "license_evidence": {"item": record["item_license"], "pdf_bitstream": record["pdf"]["rights"]},
360
+ "pdf": record["pdf"], "extracted_text": record["extracted_text"], "text_sha256": digest(text.encode("utf-8")),
361
+ "transformations": ["pdfplumber page extraction", "Unicode/whitespace normalization",
362
+ "page-number-only removal", "line-wrap repair", "limited email/labelled-phone redaction"]})
363
+ root = out / "hf_repo"
364
+ (root / "data").mkdir(parents=True, exist_ok=True)
365
+ (root / "artifacts").mkdir(exist_ok=True)
366
+ schema = pa.schema([(field, pa.int64() if field == "token_count" else pa.string()) for field in FIELDS])
367
+ pq.write_table(pa.Table.from_pylist(rows, schema=schema), root / "data/train-00000-of-00001.parquet", compression="zstd")
368
+ write_lines(root / "artifacts/attribution.jsonl", attribution)
369
+ write_lines(root / "artifacts/decisions.jsonl", decisions)
370
+ sample = sorted(rows, key=lambda row: digest(("sample:" + row["id"]).encode()))[:12]
371
+ write_lines(root / "artifacts/sample.jsonl", sample)
372
+ inventory_public = dict(inventory)
373
+ save(root / "artifacts/inventory.json", inventory_public)
374
+ stats = {"pilot_limit": inventory["limit"], "discovered_collection_items": inventory["collection_archived_items"],
375
+ "acquired": len(inventory["selected"]), "kept": len(rows), "rejected": len(decisions) - len(rows),
376
+ "tokens": sum(row["token_count"] for row in rows), "characters": sum(len(row["text"]) for row in rows),
377
+ "author_coverage": sum(bool(row["author"]) for row in rows) / len(rows) if rows else 0,
378
+ "sample_count": len(sample), "added": added}
379
+ overlap_path = out / "overlap_audit.json"
380
+ overlap = json.loads(overlap_path.read_text(encoding="utf-8")) if overlap_path.exists() else None
381
+ if overlap:
382
+ save(root / "artifacts/overlap_audit.json", overlap)
383
+ target_audit_path = out / "target_audit.json"
384
+ target_audit = load(target_audit_path) if target_audit_path.exists() else None
385
+ if target_audit:
386
+ save(root / "artifacts/target_audit.json", target_audit)
387
+ qa = {"scope": f"pilot target {inventory['limit']}; acquired {len(inventory['selected'])}; not a completeness claim",
388
+ "target_reached": inventory.get("target_reached", len(inventory["selected"]) == inventory["limit"]),
389
+ "license_gate": "CC-BY-SA-4.0 in item and matched PDF bitstream metadata",
390
+ "pii_pattern_matches": dict(pii), "exact_dedup": True, "near_dedup": "exact 5-word-shingle Jaccard >= 0.90 within pilot",
391
+ "biblioteka_nauki_overlap": overlap or "pending title comparison", "cross_source_dedup": "pending target integration",
392
+ "benchmark_overlap": "pending", "limitations": ["PDF extraction may flatten tables and equations",
393
+ "third-party figures and quoted material are not included as images but textual excerpts require review",
394
+ "isolated PDF extraction replacement characters are represented as [UNREADABLE_GLYPH]",
395
+ "pattern checks are not comprehensive de-identification", "pilot yield must not be extrapolated without a full inventory run"]}
396
+ save(root / "artifacts/stats.json", stats)
397
+ save(root / "artifacts/qa.json", qa)
398
+ run = {"id": "run:" + digest({"script": digest(Path(__file__).read_bytes()), "inventory": digest(inventory)}),
399
+ "protocol": "protocol:rock-pilot-v1", "started_at": inventory["observed_at"], "finished_at": now(),
400
+ "success": True, "actor": "actor:codex", "stats": stats}
401
+ save(root / "artifacts/run.json", run)
402
+ checksum_exclusions = {"artifacts/checksums.json", "artifacts/ontology.json"}
403
+ checks = {path.relative_to(root).as_posix(): digest(path.read_bytes()) for path in sorted(root.rglob("*"))
404
+ if path.is_file() and path.relative_to(root).as_posix() not in checksum_exclusions}
405
+ save(root / "artifacts/checksums.json", checks)
406
+ evidence_id = "evidence:qa:" + digest(qa)
407
+ inventory_evidence_id = "evidence:inventory:" + digest(inventory)
408
+ overlap_evidence_id = "evidence:overlap:" + digest(overlap) if overlap else None
409
+ target_evidence_id = "evidence:target-audit:" + digest(target_audit) if target_audit else None
410
+ source_version = "version:source:" + digest({"inventory": inventory, "texts": [item["extracted_text"]["sha256"] for item in inventory["selected"]]})
411
+ dataset_version = "version:dataset:" + digest(checks)
412
+ ontology = {"schema": "slayer-research-ontology-profile-v1",
413
+ "objects": [{"id": "object:source:rock-pollub", "type": "Source"}, {"id": "object:dataset:rock-pollub-pl-pilot", "type": "Dataset"}],
414
+ "versions": [{"id": source_version, "object": "object:source:rock-pollub", "content_address": source_version.rsplit(":", 1)[-1]},
415
+ {"id": dataset_version, "object": "object:dataset:rock-pollub-pl-pilot", "content_address": dataset_version.rsplit(":", 1)[-1]}],
416
+ "protocols": [{"id": "protocol:rock-pilot-v1", "procedure": "item+PDF rights gate, matched repository text, normalization, PII patterns, exact/near dedup"}],
417
+ "runs": [run], "evidence": [
418
+ {"id": inventory_evidence_id, "observation_type": "source_inventory",
419
+ "artifact": "artifacts/inventory.json", "content_address": digest(inventory), "produced_by": run["id"]},
420
+ {"id": evidence_id, "observation_type": "pilot_qa", "payload": qa, "produced_by": run["id"]},
421
+ ] + ([{"id": overlap_evidence_id, "observation_type": "metadata_overlap_audit",
422
+ "artifact": "artifacts/overlap_audit.json", "content_address": digest(overlap),
423
+ "produced_by": run["id"]}] if overlap else []) +
424
+ ([{"id": target_evidence_id, "observation_type": "target_registry_audit",
425
+ "artifact": "artifacts/target_audit.json", "content_address": digest(target_audit),
426
+ "produced_by": run["id"]}] if target_audit else []),
427
+ "claims": [{"id": "claim:pilot-eligibility", "statement": "Retained pilot records have Polish book metadata and CC BY-SA 4.0 evidence at item and matched PDF-bitstream level.",
428
+ "supported_by": [inventory_evidence_id, evidence_id], "falsification_condition": "A retained record lacks Polish book metadata or either rights assertion."},
429
+ {"id": "claim:no-title-overlap-detected", "statement": "No exact or near title match was detected against the current Biblioteka Nauki attribution column.",
430
+ "supported_by": [overlap_evidence_id] if overlap else [evidence_id],
431
+ "falsification_condition": "The recorded comparison contains a match, or a rerun against the pinned target version finds one."},
432
+ {"id": "claim:not-registered-at-audit", "statement": "The source key and a matching ROCK/Pollub proposal were absent from the pinned DynaWord registry and discussion list at audit time.",
433
+ "supported_by": [target_evidence_id] if target_audit else [evidence_id],
434
+ "falsification_condition": "The pinned registry or recorded discussion list contains this source."},
435
+ {"id": "claim:training-value-untested", "statement": "Training benefit and full-corpus novelty remain untested hypotheses.",
436
+ "supported_by": [evidence_id], "falsification_condition": "A controlled ablation and target-wide overlap analysis establish those properties."}],
437
+ "actors": [{"id": "actor:piotrsty", "type": "Contributor"}, {"id": "actor:politechnika-lubelska", "type": "Organization"},
438
+ {"id": "actor:codex", "type": "Agent"}],
439
+ "relations": [{"source": dataset_version, "predicate": "DERIVED_FROM", "target": source_version},
440
+ {"source": dataset_version, "predicate": "GENERATED_BY", "target": run["id"]}] +
441
+ ([{"source": dataset_version, "predicate": "VALIDATED_AGAINST",
442
+ "target": "hf:dataset:SlayerLab/polish-dynaword@" + target_audit["revision"]}]
443
+ if target_audit else []),
444
+ "pending": ["Biblioteka Nauki text overlap", "full collection inventory", "cross-source deduplication",
445
+ "benchmark contamination check", "legal review of third-party textual excerpts", "controlled training ablation"]}
446
+ save(root / "artifacts/ontology.json", ontology)
447
+ print(json.dumps(stats, ensure_ascii=False, indent=2))
448
+
449
+
450
+ def verify(out):
451
+ import pyarrow.parquet as pq
452
+ root = out / "hf_repo"
453
+ table = pq.read_table(root / "data/train-00000-of-00001.parquet")
454
+ rows = table.to_pylist()
455
+ stats = json.loads((root / "artifacts/stats.json").read_text(encoding="utf-8"))
456
+ decisions = read_lines(root / "artifacts/decisions.jsonl")
457
+ attribution = read_lines(root / "artifacts/attribution.jsonl")
458
+ sample = read_lines(root / "artifacts/sample.jsonl")
459
+ assert table.column_names == FIELDS
460
+ assert len(rows) == stats["kept"] == len(attribution)
461
+ assert len(decisions) == stats["acquired"]
462
+ assert sum(item["selected"] for item in decisions) == len(rows)
463
+ assert sum(row["token_count"] for row in rows) == stats["tokens"]
464
+ assert all(row["source"] == SOURCE and row["license"] == LICENSE and row["author"] for row in rows)
465
+ assert all(EMAIL_RE.search(row["text"]) is None for row in rows)
466
+ by_id = {row["id"]: row for row in rows}
467
+ assert len(sample) == stats["sample_count"] and all(by_id[row["id"]] == row for row in sample)
468
+ manifest = json.loads((root / "artifacts/ontology.json").read_text(encoding="utf-8"))
469
+ evidence = {item["id"] for item in manifest["evidence"]}
470
+ assert all(item["falsification_condition"] and set(item["supported_by"]) <= evidence for item in manifest["claims"])
471
+ checks = json.loads((root / "artifacts/checksums.json").read_text(encoding="utf-8"))
472
+ assert "artifacts/checksums.json" not in checks and "artifacts/ontology.json" not in checks
473
+ assert all((root / relative).is_file() and digest((root / relative).read_bytes()) == checksum
474
+ for relative, checksum in checks.items())
475
+ for item in manifest["evidence"]:
476
+ if item.get("artifact"):
477
+ artifact = root / item["artifact"]
478
+ assert artifact.is_file() and digest(json.loads(artifact.read_text(encoding="utf-8"))) == item["content_address"]
479
+ print(json.dumps({"verified": True, **stats}, ensure_ascii=False, indent=2))
480
+
481
+
482
+ def checksum_map(root):
483
+ excluded = {"artifacts/checksums.json", "artifacts/ontology.json"}
484
+ return {path.relative_to(root).as_posix(): digest(path.read_bytes()) for path in sorted(root.rglob("*"))
485
+ if path.is_file() and path.relative_to(root).as_posix() not in excluded}
486
+
487
+
488
+ def registry(base):
489
+ tree = ast.parse(base)
490
+ node = next(item.value for item in tree.body if isinstance(item, ast.Assign)
491
+ and any(isinstance(target, ast.Name) and target.id == "SOURCES" for target in item.targets))
492
+ if SOURCE in ast.literal_eval(node):
493
+ raise ValueError("source already registered")
494
+ entry = {
495
+ "file_key": SOURCE,
496
+ "pretty": "ROCK Politechnika Lubelska - Polish academic books",
497
+ "license": LICENSE,
498
+ "license_spdx": LICENSE,
499
+ "traceable": "Each retained book has CC BY-SA 4.0 evidence in both the item record and matched original-PDF bitstream metadata; URLs, checksums, attribution and exclusions are preserved.",
500
+ "upstream": COLLECTION_URL,
501
+ "provenance": f"Fetched directly from the official ROCK repository by src/fetch_{SOURCE}.py; only the fail-closed eight-record subset with item- and PDF-level rights evidence is included.",
502
+ "domain": "academic/technical",
503
+ "created": "2023-2026",
504
+ "is_ocr": False,
505
+ "custom_datasheet": True,
506
+ }
507
+ offset = sum(len(line) for line in base.splitlines(keepends=True)[:node.lineno - 1]) + node.col_offset + 1
508
+ return base[:offset] + "\n " + repr(SOURCE) + ": " + pprint.pformat(
509
+ entry, width=96, sort_dicts=False).replace("\n", "\n ") + "," + base[offset:]
510
+
511
+
512
+ def prepare(out, target_revision):
513
+ root = out / "hf_repo"
514
+ (root / "src").mkdir(parents=True, exist_ok=True)
515
+ shutil.copy2(Path(__file__), root / f"src/fetch_{SOURCE}.py")
516
+ shutil.copy2(Path(__file__).with_name("rock_pollub_requirements.txt"), root / "src/requirements.txt")
517
+ shutil.copy2(Path(__file__).with_name("test_rock_pollub_contribution.py"), root / "src/test_rock_pollub_contribution.py")
518
+ stats = load(root / "artifacts/stats.json")
519
+ notice = f"""# Notice and attribution
520
+
521
+ Source collection: {COLLECTION_URL}
522
+ Publisher policy: {POLICY_URL}
523
+
524
+ The eight retained books expose `{LICENSE}` in both the item record and the metadata of the matched original PDF bitstream. Per-record authors, titles, source URLs, license evidence and source-file checksums are preserved in `artifacts/attribution.jsonl` and `artifacts/inventory.json`.
525
+
526
+ Transformations: PDF text extraction with pdfplumber, Unicode and whitespace normalization, page-number-only removal, line-wrap repair, limited email and labelled-phone redaction, and within-source exact/near deduplication. Images are excluded. Isolated unreadable PDF glyphs are represented as `[UNREADABLE_GLYPH]`. Attribution and ShareAlike obligations remain applicable.
527
+ """
528
+ (root / "NOTICE.md").write_text(notice, encoding="utf-8")
529
+ readme = f"""---
530
+ license: cc-by-sa-4.0
531
+ language:
532
+ - pl
533
+ task_categories:
534
+ - text-generation
535
+ configs:
536
+ - config_name: default
537
+ data_files:
538
+ - split: train
539
+ path: data/train-00000-of-00001.parquet
540
+ ---
541
+
542
+ # ROCK Politechnika Lubelska PL books
543
+
544
+ A fail-closed Polish academic-book subset extracted from the official ROCK repository of Lublin University of Technology.
545
+
546
+ - Retained books: {stats['kept']}
547
+ - Text characters: {stats['characters']:,}
548
+ - Tokens: {stats['tokens']:,} (`cl100k_base` proxy)
549
+ - Author coverage: {stats['author_coverage']:.1%}
550
+ - License: CC BY-SA 4.0, confirmed for every retained item and matched PDF bitstream
551
+ - Source period: 2023-2026
552
+
553
+ The acquisition target was 20 books, but only eight passed the conservative per-file rights gate. The other inspected candidates are not included. See `NOTICE.md` and `artifacts/` for attribution, decisions, the source inventory, deterministic complete-record samples, QA, checksums, overlap audit and Slayer ontology manifest.
554
+
555
+ ## Limitations
556
+
557
+ PDF extraction can flatten tables and equations. Two isolated unreadable glyphs were marked explicitly. Pattern-based PII checks are not comprehensive de-identification. No title overlap was detected against the pinned `biblioteka_nauki` attribution column, but target-wide text deduplication, benchmark checks and controlled training ablations remain pending.
558
+ """
559
+ (root / "README.md").write_text(readme, encoding="utf-8")
560
+ build(out)
561
+ verify(out)
562
+ if load(out / "target_audit.json")["revision"] != target_revision:
563
+ raise ValueError("target audit revision mismatch")
564
+
565
+
566
+ def hf_token():
567
+ value = os.environ.get("HF_TOKEN")
568
+ if not value and os.name == "nt":
569
+ import winreg
570
+ with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Environment") as key:
571
+ value = winreg.QueryValueEx(key, "HF_TOKEN")[0]
572
+ if not value or not value.startswith("hf_"):
573
+ raise ValueError("HF_TOKEN unavailable")
574
+ return value
575
+
576
+
577
+ def all_files(root):
578
+ return [path for path in sorted(root.rglob("*")) if path.is_file()
579
+ and "__pycache__" not in path.parts and ".pytest_cache" not in path.parts]
580
+
581
+
582
+ def assemble_pr(out, base, source_commit):
583
+ root = out / "hf_repo"
584
+ pr = out / "dynaword_pr"
585
+ data = pr / "data" / SOURCE
586
+ data.mkdir(parents=True, exist_ok=True)
587
+ (pr / "src").mkdir(exist_ok=True)
588
+ (pr / "artifacts").mkdir(exist_ok=True)
589
+ shutil.copy2(root / "data/train-00000-of-00001.parquet", data / f"{SOURCE}.parquet")
590
+ for name in ("attribution.jsonl", "decisions.jsonl", "sample.jsonl", "stats.json", "qa.json", "overlap_audit.json"):
591
+ shutil.copy2(root / "artifacts" / name, data / f"{SOURCE}.{name}")
592
+ shutil.copy2(root / "NOTICE.md", data / "NOTICE.md")
593
+ shutil.copy2(root / "README.md", data / f"{SOURCE}.md")
594
+ shutil.copy2(root / "artifacts/ontology.json", pr / f"artifacts/{SOURCE}_ontology_manifest.json")
595
+ shutil.copy2(Path(__file__), pr / f"src/fetch_{SOURCE}.py")
596
+ shutil.copy2(Path(__file__).with_name("rock_pollub_requirements.txt"), pr / f"src/{SOURCE}_requirements.txt")
597
+ shutil.copy2(Path(__file__).with_name("test_rock_pollub_contribution.py"), pr / "src/test_rock_pollub_contribution.py")
598
+ (pr / "src/sources.py").write_text(registry(base), encoding="utf-8")
599
+ stats = load(root / "artifacts/stats.json")
600
+ description = f"""## Add eight Polish academic books from ROCK
601
+
602
+ Adds `{SOURCE}`: **{stats['kept']} complete books and {stats['tokens']:,} measured `cl100k_base` proxy tokens** from the official ROCK repository of Lublin University of Technology.
603
+
604
+ Source dataset: https://huggingface.co/datasets/{OWN_REPO}/tree/{source_commit}
605
+
606
+ ### Data sample
607
+
608
+ - [{stats['sample_count']} deterministic complete-record samples](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit}/artifacts/sample.jsonl)
609
+ - [Per-record attribution, source URLs and item/PDF rights evidence](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit}/artifacts/attribution.jsonl)
610
+ - [Fail-closed acquisition inventory and exclusions](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit}/artifacts/inventory.json)
611
+
612
+ ### Rights and method
613
+
614
+ Every retained record exposes CC BY-SA 4.0 in both the ROCK item record and the matched original PDF bitstream metadata. The publisher policy, source URLs, checksums and attribution are preserved. The acquisition target was 20 records; only these eight passed the conservative per-file gate. Text was extracted with pdfplumber, normalized, checked for limited PII patterns, and exact/near-deduplicated within source.
615
+
616
+ ### Overlap and Slayer ontology
617
+
618
+ No exact or fuzzy title match was detected against all 42,071 rows of `biblioteka_nauki` at pinned DynaWord revision `{load(out / 'overlap_audit.json')['target_revision']}`. This is metadata evidence, not target-wide text deduplication. The manifest separates content-addressed source/dataset Versions, Protocol, Run, Evidence, falsifiable Claims, Actors and typed lineage. Cross-source text deduplication, benchmark checks, review of quoted third-party text and controlled training ablations remain pending. This PR proposes a source, not a merged or stable release.
619
+ """
620
+ (out / "pr_description.md").write_text(description, encoding="utf-8")
621
+ return pr
622
+
623
+
624
+ def publish(out):
625
+ from huggingface_hub import CommitOperationAdd, HfApi
626
+
627
+ api = HfApi(token=hf_token())
628
+ if api.whoami()["name"].casefold() != "piotrsty":
629
+ raise ValueError("unexpected HF account")
630
+ target = api.dataset_info(TARGET)
631
+ registry_url = f"https://huggingface.co/datasets/{TARGET}/resolve/{target.sha}/src/sources.py"
632
+ response = requests.get(registry_url, headers={"User-Agent": UA}, timeout=(15, 60))
633
+ response.raise_for_status()
634
+ base = response.text
635
+ discussions = list(api.get_repo_discussions(TARGET, repo_type="dataset"))
636
+ matching = [{"num": item.num, "title": item.title, "status": item.status}
637
+ for item in discussions if "rock" in item.title.casefold() or "pollub" in item.title.casefold()]
638
+ if SOURCE in base or matching:
639
+ raise ValueError("ROCK source registration or proposal already exists")
640
+ target_audit = {"repository": TARGET, "revision": target.sha, "registry_sha256": digest(base.encode("utf-8")),
641
+ "discussion_count": len(discussions), "matching_discussions": matching, "observed_at": now()}
642
+ save(out / "target_audit.json", target_audit)
643
+ prepare(out, target.sha)
644
+ root = out / "hf_repo"
645
+ receipt_path = out / "publication.json"
646
+ receipt = load(receipt_path) if receipt_path.exists() else {}
647
+ if not receipt:
648
+ if api.repo_exists(OWN_REPO, repo_type="dataset"):
649
+ raise ValueError("own HF repository already exists without this run receipt")
650
+ api.create_repo(OWN_REPO, repo_type="dataset", private=True)
651
+ receipt = {"source_repo": OWN_REPO, "target_main_revision": target.sha, "created_at": now()}
652
+ save(receipt_path, receipt)
653
+ if receipt["target_main_revision"] != target.sha:
654
+ raise ValueError("target main changed since publication started; inspect before continuing")
655
+ if not receipt.get("source_commit"):
656
+ result = api.create_commit(OWN_REPO, repo_type="dataset",
657
+ commit_message="Add validated eight-book ROCK Polish corpus",
658
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(root).as_posix(), path_or_fileobj=str(path))
659
+ for path in all_files(root)])
660
+ receipt["source_commit"] = result.oid
661
+ save(receipt_path, receipt)
662
+ source_revision = receipt["source_commit"]
663
+ if not any(item.name == "v1.0.0" for item in api.list_repo_refs(OWN_REPO, repo_type="dataset").tags):
664
+ api.create_tag(OWN_REPO, repo_type="dataset", tag="v1.0.0", revision=source_revision)
665
+ api.update_repo_settings(OWN_REPO, repo_type="dataset", private=False)
666
+ pr = assemble_pr(out, base, source_revision)
667
+ subprocess.run([sys.executable, "-m", "pytest", "-q", str(pr / "src/test_rock_pollub_contribution.py")], check=True)
668
+ if not receipt.get("pr_url"):
669
+ result = api.create_commit(TARGET, repo_type="dataset", parent_commit=target.sha, create_pr=True,
670
+ commit_message="Add eight CC BY-SA 4.0 Polish academic books from ROCK",
671
+ commit_description=(out / "pr_description.md").read_text(encoding="utf-8"),
672
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(pr).as_posix(), path_or_fileobj=str(path))
673
+ for path in all_files(pr)])
674
+ receipt.update({"tag": "v1.0.0", "pr_url": result.pr_url, "pr_commit": result.oid, "published_at": now()})
675
+ save(receipt_path, receipt)
676
+ print(json.dumps(receipt, ensure_ascii=False, indent=2))
677
+
678
+
679
+ def audit(out):
680
+ from huggingface_hub import HfApi, hf_hub_download
681
+
682
+ api = HfApi(token=False)
683
+ receipt = load(out / "publication.json")
684
+ info = api.dataset_info(OWN_REPO)
685
+ if info.private or info.sha != receipt["source_commit"]:
686
+ raise ValueError("source repo visibility or revision mismatch")
687
+ tags = api.list_repo_refs(OWN_REPO, repo_type="dataset").tags
688
+ if not any(item.name == receipt["tag"] and item.target_commit == info.sha for item in tags):
689
+ raise ValueError("release tag mismatch")
690
+ number = int(receipt["pr_url"].rsplit("/", 1)[-1])
691
+ discussion = api.get_discussion_details(TARGET, number, repo_type="dataset")
692
+ pr_info = api.dataset_info(TARGET, revision=f"refs/pr/{number}")
693
+ if not discussion.is_pull_request or pr_info.sha != receipt["pr_commit"]:
694
+ raise ValueError("PR identity mismatch")
695
+ checked = []
696
+ cache = out / "remote_cache"
697
+ for repo, revision, root in ((OWN_REPO, info.sha, out / "hf_repo"), (TARGET, pr_info.sha, out / "dynaword_pr")):
698
+ for path in all_files(root):
699
+ name = path.relative_to(root).as_posix()
700
+ remote = Path(hf_hub_download(repo, name, repo_type="dataset", revision=revision,
701
+ token=False, cache_dir=str(cache)))
702
+ if digest(remote.read_bytes()) != digest(path.read_bytes()):
703
+ raise ValueError("remote mismatch: " + name)
704
+ checked.append({"repo": repo, "revision": revision, "path": name,
705
+ "sha256": digest(remote.read_bytes())})
706
+ result = {"observed_at": now(), "source_revision": info.sha, "pr_revision": pr_info.sha,
707
+ "pr_status": discussion.status, "target_main_revision": api.dataset_info(TARGET).sha,
708
+ "verified_files": checked}
709
+ save(out / "publication_audit.json", result)
710
+ shutil.rmtree(cache, ignore_errors=True)
711
+ print(json.dumps({**result, "verified_files": len(checked)}, ensure_ascii=False, indent=2))
712
+
713
+
714
+ if __name__ == "__main__":
715
+ parser = argparse.ArgumentParser(description=__doc__)
716
+ parser.add_argument("--output", type=Path, required=True)
717
+ parser.add_argument("--limit", type=int, default=20)
718
+ parser.add_argument("command", choices=["acquire", "audit_overlap", "build", "verify", "publish", "audit"])
719
+ args = parser.parse_args()
720
+ acquire(args.output, args.limit) if args.command == "acquire" else globals()[args.command](args.output)
src/rock_pollub_pl_requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ requests==2.32.5
2
+ pdfplumber==0.11.9
3
+ pyarrow==23.0.1
4
+ tiktoken==0.12.0
5
+ langid==1.1.6
6
+ huggingface_hub>=0.36,<2
7
+ pytest>=8,<10
src/sources.py CHANGED
@@ -1,474 +1,489 @@
1
- """Source registry for Polish DynaWord.
2
-
3
- Each entry = one openly-licensed, *traceable* human-text source (paper 2508.02271,
4
- principle: open+traceable licensing). The `traceable` field documents WHY the
5
- license holds (not just "it's public domain") — e.g. statutory basis or upstream
6
- license — as required by the Dynaword guidelines.
7
-
8
- Provenance note: data is pulled from SpeakLeash's public redistribution
9
- (iDrive e2 bucket) of these upstream sources; SpeakLeash is credited as the
10
- intermediate aggregator, upstream license/attribution is preserved per source.
11
- """
12
-
13
- # clean-6: passed the copyright review (2026-06-15). open_subtitles excluded
14
- # (derivative of copyrighted film dialogue — same lesson as Danish Gigaword).
15
- # Large cultural/academic sources require per-record rights metadata and should
16
- # be rebuilt from direct upstream/export scripts rather than blind SpeakLeash pulls.
17
- SOURCES = {
18
- "wikipedia": {
19
- "added": "2026-07-02",
20
- "release": "0.2.0",
21
- "speakleash_key": "plwiki",
22
- "pretty": "Polish Wikipedia",
23
- "license": "CC-BY-SA-3.0",
24
- "license_spdx": "CC-BY-SA-3.0",
25
- "traceable": "Wikimedia dumps explicitly released under CC-BY-SA 3.0; "
26
- "attribution to contributors + share-alike preserved.",
27
- "upstream": "https://dumps.wikimedia.org/plwiki/latest/",
28
- "domain": "encyclopedic",
29
- "created": "2001-01-15, 2026-06-14",
30
- "is_ocr": False,
31
- },
32
- "wikisource": {
33
- "added": "2026-07-02",
34
- "release": "0.2.0",
35
- "speakleash_key": "plwikisource",
36
- "pretty": "Polish Wikisource",
37
- "license": "CC-BY-SA-3.0",
38
- "license_spdx": "CC-BY-SA-3.0",
39
- "traceable": "Wikimedia dumps under CC-BY-SA 3.0; underlying texts are "
40
- "public-domain works transcribed by the community.",
41
- "upstream": "https://dumps.wikimedia.org/plwikisource/latest/",
42
- "domain": "books/source-texts",
43
- "created": "2005-01-01, 2026-06-14",
44
- "is_ocr": False,
45
- },
46
- "wiktionary_examples": {
47
- "added": "2026-07-19",
48
- "release": None,
49
- "file_key": "wiktionary_examples",
50
- "pretty": "Polish Wiktionary usage examples",
51
- "provenance": "Parsed directly from the official Wikimedia dump "
52
- "(plwiktionary-latest-pages-articles.xml.bz2); not routed "
53
- "through SpeakLeash. Usage-example sections of Polish-language "
54
- "entries extracted and grouped one document per headword.",
55
- "license": "CC-BY-SA-3.0",
56
- "license_spdx": "CC-BY-SA-3.0",
57
- "traceable": "Wikimedia dumps explicitly released under CC-BY-SA 3.0; "
58
- "attribution to contributors + share-alike preserved. "
59
- "Derived subset: usage-example sections from Polish-language "
60
- "entries only, grouped one document per headword.",
61
- "upstream": "https://dumps.wikimedia.org/plwiktionary/latest/",
62
- "domain": "lexicographic",
63
- "created": "2004-03-22, 2026-08-15",
64
- "is_ocr": False,
65
- },
66
- "eurlex": {
67
- "added": "2026-07-02",
68
- "release": "0.2.0",
69
- "speakleash_key": "eurlex_corpus",
70
- "pretty": "EUR-Lex (EU legal acts, Polish)",
71
- "license": "CC-BY-4.0",
72
- "license_spdx": "CC-BY-4.0",
73
- "traceable": "EU documents reusable under Commission Decision 2011/833/EU; "
74
- "normative acts fall outside copyright (PL art. 4 pr. aut.). "
75
- "Reuse authorised with source acknowledgement.",
76
- "upstream": "https://eur-lex.europa.eu",
77
- "domain": "legal",
78
- "created": "1952-01-01, 2024-12-31",
79
- "is_ocr": False,
80
- },
81
- "parliamentary": {
82
- "added": "2026-07-02",
83
- "release": "0.2.0",
84
- "speakleash_key": "PPC_corpus",
85
- "pretty": "Polish Parliamentary Corpus (Sejm/Senat)",
86
- "license": "public-domain (official documents)",
87
- "license_spdx": "CC-BY-4.0",
88
- "traceable": "Parliamentary proceedings are official documents outside "
89
- "copyright (PL art. 4 pr. aut.); PPC redistributed by IPI PAN "
90
- "under CC-BY-4.0.",
91
- "upstream": "http://clip.ipipan.waw.pl/PPC",
92
- "domain": "political/spoken",
93
- "created": "1991-01-01, 2019-12-31",
94
- "is_ocr": False,
95
- },
96
- "sejm_api": {
97
- "added": "2026-08-22",
98
- "custom_datasheet": True,
99
- "release": None,
100
- "file_key": "sejm_api",
101
- "pretty": "Sejm API parliamentary speeches (2023 onward)",
102
- "license": "public-domain (official documents)",
103
- "license_spdx": "LicenseRef-Polish-Official-Documents",
104
- "traceable": "Official parliamentary materials excluded from copyright "
105
- "under Polish Copyright Act art. 4(2); reusable under "
106
- "the Polish Open Data Act arts. 2(12), 5, 14 and 17.",
107
- "upstream": "https://api.sejm.gov.pl/",
108
- "provenance": "Direct official Sejm API records, preserved with speaker "
109
- "attribution and immutable PiotrSty/sejm-speeches-corpus "
110
- "v1.0.1 source provenance.",
111
- "domain": "political/spoken",
112
- "created": "2023-01-01, 2026-07-03",
113
- "is_ocr": False,
114
- },
115
- "sejm_interpellations": {
116
- "release": None,
117
- "file_key": "sejm_interpellations",
118
- "pretty": "Sejm interpellations and written questions (terms 7–10)",
119
- "license": "public-domain (official documents)",
120
- "license_spdx": "LicenseRef-Polish-Official-Documents",
121
- "traceable": "Official parliamentary materials excluded from copyright "
122
- "under Polish Copyright Act art. 4(2); reusable under "
123
- "the Polish Open Data Act arts. 2(12), 5, 14 and 17.",
124
- "upstream": "https://api.sejm.gov.pl/",
125
- "provenance": "Fetched from api.sejm.gov.pl HTML body endpoints by "
126
- "src/fetch_sejm_interpellations.py (interpellations + "
127
- "writtenQuestions, terms 7–10). Header chrome stripped into "
128
- "meta; attachment-only and keyless replies skipped; "
129
- "src/scrub_pii.py applied before jsonl write.",
130
- "domain": "political/written",
131
- "created": "2011-11-08, 2026-09-04",
132
- "is_ocr": False,
133
- "custom_datasheet": True,
134
- },
135
- "parlamint_pl": {
136
- "added": "2026-07-19",
137
- "release": None,
138
- "file_key": "parlamint_pl",
139
- "pretty": "ParlaMint-PL (parliamentary debates, 2015-2022)",
140
- "license": "CC-BY-4.0",
141
- "license_spdx": "CC-BY-4.0",
142
- "traceable": "ParlaMint 3.0 corpora released under CC-BY 4.0 (CLARIN.SI "
143
- "handle 11356/1486); parliamentary proceedings are also "
144
- "official documents (PL art. 4 pr. aut.).",
145
- "upstream": "http://hdl.handle.net/11356/1486",
146
- "provenance": "Fetched directly from the CLARIN.SI plain-text edition "
147
- "(ParlaMint-PL.tgz) by src/fetch_parlamint.py; one session "
148
- "transcript per document, utterance IDs stripped. Modern "
149
- "spoken register, complements the older PPC (1991-2019).",
150
- "domain": "political/spoken",
151
- "created": "2015-01-01, 2022-12-31",
152
- "is_ocr": False,
153
- },
154
- "wolne_lektury": {
155
- "added": "2026-07-02",
156
- "release": "0.2.0",
157
- "speakleash_key": "wolne_lektury_corpus",
158
- "pretty": "Wolne Lektury (school readings)",
159
- "license": "CC-BY-SA-4.0 / Wolna Sztuka 1.3",
160
- "license_spdx": "CC-BY-SA-4.0",
161
- "traceable": "Wolne Lektury publishes under CC-BY-SA 4.0 or Free Art "
162
- "License; texts are public-domain classics + cleared works.",
163
- "upstream": "https://wolnelektury.pl/api/books/",
164
- "domain": "literature",
165
- "created": "1500-01-01, 2024-12-31",
166
- "is_ocr": False,
167
- },
168
- "wikinews": {
169
- "added": "2026-07-02",
170
- "release": "0.2.0",
171
- "file_key": "plwikinews", # fetched from Wikimedia dumps, NOT via SpeakLeash
172
- "pretty": "Polish Wikinews",
173
- "license": "CC-BY-2.5",
174
- "license_spdx": "CC-BY-2.5",
175
- "traceable": "Wikinews content is released under CC-BY 2.5; attribution to "
176
- "contributors preserved.",
177
- "upstream": "https://pl.wikinews.org/",
178
- "provenance": "Fetched directly from the official Wikimedia dump "
179
- "(plwikinews-latest-pages-articles) by src/fetch_wikimedia.py; "
180
- "mainspace only, wikitext stripped via mwparserfromhell.",
181
- "domain": "news",
182
- "created": "2005-01-01, 2025-12-31",
183
- "is_ocr": False,
184
- },
185
- "wikivoyage": {
186
- "added": "2026-07-02",
187
- "release": "0.2.0",
188
- "file_key": "plwikivoyage",
189
- "pretty": "Polish Wikivoyage (travel guides)",
190
- "license": "CC-BY-SA-3.0",
191
- "license_spdx": "CC-BY-SA-3.0",
192
- "traceable": "Wikivoyage content is released under CC-BY-SA 3.0; "
193
- "attribution + share-alike preserved.",
194
- "upstream": "https://pl.wikivoyage.org/",
195
- "provenance": "Fetched directly from the official Wikimedia dump "
196
- "(plwikivoyage-latest-pages-articles) by src/fetch_wikimedia.py; "
197
- "mainspace only, wikitext stripped via mwparserfromhell.",
198
- "domain": "travel",
199
- "created": "2012-01-01, 2025-12-31",
200
- "is_ocr": False,
201
- },
202
- "wikibooks": {
203
- "added": "2026-07-02",
204
- "release": "0.2.0",
205
- "file_key": "plwikibooks",
206
- "pretty": "Polish Wikibooks (open textbooks)",
207
- "license": "CC-BY-SA-3.0",
208
- "license_spdx": "CC-BY-SA-3.0",
209
- "traceable": "Wikibooks content is released under CC-BY-SA 3.0; "
210
- "attribution + share-alike preserved.",
211
- "upstream": "https://pl.wikibooks.org/",
212
- "provenance": "Fetched directly from the official Wikimedia dump "
213
- "(plwikibooks-latest-pages-articles) by src/fetch_wikimedia.py; "
214
- "mainspace only, wikitext stripped via mwparserfromhell.",
215
- "domain": "instructional",
216
- "created": "2004-01-01, 2025-12-31",
217
- "is_ocr": False,
218
- },
219
- "wikiquote": {
220
- "added": "2026-07-02",
221
- "release": "0.2.0",
222
- "file_key": "plwikiquote",
223
- "pretty": "Polish Wikiquote (quotations)",
224
- "license": "CC-BY-SA-3.0",
225
- "license_spdx": "CC-BY-SA-3.0",
226
- "traceable": "Wikiquote content is released under CC-BY-SA 3.0; "
227
- "attribution + share-alike preserved.",
228
- "upstream": "https://pl.wikiquote.org/",
229
- "provenance": "Fetched directly from the official Wikimedia dump "
230
- "(plwikiquote-latest-pages-articles) by src/fetch_wikimedia.py; "
231
- "mainspace only, wikitext stripped via mwparserfromhell.",
232
- "domain": "quotations",
233
- "created": "2005-01-01, 2025-12-31",
234
- "is_ocr": False,
235
- },
236
- "eltec_pol": {
237
- "added": "2026-07-02",
238
- "release": "0.2.0",
239
- "file_key": "eltec_pol",
240
- "pretty": "ELTeC-pol (European Literary Text Collection, Polish)",
241
- "license": "CC-BY-4.0",
242
- "license_spdx": "CC-BY-4.0",
243
- "traceable": "ELTeC corpora are released under CC-BY 4.0 by the COST Action "
244
- "'Distant Reading for European Literary History' (CA16204).",
245
- "upstream": "https://github.com/COST-ELTeC/ELTeC-pol",
246
- "provenance": "Fetched directly from the COST-ELTeC/ELTeC-pol GitHub "
247
- "repository (level1 TEI) by src/fetch_eltec.py; reading text "
248
- "extracted from TEI <body> paragraphs.",
249
- "domain": "literature",
250
- "created": "1840-01-01, 1920-12-31",
251
- "is_ocr": False,
252
- },
253
- "dziennik_ustaw": {
254
- "added": "2026-07-02",
255
- "release": "0.2.0",
256
- "file_key": "dziennik_ustaw", # fetched directly, NOT via SpeakLeash
257
- "pretty": "Dziennik Ustaw + Monitor Polski (Polish primary legislation)",
258
- "license": "public-domain (official documents)",
259
- "license_spdx": "CC0-1.0",
260
- "traceable": "Normative acts and their official drafts are not subject to "
261
- "copyright (PL art. 4 ustawy o prawie autorskim). Published by "
262
- "the state; reuse unrestricted.",
263
- "upstream": "https://api.sejm.gov.pl/eli/acts",
264
- "provenance": "Fetched directly from the Sejm ELI API (text.html per act) "
265
- "by src/fetch_eli.py — a native source, not redistributed via "
266
- "SpeakLeash. Full provenance: each act's `meta.url` is its ELI "
267
- "address, resolvable on api.sejm.gov.pl.",
268
- "domain": "legal",
269
- "created": "1918-01-01, 2025-12-31",
270
- "is_ocr": False,
271
- },
272
- "govpl": {
273
- "added": "2026-07-19",
274
- "release": "0.2.2",
275
- "file_key": "govpl", # fetched directly from gov.pl, NOT via SpeakLeash
276
- "pretty": "gov.pl — Polish government press releases",
277
- "license": "CC-BY-SA-4.0",
278
- "license_spdx": "CC-BY-SA-4.0",
279
- "traceable": "All textual content on gov.pl is published under CC-BY-SA "
280
- "4.0 (site footer: \"Treści tekstowe publikowane w serwisie "
281
- "… są udostępniane na licencji CC BY-SA 4.0\"). Authored and "
282
- "hosted by the Polish government, which holds the right to "
283
- "license it — same open family as Polish Wikipedia.",
284
- "upstream": "https://www.gov.pl/",
285
- "provenance": "Ministry/agency press releases fetched directly from gov.pl "
286
- "(editor-content per article, HTML stripped) by "
287
- "src/fetch_govpl.py. Subsites + their non-uniform news-section "
288
- "paths are enumerated by src/discover_govpl.py into the "
289
- "committed manifest src/govpl_subsites.json (gov.pl has no "
290
- "sitemap/API). Each record's meta.url resolves on gov.pl.",
291
- "domain": "government",
292
- # actual min/max of article dates in the fetched corpus (90,124 dated).
293
- "created": "2005-09-26, 2026-07-19",
294
- "is_ocr": False,
295
- },
296
- "samorzad_gov_pl": {
297
- "added": "2026-08-14",
298
- "release": "0.2.5",
299
- "file_key": "samorzad_gov_pl",
300
- "pretty": "samorzad.gov.pl — Polish public-sector institutions",
301
- "license": "CC-BY-SA-4.0",
302
- "license_spdx": "CC-BY-SA-4.0",
303
- "traceable": "The shared samorzad.gov.pl platform footer publishes textual "
304
- "content under CC BY-SA 4.0. Every retained v0.1 source page "
305
- "referenced the shared footer script; audiovisual media and "
306
- "attachment bytes are not redistributed.",
307
- "upstream": "https://huggingface.co/datasets/dawidmajewski/samorzad-gov-pl-articles",
308
- "provenance": "Converted reproducibly from the published v0.1 source dataset "
309
- "by src/clean_samorzad_gov_pl.py. The source was collected "
310
- "directly from public samorzad.gov.pl pages across 246 local "
311
- "public institutions and one central platform tenant. "
312
- "Institution display names are frozen "
313
- "from each tenant homepage's og:site_name metadata and stored "
314
- "as DynaWord author values; discovered, fetched and attribution "
315
- "URLs plus license details are preserved in the sidecar.",
316
- "domain": "local government, education, social services and culture",
317
- "created": "2020-2026 for 21,892 dated records; 59,530 source records undated",
318
- "is_ocr": False,
319
- "custom_datasheet": True,
320
- },
321
- "biblioteka_nauki": {
322
- "added": "2026-06-27",
323
- "custom_datasheet": True,
324
- "release": "0.2.4",
325
- "file_key": "biblioteka_nauki_pl_corpus",
326
- "pretty": "Biblioteka Nauki",
327
- "license": "per-record upstream license",
328
- "license_spdx": "MIXED",
329
- "traceable": "Documents are accepted only when the direct upstream record "
330
- "exposes a reusable license. The parquet carries the "
331
- "per-document `license` and `author` fields from the upstream "
332
- "metadata collected by the source-specific rebuild script.",
333
- "upstream": "https://bibliotekanauki.pl/",
334
- "provenance": "Fetched directly from Biblioteka Nauki via the contributor "
335
- "rebuild script, not from the SpeakLeash redistribution. "
336
- "License and author metadata are checked document by document "
337
- "before normalization into the DynaWord schema.",
338
- "domain": "academic",
339
- "created": "unknown",
340
- "is_ocr": False,
341
- },
342
- "europeana": {
343
- "release": None,
344
- # Direct rebuild output from fetch_europeana.py, never the raw
345
- # SpeakLeash Europeana aggregate.
346
- "file_key": "europeana",
347
- "pretty": "Europeana Polish records",
348
- "license": "per-record public-domain/open rights statement",
349
- "license_spdx": "MIXED",
350
- "traceable": "Documents are accepted only with per-record Europeana rights "
351
- "metadata classified as public-domain/open. Public-domain "
352
- "status is jurisdiction-sensitive; downstream users must "
353
- "check their local legal requirements.",
354
- "upstream": "https://www.europeana.eu/",
355
- "provenance": "Fetched directly from Europeana via the contributor rebuild "
356
- "script, preserving per-record rights and creator metadata. "
357
- "The raw SpeakLeash aggregate remains insufficient because "
358
- "it does not carry enough rights evidence for release.",
359
- "domain": "cultural heritage",
360
- "created": "unknown",
361
- "is_ocr": True,
362
- "legal_note": "Europeana public-domain statements are primarily evaluated "
363
- "for Poland/EU. For US reuse, records created/published "
364
- "before 1929 are the conservative release slice; later "
365
- "records should remain separately labeled or held until "
366
- "legal review confirms their US status.",
367
- },
368
- "nkjp1m": {
369
- "added": "2026-06-15",
370
- "custom_datasheet": True,
371
- "release": "0.2.3",
372
- "file_key": "nkjp1m",
373
- "pretty": "The manually annotated 1-million word subcorpus of the National Corpus of Polish",
374
- "license": "CC-BY",
375
- "license_spdx": "CC-BY-4.0",
376
- "traceable": "The NKJP download page (clip.ipipan.waw.pl) states the manually annotated 1-million-word subcorpus (Podkorpus Milionowy NKJP 1.2) is available under a CC-BY licence; attribution to the NKJP Consortium (IPI PAN) preserved. The page states 'CC-BY' with no version, normalized to CC-BY-4.0 for SPDX. The CC-BY licence covers the corpus text; NKJP's separate tools are GPL and are not included here.",
377
- "upstream": "https://clip.ipipan.waw.pl/NationalCorpusOfPolish",
378
- "provenance": "Downloaded the IPI PAN tarball (NKJP-PodkorpusMilionowy-1.2.tar.gz) directly by src/fetch_njkp.py, one row per TEI <div> passage (its <ab> paragraphs joined by newlines, ellipsis markers stripped). The same minimal gates as build_dynaword.py are applied per passage (drop < 200 chars, drop non-Polish by diacritic ratio, exact sha1 dedup; the OCR gate is inapplicable). Per-document 'created' is the sample's TEI publication date (<date type=\"published\">) where the header records one. Normalized into the DynaWord schema; cl100k token counts via tiktoken (encode_ordinary), and the stats are recomputed from the written parquet.",
379
- "domain": "mixed (balanced reference corpus)",
380
- "created": "1957-2008 (recorded for 6,581 of 18,381 documents; per-document in the created column)",
381
- "is_ocr": False,
382
- },
383
- "european_hplt_v3_pl": {
384
- "added": "2026-07-14",
385
- "release": "0.2.3",
386
- "file_key": "european_hplt_v3_pl",
387
- "pretty": "HPLT v3.0 Polish (web, top WDS bins 10-5)",
388
- "license": "CC0-1.0",
389
- "license_spdx": "CC0-1.0",
390
- "traceable": "HPLT v3.0 Terms of Use license the data packaging under CC0-1.0 "
391
- "(hplt-project.org/datasets/v3.0; HF card HPLT/HPLT3.0). HPLT does not "
392
- "own the underlying web text; notice-and-takedown applies and downstream "
393
- "legal/provenance review remains the user's responsibility.",
394
- "upstream": "https://data.hplt-project.org/three/sorted/pol_Latn/",
395
- "provenance": "Fetched directly from the HPLT v3 distribution (pol_Latn shards "
396
- "10_1, 9_1-9_4, 8_1-8_4, 7_1-7_4, 6_1-6_2, 5_1-5_2 [WDS 10 down to 5]) by "
397
- "src/clean_hplt_v3.py + run_pipeline.py, NOT via SpeakLeash. Filtered: "
398
- "lang=pol_Latn + prob>=0.80, MT-prob<0.20, register in ID/OP/HI/IN/NA, "
399
- "min 400 chars / 80 words, boilerplate/adult/legalish drop, length cap "
400
- "120k chars, CJK-mojibake drop, wikipedia/wikisource/wikimedia + file-host "
401
- "domains excluded, per-domain cap. Phone->[Telefon] / email+national-ID->[PII] "
402
- "via src/scrub_pii.py (in-tree; supersedes the out-of-repo v12b pass); "
403
- "PERSON mentions → [PII] via src/scrub_entities.py on this web shard only. "
404
- "Token counts via tiktoken cl100k.",
405
- "domain": "web",
406
- "created": "2012-01-01, 2024-12-31",
407
- "is_ocr": False,
408
- "legal_note": "Web-crawl derived: accept_after_web_review. HPLT is globally "
409
- "deduplicated upstream and WDS quality-sorted. Cross-source near/"
410
- "containment dedup vs the existing WDS-10+9 base shards was performed "
411
- "for the WDS 8-5 + extra-9 expansion: exact-dup=0, near-dup overlap="
412
- "0.0000% (byte-verified). Copyright recurs at all lengths in web crawl. "
413
- "Parity with the accepted european-hplt-v1 CC0 basis.",
414
- "custom_datasheet": True,
415
- },
416
- "1000_novels": {
417
- "added": "2026-07-02",
418
- "release": "0.2.1",
419
- "speakleash_key": "1000_novels_corpus_CLARIN-PL",
420
- "pretty": "1000 Novels Corpus (CLARIN-PL)",
421
- "license": "CC-BY-4.0",
422
- "license_spdx": "CC-BY-4.0",
423
- "traceable": "The 1000 Novels Corpus is released under Creative Commons "
424
- "Attribution 4.0 International by CLARIN-PL / Wrocław University "
425
- "of Technology, with attribution to the corpus authors and "
426
- "maintainers.",
427
- "upstream": "https://clarin-pl.eu/dspace/handle/11321/312",
428
- "domain": "literature",
429
- "created": "unknown",
430
- "is_ocr": False,
431
- # Datasheet is contributor-committed (added 2026-07-02); skip regeneration
432
- # so the global ADDED stamp does not overwrite the real add date.
433
- "custom_datasheet": True,
434
- },
435
- "global_voices": {
436
- "added": "2026-07-15",
437
- "release": "0.2.3",
438
- # Data contributed directly (PR #7): no in-repo fetch/build script and a
439
- # hand-authored datasheet. Registered for the source table + release totals;
440
- # the datasheet stays contributor-owned via custom_datasheet.
441
- "file_key": "global_voices",
442
- "pretty": "Global Voices Polish",
443
- "license": "CC-BY-3.0",
444
- "license_spdx": "CC-BY-3.0",
445
- "traceable": "CC BY 3.0 verified from the article-level license link published "
446
- "with each retained Global Voices article; each record carries "
447
- "CC-BY-3.0 metadata and per-document author/translator attribution "
448
- "in global_voices.attribution.jsonl.",
449
- "upstream": "https://pl.globalvoices.org/",
450
- "domain": "civic media, news and public-interest journalism",
451
- "created": "2008-11-04, 2023-05-24",
452
- "is_ocr": False,
453
- "custom_datasheet": True,
454
- },
455
- }
456
-
457
- # Fallback stamp for a source with no recorded "added" date of its own.
458
- ADDED = "2026-07-19"
459
- EXCLUDED = {
460
- "open_subtitles_corpus": "Derivative of copyrighted film/TV dialogue; "
461
- "OpenSubtitles uploads largely unlicensed. Same copyright lesson as "
462
- "Danish Gigaword's OpenSubtitles (paper 2508.02271). Not openly licensed.",
463
- "europeana_eu_pl_corpus_raw_speakleash": "Aggregated items with mixed "
464
- "per-record rights (PD / CC-BY-NC / rights-reserved). The raw "
465
- "SpeakLeash redistribution is excluded; only a direct rebuild preserving "
466
- "per-record rights metadata may be included.",
467
- "1000_novels_corpus_CLARIN-PL": "CC-BY-4.0 label, but 'novels' likely include "
468
- "in-copyright contemporary works; verify titles/years on CLARIN handle "
469
- "11321/312 before inclusion.",
470
- "project_gutenberg_pl_corpus": "Only 31 PL books (4.3MB) — PG is ~99% English; "
471
- "Polish PD literature already covered by wolne_lektury + wikisource (so "
472
- "near-redundant after dedup). Dropped to avoid the PD-in-EU per-work check "
473
- "(PG claims PD-in-US only) for negligible token gain.",
474
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Source registry for Polish DynaWord.
2
+
3
+ Each entry = one openly-licensed, *traceable* human-text source (paper 2508.02271,
4
+ principle: open+traceable licensing). The `traceable` field documents WHY the
5
+ license holds (not just "it's public domain") — e.g. statutory basis or upstream
6
+ license — as required by the Dynaword guidelines.
7
+
8
+ Provenance note: data is pulled from SpeakLeash's public redistribution
9
+ (iDrive e2 bucket) of these upstream sources; SpeakLeash is credited as the
10
+ intermediate aggregator, upstream license/attribution is preserved per source.
11
+ """
12
+
13
+ # clean-6: passed the copyright review (2026-06-15). open_subtitles excluded
14
+ # (derivative of copyrighted film dialogue — same lesson as Danish Gigaword).
15
+ # Large cultural/academic sources require per-record rights metadata and should
16
+ # be rebuilt from direct upstream/export scripts rather than blind SpeakLeash pulls.
17
+ SOURCES = {
18
+ 'rock_pollub_pl': {'file_key': 'rock_pollub_pl',
19
+ 'pretty': 'ROCK Politechnika Lubelska - Polish academic books',
20
+ 'license': 'CC-BY-SA-4.0',
21
+ 'license_spdx': 'CC-BY-SA-4.0',
22
+ 'traceable': 'Each retained book has CC BY-SA 4.0 evidence in both the item record and '
23
+ 'matched original-PDF bitstream metadata; URLs, checksums, attribution and '
24
+ 'exclusions are preserved.',
25
+ 'upstream': 'https://rock.pollub.pl/collections/a42db069-319d-4d51-88d1-490ee7e6bad8',
26
+ 'provenance': 'Fetched directly from the official ROCK repository by '
27
+ 'src/fetch_rock_pollub_pl.py; only the fail-closed eight-record subset with '
28
+ 'item- and PDF-level rights evidence is included.',
29
+ 'domain': 'academic/technical',
30
+ 'created': '2023-2026',
31
+ 'is_ocr': False,
32
+ 'custom_datasheet': True},
33
+ "wikipedia": {
34
+ "added": "2026-07-02",
35
+ "release": "0.2.0",
36
+ "speakleash_key": "plwiki",
37
+ "pretty": "Polish Wikipedia",
38
+ "license": "CC-BY-SA-3.0",
39
+ "license_spdx": "CC-BY-SA-3.0",
40
+ "traceable": "Wikimedia dumps explicitly released under CC-BY-SA 3.0; "
41
+ "attribution to contributors + share-alike preserved.",
42
+ "upstream": "https://dumps.wikimedia.org/plwiki/latest/",
43
+ "domain": "encyclopedic",
44
+ "created": "2001-01-15, 2026-06-14",
45
+ "is_ocr": False,
46
+ },
47
+ "wikisource": {
48
+ "added": "2026-07-02",
49
+ "release": "0.2.0",
50
+ "speakleash_key": "plwikisource",
51
+ "pretty": "Polish Wikisource",
52
+ "license": "CC-BY-SA-3.0",
53
+ "license_spdx": "CC-BY-SA-3.0",
54
+ "traceable": "Wikimedia dumps under CC-BY-SA 3.0; underlying texts are "
55
+ "public-domain works transcribed by the community.",
56
+ "upstream": "https://dumps.wikimedia.org/plwikisource/latest/",
57
+ "domain": "books/source-texts",
58
+ "created": "2005-01-01, 2026-06-14",
59
+ "is_ocr": False,
60
+ },
61
+ "wiktionary_examples": {
62
+ "added": "2026-07-19",
63
+ "release": None,
64
+ "file_key": "wiktionary_examples",
65
+ "pretty": "Polish Wiktionary usage examples",
66
+ "provenance": "Parsed directly from the official Wikimedia dump "
67
+ "(plwiktionary-latest-pages-articles.xml.bz2); not routed "
68
+ "through SpeakLeash. Usage-example sections of Polish-language "
69
+ "entries extracted and grouped one document per headword.",
70
+ "license": "CC-BY-SA-3.0",
71
+ "license_spdx": "CC-BY-SA-3.0",
72
+ "traceable": "Wikimedia dumps explicitly released under CC-BY-SA 3.0; "
73
+ "attribution to contributors + share-alike preserved. "
74
+ "Derived subset: usage-example sections from Polish-language "
75
+ "entries only, grouped one document per headword.",
76
+ "upstream": "https://dumps.wikimedia.org/plwiktionary/latest/",
77
+ "domain": "lexicographic",
78
+ "created": "2004-03-22, 2026-08-15",
79
+ "is_ocr": False,
80
+ },
81
+ "eurlex": {
82
+ "added": "2026-07-02",
83
+ "release": "0.2.0",
84
+ "speakleash_key": "eurlex_corpus",
85
+ "pretty": "EUR-Lex (EU legal acts, Polish)",
86
+ "license": "CC-BY-4.0",
87
+ "license_spdx": "CC-BY-4.0",
88
+ "traceable": "EU documents reusable under Commission Decision 2011/833/EU; "
89
+ "normative acts fall outside copyright (PL art. 4 pr. aut.). "
90
+ "Reuse authorised with source acknowledgement.",
91
+ "upstream": "https://eur-lex.europa.eu",
92
+ "domain": "legal",
93
+ "created": "1952-01-01, 2024-12-31",
94
+ "is_ocr": False,
95
+ },
96
+ "parliamentary": {
97
+ "added": "2026-07-02",
98
+ "release": "0.2.0",
99
+ "speakleash_key": "PPC_corpus",
100
+ "pretty": "Polish Parliamentary Corpus (Sejm/Senat)",
101
+ "license": "public-domain (official documents)",
102
+ "license_spdx": "CC-BY-4.0",
103
+ "traceable": "Parliamentary proceedings are official documents outside "
104
+ "copyright (PL art. 4 pr. aut.); PPC redistributed by IPI PAN "
105
+ "under CC-BY-4.0.",
106
+ "upstream": "http://clip.ipipan.waw.pl/PPC",
107
+ "domain": "political/spoken",
108
+ "created": "1991-01-01, 2019-12-31",
109
+ "is_ocr": False,
110
+ },
111
+ "sejm_api": {
112
+ "added": "2026-08-22",
113
+ "custom_datasheet": True,
114
+ "release": None,
115
+ "file_key": "sejm_api",
116
+ "pretty": "Sejm API parliamentary speeches (2023 onward)",
117
+ "license": "public-domain (official documents)",
118
+ "license_spdx": "LicenseRef-Polish-Official-Documents",
119
+ "traceable": "Official parliamentary materials excluded from copyright "
120
+ "under Polish Copyright Act art. 4(2); reusable under "
121
+ "the Polish Open Data Act arts. 2(12), 5, 14 and 17.",
122
+ "upstream": "https://api.sejm.gov.pl/",
123
+ "provenance": "Direct official Sejm API records, preserved with speaker "
124
+ "attribution and immutable PiotrSty/sejm-speeches-corpus "
125
+ "v1.0.1 source provenance.",
126
+ "domain": "political/spoken",
127
+ "created": "2023-01-01, 2026-07-03",
128
+ "is_ocr": False,
129
+ },
130
+ "sejm_interpellations": {
131
+ "release": None,
132
+ "file_key": "sejm_interpellations",
133
+ "pretty": "Sejm interpellations and written questions (terms 7–10)",
134
+ "license": "public-domain (official documents)",
135
+ "license_spdx": "LicenseRef-Polish-Official-Documents",
136
+ "traceable": "Official parliamentary materials excluded from copyright "
137
+ "under Polish Copyright Act art. 4(2); reusable under "
138
+ "the Polish Open Data Act arts. 2(12), 5, 14 and 17.",
139
+ "upstream": "https://api.sejm.gov.pl/",
140
+ "provenance": "Fetched from api.sejm.gov.pl HTML body endpoints by "
141
+ "src/fetch_sejm_interpellations.py (interpellations + "
142
+ "writtenQuestions, terms 7–10). Header chrome stripped into "
143
+ "meta; attachment-only and keyless replies skipped; "
144
+ "src/scrub_pii.py applied before jsonl write.",
145
+ "domain": "political/written",
146
+ "created": "2011-11-08, 2026-09-04",
147
+ "is_ocr": False,
148
+ "custom_datasheet": True,
149
+ },
150
+ "parlamint_pl": {
151
+ "added": "2026-07-19",
152
+ "release": None,
153
+ "file_key": "parlamint_pl",
154
+ "pretty": "ParlaMint-PL (parliamentary debates, 2015-2022)",
155
+ "license": "CC-BY-4.0",
156
+ "license_spdx": "CC-BY-4.0",
157
+ "traceable": "ParlaMint 3.0 corpora released under CC-BY 4.0 (CLARIN.SI "
158
+ "handle 11356/1486); parliamentary proceedings are also "
159
+ "official documents (PL art. 4 pr. aut.).",
160
+ "upstream": "http://hdl.handle.net/11356/1486",
161
+ "provenance": "Fetched directly from the CLARIN.SI plain-text edition "
162
+ "(ParlaMint-PL.tgz) by src/fetch_parlamint.py; one session "
163
+ "transcript per document, utterance IDs stripped. Modern "
164
+ "spoken register, complements the older PPC (1991-2019).",
165
+ "domain": "political/spoken",
166
+ "created": "2015-01-01, 2022-12-31",
167
+ "is_ocr": False,
168
+ },
169
+ "wolne_lektury": {
170
+ "added": "2026-07-02",
171
+ "release": "0.2.0",
172
+ "speakleash_key": "wolne_lektury_corpus",
173
+ "pretty": "Wolne Lektury (school readings)",
174
+ "license": "CC-BY-SA-4.0 / Wolna Sztuka 1.3",
175
+ "license_spdx": "CC-BY-SA-4.0",
176
+ "traceable": "Wolne Lektury publishes under CC-BY-SA 4.0 or Free Art "
177
+ "License; texts are public-domain classics + cleared works.",
178
+ "upstream": "https://wolnelektury.pl/api/books/",
179
+ "domain": "literature",
180
+ "created": "1500-01-01, 2024-12-31",
181
+ "is_ocr": False,
182
+ },
183
+ "wikinews": {
184
+ "added": "2026-07-02",
185
+ "release": "0.2.0",
186
+ "file_key": "plwikinews", # fetched from Wikimedia dumps, NOT via SpeakLeash
187
+ "pretty": "Polish Wikinews",
188
+ "license": "CC-BY-2.5",
189
+ "license_spdx": "CC-BY-2.5",
190
+ "traceable": "Wikinews content is released under CC-BY 2.5; attribution to "
191
+ "contributors preserved.",
192
+ "upstream": "https://pl.wikinews.org/",
193
+ "provenance": "Fetched directly from the official Wikimedia dump "
194
+ "(plwikinews-latest-pages-articles) by src/fetch_wikimedia.py; "
195
+ "mainspace only, wikitext stripped via mwparserfromhell.",
196
+ "domain": "news",
197
+ "created": "2005-01-01, 2025-12-31",
198
+ "is_ocr": False,
199
+ },
200
+ "wikivoyage": {
201
+ "added": "2026-07-02",
202
+ "release": "0.2.0",
203
+ "file_key": "plwikivoyage",
204
+ "pretty": "Polish Wikivoyage (travel guides)",
205
+ "license": "CC-BY-SA-3.0",
206
+ "license_spdx": "CC-BY-SA-3.0",
207
+ "traceable": "Wikivoyage content is released under CC-BY-SA 3.0; "
208
+ "attribution + share-alike preserved.",
209
+ "upstream": "https://pl.wikivoyage.org/",
210
+ "provenance": "Fetched directly from the official Wikimedia dump "
211
+ "(plwikivoyage-latest-pages-articles) by src/fetch_wikimedia.py; "
212
+ "mainspace only, wikitext stripped via mwparserfromhell.",
213
+ "domain": "travel",
214
+ "created": "2012-01-01, 2025-12-31",
215
+ "is_ocr": False,
216
+ },
217
+ "wikibooks": {
218
+ "added": "2026-07-02",
219
+ "release": "0.2.0",
220
+ "file_key": "plwikibooks",
221
+ "pretty": "Polish Wikibooks (open textbooks)",
222
+ "license": "CC-BY-SA-3.0",
223
+ "license_spdx": "CC-BY-SA-3.0",
224
+ "traceable": "Wikibooks content is released under CC-BY-SA 3.0; "
225
+ "attribution + share-alike preserved.",
226
+ "upstream": "https://pl.wikibooks.org/",
227
+ "provenance": "Fetched directly from the official Wikimedia dump "
228
+ "(plwikibooks-latest-pages-articles) by src/fetch_wikimedia.py; "
229
+ "mainspace only, wikitext stripped via mwparserfromhell.",
230
+ "domain": "instructional",
231
+ "created": "2004-01-01, 2025-12-31",
232
+ "is_ocr": False,
233
+ },
234
+ "wikiquote": {
235
+ "added": "2026-07-02",
236
+ "release": "0.2.0",
237
+ "file_key": "plwikiquote",
238
+ "pretty": "Polish Wikiquote (quotations)",
239
+ "license": "CC-BY-SA-3.0",
240
+ "license_spdx": "CC-BY-SA-3.0",
241
+ "traceable": "Wikiquote content is released under CC-BY-SA 3.0; "
242
+ "attribution + share-alike preserved.",
243
+ "upstream": "https://pl.wikiquote.org/",
244
+ "provenance": "Fetched directly from the official Wikimedia dump "
245
+ "(plwikiquote-latest-pages-articles) by src/fetch_wikimedia.py; "
246
+ "mainspace only, wikitext stripped via mwparserfromhell.",
247
+ "domain": "quotations",
248
+ "created": "2005-01-01, 2025-12-31",
249
+ "is_ocr": False,
250
+ },
251
+ "eltec_pol": {
252
+ "added": "2026-07-02",
253
+ "release": "0.2.0",
254
+ "file_key": "eltec_pol",
255
+ "pretty": "ELTeC-pol (European Literary Text Collection, Polish)",
256
+ "license": "CC-BY-4.0",
257
+ "license_spdx": "CC-BY-4.0",
258
+ "traceable": "ELTeC corpora are released under CC-BY 4.0 by the COST Action "
259
+ "'Distant Reading for European Literary History' (CA16204).",
260
+ "upstream": "https://github.com/COST-ELTeC/ELTeC-pol",
261
+ "provenance": "Fetched directly from the COST-ELTeC/ELTeC-pol GitHub "
262
+ "repository (level1 TEI) by src/fetch_eltec.py; reading text "
263
+ "extracted from TEI <body> paragraphs.",
264
+ "domain": "literature",
265
+ "created": "1840-01-01, 1920-12-31",
266
+ "is_ocr": False,
267
+ },
268
+ "dziennik_ustaw": {
269
+ "added": "2026-07-02",
270
+ "release": "0.2.0",
271
+ "file_key": "dziennik_ustaw", # fetched directly, NOT via SpeakLeash
272
+ "pretty": "Dziennik Ustaw + Monitor Polski (Polish primary legislation)",
273
+ "license": "public-domain (official documents)",
274
+ "license_spdx": "CC0-1.0",
275
+ "traceable": "Normative acts and their official drafts are not subject to "
276
+ "copyright (PL art. 4 ustawy o prawie autorskim). Published by "
277
+ "the state; reuse unrestricted.",
278
+ "upstream": "https://api.sejm.gov.pl/eli/acts",
279
+ "provenance": "Fetched directly from the Sejm ELI API (text.html per act) "
280
+ "by src/fetch_eli.py — a native source, not redistributed via "
281
+ "SpeakLeash. Full provenance: each act's `meta.url` is its ELI "
282
+ "address, resolvable on api.sejm.gov.pl.",
283
+ "domain": "legal",
284
+ "created": "1918-01-01, 2025-12-31",
285
+ "is_ocr": False,
286
+ },
287
+ "govpl": {
288
+ "added": "2026-07-19",
289
+ "release": "0.2.2",
290
+ "file_key": "govpl", # fetched directly from gov.pl, NOT via SpeakLeash
291
+ "pretty": "gov.pl — Polish government press releases",
292
+ "license": "CC-BY-SA-4.0",
293
+ "license_spdx": "CC-BY-SA-4.0",
294
+ "traceable": "All textual content on gov.pl is published under CC-BY-SA "
295
+ "4.0 (site footer: \"Treści tekstowe publikowane w serwisie "
296
+ "… są udostępniane na licencji CC BY-SA 4.0\"). Authored and "
297
+ "hosted by the Polish government, which holds the right to "
298
+ "license it — same open family as Polish Wikipedia.",
299
+ "upstream": "https://www.gov.pl/",
300
+ "provenance": "Ministry/agency press releases fetched directly from gov.pl "
301
+ "(editor-content per article, HTML stripped) by "
302
+ "src/fetch_govpl.py. Subsites + their non-uniform news-section "
303
+ "paths are enumerated by src/discover_govpl.py into the "
304
+ "committed manifest src/govpl_subsites.json (gov.pl has no "
305
+ "sitemap/API). Each record's meta.url resolves on gov.pl.",
306
+ "domain": "government",
307
+ # actual min/max of article dates in the fetched corpus (90,124 dated).
308
+ "created": "2005-09-26, 2026-07-19",
309
+ "is_ocr": False,
310
+ },
311
+ "samorzad_gov_pl": {
312
+ "added": "2026-08-14",
313
+ "release": "0.2.5",
314
+ "file_key": "samorzad_gov_pl",
315
+ "pretty": "samorzad.gov.pl — Polish public-sector institutions",
316
+ "license": "CC-BY-SA-4.0",
317
+ "license_spdx": "CC-BY-SA-4.0",
318
+ "traceable": "The shared samorzad.gov.pl platform footer publishes textual "
319
+ "content under CC BY-SA 4.0. Every retained v0.1 source page "
320
+ "referenced the shared footer script; audiovisual media and "
321
+ "attachment bytes are not redistributed.",
322
+ "upstream": "https://huggingface.co/datasets/dawidmajewski/samorzad-gov-pl-articles",
323
+ "provenance": "Converted reproducibly from the published v0.1 source dataset "
324
+ "by src/clean_samorzad_gov_pl.py. The source was collected "
325
+ "directly from public samorzad.gov.pl pages across 246 local "
326
+ "public institutions and one central platform tenant. "
327
+ "Institution display names are frozen "
328
+ "from each tenant homepage's og:site_name metadata and stored "
329
+ "as DynaWord author values; discovered, fetched and attribution "
330
+ "URLs plus license details are preserved in the sidecar.",
331
+ "domain": "local government, education, social services and culture",
332
+ "created": "2020-2026 for 21,892 dated records; 59,530 source records undated",
333
+ "is_ocr": False,
334
+ "custom_datasheet": True,
335
+ },
336
+ "biblioteka_nauki": {
337
+ "added": "2026-06-27",
338
+ "custom_datasheet": True,
339
+ "release": "0.2.4",
340
+ "file_key": "biblioteka_nauki_pl_corpus",
341
+ "pretty": "Biblioteka Nauki",
342
+ "license": "per-record upstream license",
343
+ "license_spdx": "MIXED",
344
+ "traceable": "Documents are accepted only when the direct upstream record "
345
+ "exposes a reusable license. The parquet carries the "
346
+ "per-document `license` and `author` fields from the upstream "
347
+ "metadata collected by the source-specific rebuild script.",
348
+ "upstream": "https://bibliotekanauki.pl/",
349
+ "provenance": "Fetched directly from Biblioteka Nauki via the contributor "
350
+ "rebuild script, not from the SpeakLeash redistribution. "
351
+ "License and author metadata are checked document by document "
352
+ "before normalization into the DynaWord schema.",
353
+ "domain": "academic",
354
+ "created": "unknown",
355
+ "is_ocr": False,
356
+ },
357
+ "europeana": {
358
+ "release": None,
359
+ # Direct rebuild output from fetch_europeana.py, never the raw
360
+ # SpeakLeash Europeana aggregate.
361
+ "file_key": "europeana",
362
+ "pretty": "Europeana Polish records",
363
+ "license": "per-record public-domain/open rights statement",
364
+ "license_spdx": "MIXED",
365
+ "traceable": "Documents are accepted only with per-record Europeana rights "
366
+ "metadata classified as public-domain/open. Public-domain "
367
+ "status is jurisdiction-sensitive; downstream users must "
368
+ "check their local legal requirements.",
369
+ "upstream": "https://www.europeana.eu/",
370
+ "provenance": "Fetched directly from Europeana via the contributor rebuild "
371
+ "script, preserving per-record rights and creator metadata. "
372
+ "The raw SpeakLeash aggregate remains insufficient because "
373
+ "it does not carry enough rights evidence for release.",
374
+ "domain": "cultural heritage",
375
+ "created": "unknown",
376
+ "is_ocr": True,
377
+ "legal_note": "Europeana public-domain statements are primarily evaluated "
378
+ "for Poland/EU. For US reuse, records created/published "
379
+ "before 1929 are the conservative release slice; later "
380
+ "records should remain separately labeled or held until "
381
+ "legal review confirms their US status.",
382
+ },
383
+ "nkjp1m": {
384
+ "added": "2026-06-15",
385
+ "custom_datasheet": True,
386
+ "release": "0.2.3",
387
+ "file_key": "nkjp1m",
388
+ "pretty": "The manually annotated 1-million word subcorpus of the National Corpus of Polish",
389
+ "license": "CC-BY",
390
+ "license_spdx": "CC-BY-4.0",
391
+ "traceable": "The NKJP download page (clip.ipipan.waw.pl) states the manually annotated 1-million-word subcorpus (Podkorpus Milionowy NKJP 1.2) is available under a CC-BY licence; attribution to the NKJP Consortium (IPI PAN) preserved. The page states 'CC-BY' with no version, normalized to CC-BY-4.0 for SPDX. The CC-BY licence covers the corpus text; NKJP's separate tools are GPL and are not included here.",
392
+ "upstream": "https://clip.ipipan.waw.pl/NationalCorpusOfPolish",
393
+ "provenance": "Downloaded the IPI PAN tarball (NKJP-PodkorpusMilionowy-1.2.tar.gz) directly by src/fetch_njkp.py, one row per TEI <div> passage (its <ab> paragraphs joined by newlines, ellipsis markers stripped). The same minimal gates as build_dynaword.py are applied per passage (drop < 200 chars, drop non-Polish by diacritic ratio, exact sha1 dedup; the OCR gate is inapplicable). Per-document 'created' is the sample's TEI publication date (<date type=\"published\">) where the header records one. Normalized into the DynaWord schema; cl100k token counts via tiktoken (encode_ordinary), and the stats are recomputed from the written parquet.",
394
+ "domain": "mixed (balanced reference corpus)",
395
+ "created": "1957-2008 (recorded for 6,581 of 18,381 documents; per-document in the created column)",
396
+ "is_ocr": False,
397
+ },
398
+ "european_hplt_v3_pl": {
399
+ "added": "2026-07-14",
400
+ "release": "0.2.3",
401
+ "file_key": "european_hplt_v3_pl",
402
+ "pretty": "HPLT v3.0 Polish (web, top WDS bins 10-5)",
403
+ "license": "CC0-1.0",
404
+ "license_spdx": "CC0-1.0",
405
+ "traceable": "HPLT v3.0 Terms of Use license the data packaging under CC0-1.0 "
406
+ "(hplt-project.org/datasets/v3.0; HF card HPLT/HPLT3.0). HPLT does not "
407
+ "own the underlying web text; notice-and-takedown applies and downstream "
408
+ "legal/provenance review remains the user's responsibility.",
409
+ "upstream": "https://data.hplt-project.org/three/sorted/pol_Latn/",
410
+ "provenance": "Fetched directly from the HPLT v3 distribution (pol_Latn shards "
411
+ "10_1, 9_1-9_4, 8_1-8_4, 7_1-7_4, 6_1-6_2, 5_1-5_2 [WDS 10 down to 5]) by "
412
+ "src/clean_hplt_v3.py + run_pipeline.py, NOT via SpeakLeash. Filtered: "
413
+ "lang=pol_Latn + prob>=0.80, MT-prob<0.20, register in ID/OP/HI/IN/NA, "
414
+ "min 400 chars / 80 words, boilerplate/adult/legalish drop, length cap "
415
+ "120k chars, CJK-mojibake drop, wikipedia/wikisource/wikimedia + file-host "
416
+ "domains excluded, per-domain cap. Phone->[Telefon] / email+national-ID->[PII] "
417
+ "via src/scrub_pii.py (in-tree; supersedes the out-of-repo v12b pass); "
418
+ "PERSON mentions → [PII] via src/scrub_entities.py on this web shard only. "
419
+ "Token counts via tiktoken cl100k.",
420
+ "domain": "web",
421
+ "created": "2012-01-01, 2024-12-31",
422
+ "is_ocr": False,
423
+ "legal_note": "Web-crawl derived: accept_after_web_review. HPLT is globally "
424
+ "deduplicated upstream and WDS quality-sorted. Cross-source near/"
425
+ "containment dedup vs the existing WDS-10+9 base shards was performed "
426
+ "for the WDS 8-5 + extra-9 expansion: exact-dup=0, near-dup overlap="
427
+ "0.0000% (byte-verified). Copyright recurs at all lengths in web crawl. "
428
+ "Parity with the accepted european-hplt-v1 CC0 basis.",
429
+ "custom_datasheet": True,
430
+ },
431
+ "1000_novels": {
432
+ "added": "2026-07-02",
433
+ "release": "0.2.1",
434
+ "speakleash_key": "1000_novels_corpus_CLARIN-PL",
435
+ "pretty": "1000 Novels Corpus (CLARIN-PL)",
436
+ "license": "CC-BY-4.0",
437
+ "license_spdx": "CC-BY-4.0",
438
+ "traceable": "The 1000 Novels Corpus is released under Creative Commons "
439
+ "Attribution 4.0 International by CLARIN-PL / Wrocław University "
440
+ "of Technology, with attribution to the corpus authors and "
441
+ "maintainers.",
442
+ "upstream": "https://clarin-pl.eu/dspace/handle/11321/312",
443
+ "domain": "literature",
444
+ "created": "unknown",
445
+ "is_ocr": False,
446
+ # Datasheet is contributor-committed (added 2026-07-02); skip regeneration
447
+ # so the global ADDED stamp does not overwrite the real add date.
448
+ "custom_datasheet": True,
449
+ },
450
+ "global_voices": {
451
+ "added": "2026-07-15",
452
+ "release": "0.2.3",
453
+ # Data contributed directly (PR #7): no in-repo fetch/build script and a
454
+ # hand-authored datasheet. Registered for the source table + release totals;
455
+ # the datasheet stays contributor-owned via custom_datasheet.
456
+ "file_key": "global_voices",
457
+ "pretty": "Global Voices Polish",
458
+ "license": "CC-BY-3.0",
459
+ "license_spdx": "CC-BY-3.0",
460
+ "traceable": "CC BY 3.0 verified from the article-level license link published "
461
+ "with each retained Global Voices article; each record carries "
462
+ "CC-BY-3.0 metadata and per-document author/translator attribution "
463
+ "in global_voices.attribution.jsonl.",
464
+ "upstream": "https://pl.globalvoices.org/",
465
+ "domain": "civic media, news and public-interest journalism",
466
+ "created": "2008-11-04, 2023-05-24",
467
+ "is_ocr": False,
468
+ "custom_datasheet": True,
469
+ },
470
+ }
471
+
472
+ # Fallback stamp for a source with no recorded "added" date of its own.
473
+ ADDED = "2026-07-19"
474
+ EXCLUDED = {
475
+ "open_subtitles_corpus": "Derivative of copyrighted film/TV dialogue; "
476
+ "OpenSubtitles uploads largely unlicensed. Same copyright lesson as "
477
+ "Danish Gigaword's OpenSubtitles (paper 2508.02271). Not openly licensed.",
478
+ "europeana_eu_pl_corpus_raw_speakleash": "Aggregated items with mixed "
479
+ "per-record rights (PD / CC-BY-NC / rights-reserved). The raw "
480
+ "SpeakLeash redistribution is excluded; only a direct rebuild preserving "
481
+ "per-record rights metadata may be included.",
482
+ "1000_novels_corpus_CLARIN-PL": "CC-BY-4.0 label, but 'novels' likely include "
483
+ "in-copyright contemporary works; verify titles/years on CLARIN handle "
484
+ "11321/312 before inclusion.",
485
+ "project_gutenberg_pl_corpus": "Only 31 PL books (4.3MB) — PG is ~99% English; "
486
+ "Polish PD literature already covered by wolne_lektury + wikisource (so "
487
+ "near-redundant after dedup). Dropped to avoid the PD-in-EU per-work check "
488
+ "(PG claims PD-in-US only) for negligible token gain.",
489
+ }
src/test_rock_pollub_contribution.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ast
2
+ import json
3
+ from pathlib import Path
4
+
5
+ import pyarrow.parquet as pq
6
+
7
+
8
+ ROOT = Path(__file__).parents[1]
9
+ SOURCE = "rock_pollub_pl"
10
+ DATA = ROOT / "data" / SOURCE
11
+
12
+
13
+ def lines(path):
14
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line]
15
+
16
+
17
+ def test_registry_and_dataset_contract():
18
+ module = ast.parse((ROOT / "src/sources.py").read_text(encoding="utf-8"))
19
+ node = next(item.value for item in module.body if isinstance(item, ast.Assign)
20
+ and any(isinstance(target, ast.Name) and target.id == "SOURCES" for target in item.targets))
21
+ entry = ast.literal_eval(node)[SOURCE]
22
+ assert entry["file_key"] == SOURCE
23
+ assert entry["license_spdx"] == "CC-BY-SA-4.0"
24
+ table = pq.read_table(DATA / f"{SOURCE}.parquet")
25
+ assert table.column_names == ["id", "text", "source", "added", "created", "token_count", "license", "author"]
26
+ rows = table.to_pylist()
27
+ stats = json.loads((DATA / f"{SOURCE}.stats.json").read_text(encoding="utf-8"))
28
+ assert len(rows) == stats["kept"] == 8
29
+ assert sum(row["token_count"] for row in rows) == stats["tokens"] == 1177858
30
+ assert all(row["source"] == SOURCE and row["license"] == "CC-BY-SA-4.0" and row["author"] for row in rows)
31
+
32
+
33
+ def test_attribution_samples_and_ontology():
34
+ rows = pq.read_table(DATA / f"{SOURCE}.parquet").to_pylist()
35
+ attribution = lines(DATA / f"{SOURCE}.attribution.jsonl")
36
+ samples = lines(DATA / f"{SOURCE}.sample.jsonl")
37
+ assert {row["id"] for row in rows} == {item["id"] for item in attribution}
38
+ assert all(item["license_evidence"]["item"] and item["license_evidence"]["pdf_bitstream"] for item in attribution)
39
+ assert {row["id"] for row in samples} == {row["id"] for row in rows}
40
+ manifest = json.loads((ROOT / f"artifacts/{SOURCE}_ontology_manifest.json").read_text(encoding="utf-8"))
41
+ evidence = {item["id"] for item in manifest["evidence"]}
42
+ assert all(set(item["supported_by"]) <= evidence and item["falsification_condition"] for item in manifest["claims"])
43
+ assert any(item["predicate"] == "VALIDATED_AGAINST" for item in manifest["relations"])