chuyue commited on
Commit
69fa30b
Β·
verified Β·
1 Parent(s): 36b05e1

Add Ultra-FineWeb-L1 dataset card

Browse files
Files changed (1) hide show
  1. README.md +276 -0
README.md ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ task_categories:
6
+ - text-generation
7
+ pretty_name: Ultra-FineWeb-L1
8
+ tags:
9
+ - llm
10
+ - pretraining
11
+ - web-corpus
12
+ - common-crawl
13
+ - data-filtering
14
+ - deduplication
15
+ - fineweb
16
+ - ultradata
17
+ configs:
18
+ - config_name: default
19
+ data_files:
20
+ - split: train
21
+ path: "data/CC-MAIN-*/*.parquet"
22
+ features:
23
+ - name: uid
24
+ dtype: string
25
+ - name: content
26
+ dtype: string
27
+ - name: meta
28
+ dtype: string
29
+ - name: dataset_index
30
+ dtype: string
31
+ ---
32
+
33
+ # Ultra-FineWeb-L1
34
+
35
+ <p align="center">
36
+ <a href="https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1">πŸ€— Dataset</a> |
37
+ <a href="https://huggingface.co/datasets/openbmb/Ultra-FineWeb">πŸ” L2 Selected Data</a> |
38
+ <a href="https://huggingface.co/openbmb/Ultra-FineWeb-classifier">🧰 Quality Classifier</a> |
39
+ <a href="https://ultradata.openbmb.cn/">🌐 UltraData</a> |
40
+ <a href="https://huggingface.co/collections/openbmb/ultradata">πŸ“¦ UltraData Collection</a>
41
+ </p>
42
+
43
+ ***Ultra-FineWeb-L1*** is a large-scale English web corpus built directly from recent [Common Crawl](https://commoncrawl.org/) WARC dumps. It reproduces the core FineWeb processing pipeline and adds internal text sanitation for encoding artifacts and anomalous documents. The result is the **L1 filtered layer** for general web data in the [UltraData](https://ultradata.openbmb.cn/) L0-L4 tiered data management framework.
44
+
45
+ The corpus is organized by Common Crawl dump and stored as zstd-compressed Parquet files. It is intended for large-scale language-model pre-training, data filtering research, and the construction of higher-quality web corpora.
46
+
47
+ ## πŸ“š Dataset Family
48
+
49
+ Ultra-FineWeb-L1 is the rule-filtered source corpus for the newer English high-quality subset in [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb):
50
+
51
+ | Layer | Dataset | Processing | Repository location |
52
+ |:---:|:---|:---|:---|
53
+ | **L1** | **Ultra-FineWeb-L1** | Parsing, English filtering, heuristic filtering, PII replacement, dump-level MinHash deduplication, and text sanitation | `openbmb/Ultra-FineWeb-L1/data/CC-MAIN-*` |
54
+ | **L2** | **Ultra-FineWeb L1-EN-HQ** | L1 data additionally selected by the [Ultra-FineWeb classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier) | `openbmb/Ultra-FineWeb/data/ultrafineweb_l1_en_hq/CC-MAIN-*` |
55
+ | **L3** | **Ultra-FineWeb-L3** | Q&A generation and multi-style rewriting from selected web data | [`openbmb/Ultra-FineWeb-L3`](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L3) |
56
+
57
+ This repository contains the **L1 output**. Classifier scores such as `meta.pred_score` belong to the L2 classifier output and are not guaranteed to be present here.
58
+
59
+ ## πŸ—οΈ L1 Processing Pipeline
60
+
61
+ Each Common Crawl dump is processed independently. Intermediate results are materialized so that individual stages can be rerun without restarting the full pipeline.
62
+
63
+ ### 1. WARC Parsing
64
+
65
+ Common Crawl `*.warc.gz` files are converted to Parquet. Only `WARC-Type: response` records with a successful HTTP 2xx status and an HTML-compatible content type are retained. Raw HTML bytes are kept undecoded at ingestion to avoid lossy charset guesses.
66
+
67
+ ### 2. Main-text Extraction
68
+
69
+ Main text is extracted with [trafilatura](https://github.com/adbar/trafilatura) 2.0 using settings aligned with the FineWeb/DataTrove pipeline:
70
+
71
+ ```python
72
+ trafilatura.extract(
73
+ html,
74
+ favor_precision=True,
75
+ include_comments=False,
76
+ deduplicate=True,
77
+ )
78
+ ```
79
+
80
+ The extractor emits plain text and excludes images and comment sections. Oversized or malformed HTML is guarded by input-size, table-span, and process-memory limits.
81
+
82
+ ### 3. English Language Filtering
83
+
84
+ Language identification uses fastText `lid.176.bin`. A document is retained only when English is the top prediction with a score of at least **0.65**, matching the FineWeb threshold.
85
+
86
+ ### 4. Heuristic Quality Filtering
87
+
88
+ The pipeline reproduces 32 independently configurable DataTrove/FineWeb rules. English tokenization uses NLTK `TreebankWordTokenizer` to align rule statistics with the reference implementation.
89
+
90
+ | Filter group | Rules | Representative checks |
91
+ |:---|:---:|:---|
92
+ | Gopher Repetition | 13 | Duplicate-line and duplicate-paragraph ratios, top n-gram ratios, repeated n-gram character ratios |
93
+ | Gopher Quality | 8 groups | Word count `[50, 100000]`, mean word length `[3, 10]`, symbol-word ratio, stop-word count, alphabetic-word ratio |
94
+ | C4 | 7 | Sentence-ending punctuation, curly brackets, `lorem ipsum`, JavaScript lines, policy boilerplate |
95
+ | FineWeb Quality | 4 | Short-line ratio, line-ending punctuation ratio, duplicate-line character ratio, newline-to-word ratio |
96
+
97
+ ### 5. PII Replacement
98
+
99
+ Detected email addresses, IPv4/IPv6 addresses, phone numbers, identity-card numbers, and credit-card numbers are replaced with syntactically valid placeholder values. Identity-card and credit-card detection applies checksum validation to reduce false positives. Documents are rewritten rather than removed at this stage.
100
+
101
+ ### 6. Dump-level MinHash Deduplication
102
+
103
+ Near-duplicate detection is performed **within each Common Crawl dump**, following the FineWeb finding that cross-dump deduplication can reduce model quality.
104
+
105
+ | Parameter | Value |
106
+ |:---|:---|
107
+ | Shingling | Word 5-grams |
108
+ | Signature size | `num_perm = 360` |
109
+ | LSH buckets | `30` bands x `12` rows |
110
+
111
+ ### 7. Duplicate Removal
112
+
113
+ Documents identified as duplicate followers are removed with a left anti-join against the generated duplicate blacklist. The output of this stage is directly comparable with the official FineWeb pipeline.
114
+
115
+ ### 8. Internal Text Sanitation
116
+
117
+ An additional quality-control pass addresses encoding and length problems that are not fully covered by the reference pipeline:
118
+
119
+ | Operation | Behavior |
120
+ |:---|:---|
121
+ | HTML entity decoding | Decodes residual entities with `html.unescape()` |
122
+ | Invisible-character cleanup | Removes Unicode private-use, zero-width, and C0/C1 control characters while preserving tabs and line breaks; normalizes non-breaking and full-width spaces |
123
+ | Encoding repair | Uses `ftfy.fix_text` with HTML unescaping enabled while preserving original quote shape and character width |
124
+ | Corrupted-text filtering | Drops documents containing strong mojibake patterns or the Unicode replacement character |
125
+ | Length filtering | Keeps documents with `[100, 10000000]` whitespace-delimited English words |
126
+
127
+ The first three operations rewrite text. The final two discard the full document.
128
+
129
+ ## πŸ“ˆ FineWeb Alignment
130
+
131
+ The following statistics are for **CC-MAIN-2025-26 only** and describe the output immediately after dump-level MinHash deduplication, before the additional L1 sanitation stage. They should not be interpreted as aggregate statistics for the entire repository.
132
+
133
+ | Metric | Heuristic-filtered, before deduplication | After MinHash deduplication |
134
+ |:---|---:|---:|
135
+ | Ultra-FineWeb-L1 unique URLs | 258,071,345 | 194,402,835 |
136
+ | FineWeb unique URLs | 193,438,138 | 193,438,138 |
137
+ | URL intersection | 182,421,184 | 175,281,630 |
138
+ | Recall against FineWeb | 94.30% | **90.61%** |
139
+ | Precision | 70.69% | **90.16%** |
140
+
141
+ For the same dump, the pipeline parsed 100,000 WARC files and approximately 2.349 billion HTML pages. A total of 280,627,590 documents entered MinHash deduplication. After deduplication, the corpus size and FineWeb overlap are closely aligned while preserving independently reproduced processing.
142
+
143
+ ## πŸ“ Repository Layout
144
+
145
+ Ultra-FineWeb-L1 is grouped by Common Crawl dump:
146
+
147
+ ```text
148
+ data/
149
+ └── CC-MAIN-YYYY-WW/
150
+ β”œβ”€β”€ CC-MAIN-YYYY-WW-part-0001-of-NNNN.parquet
151
+ β”œβ”€β”€ CC-MAIN-YYYY-WW-part-0002-of-NNNN.parquet
152
+ └── ...
153
+ ```
154
+
155
+ The classifier-selected L2 data is released separately in [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb):
156
+
157
+ ```text
158
+ data/
159
+ └── ultrafineweb_l1_en_hq/
160
+ └── CC-MAIN-YYYY-WW/
161
+ β”œβ”€β”€ ultrafineweb-l1-en-hq-CC-MAIN-YYYY-WW-part-0001-of-NNNN.parquet
162
+ └── ...
163
+ ```
164
+
165
+ ## 🧾 Data Format
166
+
167
+ Files use Parquet with zstd compression. Each record contains:
168
+
169
+ | Field | Type | Description |
170
+ |:---|:---|:---|
171
+ | `uid` | string | UUID4 document identifier |
172
+ | `content` | string | Cleaned plain text after PII replacement |
173
+ | `meta` | string | JSON-encoded document metadata |
174
+ | `dataset_index` | string | Dataset-source identifier |
175
+
176
+ The `meta` JSON may contain:
177
+
178
+ | Key | Description |
179
+ |:---|:---|
180
+ | `url` | Original page URL |
181
+ | `language`, `language_score` | fastText language prediction and confidence |
182
+ | `warc_record_id`, `warc_date` | WARC record identifier and crawl time |
183
+ | `source_file` | Source WARC filename |
184
+ | `pii_emails`, `pii_ips`, `pii_phones`, `pii_id_cards`, `pii_credit_cards` | Number of replacements for each PII category |
185
+
186
+ ## πŸš€ Quick Start
187
+
188
+ Because the complete corpus is several terabytes, streaming or selecting a specific dump is strongly recommended.
189
+
190
+ ```python
191
+ from datasets import load_dataset
192
+ import json
193
+
194
+ ds = load_dataset(
195
+ "openbmb/Ultra-FineWeb-L1",
196
+ split="train",
197
+ streaming=True,
198
+ )
199
+
200
+ example = next(iter(ds))
201
+ metadata = json.loads(example["meta"])
202
+
203
+ print(example["content"][:500])
204
+ print(metadata["url"])
205
+ ```
206
+
207
+ To stream a single dump directly:
208
+
209
+ ```python
210
+ from datasets import load_dataset
211
+
212
+ ds = load_dataset(
213
+ "parquet",
214
+ data_files={
215
+ "train": (
216
+ "hf://datasets/openbmb/Ultra-FineWeb-L1/"
217
+ "data/CC-MAIN-2025-51/*.parquet"
218
+ )
219
+ },
220
+ split="train",
221
+ streaming=True,
222
+ )
223
+ ```
224
+
225
+ For a private or gated repository, authenticate first with a Hugging Face user token that has access to the dataset.
226
+
227
+ ## ⚠️ Limitations and Responsible Use
228
+
229
+ Ultra-FineWeb-L1 is derived from large-scale web crawls. Automated filtering and PII replacement are best-effort processes and cannot guarantee that all problematic content has been removed. The corpus may still contain:
230
+
231
+ - Personal or sensitive information not recognized by the replacement rules
232
+ - Copyrighted material or content subject to source-specific terms
233
+ - Offensive, biased, misleading, malicious, or low-quality text
234
+ - Credentials, API keys, secrets, executable snippets, or unsafe instructions
235
+ - Duplicate or corrupted documents that escaped automated checks
236
+
237
+ Users are responsible for evaluating legal and policy requirements in their jurisdiction and for applying task-specific safety, secret-scanning, privacy, and quality controls before training or redistribution. This dataset should not be treated as a verified source of factual information.
238
+
239
+ ## ❀️ Acknowledgements
240
+
241
+ - **Raw web data:** [Common Crawl](https://commoncrawl.org/)
242
+ - **Reference pipeline:** [FineWeb](https://huggingface.co/datasets/HuggingFaceFW/fineweb) and [DataTrove](https://github.com/huggingface/datatrove)
243
+ - **Text extraction and cleanup:** [trafilatura](https://github.com/adbar/trafilatura), [ftfy](https://github.com/rspeer/python-ftfy), and [NLTK](https://www.nltk.org/)
244
+ - **Language identification and L2 selection:** [fastText](https://fasttext.cc/) and the [Ultra-FineWeb classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier)
245
+ - **Data framework:** [UltraData L0-L4 Tiered Data Management](https://ultradata.openbmb.cn/)
246
+
247
+ ## πŸ“– Citation
248
+
249
+ If you find **Ultra-FineWeb-L1** useful in your research, please consider citing the dataset:
250
+
251
+ ```bibtex
252
+ @misc{ultra-fineweb-l1,
253
+ title={Ultra-FineWeb-L1},
254
+ author={OpenBMB},
255
+ year={2026},
256
+ url={https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1},
257
+ publisher={Hugging Face}
258
+ }
259
+ ```
260
+
261
+ For the Ultra-FineWeb quality-filtering method, please also cite:
262
+
263
+ ```bibtex
264
+ @misc{wang2025ultrafineweb,
265
+ title={{Ultra-FineWeb}: Efficient Data Filtering and Verification for High-Quality LLM Training Data},
266
+ author={Yudong Wang and Zixuan Fu and Jie Cai and Peijun Tang and Hongya Lyu and Yewei Fang and Zhi Zheng and Jie Zhou and Guoyang Zeng and Chaojun Xiao and Xu Han and Zhiyuan Liu},
267
+ year={2025},
268
+ eprint={2505.05427},
269
+ archivePrefix={arXiv},
270
+ primaryClass={cs.CL}
271
+ }
272
+ ```
273
+
274
+ ## πŸ“œ License
275
+
276
+ The dataset card declares the Apache 2.0 license. Because the dataset is derived from web content, users must also respect the rights, licenses, and terms associated with the original sources.