Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: c-uda
|
3 |
+
task_categories:
|
4 |
+
- text-generation
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
---
|
8 |
+
|
9 |
+
# Marin Markdownified Ar5iv
|
10 |
+
|
11 |
+
Markdownified Ar5iv transforms academic papers from arXiv into clean, structured Markdown format consisting of **2.74B tokens** across two splits. This dataset preserves th content while making it accessible for language model training on academic text.
|
12 |
+
|
13 |
+
| | Value |
|
14 |
+
|---------------------|-------|
|
15 |
+
| Tokens | 2 742 463 924 |
|
16 |
+
| Primary source | https://sigmathling.kwarc.info/resources/ar5iv-dataset-2024/ |
|
17 |
+
| File format | JSONL |
|
18 |
+
| License | C-UDA-1.0 (mirrors upstream Ar5iv 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 Ar5iv dump in Extended DOLMA format, which provides HTML representations of academic papers with metadata.
|
25 |
+
|
26 |
+
2. **Structural Cleanup**
|
27 |
+
- The abstract is transformed into a proper section heading for consistent document structure
|
28 |
+
- LaTeX equations are carefully preserved using inline ($...$) and display ($$...$$) notation
|
29 |
+
- Code blocks and listings maintain proper formatting with appropriate line breaks
|
30 |
+
|
31 |
+
3. **Noise Reduction:**
|
32 |
+
- Author information is removed
|
33 |
+
- Title page elements are streamlined to avoid redundancy
|
34 |
+
- The Ar5iv footer is removed to eliminate conversion metadata
|
35 |
+
- Figure captions are removed to focus on the main content
|
36 |
+
- Bibliography sections, footnotes, and citation links are removed
|
37 |
+
|
38 |
+
4. **Formatting Cleanup:**
|
39 |
+
- List items are cleaned to prevent duplicate numbering patterns (e.g., "1. 1.")
|
40 |
+
- Content before the first main section (typically metadata) is removed
|
41 |
+
- Equation tables are converted to inline elements for better rendering
|
42 |
+
|
43 |
+
5. **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 while removing scripts, tracking code, and boilerplate.
|
44 |
+
|
45 |
+
6. **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. The final output stores each article as a JSON object containing the Markdown text and essential metadata.
|
46 |
+
|
47 |
+
## Dataset Variants
|
48 |
+
|
49 |
+
The Markdownified Ar5iv dataset comes in two variants:
|
50 |
+
|
51 |
+
1. **Ar5iv No Problem (2.74B tokens):** Papers that were converted without significant issues or warnings during the HTML generation process. This subset represents the cleanest and most reliable papers.
|
52 |
+
2. **Ar5iv Warning (19.6B tokens):** Papers that generated warnings during conversion from LaTeX to HTML. While still valuable, these may contain occasional formatting artifacts.
|
53 |
+
|
54 |
+
## Usage Example
|
55 |
+
|
56 |
+
```python
|
57 |
+
from datasets import load_dataset
|
58 |
+
|
59 |
+
ds = load_dataset(
|
60 |
+
"marin-community/ar5iv-warning-markdown",
|
61 |
+
split="train",
|
62 |
+
streaming=True
|
63 |
+
)
|
64 |
+
|
65 |
+
for article in ds.take(3):
|
66 |
+
print(article["text"])
|
67 |
+
```
|
68 |
+
|
69 |
+
## Citation
|
70 |
+
|
71 |
+
If you use this dataset in your research, please cite both the original Wikipedia contributors and our work:
|
72 |
+
```
|
73 |
+
@misc{markdownified_ar5iv_2024,
|
74 |
+
title = {Markdownified Ar5iv},
|
75 |
+
author = {The Marin Community},
|
76 |
+
year = {2024},
|
77 |
+
url = {https://huggingface.co/datasets/marin-community/markdownified-ar5iv}
|
78 |
+
}
|
79 |
+
```
|
80 |
+
|
81 |
+
## License
|
82 |
+
|
83 |
+
All content inherits Ar5iv's licensing: C-UDA-1.0. Our conversion tools and pipeline are released under Apache 2.0.
|
84 |
+
|
85 |
+
## Acknowledgement
|
86 |
+
|
87 |
+
We extend our gratitude to:
|
88 |
+
|
89 |
+
- The Wikimedia Foundation and Wikipedia's volunteer editors
|
90 |
+
- Janek Bevendorff for the [Resiliparse project](https://github.com/chatnoir-eu/chatnoir-resiliparse)
|
91 |
+
- Matthew Dapena-Tretter for [Markdownify](https://github.com/matthewwithanm/python-markdownify)
|