File size: 30,092 Bytes
bb08b33
948d003
 
 
 
 
 
 
 
 
 
 
 
 
 
bb08b33
948d003
71433f1
948d003
 
 
 
6927795
948d003
 
 
 
 
ca195ec
 
 
 
 
 
 
6927795
ca195ec
 
362a49e
ca195ec
 
 
6927795
ca195ec
948d003
 
 
 
 
 
 
 
6570903
 
 
 
 
6927795
 
 
948d003
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6927795
 
 
948d003
 
 
 
6927795
 
 
 
 
71433f1
6927795
 
 
 
 
74a71cc
 
362a49e
 
74a71cc
948d003
 
ca195ec
948d003
74a71cc
 
948d003
 
 
 
 
6927795
948d003
 
6927795
948d003
 
 
 
 
ca195ec
948d003
 
 
 
 
 
 
 
 
 
74a71cc
 
 
 
 
 
 
 
6927795
74a71cc
 
 
 
6927795
74a71cc
 
 
 
72b1117
74a71cc
 
 
72b1117
74a71cc
 
72b1117
74a71cc
 
 
ca195ec
 
 
 
 
362a49e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0550d1f
 
 
362a49e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ca195ec
 
 
 
 
 
 
 
 
72b1117
ca195ec
 
 
 
 
 
 
 
 
 
74a71cc
 
 
71433f1
74a71cc
 
 
 
 
 
72b1117
74a71cc
 
6927795
 
 
 
71433f1
6927795
 
 
 
 
 
 
 
 
71433f1
6927795
 
 
71433f1
6927795
 
 
 
 
 
 
 
 
 
 
 
 
 
948d003
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6927795
ca195ec
 
 
948d003
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74a71cc
 
6927795
 
72b1117
71433f1
72b1117
 
 
 
 
 
 
 
74a71cc
 
72b1117
 
 
 
 
ca195ec
72b1117
 
 
 
 
 
 
 
 
 
74a71cc
 
72b1117
 
 
 
 
ca195ec
 
 
 
 
 
 
 
71433f1
ca195ec
 
 
72b1117
74a71cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71433f1
74a71cc
 
 
 
 
 
 
 
72b1117
 
 
 
 
74a71cc
72b1117
74a71cc
 
72b1117
74a71cc
 
 
71433f1
ca195ec
 
71433f1
ca195ec
71433f1
ca195ec
6927795
ca195ec
 
6927795
ca195ec
 
 
 
72b1117
 
ca195ec
 
72b1117
 
ca195ec
72b1117
 
 
 
 
 
 
 
ca195ec
 
72b1117
 
ca195ec
 
 
 
71433f1
72b1117
 
ca195ec
 
72b1117
 
 
 
 
 
 
 
 
 
ca195ec
 
71433f1
ca195ec
 
 
 
 
72b1117
 
 
ca195ec
 
74a71cc
 
 
 
948d003
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362a49e
 
 
948d003
ca195ec
948d003
ca195ec
 
 
 
 
948d003
362a49e
ca195ec
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
---
language:
- ru
license: cc-by-sa-4.0
pretty_name: Russian Wikipedia quality articles with subjects (20261001)
configs:
- config_name: articles
  default: true
  data_files:
  - split: corpus
    path: data/articles.jsonl.gz
- config_name: topics
  data_files:
  - split: corpus
    path: data/topics.jsonl.gz
---

# RuWiki-Good-Thematized-2026 — Russian Wikipedia quality articles with subjects

This Russian-language collection contains **17,251 Wikipedia articles**
with at least one subject label from a fixed taxonomy of **28 subjects**.
It is selected from the **17,413 articles** in
[Russian Wikipedia quality articles](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026),
based on the **20261001** dump. Each article retains the original title, readable
text, wikitext, direct categories, community quality status and revision links,
and adds a `topics` list. The `topics` configuration supplies the complete subject
definitions. The full category catalog remains in the source collection.

## Files at a glance

| File | Purpose | Bytes |
| --- | --- | ---: |
| `data/articles.jsonl.gz` | Source articles with retained subject labels. | 413,342,335 |
| `data/topics.jsonl.gz` | The 28 subject definitions and their boundaries. | 2,671 |
| `data/labels.json` | Article-ID to subject-slug mapping for replay and analysis. | 649,823 |
| `data/topic-provenance.jsonl.gz` | Frozen initial/final assignments and review status for all Full IDs. | 127,895 |
| `data/noow.csv` | Whole-document text and ordered normalized VW features. | 1,118,455,706 |
| `data/bow.csv` | The same documents with counted VW features. | 875,143,956 |
| `data/splits.json` | Optional fit/calibration/validation memberships by article ID. | 291,038 |

