Update README.md
Browse files
README.md
CHANGED
|
@@ -4,4 +4,81 @@ task_categories:
|
|
| 4 |
- text-generation
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
- text-generation
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Marin Markdownified Wikipedia
|
| 10 |
+
|
| 11 |
+
Markdownified Wikipedia is a large-scale, pre-processed version of the English Wikipedia Enterprise HTML dump consisting of **8.59B tokens**. The corpus has been converted to clean, section-aware Markdown for language-model training.
|
| 12 |
+
|
| 13 |
+
| | Value |
|
| 14 |
+
|---------------------|-------|
|
| 15 |
+
| Tokens (GPT-style) | 8 587 224 558 |
|
| 16 |
+
| Primary source | https://dumps.wikimedia.org/other/enterprise_html/runs/20241201/enwiki-NS0-20241201-ENTERPRISE-HTML.json.tar.gz |
|
| 17 |
+
| File format | JSONL |
|
| 18 |
+
| License | CC-BY-SA 4.0 (mirrors upstream Wikipedia licenses) |
|
| 19 |
+
|
| 20 |
+
## Processing and Cleaning Pipeline
|
| 21 |
+
|
| 22 |
+
Our conversion pipeline combines several sophisticated techniques to transform raw Wikipedia HTML into high-quality Markdown:
|
| 23 |
+
|
| 24 |
+
1. **HTML Preprocessing:** We start with the Enterprise HTML dump in DOLMA format, which provides HTML representations of Wikipedia articles with metadata.
|
| 25 |
+
|
| 26 |
+
2. **Structural Cleanup**
|
| 27 |
+
- Mathematical equations are converted from MathML to LaTeX notation with appropriate delimiters
|
| 28 |
+
- Infoboxes are relocated to a dedicated section at the end of each article
|
| 29 |
+
- Reference sections and citations are removed to reduce noise and focus on the informative content
|
| 30 |
+
|
| 31 |
+
3. **DOM Simplification:** We employ a [custom-enhanced version of Resiliparse](https://github.com/stanford-crfm/chatnoir-resiliparse) that preserves semantic HTML structure. Rather than flattening to plain text, we retain important elements like headings, paragraphs, lists, and links while removing scripts, tracking code, and boilerplate.
|
| 32 |
+
|
| 33 |
+
4. **Markdown Conversion:** Our [custom Markdownify](https://github.com/marin-community/marin/blob/main/marin/markdown/markdown.py#L145-L650) implementation transforms the simplified DOM into clean Markdown with these characteristics:
|
| 34 |
+
- Consistent heading format using the ATX style (# Heading)
|
| 35 |
+
- Removal of Wikipedia-specific navigation elements and edit buttons
|
| 36 |
+
- Preservation of tables in GitHub-flavored Markdown
|
| 37 |
+
- Standardized list formatting
|
| 38 |
+
|
| 39 |
+
The final output stores each article as a JSON object containing the Markdown text and essential metadata (ID, title, URL, creation date, and optional abstract).
|
| 40 |
+
|
| 41 |
+
5. **Quality Filtering:** Articles are discarded when they match any of these criteria:
|
| 42 |
+
- More than 50% digits
|
| 43 |
+
- Fewer than 70 words
|
| 44 |
+
- More than 50% special characters
|
| 45 |
+
These filters were applied to remove statistical tables, list-only pages, and navigation stubs.
|
| 46 |
+
|
| 47 |
+
## Usage Example
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from datasets import load_dataset
|
| 51 |
+
|
| 52 |
+
ds = load_dataset(
|
| 53 |
+
"marin-community/wikipedia-markdown",
|
| 54 |
+
split="train",
|
| 55 |
+
streaming=True
|
| 56 |
+
)
|
| 57 |
+
|
| 58 |
+
for article in ds.take(3):
|
| 59 |
+
print(article["text"])
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Citation
|
| 63 |
+
|
| 64 |
+
If you use this dataset in your research, please cite both the original Wikipedia contributors and our work:
|
| 65 |
+
```
|
| 66 |
+
@misc{markdownified_wiki_2024,
|
| 67 |
+
title = {Markdownified Wikipedia},
|
| 68 |
+
author = {The Marin Community},
|
| 69 |
+
year = {2024},
|
| 70 |
+
url = {https://huggingface.co/datasets/marin-community/markdownified-wiki}
|
| 71 |
+
}
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## License
|
| 75 |
+
|
| 76 |
+
All content inherits Wikipedia's licensing: CC-BY-SA 4.0. Our conversion tools and pipeline are released under Apache 2.0.
|
| 77 |
+
|
| 78 |
+
## Acknowledgement
|
| 79 |
+
|
| 80 |
+
We extend our gratitude to:
|
| 81 |
+
|
| 82 |
+
- The Wikimedia Foundation and Wikipedia's volunteer editors
|
| 83 |
+
- Janek Bevendorff for the [Resiliparse project](https://github.com/chatnoir-eu/chatnoir-resiliparse)
|
| 84 |
+
- Matthew Dapena-Tretter for [Markdownify](https://github.com/matthewwithanm/python-markdownify)
|