| --- |
| license: |
| - gfdl |
| - cc-by-sa-3.0 |
| language: |
| - de |
| task_categories: |
| - text-generation |
| - fill-mask |
| size_categories: |
| - 1M<n<10M |
| tags: |
| - wikipedia |
| - german |
| - language-modeling |
| - pretraining |
| - cleaned |
| pretty_name: German Wikipedia (Cleaned) |
| --- |
| |
| # German Wikipedia (Cleaned) |
|
|
| A cleaned, plain-text version of the German Wikipedia for language model |
| pre-training. Each line is a single article; wiki markup, references, and |
| boilerplate navigation sections have been removed. |
|
|
| | | | |
| |---|---| |
| | Articles | ~2,000,000 | |
| | Size | ~10 GB (UTF-8 plain text) | |
| | Format | JSONL, one `{"text": "..."}` object per line | |
| | Source dump | `dewiki-20260601-pages-articles-multistream.xml.bz2` | |
| | Source URL | <https://dumps.wikimedia.org/dewiki/20260601/> | |
| | License | GFDL + CC-BY-SA 3.0 (inherited) | |
| | Language | German (`de`) | |
|
|
| ## What's in this dataset |
|
|
| Plain-text article bodies. Section structure (headers, paragraphs) is |
| preserved as line breaks; wiki markup, templates, infoboxes, tables, |
| image captions, magic words, references, and the standard |
| end-of-article navigation sections are stripped. |
|
|
| Every record is a single article. The corpus is suitable for: |
|
|
| - Continued pre-training of base language models on German |
| - Causal language modeling from scratch |
| - Masked language modeling (BERT-style) |
| - Domain-adaptive pre-training for German-heavy applications |
|
|
| ## What was filtered out |
|
|
| The following pages from the raw MediaWiki dump are excluded: |
|
|
| - **Non-article namespaces** — `Wikipedia:`, `Portal:`, `Hilfe:`, |
| `Kategorie:`, `Vorlage:`, `Modul:`, `MediaWiki:` (any namespace != 0) |
| - **Redirects** |
| - **Stubs** — articles with fewer than 1500 characters after markup |
| stripping |
| - **Oversized articles** — articles longer than 80,000 characters after |
| cleanup (typically list-articles and bot-generated entries) |
| - **Disambiguation pages** — titles containing "(Begriffsklärung)" or |
| "(disambiguation)" |
| - **List pages** — titles starting with "Liste " or "List " |
|
|
| Within retained articles, the following residual cleanup is applied: |
|
|
| - Lines beginning with `mini|` are removed (leftover cells from stripped |
| Infobox templates) |
| - Runs of three or more consecutive newlines are collapsed to two |
|
|
| ## How to use |
|
|
| Load with the `datasets` library: |
|
|
| ```python |
| from datasets import load_dataset |
| |
| ds = load_dataset("gmrrh/de-wiki", split="train") |
| |
| # ds[i]["text"] is the full article body as a single string |
| |
| # Iterate for training |
| for ex in ds: |
| text = ex["text"] |
| # tokenize, pack into chunks, train |
| ``` |
|
|
| Streaming for environments where the ~10 GB download is inconvenient: |
|
|
| ```python |
| from datasets import load_dataset |
| |
| ds = load_dataset( |
| "gmrrh/de-wiki", |
| split="train", |
| streaming=True, |
| ) |
| for ex in ds: |
| text = ex["text"] |
| # ... |
| ``` |
|
|
| ## Data fields |
|
|
| | Field | Type | Description | |
| |---|---|---| |
| | `text` | `string` | Article body, plain text, UTF-8, line-broken by section | |
|
|
| There is a single `train` split. No held-out splits are provided; this is |
| a pre-training corpus, not an evaluation benchmark. |
|
|
| ## How this dataset was built |
|
|
| The pipeline is reproducible from public sources. Source code for the |
| cleaning scripts is published alongside this dataset. |
|
|
| 1. **Download the raw dump** from |
| `https://dumps.wikimedia.org/dewiki/<YYYYMMDD>/dewiki-<YYYYMMDD>-pages-articles-multistream.xml.bz2`. |
| The dump used for the current version is `20260601`. |
| 2. **Stream-parse** the MediaWiki XML with `mwxml` (forward-only |
| `iterparse`, no full XML tree in memory). |
| 3. **Drop** pages by namespace, redirect status, and title patterns |
| before any expensive text processing. |
| 4. **Strip wiki markup** with `mwparserfromhell.parse(text).strip_code(normalize=True, collapse=True)`, |
| which removes templates, tables, wiki links, magic words, etc. |
| 5. **Post-clean** the resulting plain text: drop residual `mini|` lines, |
| collapse whitespace runs. |
| 6. **Length-filter** to a 1,500–80,000 character band. |
| 7. **Stream-write** to JSONL, one article per line. |
|
|
| A 7.6 GB compressed `.xml.bz2` produces a ~10 GB cleaned JSONL of |
| approximately 1.8 million articles, with an end-to-end runtime of roughly |
| 2–4 hours on a single CPU. |
|
|
| ## License and attribution |
|
|
| This dataset is derived from Wikipedia content, which is dual-licensed |
| under the **GNU Free Documentation License (GFDL)** and the |
| **Creative Commons Attribution-ShareAlike 3.0 License |
| (CC-BY-SA 3.0)**. See <https://dumps.wikimedia.org/legal.html> for |
| the full text. |
|
|
| If you build on top of this dataset and redistribute the derivative |
| work, the share-alike clause applies: the resulting work must be |
| released under a compatible license. |
|
|
| Required attribution when using this dataset: |
|
|
| > Contains modified data from Wikipedia, the free encyclopedia |
| > (<https://de.wikipedia.org/>), used under CC-BY-SA 3.0 / GFDL. |
|
|
| ## Known limitations |
|
|
| - **Residual markup artifacts.** Markup stripping is heuristic. A small |
| fraction of articles may retain table cells, list fragments, or |
| template-rendered text that `mwparserfromhell` did not fully collapse. |
| - **Knowledge cutoff.** Coverage ends at the snapshot date of the source |
| dump (`20260601` in this version). Events after that date are not |
| present. |
| - **Wikipedia biases.** The corpus inherits the topical, demographic, |
| and editorial biases of the German-language Wikipedia community. |
| See <https://en.wikipedia.org/wiki/Wikipedia:Systemic_bias> for |
| background. |
| - **German only.** No multilingual alignment is provided; cross-lingual |
| training will require additional data sources. |
| - **Repetitive boilerplate.** End-of-article sections ("Literatur", |
| "Siehe auch", "Kategorien", "Weblinks") are stripped, but |
| introduction-style infobox cells may still appear in some articles. |
|
|
| ## Intended use |
|
|
| - Pre-training and continued pre-training of German language models. |
| - Research on German-language NLP. |
|
|
| ## Out-of-scope use |
|
|
| - Use as an authoritative reference for facts. Wikipedia is editable by |
| anyone and contains errors; consult primary sources for citation. |
| - Production systems where factual accuracy is safety-critical. |
| - Any use that violates the GFDL or CC-BY-SA 3.0 terms, including |
| redistribution under a more restrictive license. |
|
|
| ## Citation |
|
|
| If you use this dataset in academic work, please cite the underlying |
| Wikipedia source: |
|
|
| ```bibtex |
| @misc{wikimedia_2026_dump, |
| author = {{Wikimedia Foundation}}, |
| title = {Wikimedia Downloads}, |
| howpublished = {\url{https://dumps.wikimedia.org}}, |
| note = {German Wikipedia dump, snapshot 20260601}, |
| year = {2026} |
| } |
| ``` |
|
|
| ## Changelog |
|
|
| - **v1** — Initial release. ~2.0M articles, German Wikipedia dump |
| snapshot `20260601`. Pipeline: `mwxml` stream-parse → |
| `mwparserfromhell.strip_code()` → `mini|` regex → length filter |
| 1,500–80,000 chars. |