Vasily Alexeev commited on
Commit
74a71cc
·
1 Parent(s): fc1ad9b

add csv data for topic modeling

Browse files
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. README.md +115 -7
  3. data/bow.csv +3 -0
  4. data/labels.json +0 -0
  5. data/noow.csv +3 -0
.gitattributes CHANGED
@@ -60,3 +60,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  *.jsonl filter=lfs diff=lfs merge=lfs -text
62
  *.jsonl.gz filter=lfs diff=lfs merge=lfs -text
 
 
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  *.jsonl filter=lfs diff=lfs merge=lfs -text
62
  *.jsonl.gz filter=lfs diff=lfs merge=lfs -text
63
+ *.csv filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -56,14 +56,16 @@ their subject list is nonempty: **162 source articles** have no assigned subject
56
  omitted. No coverage quota, topic balancing or maximum label count was used.
57
  Subject frequencies and intersections are consequently uneven.
58
 
59
- There is no NLP preprocessing, model scoring or research train/test split in this
60
- package. The `corpus` split is a storage partition. Source text has not been
61
- shortened or rewritten for subject selection. No exact duplicate source text was
 
62
  removed. This collection is not a representative sample of Russian writing.
63
 
64
  ## Loading
65
 
66
- Both configurations use compressed JSON Lines and require no dataset script.
 
67
 
68
  ```python
69
  from datasets import load_dataset
@@ -90,6 +92,48 @@ topics = load_dataset(
90
  )
91
  ```
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  ## Article fields
94
 
95
 
@@ -227,6 +271,67 @@ fragments of markup or awkward text may remain. `wikitext` is retained so reader
227
  can inspect these losses or apply a different extraction procedure. Neither
228
  `raw_text` nor the category metadata is a manually corrected annotation.
229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  ## Attribution, license and use
231
 
232
 
@@ -248,15 +353,18 @@ sample of Russian writing or an evenly balanced subject collection. Quality
248
  status does not guarantee accuracy, neutrality, completeness or suitability for
249
  any downstream application. Articles can contain sensitive, biased, outdated or
250
  offensive material. The partial subject labels described here do not establish a complete reference
251
- annotation. Downstream preprocessing, deduplication policy and research splits
252
- must be specified separately.
253
 
254
  ## Published file identity
255
 
256
- | File | Compressed bytes | SHA-256 |
257
  | --- | ---: | --- |
258
  | `data/articles.jsonl.gz` | 413,342,335 | `9eb7efffe99fc7c9bc3f4b3eb9f0378d91f387081f97cf9abea9c1686797c1ed` |
259
  | `data/topics.jsonl.gz` | 2,671 | `c8cf602a924f18255e155cdcaa9357907461851e849113c72051c2b89484f22c` |
 
 
 
260
 
261
  The source article payload SHA-256 is
262
  `c51f9b6bee4c85f25ffb861060f52490a9276bae289d2aa2db7e0d10e2dda950`.
 
56
  omitted. No coverage quota, topic balancing or maximum label count was used.
57
  Subject frequencies and intersections are consequently uneven.
58
 
59
+ The original JSON records have no NLP preprocessing or model scoring. The
60
+ optional preparation workflow below produces separate NLP CSV files without a
61
+ research train/test split. The `corpus` split is a storage partition. Source text
62
+ has not been shortened or rewritten for subject selection. No exact duplicate source text was
63
  removed. This collection is not a representative sample of Russian writing.
64
 
65
  ## Loading
66
 
67
+ The `articles` configuration is the default. `articles` and `topics` use
68
+ compressed JSON Lines and the `corpus` split, with no dataset script.
69
 
70
  ```python
71
  from datasets import load_dataset
 
92
  )
93
  ```
94
 
95
+ The prepared NLP files `data/noow.csv` and `data/bow.csv` contain the same
96
+ 17,251 article IDs, in source order, with string columns `id`, `raw_text`,
97
+ `vw_text`. Use the CSV reader for these files, separately from the repository's
98
+ JSON Lines configurations:
99
+
100
+ ```python
101
+ noow = load_dataset(
102
+ "csv",
103
+ data_files={"corpus": "hf://datasets/TopicNet/RuWiki-Good-2026-V2-Selected/data/noow.csv"},
104
+ split="corpus",
105
+ )
106
+ bow = load_dataset(
107
+ "csv",
108
+ data_files={"corpus": "hf://datasets/TopicNet/RuWiki-Good-2026-V2-Selected/data/bow.csv"},
109
+ split="corpus",
110
+ )
111
+ ```
112
+
113
+ From the parent of a downloaded repository:
114
+
115
+ ```python
116
+ noow = load_dataset(
117
+ "csv", data_files={"corpus": "RuWiki-Good-2026-V2-Selected/data/noow.csv"}, split="corpus"
118
+ )
119
+ bow = load_dataset(
120
+ "csv", data_files={"corpus": "RuWiki-Good-2026-V2-Selected/data/bow.csv"}, split="corpus"
121
+ )
122
+ ```
123
+
124
+ The NLP preparation section describes the normalized namespaces and text fields.
125
+
126
+ The sidecar [data/labels.json](data/labels.json) is a JSON object mapping every
127
+ Selected article ID to its list of subject slugs, matching both article `topics`
128
+ and the CSV `@topic` namespace. It is not a separate dataset configuration.
129
+
130
+ ```python
131
+ import json
132
+ from pathlib import Path
133
+
134
+ labels = json.loads(Path("RuWiki-Good-2026-V2-Selected/data/labels.json").read_text(encoding="utf-8"))
135
+ ```
136
+
137
  ## Article fields
138
 
139
 
 
271
  can inspect these losses or apply a different extraction procedure. Neither
