--- language: - ru license: cc-by-sa-4.0 pretty_name: Russian Wikipedia quality articles (20261001) configs: - config_name: articles default: true data_files: - split: corpus path: data/articles.jsonl.gz - config_name: categories data_files: - split: corpus path: data/categories.jsonl.gz --- # RuWiki-Good-2026 — Russian Wikipedia quality articles A Russian-language corpus of **17,413 Wikipedia articles** with active community quality status in the **20261001** Russian Wikipedia dump, accompanied by a catalog of **831,556 categories**. Each article includes its title, source wikitext, extracted readable text, direct categories, quality status and revision links. The category catalog supports inspection of direct membership and parent relationships; it is not a curated subject taxonomy. The full collection is published as [TopicNet/RuWiki-Good-2026](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026). Its subject-labeled companion is [TopicNet/RuWiki-Good-Thematized-2026](https://huggingface.co/datasets/TopicNet/RuWiki-Good-Thematized-2026). In the preparation commands below, these datasets are called Full and Thematized, respectively. ## Files at a glance | File | Purpose | Bytes | | --- | --- | ---: | | `data/articles.jsonl.gz` | Source article records, readable text and provenance. | 409,970,311 | | `data/categories.jsonl.gz` | Category catalog and direct parent relationships. | 22,459,573 | | `data/noow.csv` | Whole-document text and ordered normalized VW features. | 1,128,356,201 | | `data/bow.csv` | The same documents with counted VW features. | 883,080,852 | The reusable code, environment locks and source/output pins are in [preprocessing/](preprocessing/). [SHA256SUMS](SHA256SUMS) covers the published data and preparation files; see [file verification](#file-verification). ## Coverage and selection The corpus is the union of namespace-0 articles in these direct SQL categories: | Status value | Russian designation | Selection category | Articles | | --- | --- | --- | ---: | | `recommended` | Добротные статьи | `Википедия:Добротные_статьи_по_алфавиту` | 9,937 | | `good` | Хорошие статьи | `Википедия:Хорошие_статьи_по_алфавиту` | 5,264 | | `featured` | Избранные статьи | `Википедия:Избранные_статьи_по_алфавиту` | 2,212 | Redirects and disambiguation pages are excluded. Statuses are stored as lists: multiple active statuses are preserved rather than ranked or collapsed. Former status categories are retained separately and do not exclude an article that has an active status. These are community editorial designations at this snapshot, not independent factual checks or current assessments. All selected articles are retained. Source selection applies no thematic filtering, sampling, subject-label assignment or research train/test split. The original JSON records are preserved; the optional preparation workflow below produces separate NLP CSV files. There are no exact duplicate `wikitext` or `raw_text` values in this snapshot; the selection procedure does not remove records because they share text. The `corpus` partition is a storage partition, not a research split. ## Quick start: load the published files The `articles` configuration is the default. `articles` and `categories` use compressed JSON Lines and the `corpus` split, with no dataset script. With Hugging Face Datasets: ```python from datasets import load_dataset articles = load_dataset( "TopicNet/RuWiki-Good-2026", "articles", split="corpus" ) categories = load_dataset( "TopicNet/RuWiki-Good-2026", "categories", split="corpus" ) print(len(articles)) # 17413 print(len(categories)) # 831556 ``` From a downloaded repository, the same files can be loaded directly: ```python articles = load_dataset( "json", data_files={"corpus": "data/articles.jsonl.gz"}, split="corpus" ) categories = load_dataset( "json", data_files={"corpus": "data/categories.jsonl.gz"}, split="corpus" ) ``` The prepared NLP files `data/noow.csv` and `data/bow.csv` contain the same 17,413 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-2026/data/noow.csv"}, split="corpus", ) bow = load_dataset( "csv", data_files={"corpus": "hf://datasets/TopicNet/RuWiki-Good-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. 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. ## Article fields | Field | JSON type | Meaning | | --- | --- | --- | | `id` | string | Stable page identity, `ruwiki/`. | | `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. | 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" } ``` ## Category fields and joins | Field | JSON type | Meaning | | --- | --- | --- | | `title` | string | Category name without the category namespace prefix, preserving SQL underscores. | | `page_id` | integer or null | Category page ID; null for redlinks. | | `wikidata_id` | string or null | Wikidata QID, when available. | | `is_hidden` | boolean or null | Hidden-category flag; null for redlinks. | | `is_redirect` | boolean or null | Category-page redirect flag; null for redlinks. | | `parents` | array of strings | Direct parent category names in the same spelling as `title`. | The catalog includes all category pages in the SQL snapshot and referenced categories without a page (redlinks), rather than only categories used by the selected articles. There are **72,676 redlinks**, **2,047,936 parent links** and **269,139 direct article-category links**. Redlink records have null page ID, flags and QID and an empty parent list. Parent cycles and redirect flags are preserved; parent links do not define a tree or validated semantic hierarchy. Join an article's `categories` entries, or a category's `parents` entries, to category `title` exactly, without converting underscores to spaces. Article `title` uses spaces and is not the join key. For instance, `Социология` is a direct category of article `ruwiki/21`. The following complete category record illustrates the stored format: ```json { "is_hidden": false, "is_redirect": false, "page_id": 3042229, "parents": [ "Википедия:Категории_с_основной_статьёй_из_Викиданных", "Категории_музыкальных_коллективов_США" ], "title": "(hed)_P.E.", "wikidata_id": "Q7573257" } ``` ## Sources and revision semantics The source is the [Russian Wikipedia 20261001 dump](https://dumps.wikimedia.org/ruwiki/20261001/). The [source and output pins](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`. **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](preprocessing/prepare.py) builds `noow.csv` and `bow.csv` from the pinned article snapshots without modifying their JSON files. Full uses all 17,413 articles. Each CSV has exactly three columns: `id`, `raw_text`, `vw_text`. IDs and article order are preserved. CSV `raw_text` is the title, two LF characters and the original readable body with only its leading CR/LF characters removed. In the original JSON, `raw_text` remains the readable body alone. Standard CSV quoting preserves embedded newlines; one whole-document row can span many physical lines. `vw_text` uses Vowpal Wabbit namespaces in this order: | Namespace | Contents | | --- | --- | | `@title` | Normalized title tokens. | | `@word` | Normalized body tokens only; the title is not prepended. | | `@bigram` | Accepted adjacent body bigrams. | | `@trigram` | Accepted adjacent body trigrams. | | `@category` | All direct Wikipedia categories, including service and maintenance categories. | NOOW preserves the normalized token sequence within each namespace, not the raw prose. BOW counts exactly those NOOW tokens independently in each namespace. It does not trim the token sequence or remove articles. There are no research splits, deduplication, model training or chain extraction in this workflow. Normalization uses `spacy.blank("ru")`, pymorphy3 normal forms and the union of spaCy Russian and NLTK Russian stopwords. Punctuation and whitespace tokens are removed; HTML tags, URLs and email addresses become ``, `` and ``. Cyrillic stress marks are removed; lexical Cyrillic compounds with ASCII hyphen, U+2010 or U+2011 are normalized to ASCII hyphens and kept as single tokens. Person names are not masked. Bigrams and trigrams are selected independently using NLTK PMI after a corpus frequency threshold of 5, with `nbest(32100)[100:]` for each order. Selection uses all normalized article bodies in the chosen collection; it is **corpus-global**, not fitted only on a later training split. Full and Thematized therefore have separately selected n-gram vocabularies. These CSVs are not a claim of evaluation without information from held-out documents. For text-only experiments, use only `@word`; title, category and subject metadata may reveal evaluation targets. ### Rebuild NLP CSVs from ready article snapshots Run the preparation commands from `preprocessing/` in the downloaded Full collection. 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 the Thematized 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. Python 3.11.15 is the pinned runtime for both build and verify: VW escaping depends on its Unicode database. On Linux x86-64, use the supplied locks: ```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 --help python prepare.py --stage nlp --action download --dataset both \ --sources-dir "$work_dir/nlp-sources" python prepare.py --stage nlp --action build --dataset both \ --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 both \ --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, so earlier commands without `--stage` continue to work. Choose `--dataset full`, `selected` or `both`. The [pinned NLP contract](preprocessing/wikipedia-quality-nlp-20261001.json) records source revisions, source payload hashes and runtime requirements. The [corpus contract](preprocessing/wikipedia-quality-corpus-20261001.json) additionally pins the expected published NLP output bytes. `requirements.txt` lists direct dependencies, including `mwparserfromhell==0.7.2` for corpus extraction. The locks retain the complete environment used for NLP; no downloaded spaCy language model is needed. If installing only the direct requirements in a separate environment, retain Python 3.11.15. Download checks existing source files against their pins, fetches missing files, and acquires the pinned NLTK archive at `$work_dir/nlp-sources/nltk_data/corpora/stopwords.zip`. To reuse downloaded JSONL files, place them at `$work_dir/nlp-sources/full/articles.jsonl.gz`, `$work_dir/nlp-sources/selected/articles.jsonl.gz` and `$work_dir/nlp-sources/selected/topics.jsonl.gz` before running download. This step creates the local NLTK resource directory; no pre-existing `nltk_data` is required. Use `--nltk-data` to select a different local NLTK resource directory. Hugging Face downloads use anonymous Python `urllib`. For restricted repositories, fetch the pinned files with authenticated tools, place them at the paths above, and rerun download. The script does not handle authentication tokens. Build runs offline, checks runtime versions and Russian stopword content, and writes `$work_dir/nlp-output/full` and `$work_dir/nlp-output/selected`. Keep outputs and scratch separate from published data and use a fresh scratch directory for a new build. Progress messages identify phases and document counts. Each build manifest records counts and ordered IDs of documents with an empty `@word` namespace; those articles remain in the output. Verification needs no NLP packages. It checks source identities, output hashes against the build manifest, schemas, source text and NOOW/BOW token-count agreement. The shared entry point then independently checks the generated CSVs and Thematized labels against published byte sizes and SHA-256 pins in the corpus contract, reporting `PUBLISHED_NLP_OK` on success. These expectations are separate from the newly generated manifest. Verification does not rerun tokenization, lemmatization or PMI selection. A measured build of both NLP collections from the 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 files. These measurements exclude raw dump downloads and corpus reconstruction; they are an example from one environment, not a bound for other machines. 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/full" 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" ) ``` ## Rebuild the corpus from Wikimedia dumps The same entry point supports `--stage corpus`, with `download`, `build` and `verify` actions. The [corpus contract](preprocessing/wikipedia-quality-corpus-20261001.json) pins the six 20261001 dump files, the published article/category payloads and the retained Thematized annotations. This public raw-dump replay has **not yet been run end to end**. Its download time, build time and peak disk and memory requirements have not been measured; the NLP measurements above do not describe this stage. Keep the same `preprocessing/` working directory and path variables as in the NLP commands above. The Thematized annotation directory must already contain `labels.json` and `topics.jsonl.gz`. These retained mappings reproduce the published subject assignments; the script does not rerun AI labeling. ```bash python prepare.py --stage corpus --action download --dataset both \ --sources-dir "$work_dir/dump-sources" # Resume an interrupted dump download explicitly: python prepare.py --stage corpus --action download --dataset both \ --sources-dir "$work_dir/dump-sources" \ --resume 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" ``` Download stores and checks the six pinned files beneath `--sources-dir`. After all files are present, build is offline. It reconstructs SQL metadata, selects qualifying article IDs, extracts the indexed XML revisions, and applies the readable-text cleanup. It 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`. Use separate fresh output and scratch directories, leaving published `data/` untouched. Corpus verification compares outputs with the independently bundled expected published payloads, rather than trusting hashes newly written by the build itself. For Full only, set `--dataset full` and omit `--annotations-dir`. Thematized can also be reconstructed from a previously accepted Full corpus without rereading the dumps. From the same `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. To continue from reconstructed JSONL to NLP, the corpus output root is directly usable as `--sources-dir`. Download then supplies the pinned NLTK archive before the offline NLP build: ```bash python prepare.py --stage nlp --action download --dataset both \ --sources-dir "$work_dir/corpus-output" python prepare.py --stage nlp --action build --dataset both \ --sources-dir "$work_dir/corpus-output" \ --output-dir "$work_dir/replay-nlp-output" \ --scratch-dir "$work_dir/replay-nlp-scratch" python prepare.py --stage nlp --action verify --dataset both \ --sources-dir "$work_dir/corpus-output" \ --output-dir "$work_dir/replay-nlp-output" ``` The code in `preprocessing/` is available under its [MIT license](preprocessing/LICENSE). The article text and its normalized derivatives retain the CC BY-SA 4.0 terms and attribution requirements described 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. Any further subject labels, deduplication policy, preprocessing and research splits needed for a downstream study must be specified separately. ## File verification From the root of the downloaded repository, verify the distributed data and preparation files with: ```bash sha256sum -c SHA256SUMS ``` [SHA256SUMS](SHA256SUMS) lists those files without embedding long digests in this card. It excludes this README and Git/service metadata. The corpus and NLP contracts in `preprocessing/` pin source inputs, while the corpus contract also pins expected published corpus and NLP payloads independently of a new build. A successful checksum check establishes agreement with the supplied manifest; use a trusted repository revision when establishing provenance.