[SHA256SUMS](SHA256SUMS) covers this repository's published data. Preparation code,
environment locks and source/output pins are maintained once in the
[Full collection](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026/tree/main/preprocessing).

## Selection and subject labels

The source includes namespace-0 articles with active recommended (Добротные),
good (Хорошие) or featured (Избранные) community status. Redirects and
disambiguation pages are excluded. Multiple active statuses are retained;
former-status categories are recorded separately. These are editorial
designations at the snapshot date, not independent factual checks.

The taxonomy was inspired by the broad subject domains of
[PostNauka](https://huggingface.co/datasets/TopicNet/PostNauka),
[SciNews](https://huggingface.co/datasets/TopicNet/SciNews),
and [BBC News](https://huggingface.co/datasets/TopicNet/BBC-News),
then adapted to Wikipedia articles and their editorial rubrics.
Its 28 subjects are not an identical copy of any of those sources' classes;
the published topic definitions specify the boundaries used here.

Subject assignment combines mappings from specific direct editorial rubrics
with AI-assisted review of ambiguous rubrics using direct subject categories and,
where needed, excerpts from the saved readable text. Mixed editorial rubrics
identify possible subjects; they do not assign all those subjects simultaneously.
Category ancestry is not propagated. Category mappings are assessed against the
subject definitions: a category name being present does not by itself establish
a narrow subject, and an interdisciplinary regional-studies category does not
automatically establish language scholarship. Incidental mentions, birthplaces, awards,
party membership or education alone do not establish a subject. Labels already
supported by specific rubrics are retained unless there is explicit contrary
evidence.

Labels are **partial** and were curated with AI assistance; they are not
exhaustive annotation or a human gold standard. Category interpretation may be
wrong, and relevant subjects may have been missed. Text review was limited to
selected passages where categories needed clarification; articles were not read
in full. A missing label is not evidence that the article lacks that subject.
Multiple labels are allowed when each has independent support. They can arise
from several specific independent rubrics, as well as from additional review;
a mixed rubric alone never establishes several labels. Articles are included when
their subject list is nonempty: **162 source articles** have no assigned subject label and are
omitted. No coverage quota, topic balancing or maximum label count was used.
Subject frequencies and intersections are consequently uneven.

Of the **17,413 source articles**, **14,945** required no additional review:
**13,984** initially had one subject and **961** had several. The remaining
**2,468** articles had evidence from **44 ambiguous editorial rubrics** and
received additional AI-assisted review. Of these, **2,306** were retained and
**162** were excluded because their final subject lists were empty. In total,
**2,054** articles had their subject lists changed. The final Thematized collection
contains **17,251 articles: 15,599 with one subject and 1,652 with several**.
Additional review records a step in annotation: it does not imply an automatic
label change and is not a confidence score. Articles without additional review
are not thereby certified correct.

The original JSON records have no NLP preprocessing or model scoring. The
optional preparation workflow below produces separate NLP CSV files without a
research train/test split; a fixed reference partition is supplied separately in
`data/splits.json`. The `corpus` split is a storage partition. Source text
has not been shortened or rewritten for subject selection. No exact duplicate source text was
removed. This collection is not a representative sample of Russian writing.

## Quick start: load the published files

The `articles` configuration is the default. `articles` and `topics` use
compressed JSON Lines and the `corpus` split, with no dataset script.

```python
from datasets import load_dataset

articles = load_dataset(
    "TopicNet/RuWiki-Good-Thematized-2026", "articles", split="corpus"
)
topics = load_dataset(
    "TopicNet/RuWiki-Good-Thematized-2026", "topics", split="corpus"
)
print(len(articles))  # 17251
print(len(topics))    # 28
```

From a downloaded repository, load the JSON Lines files directly:

```python
articles = load_dataset(
    "json", data_files={"corpus": "data/articles.jsonl.gz"}, split="corpus"
)
topics = load_dataset(
    "json", data_files={"corpus": "data/topics.jsonl.gz"}, split="corpus"
)
```

The prepared NLP files `data/noow.csv` and `data/bow.csv` contain the same
17,251 article IDs, in source order, with string columns `id`, `raw_text`,
`vw_text`. Use the CSV reader for these files, separately from the repository's
JSON Lines configurations:

```python
noow = load_dataset(
    "csv",
    data_files={"corpus": "hf://datasets/TopicNet/RuWiki-Good-Thematized-2026/data/noow.csv"},
    split="corpus",
)
bow = load_dataset(
    "csv",
    data_files={"corpus": "hf://datasets/TopicNet/RuWiki-Good-Thematized-2026/data/bow.csv"},
    split="corpus",
)
```

From the root of the downloaded repository:

```python
noow = load_dataset(
    "csv", data_files={"corpus": "data/noow.csv"}, split="corpus"
)
bow = load_dataset(
    "csv", data_files={"corpus": "data/bow.csv"}, split="corpus"
)
```

CSV is the primary prepared format. The explicit `"csv"` builder above is
required: these files are not additional YAML configurations, because combining
JSON and CSV builders in one repository configuration did not load reliably.
The published CSV files have been fully read with Hugging Face Datasets.

### Optional reference splits

[data/splits.json](data/splits.json) maps each partition name to an ordered list
of article IDs. The lists are disjoint and together cover all 17,251 articles:

| Partition | Documents | Intended use |
| --- | ---: | --- |
| `fit` | 10,342 | Fit models and training-dependent vocabularies or statistics. |
| `calibration` | 3,434 | Tune parameters and make development decisions. |
| `validation` | 3,475 | Evaluate the selected procedure on held-out documents. |

The partition uses multilabel group stratification with approximate proportions
60/20/20 and seeds 20260824 and 20260825 for the two successive splits.
Near-duplicate articles, identified by Jaccard similarity ≥0.9 between sets of
five-word shingles, stay in the same partition. The procedure found one such
pair (article IDs `ruwiki/10869327` and `ruwiki/10872523` —
whose titles are "Город Казань (шмак)" and "Северная звезда (шмак)", respectively);
both articles are in `fit`. No articles were removed.

The same IDs occur in `articles`, `noow.csv`, `bow.csv` and `labels.json`.
The Hugging Face split `corpus` still contains the whole collection; use the
stored memberships when you want this reference partition. After loading
`articles` above, run from the root of a downloaded repository:

```python
import json
from pathlib import Path
from datasets import DatasetDict

splits = json.loads(Path("data/splits.json").read_text(encoding="utf-8"))
index = {doc_id: i for i, doc_id in enumerate(articles["id"])}
partitioned = DatasetDict({
    name: articles.select([index[doc_id] for doc_id in ids])
    for name, ids in splits.items()
})
print({name: len(part) for name, part in partitioned.items()})
# {'calibration': 3434, 'fit': 10342, 'validation': 3475}
```

For either CSV representation, replace `articles` with the loaded `noow` or
`bow` dataset. Selection preserves the order recorded in `splits.json`.
The shared corpus/NLP preparation workflow does not generate this supplementary
partition. Its published ngrams use all article bodies, so applying the
memberships does not make those features training-only; see the NLP preparation
section below. Text-only modeling can use `@word` and fit any further vocabulary
or statistics on `fit` alone.

To export one VW document per line without loading the CSV into memory, run this
from the downloaded repository. Choose an output path outside the repository:

```python
import csv
from pathlib import Path

csv.field_size_limit(2**31 - 1)
with Path("data/noow.csv").open(encoding="utf-8", newline="") as source:
    with Path("../noow.vw").open("w", encoding="utf-8", newline="") as output:
        for row in csv.DictReader(source):
            output.write(row["vw_text"] + "\n")
```

The field-size setting is needed only for Python's standard `csv` reader;
it does not configure Hugging Face Datasets. Use `bow.csv` in the same example
for counted features. CSV records contain whole documents and may include
embedded newlines in `raw_text`, so splitting the CSV by physical lines is unsafe.
The repository does not store a second permanent copy as VW text files.

The NLP preparation section describes the normalized namespaces and text fields.

The sidecar [data/labels.json](data/labels.json) is a JSON object mapping every
Thematized article ID to its list of subject slugs, matching both article `topics`
and the CSV `@topic` namespace. It is not a separate dataset configuration.

```python
import json
from pathlib import Path

labels = json.loads(Path("data/labels.json").read_text(encoding="utf-8"))
```

## Frozen topic provenance

[data/topic-provenance.jsonl.gz](data/topic-provenance.jsonl.gz) contains one
record for each of the **17,413 Full article IDs**, including the 162 articles
excluded from Thematized. Records are ordered by numeric page ID. This is frozen
annotation metadata, separate from corpus reconstruction and NLP build outputs;
preprocessing does not re-annotate it or create new subject evidence. It records
the initial specific-rubric assignments and the final accepted assignments,
without publishing internal annotation decision logs.

| Field | JSON type | Meaning |
| --- | --- | --- |
| `id` | string | Full article ID, `ruwiki/<page_id>`; join to Full to inspect excluded articles. |
| `initial_topics` | array of strings | Subjects supported by specific direct editorial rubrics before additional review. |
| `topics` | array of strings | Final subjects; matches `data/labels.json` for every Thematized ID. An empty list identifies an excluded Full article. |
| `additional_review` | boolean | Whether baseline ambiguous-rubric evidence led to additional AI-assisted review; not whether labels changed or a confidence score. |
| `unresolved_rubrics` | array of strings | Ambiguous direct editorial rubrics at the initial stage; retained as historical evidence even after review, not a claim that the final subjects remain unresolved. |

To stream only reviewed articles retained in Thematized, run this from the root of
the downloaded repository. Use `not row["topics"]` instead of `row["topics"]`
to inspect the excluded articles, joining their IDs to Full:

```python
import gzip
import json

with gzip.open("data/topic-provenance.jsonl.gz", "rt", encoding="utf-8") as source:
    for line in source:
        row = json.loads(line)
        if row["additional_review"] and row["topics"]:
            print(row["id"], row["initial_topics"], row["topics"])
```

## Article fields


| Field | JSON type | Meaning |
| --- | --- | --- |
| `id` | string | Stable page identity, `ruwiki/<page_id>`. |
| `page_id` | integer | Russian Wikipedia page ID. |
| `title` | string | Article title with spaces, separate from the text. |
| `wikitext` | string | XML-decoded revision wikitext. |
| `raw_text` | string | Readable text extracted from `wikitext`; not rendered HTML. |
| `wikitext_sha256` | string | SHA-256 of UTF-8 encoded `wikitext`. |
| `raw_text_sha256` | string | SHA-256 of UTF-8 encoded `raw_text`. |
| `quality_statuses` | array of strings | Active `recommended`, `good` and/or `featured` statuses from SQL. |
| `former_quality_categories` | array of strings | Direct former-status category names from SQL; may be empty. |
| `categories` | array of strings | All direct SQL category names, including maintenance categories. |
| `wikidata_id` | string or null | Wikidata QID from SQL page properties, when available. |
| `revision_id` | integer | Content revision ID from XML. |
| `revision_timestamp` | string | XML revision timestamp in UTC, such as `2026-09-26T22:17:57Z`. |
| `metadata_revision_id` | integer | SQL page revision ID; may differ from `revision_id`. |
| `page_url` | string | Page-ID URL for the source page and access to its history. |
| `revision_url` | string | Permanent URL for the content revision. |
| `topics` | array of strings | Sorted unique subject slugs; at least one in every retained article. |

The source fields are preserved exactly; only `topics` is added. The table describes the stored JSON types. Hugging Face Datasets 5.0.0 infers
`revision_timestamp` as `timestamp[s]` and `former_quality_categories` as
`List(null)` for this release, whose former-status lists are empty. Nullable
scalar fields remain nullable when loaded.

For example, the following is an actual record projected onto a few fields (the
text and remaining fields are omitted here):

```json
{
  "id": "ruwiki/21",
  "page_id": 21,
  "title": "Социология",
  "quality_statuses": [
    "featured"
  ],
  "wikidata_id": "Q21201",
  "revision_id": 155304860,
  "metadata_revision_id": 155304860,
  "revision_timestamp": "2026-09-26T22:17:57Z",
  "page_url": "https://ru.wikipedia.org/?curid=21",
  "revision_url": "https://ru.wikipedia.org/w/index.php?oldid=155304860",
  "topics": [
    "social-sciences-education"
  ]
}
```

## Topic fields and distribution

Each topic record contains the definition used to assign that subject. Join article
`topics` entries to topic `slug`.

| Field | JSON type | Meaning |
| --- | --- | --- |
| `slug` | string | Stable subject identifier used in article `topics`. |
| `name_en` | string | English subject name. |
| `name_ru` | string | Russian subject name. |
| `definition_and_boundaries` | string | Russian definition and boundaries between subjects. |

Counts overlap because an article may have several subjects.

| Subject | Slug | Articles |
| --- | --- | ---: |
| Mathematics and statistics | `mathematics` | 158 |
| Physics | `physics` | 220 |
| Chemistry | `chemistry` | 132 |
| Astronomy and space | `astronomy-space` | 283 |
| Earth science | `earth-science` | 63 |
| Geography and places | `geography` | 767 |
| Biology | `biology` | 1,370 |
| Medicine and health | `health` | 207 |
| Environment and agriculture | `environment-agriculture` | 87 |
| History and archaeology | `history-archaeology` | 4,177 |
| Military affairs and security | `military-security` | 2,332 |
| Politics and law | `politics-law` | 1,140 |
| Economics and business | `economy-business` | 254 |
| Philosophy | `philosophy` | 108 |
| Religion and mythology | `religion-mythology` | 814 |
| Language and linguistics | `language` | 264 |
| Literature | `literature` | 1,132 |
| Visual and performing arts | `visual-performing-arts` | 755 |
| Architecture and structures | `architecture` | 428 |
| Film, television and animation | `film-television-animation` | 850 |
| Music | `music` | 952 |
| Games | `games` | 784 |
| Sport | `sport` | 754 |
| Media and communication | `media-communication` | 123 |
| Food and gastronomy | `food` | 92 |
| Technology and industry | `technology` | 356 |
| Transport | `transport` | 376 |
| Society and education | `social-sciences-education` | 254 |

| Subjects per article | Articles |
| ---: | ---: |
| 1 | 15,599 |
| 2 | 1,400 |
| 3 | 197 |
| 4 | 38 |
| 5 | 13 |
| 6 | 3 |
| 7 | 1 |

## Sources and revision semantics


The source is the [Russian Wikipedia 20261001 dump](https://dumps.wikimedia.org/ruwiki/20261001/).
The [source and output pins](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026/blob/main/preprocessing/wikipedia-quality-corpus-20261001.json) record the names, byte sizes and SHA-256 digests of all six
inputs: page, page properties, category links and link targets SQL dumps, plus the
multistream article XML and its index. Dump mirrors may later remove this dated
snapshot; the pins identify the inputs independently of their availability.

SQL provides selection, titles, page properties and category relationships. XML
provides article content, `revision_id` and `revision_timestamp`. In the 17,413-article source collection, **11 articles**
have differing SQL and XML revision IDs; the metadata and content should not be
assumed to describe one atomic revision. Use `revision_url` to identify the exact
text revision, and retain both IDs when recording provenance. Live pages and
categories can differ from this snapshot.

Readable extraction uses `mwparserfromhell` 0.7.2 and deterministic markup cleanup.
It does not render Wikipedia or expand templates fully. Templates, infoboxes,
tables, references, captions, formulae and formatting may be removed or simplified;
fragments of markup or awkward text may remain. `wikitext` is retained so readers
can inspect these losses or apply a different extraction procedure. Neither
`raw_text` nor the category metadata is a manually corrected annotation.

## NLP preparation

The [standalone preparation code](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026/tree/main/preprocessing)
and [full instructions](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026#nlp-preparation)
are maintained in Full. Run the preparation commands from Full's
`preprocessing/` directory, including when preparing only Thematized. Local
repository directories may have any names. Replace the paths below with your own
absolute paths: `work_dir` is a separate working directory, and `selected_data`
points to this collection's `data/` directory. Choose fresh output and scratch
paths on a disk with enough space; corpus output and scratch inside a published
clone are rejected. Build and verify require Python 3.11.15 because VW escaping
depends on its Unicode database; verify needs no NLP packages. On Linux x86-64,
install the supplied locked environment. `requirements.txt` includes
`mwparserfromhell==0.7.2` for corpus extraction.

```bash
cd "/absolute/path/to/full/preprocessing"
work_dir="/absolute/path/to/ruwiki-rebuild"
selected_data="/absolute/path/to/selected/data"

conda create --name ruwiki-nlp --file conda-linux-64.lock.txt
conda activate ruwiki-nlp
python -m pip install -r pip-linux-x86_64.lock.txt
python prepare.py --stage nlp --action download --dataset selected \
  --sources-dir "$work_dir/nlp-sources"
python prepare.py --stage nlp --action build --dataset selected \
  --sources-dir "$work_dir/nlp-sources" \
  --output-dir "$work_dir/nlp-output" \
  --scratch-dir "$work_dir/nlp-scratch"
python prepare.py --stage nlp --action verify --dataset selected \
  --sources-dir "$work_dir/nlp-sources" \
  --output-dir "$work_dir/nlp-output"
```

Local paths above are independent of Hugging Face repository names. Online
loading examples and cross-repository links use the published Hugging Face IDs.
If those IDs change, the links and the downloader's pinned source addresses need
to be reviewed separately; renaming a local directory does not change them.

`--stage nlp` is the default; commands without it continue to work. Use
`--dataset both` to prepare both collections. Download checks pinned source
snapshots and supplies the pinned NLTK stopwords archive. Build runs offline.
Keep output and scratch separate from published `data/` and use fresh directories
for a new build. Full's instructions explain reuse of local JSONL files and
access to restricted source repositories.

After the structural NLP checks, the shared entry point independently compares
CSV and Thematized label byte sizes and SHA-256 hashes with published expectations
in the corpus contract, reporting `PUBLISHED_NLP_OK`. It does not rely on the
new build manifest as its authority and does not replay NLP normalization.

The workflow produces `$work_dir/nlp-output/selected/noow.csv` and `bow.csv` with exactly
`id`, `raw_text`, `vw_text` columns for all 17,251 selected IDs, preserving article
order. CSV `raw_text` is the title, two LF characters and the original readable
body with its leading CR/LF characters removed. Original JSON `raw_text` remains
the readable body alone; the source JSON files are unchanged.

The normalized VW namespaces are `@title`, `@word`, `@bigram`, `@trigram`,
`@category`, then `@topic`. `@word` contains the body only. `@category` retains
all direct categories, including service and maintenance categories. `@topic`
contains the accepted subject slugs described above, not raw Wikipedia rubric
names. `labels.json` maps article IDs to those same subject slugs. These labels
remain partial and AI-assisted; preprocessing does not improve their validity.
NOOW preserves normalized token order within each namespace, not raw prose.
BOW counts precisely the same tokens separately in every namespace.

Normalization uses spaCy Russian tokenization, pymorphy3 lemmas and the union of
spaCy and pinned NLTK Russian stopwords. Punctuation is removed; tags, URLs and
email addresses become placeholders. Cyrillic stress marks are removed and
lexical Cyrillic hyphenated compounds are retained with ASCII hyphens. Names
are not masked. There is no article removal, token trimming, research split,
model training or chain extraction. Build prints phase and document-count
progress; the manifest reports empty `@word` articles by count and ordered IDs
without dropping them.

Bigrams and trigrams use independent NLTK PMI selection after frequency ≥5,
with `nbest(32100)[100:]` for each order. This selection uses **all Thematized
article bodies**, independently of Full; it is corpus-global rather than fitted
only on a future training partition. For text-only experiments, use only `@word`
to avoid exposing category, title or subject metadata to the model. The workflow
does not establish an evaluation without information from held-out documents.

Load a generated CSV directly:

```python
from pathlib import Path

# Use the same work directory as in the shell commands.
work_dir = Path("/absolute/path/to/ruwiki-rebuild")
output_dir = work_dir / "nlp-output/selected"
noow = load_dataset(
    "csv", data_files={"corpus": str(output_dir / "noow.csv")}, split="corpus"
)
bow = load_dataset(
    "csv", data_files={"corpus": str(output_dir / "bow.csv")}, split="corpus"
)
```

A measured NLP build of **both Full and Thematized** from ready JSONL snapshots took
42 min 5.83 s, with 10.58 GiB peak resident memory, approximately 3.74 GiB of final
output and 0.53 GiB of scratch. These are measurements from one environment,
not Thematized-only estimates or measurements of replay from raw Wikimedia dumps.

## Rebuild Thematized from source data

Full's [corpus replay instructions](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026#rebuild-the-corpus-from-wikimedia-dumps)
cover the six pinned 20261001 dumps, explicit download resumption with `--resume`,
offline construction and independent published-payload verification. The shared
[source and output contract](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026/blob/main/preprocessing/wikipedia-quality-corpus-20261001.json)
contains source dump and annotation pins. The new public path from raw dumps has
**not yet been run end to end**; its runtime and resource requirements remain
unmeasured.

For the complete path, keep the same Full `preprocessing/` working directory
and path variables as in the NLP commands above:

```bash
python prepare.py --stage corpus --action download --dataset both \
  --sources-dir "$work_dir/dump-sources"
# Add --resume explicitly when continuing an interrupted download.
python prepare.py --stage corpus --action build --dataset both \
  --sources-dir "$work_dir/dump-sources" \
  --annotations-dir "$selected_data" \
  --output-dir "$work_dir/corpus-output" \
  --scratch-dir "$work_dir/corpus-scratch"
python prepare.py --stage corpus --action verify --dataset both \
  --sources-dir "$work_dir/dump-sources" \
  --output-dir "$work_dir/corpus-output"
```

This writes `$work_dir/corpus-output/full/articles.jsonl.gz` and `categories.jsonl.gz`,
plus `$work_dir/corpus-output/selected/articles.jsonl.gz` and `topics.jsonl.gz`. The
annotation directory must already contain this collection's `labels.json` and
`topics.jsonl.gz`. Reconstruction retains the published mapping and does not
rerun AI annotation or establish new evidence for label correctness.

If a previously accepted Full corpus is already available, build only Thematized
without rereading the dumps. From the same Full `preprocessing/` directory,
resolve Full's data path:

```bash
full_data="$(cd ../data && pwd -P)"
python prepare.py --stage corpus --action build --dataset selected \
  --sources-dir "$full_data" \
  --full-dir "$full_data" \
  --annotations-dir "$selected_data" \
  --output-dir "$work_dir/selected-output" \
  --scratch-dir "$work_dir/selected-scratch"
python prepare.py --stage corpus --action verify --dataset selected \
  --sources-dir "$full_data" \
  --output-dir "$work_dir/selected-output"
```

This Thematized-only workflow has been verified byte for byte against the published
archive of all 17,251 articles, the labels file and the topic definitions.

Use fresh output and scratch directories. Corpus verification checks exact
compressed output bytes against the separately bundled published payload pins;
it does not treat a newly generated manifest as independent evidence. To prepare
NLP CSVs from `$work_dir/corpus-output`, run the earlier NLP commands with
`--sources-dir "$work_dir/corpus-output"` and fresh `--output-dir "$work_dir/replay-nlp-output"` and
`--scratch-dir "$work_dir/replay-nlp-scratch"`. Run NLP download first to supply NLTK
stopwords, then offline build and verify.

Preparation code is MIT licensed in the source collection. Article text and its
normalized derivatives retain the CC BY-SA 4.0 terms and attribution obligations
below.

## Attribution, license and use


Article text and wikitext are attributed to **Russian Wikipedia contributors**
and distributed under [Creative Commons Attribution-ShareAlike 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
Each record's `revision_url` identifies the revision used; `page_url` provides
access to the page and its edit history for contributor attribution. Follow
attribution and share-alike requirements when redistributing text or adaptations,
identify your changes, and preserve appropriate source links. Wikipedia can
contain quotations or other third-party material with additional terms. Wikidata
identifiers refer to [Wikidata](https://www.wikidata.org/wiki/Wikidata:Licensing),
whose structured data is available under CC0; their presence does not change the
license of the article text. Images and other media binaries are not included.

Potential uses include Russian text analysis, inspection of markup extraction and
research on Wikipedia editorial metadata or category relationships. This is a
small, editorially selected portion of Russian Wikipedia, not a representative
sample of Russian writing or an evenly balanced subject collection. Quality
status does not guarantee accuracy, neutrality, completeness or suitability for
any downstream application. Articles can contain sensitive, biased, outdated or
offensive material. The partial subject labels described here do not establish a complete reference
annotation. The optional reference splits above provide one document partition;
further downstream preprocessing, deduplication and any alternative split policy
must be specified for each study.

## File verification

Run from this downloaded repository's root:

```bash
sha256sum -c SHA256SUMS
```

[SHA256SUMS](SHA256SUMS) covers all seven data files, excluding this README and
Git/service metadata. Full has its own manifest for its data and shared
preparation files. The shared corpus contract independently pins expected
published reconstruction payloads. A successful local checksum check establishes
agreement with the supplied manifest; use a trusted repository revision to
establish provenance.