272
  `raw_text` nor the category metadata is a manually corrected annotation.
273
 
274
+ ## NLP preparation
275
+
276
+ The [standalone preparation code](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026-V2/tree/main/preprocessing)
277
+ and [full instructions](https://huggingface.co/datasets/TopicNet/RuWiki-Good-2026-V2#nlp-preparation)
278
+ are maintained in the source collection. Download the code directory and use
279
+ `--dataset selected` to prepare this collection, or `--dataset both` to prepare
280
+ both collections from their pinned sources. Build and verify require Python
281
+ 3.11.15; verify needs no NLP packages.
282
+
283
+ ```bash
284
+ python prepare.py --action download --dataset selected --sources-dir ./sources
285
+ python prepare.py --action build --dataset selected --sources-dir ./sources --output-dir ./output --scratch-dir ./scratch
286
+ python prepare.py --action verify --dataset selected --sources-dir ./sources --output-dir ./output
287
+ ```
288
+
289
+ The workflow produces `output/selected/noow.csv` and `bow.csv` with exactly
290
+ `id`, `raw_text`, `vw_text` columns for all 17,251 selected IDs, preserving article
291
+ order. CSV `raw_text` is the title, two LF characters and the original readable
292
+ body with its leading CR/LF characters removed. Original JSON `raw_text` remains
293
+ the readable body alone; the source JSON files are unchanged.
294
+
295
+ The normalized VW namespaces are `@title`, `@word`, `@bigram`, `@trigram`,
296
+ `@category`, then `@topic`. `@word` contains the body only. `@category` retains
297
+ all direct categories, including service and maintenance categories. `@topic`
298
+ contains the accepted subject slugs described above, not raw Wikipedia rubric
299
+ names. `labels.json` maps article IDs to those same subject slugs. These labels
300
+ remain partial and AI-assisted; preprocessing does not improve their validity.
301
+ NOOW preserves normalized token order within each namespace, not raw prose.
302
+ BOW counts precisely the same tokens separately in every namespace.
303
+
304
+ Normalization uses spaCy Russian tokenization, pymorphy3 lemmas and the union of
305
+ spaCy and pinned NLTK Russian stopwords. Punctuation is removed; tags, URLs and
306
+ email addresses become placeholders. Cyrillic stress marks are removed and
307
+ lexical Cyrillic hyphenated compounds are retained with ASCII hyphens. Names
308
+ are not masked. There is no article removal, token trimming, research split,
309
+ model training or chain extraction. Build prints phase and document-count
310
+ progress; the manifest reports empty `@word` articles by count and ordered IDs
311
+ without dropping them.
312
+
313
+ Bigrams and trigrams use independent NLTK PMI selection after frequency ≥5,
314
+ with `nbest(32100)[100:]` for each order. This selection uses **all Selected
315
+ article bodies**, independently of Full; it is corpus-global rather than fitted
316
+ only on a future training partition. For text-only experiments, use only `@word`
317
+ to avoid exposing category, title or subject metadata to the model. The workflow
318
+ does not establish an evaluation without information from held-out documents.
319
+
320
+ Load a generated CSV directly:
321
+
322
+ ```python
323
+ noow = load_dataset(
324
+ "csv", data_files={"corpus": "output/selected/noow.csv"}, split="corpus"
325
+ )
326
+ bow = load_dataset(
327
+ "csv", data_files={"corpus": "output/selected/bow.csv"}, split="corpus"
328
+ )
329
+ ```
330
+
331
+ Preparation code is MIT licensed in the source collection. Article text and its
332
+ normalized derivatives retain the CC BY-SA 4.0 terms and attribution obligations
333
+ below.
334
+
335
  ## Attribution, license and use
336
 
337
 
 
353
  status does not guarantee accuracy, neutrality, completeness or suitability for
354
  any downstream application. Articles can contain sensitive, biased, outdated or
355
  offensive material. The partial subject labels described here do not establish a complete reference
356
+ annotation. Further downstream preprocessing, deduplication policy and research
357
+ splits must be specified separately.
358
 
359
  ## Published file identity
360
 
361
+ | File | Bytes | SHA-256 |
362
  | --- | ---: | --- |
363
  | `data/articles.jsonl.gz` | 413,342,335 | `9eb7efffe99fc7c9bc3f4b3eb9f0378d91f387081f97cf9abea9c1686797c1ed` |
364
  | `data/topics.jsonl.gz` | 2,671 | `c8cf602a924f18255e155cdcaa9357907461851e849113c72051c2b89484f22c` |
365
+ | `data/noow.csv` | 1,118,455,706 | `2c71aa6b5a327ebe924f5f0160eaf6f923a86da1a3a7fe8c68aa67f8858f8b6b` |
366
+ | `data/bow.csv` | 875,143,956 | `bff3a82c29ab3b866fe86135ff99b3897deb98dc4e5ed6db4ea7b24bd4011bae` |
367
+ | `data/labels.json` | 649,823 | `e7ceacd69d76601df24bb42e6d0177f46142d0b8ac1bf6e8c22ad4d5a0b0ca70` |
368
 
369
  The source article payload SHA-256 is
370
  `c51f9b6bee4c85f25ffb861060f52490a9276bae289d2aa2db7e0d10e2dda950`.
data/bow.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bff3a82c29ab3b866fe86135ff99b3897deb98dc4e5ed6db4ea7b24bd4011bae
3
+ size 875143956
data/labels.json ADDED
The diff for this file is too large to render. See raw diff
 
data/noow.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c71aa6b5a327ebe924f5f0160eaf6f923a86da1a3a7fe8c68aa67f8858f8b6b
3
+ size 1118455706