jph00 commited on
Commit
c620e09
·
verified ·
1 Parent(s): f93fa9d

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - en
5
+ configs:
6
+ - config_name: articles
7
+ default: true
8
+ data_files: data/articles/*.parquet
9
+ - config_name: chunks
10
+ data_files: data/chunks/*.parquet
11
+ ---
12
+
13
+ # Simple English Wikipedia as clean md
14
+
15
+ This dataset is a cleaned, structurally faithful approximation of the Simple English Wikipedia article corpus in Answer.AI's canonical `md` dialect. It was produced from the Wikimedia dump dated **20260801** by [Answer.AI's parse-wiki pipeline](https://github.com/AnswerDotAI/parse-wiki).
16
+
17
+ It is designed for language-model training and for agent/RAG systems. The `articles` configuration provides complete documents for continued pretraining, corpus analysis, rechunking, and task-specific dataset creation. The `chunks` configuration provides section-aware retrieval units without duplicating article text: every chunk is a UTF-8 byte range into an article plus a small Markdown heading prefix. This keeps the corpus compact while preserving useful article and section breadcrumbs.
18
+
19
+ ## Contents
20
+
21
+ - **articles** — 268,871 cleaned articles with dense `article_id`, Wikimedia page and revision IDs, title, revision timestamp, complete `md`, and conversion warnings.
22
+ - **chunks** — 306,241 chunk indexes targeting about 700 words, with `article_id`, per-article `chunk_id`, UTF-8 `start_byte`/`byte_len`, `prefix_md`, `start_kind`, and `word_count`.
23
+
24
+ The article row number equals `article_id`, and chunk rows are ordered by `article_id` then `chunk_id`. UTF-8 byte offsets—not Python character offsets—are used so ranges are stable across languages and tools.
25
+
26
+ ```python
27
+ from datasets import load_dataset
28
+
29
+ articles = load_dataset("answerdotai/simplewiki", "articles", split="train")
30
+ chunks = load_dataset("answerdotai/simplewiki", "chunks", split="train")
31
+
32
+ def materialize(article, chunk):
33
+ body = article["md"].encode()
34
+ start = chunk["start_byte"]
35
+ return chunk["prefix_md"] + body[start:start + chunk["byte_len"]].decode()
36
+
37
+ chunk = chunks[100]
38
+ text = materialize(articles[chunk["article_id"]], chunk)
39
+ ```
40
+
41
+ `materialize.py` contains the same dependency-free reconstruction helper. Retrieval systems can store chunk rows in their vector index, fetch the corresponding article by dense row ID, and reconstruct only selected chunks. Training pipelines can stream complete article rows or materialize chunk rows on demand.
42
+
43
+ ## Processing
44
+
45
+ The Rust pipeline parses wikitext directly into mdhtml's document model, applies Wikipedia-specific cleanup structurally, serializes each retained article once, and computes chunks from the same document without reparsing. It keeps namespace-0, non-redirect, non-disambiguation pages with at least 250 source bytes and discards pages without enough prose after cleanup. Navigation, maintenance, citation, sidebar, and similar non-article templates are removed using Wikimedia template/category metadata; common semantic templates, math, tables, and links are converted directly. Unsupported expansion-dependent constructs may remain as explicit raw wikitext islands.
46
+
47
+ The chunker prefers high-level heading boundaries and only falls back to lower headings and block boundaries as needed. Footnote references and definitions are removed by this Wikipedia cleanup; the generic chunker also never duplicates footnote definitions across chunks.
48
+
49
+ See `manifest.json` for exact input checksums, schema version, processing parameters, output checksums, and tool source identifiers.
50
+
51
+ ## Uses and limitations
52
+
53
+ Useful applications include language-model pretraining or adaptation, embedding and retrieval corpora, grounded agent knowledge stores, search, summarization, and experiments with alternative chunking strategies. `page_id`, `revision_id`, and `timestamp` support provenance, exact revision links, auditing, and future incremental updates.
54
+
55
+ This is intentionally a fast, useful approximation rather than a browser-perfect rendering. MediaWiki templates requiring server-side expansion may be simplified, removed, or retained as raw syntax. Images and Wikipedia-only presentation/navigation are generally omitted. Consumers requiring exact current facts should follow the stored revision provenance and compare against Wikimedia.
56
+
57
+ ## License and attribution
58
+
59
+ Wikipedia text is provided by its contributors under the [Creative Commons Attribution-ShareAlike 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/) and may also be available under the GFDL. This transformed dataset is distributed under CC BY-SA 4.0. Attribute **Simple English Wikipedia contributors**, link to the relevant article or revision, and indicate that the text was transformed by Answer.AI's parse-wiki pipeline. For a row, an exact revision URL is:
60
+
61
+ ```python
62
+ url = f"https://simple.wikipedia.org/w/index.php?oldid={article['revision_id']}"
63
+ ```
64
+
65
+ See [Wikimedia's reuse guidance](https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use) for full terms.
data/articles/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0cd8029d2f7fc1db61ddd220a53c1bceab3880717fa31918ffda275730d5378
3
+ size 189921335
data/chunks/train-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3746de9d9cdd45eeebaf81198429ba098dc976647f1ef24203c3605646ae4821
3
+ size 5722492
manifest.json ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": 1,
3
+ "wiki": "simplewiki",
4
+ "dump_date": "20260801",
5
+ "generated_at": "2026-08-24T05:29:28.699501+00:00",
6
+ "parameters": {
7
+ "min_bytes": 250,
8
+ "target_words": 700,
9
+ "limit": null
10
+ },
11
+ "counts": {
12
+ "articles": 268871,
13
+ "chunks": 306241
14
+ },
15
+ "unresolved_templates": [
16
+ [
17
+ "mp",
18
+ 172171
19
+ ],
20
+ [
21
+ "gbmappingsmall",
22
+ 43625
23
+ ],
24
+ [
25
+ "coloredlink",
26
+ 40673
27
+ ],
28
+ [
29
+ "goal",
30
+ 36612
31
+ ],
32
+ [
33
+ "flagicon",
34
+ 23927
35
+ ],
36
+ [
37
+ "momp",
38
+ 21352
39
+ ],
40
+ [
41
+ "mesh number",
42
+ 20318
43
+ ],
44
+ [
45
+ "italictitle",
46
+ 9970
47
+ ],
48
+ [
49
+ "in lang",
50
+ 8536
51
+ ],
52
+ [
53
+ "flag",
54
+ 8112
55
+ ],
56
+ [
57
+ "football box collapsible",
58
+ 7912
59
+ ],
60
+ [
61
+ "fs player",
62
+ 7320
63
+ ],
64
+ [
65
+ "nom",
66
+ 7123
67
+ ],
68
+ [
69
+ "start date",
70
+ 6894
71
+ ],
72
+ [
73
+ "nihongo",
74
+ 6332
75
+ ],
76
+ [
77
+ "hlist",
78
+ 6284
79
+ ],
80
+ [
81
+ "won",
82
+ 5118
83
+ ],
84
+ [
85
+ "football player club statistics 2",
86
+ 4941
87
+ ],
88
+ [
89
+ "fbaicon",
90
+ 4471
91
+ ],
92
+ [
93
+ "football box",
94
+ 4217
95
+ ],
96
+ [
97
+ "yes",
98
+ 4212
99
+ ],
100
+ [
101
+ "party color|conservative party (uk)",
102
+ 3988
103
+ ],
104
+ [
105
+ "no",
106
+ 3525
107
+ ],
108
+ [
109
+ "center|\u2014",
110
+ 3515
111
+ ],
112
+ [
113
+ "party color|labour party (uk)",
114
+ 3445
115
+ ],
116
+ [
117
+ "fbu",
118
+ 3382
119
+ ],
120
+ [
121
+ "sort dash",
122
+ 3350
123
+ ],
124
+ [
125
+ "fb",
126
+ 3345
127
+ ],
128
+ [
129
+ "fbicon",
130
+ 3216
131
+ ],
132
+ [
133
+ "track listing",
134
+ 3045
135
+ ]
136
+ ],
137
+ "raw_formats": [
138
+ [
139
+ "wikitext",
140
+ 57986
141
+ ],
142
+ [
143
+ "html",
144
+ 12746
145
+ ]
146
+ ],
147
+ "inputs": {
148
+ "xml": {
149
+ "path": "simplewiki-latest-pages-articles.xml",
150
+ "sha256": "cb7c2d5de57ed0f3aa40f6c8cf96a7ed365a5388d205da6b614df7c4e430cf29"
151
+ },
152
+ "page_props": {
153
+ "path": "simplewiki-latest-page_props.sql",
154
+ "sha256": "2820009b359ebbbea97a49a27b17c3906185b05e0e8c7f88fb30374f0d948f5a"
155
+ },
156
+ "template_db": {
157
+ "path": "simplewiki-templates.sqlite",
158
+ "sha256": "b0c5ac4f446c67dc4ec4590c5921af4093fc12c30aa34088def88129efb1120f"
159
+ }
160
+ },
161
+ "tools": {
162
+ "parse_wiki": {
163
+ "commit": "bc35219afe3739c81718424019649114afc18930",
164
+ "dirty": true
165
+ },
166
+ "mdhtml": {
167
+ "commit": "dfeaf6f61cfa54afbf16b718169bc3a6995f9373",
168
+ "dirty": true
169
+ }
170
+ },
171
+ "files": {
172
+ "data/articles/train-00000.parquet": {
173
+ "bytes": 189921335,
174
+ "sha256": "b0cd8029d2f7fc1db61ddd220a53c1bceab3880717fa31918ffda275730d5378"
175
+ },
176
+ "data/chunks/train-00000.parquet": {
177
+ "bytes": 5722492,
178
+ "sha256": "3746de9d9cdd45eeebaf81198429ba098dc976647f1ef24203c3605646ae4821"
179
+ }
180
+ }
181
+ }
materialize.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ """Reconstruct chunk text from the two dataset configurations."""
2
+
3
+ def materialize(article, chunk):
4
+ body = article["md"].encode()
5
+ start = chunk["start_byte"]
6
+ return chunk["prefix_md"] + body[start:start+chunk["byte_len"]].decode()