Keiran Paster commited on
Commit
f52ae43
1 Parent(s): b95faa6

add pipline

Browse files
Files changed (1) hide show
  1. README.md +55 -19
README.md CHANGED
@@ -31,30 +31,32 @@ dataset_info:
31
 
32
  **OpenWebMath** is a dataset containing the majority of the high-quality, mathematical text from the internet. It is filtered and extracted from over 200B HTML files on Common Crawl down to a set of **6.3 million documents** containing **14.7B tokens**. OpenWebMath is intended for use in *pretraining* and *finetuning* large language models.
33
 
 
 
 
 
 
 
 
34
  Important Links:
35
  - [ArXiv Paper](...)
36
  - [GitHub Repository](...)
37
  - [Paper Twitter Thread](...)
38
 
39
- ### Citation Information
40
 
41
- ```
42
- @article{openwebmath,
43
- title={OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text},
44
- author={Keiran Paster and Marco Dos Santos and Zhangir Azerbayev and Jimmy Ba},
45
- journal={arXiv preprint arXiv:????.?????},
46
- eprint={????.?????},
47
- eprinttype = {arXiv},
48
- url={https://arxiv.org/abs/????.?????},
49
- year={2023}
50
  }
51
  ```
52
 
53
- # Dataset Contents
54
-
55
- Our aim with OpenWebMath was to build a dataset of as many mathematical documents sourced from the web as possible while preserving the formatting of mathematical content such as LaTeX equations. OpenWebMath contains documents from over 130k different domains, ranging from forums, educational and reference content, and blogs. The dataset contains documents covering mathematics, physics, statistics, computer science, and more.
56
-
57
- We provide automatically collected annotations for the source `url`, `timestamp` of the crawl and various information regarding the webpage and the text extraction.
58
 
59
  **Table 1:** Most Common Domains in OpenWebMath by Character Count
60
  | Domain | # Characters | % Characters |
@@ -78,10 +80,44 @@ We provide automatically collected annotations for the source `url`, `timestamp`
78
  **Figure 2:** OpenWebMath Pipeline
79
  <img src="imgs/pipeline.png" alt="Overview of the OpenWebMath Pipeline">
80
 
81
- OpenWebMath builds on the massive Common Crawl dataset, which contains over 200B HTML documents. We filtered the data to only include documents that are: (1) in English, (2) contain mathematical content, and (3) are of high quality. We also put a strong emphasis on extracting LaTeX content from the HTML documents as well as reducing boilerplate in comparison to other web datasets.
82
-
83
- As shown in Figure 2, the processing pipeline for OpenWebMath falls into five stages. First, we apply a prefilter to all HTML documents in Common Crawl to quickly judge whether they have mathematical content, skipping those that do not before doing the extensive processing needed to extract text and equations and remove boilerplate. Second, we extract the text, including mathematical content, from the HTML documents. Third, we apply language identification filters, perplexity-based quality filtering, and a mathematical content classifier filter. Fourth, we deduplicate the dataset using SimHash. Finally, we manually inspect the documents gathered in the previous steps and view documents from the most popular domains by document-count and character-count, removing domains that are not high quality. Please find more information about the processing pipeline in the paper.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  # License
86
 
87
- OpenWebMath is made available under an ODC-By 1.0 license; users should also abide by the CommonCrawl ToU: [https://commoncrawl.org/terms-of-use/](https://commoncrawl.org/terms-of-use/). We do not alter the license of any of the underlying data.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  **OpenWebMath** is a dataset containing the majority of the high-quality, mathematical text from the internet. It is filtered and extracted from over 200B HTML files on Common Crawl down to a set of **6.3 million documents** containing **14.7B tokens**. OpenWebMath is intended for use in *pretraining* and *finetuning* large language models.
33
 
34
+ You can download the dataset using Hugging Face:
35
+
36
+ ```python
37
+ from datasets import load_dataset
38
+ ds = load_dataset("open-web-math/open-web-math")
39
+ ```
40
+
41
  Important Links:
42
  - [ArXiv Paper](...)
43
  - [GitHub Repository](...)
44
  - [Paper Twitter Thread](...)
45
 
46
+ # Dataset Contents
47
 
48
+ The dataset is structured as follows:
49
+
50
+ ```python
51
+ {
52
+ "text": ... # text of the document,
53
+ "url": ... # url of the document,
54
+ "date": ... # date the page was crawled,
55
+ "metadata": ... # a JSON string containing information from the extraction process
 
56
  }
57
  ```
58
 
59
+ OpenWebMath contains documents from over 130k different domains, including data from forums, educational pages, and blogs. The dataset contains documents covering mathematics, physics, statistics, computer science, and more. We summarize the content distribution of OpenWebMath in Figure 1 and Table 1.
 
 
 
 
60
 
61
  **Table 1:** Most Common Domains in OpenWebMath by Character Count
62
  | Domain | # Characters | % Characters |
 
80
  **Figure 2:** OpenWebMath Pipeline
81
  <img src="imgs/pipeline.png" alt="Overview of the OpenWebMath Pipeline">
82
 
83
+ OpenWebMath builds on the massive [Common Crawl](https://commoncrawl.org/) dataset, which contains over 200B HTML documents. We filtered the data to only include documents that are: (1) in English, (2) contain mathematical content, and (3) are of high quality. We also put a strong emphasis on extracting LaTeX content from the HTML documents as well as reducing boilerplate in comparison to other web datasets.
84
+
85
+ The OpenWebMath pipeline consists of five steps:
86
+ 1. **Prefiltering HTML Documents**:
87
+ - Apply a prefilter to all HTML documents in Common Crawl.
88
+ - Quickly judge whether documents have mathematical content.
89
+ - Skip documents without mathematical content to avoid extensive processing.
90
+
91
+ 2. **Text Extraction**:
92
+ - Extract text, including LaTeX content, from the HTML documents.
93
+
94
+ 3. **Content Classification and Filtering**:
95
+ - Apply a [FastText language identification model](https://fasttext.cc/docs/en/language-identification.html) to keep only English documents.
96
+ - Filter high perplexity documents using a [KenLM](https://github.com/kpu/kenlm) model trained on [Proof-Pile](https://huggingface.co/datasets/hoskinson-center/proof-pile).
97
+ - Filter non-mathematical documents using our own *MathScore* model.
98
+
99
+ 4. **Deduplication**:
100
+ - Deduplicate the dataset using SimHash in [text-dedup](https://github.com/ChenghaoMou/text-dedup).
101
+
102
+ 5. **Manual Inspection**:
103
+ - Inspect the documents gathered from previous steps and remove low quality pages.
104
+
105
+ For a detailed discussion on the processing pipeline, please refer to the associated paper.
106
 
107
  # License
108
 
109
+ OpenWebMath is made available under an ODC-By 1.0 license; users should also abide by the CommonCrawl ToU: [https://commoncrawl.org/terms-of-use/](https://commoncrawl.org/terms-of-use/). We do not alter the license of any of the underlying data.
110
+
111
+ # Citation Information
112
+
113
+ ```
114
+ @article{openwebmath,
115
+ title={OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text},
116
+ author={Keiran Paster and Marco Dos Santos and Zhangir Azerbayev and Jimmy Ba},
117
+ journal={arXiv preprint arXiv:????.?????},
118
+ eprint={????.?????},
119
+ eprinttype = {arXiv},
120
+ url={https://arxiv.org/abs/????.?????},
121
+ year={2023}
122
+ }
123
+ ```