BigDong commited on
Commit
8e3de9f
·
1 Parent(s): 4ed02d8

update readme

Browse files
Files changed (3) hide show
  1. README.md +26 -14
  2. README_ZH.md +139 -0
  3. assets/ultra-fineweb-logo.png +2 -2
README.md CHANGED
@@ -1,34 +1,46 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
4
  # Ultra-FineWeb-Classifier
5
 
6
  <div align="center">
7
  <img src="assets/ultra-fineweb-logo.png" width="600"/>
8
  </div>
9
 
10
- <!-- <div align="center">
11
- English | [简体中文]()
12
- </div> -->
 
 
 
13
 
14
- <div align="center">
 
 
 
15
 
16
- [📜 Technical Report](https://arxiv.org/abs/2505.05427)
17
 
18
- </div>
19
 
20
- ## 📚 Introduction
21
 
22
- Ultra-FineWeb is a **large-scale, high-quality, and efficiently-filtered dataset**. We use the proposed efficient verification-based high-quality filtering pipeline to the FineWeb and Chinese FineWeb datasets (source data from Chinese FineWeb-edu-v2, which includes IndustryCorpus2, MiChao, WuDao, SkyPile, WanJuan, ChineseWebText, TeleChat, and CCI3), resulting in the creation of higher-quality Ultra-FineWeb-en with approximately 1T tokens, and Ultra-FineWeb-zh datasets with approximately 120B tokens, collectively referred to as Ultra-FineWeb. ***Ultra-FineWeb*** serves as a core pre-training web dataset for the [MiniCPM4 Series](https://huggingface.co/collections/openbmb/minicpm-4-6841ab29d180257e940baa9b) models.
23
- - [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb): Ultra-FineWeb, a **large-scale, high-quality, and efficiently-filtered dataset**, with 1T English tokens and 120B Chinese tokens.
24
- - [Ultra-FineWeb-classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier): Ultra-FineWeb classifier, for filtering high-quality data from web corpora. (**<-- you are here**)
 
25
 
26
  ## 📢 What's New
27
 
28
- - **[2025.05.09]** **Ultra-FineWeb** technical report is available on [arXiv](https://arxiv.org/abs/2505.05427). 🔥🔥🔥
29
- - **[2025.05.15]** **Ultra-FineWeb** tops the Hugging Face Datasets Trending list, reaching the #1 spot! ⭐️⭐️⭐️
30
- - **[2025.06.06]** **Ultra-FineWeb-en** and **Ultra-FineWeb-zh** datasets are now available on Hugging Face, released alongside the [MiniCPM4 Series](https://huggingface.co/collections/openbmb/minicpm-4-6841ab29d180257e940baa9b) models.
 
31
  - **[2025.06.16]** The **Ultra-FineWeb-classifier** is now available on Hugging Face: [openbmb/Ultra-FineWeb-classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier). 🚀🚀🚀
 
 
 
32
 
33
  ## 💡 Highlights
34
 
@@ -70,7 +82,7 @@ Normalized content: {Normalized content}
70
  - Pred score: {Pred score}
71
  ```
72
 
73
- ### Inference folder
74
 
75
  Assume the input folder is `data/input`, the key of the content is `content`, and the output folder is `data/output`. User can run the [`scripts/local_scripts/infer_folder.py`](scripts/local_scripts/infer_folder.py) script to infer the folder:
76
  ```bash
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+
5
  # Ultra-FineWeb-Classifier
6
 
7
  <div align="center">
8
  <img src="assets/ultra-fineweb-logo.png" width="600"/>
9
  </div>
10
 
11
+ <p align="center">
12
+ <a href="https://arxiv.org/abs/2505.05427">📜 Technical Report</a> |
13
+ <a href="https://huggingface.co/datasets/openbmb/Ultra-FineWeb">🤗 Ultra-FineWeb</a> |
14
+ <a href="https://huggingface.co/collections/openbmb/ultradata">📦 UltraData Collection</a> |
15
+ <a href="https://ultradata.openbmb.cn/">🌐 UltraData</a>
16
+ </p>
17
 
18
+ <p align="center">
19
+ English |
20
+ <a href="https://huggingface.co/openbmb/Ultra-FineWeb-classifier/blob/main/README_ZH.md">中文</a>
21
+ </p>
22
 
23
+ ## 📚 Introduction
24
 
25
+ ***Ultra-FineWeb-Classifier*** is a lightweight bilingual quality classifier for selecting high-quality documents from large-scale English and Chinese web corpora. It is developed through the efficient verification-based filtering pipeline proposed in the [Ultra-FineWeb technical report](https://arxiv.org/abs/2505.05427) and implemented with [fastText](https://fasttext.cc/) to provide efficient, low-cost inference at web scale.
26
 
27
+ The repository provides separate English and Chinese classifier weights. Applying these classifiers to FineWeb and Chinese FineWeb produces [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb), a higher-quality web pre-training dataset containing approximately **1T English tokens** and **120B Chinese tokens**. Ultra-FineWeb serves as a core pre-training web dataset for the [MiniCPM4 Series](https://huggingface.co/collections/openbmb/minicpm4) and [MiniCPM5 Series](https://huggingface.co/collections/openbmb/minicpm5).
28
 
29
+ - [Ultra-FineWeb-L1](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1): **L1 filtered data** after basic cleaning, heuristic filtering, sensitive-field replacement, and deduplication.
30
+ - [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb): **L2 selected data** containing approximately **1T English tokens** and **120B Chinese tokens**.
31
+ - [Ultra-FineWeb-Classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier): lightweight English and Chinese quality classifiers for filtering web corpora. (**Current classifier**)
32
+ - [Ultra-FineWeb-L3](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L3): **L3 refined data** built via Q&A pair generation and multi-style rewriting, containing **400B+ English tokens** and **200B+ Chinese tokens**.
33
 
34
  ## 📢 What's New
35
 
36
+ - **[2026.08.20]** The [***Ultra-FineWeb-L1***](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1) dataset is released, together with the L2 selected subset produced by the **Ultra-FineWeb-Classifier**. 🚀🚀🚀
37
+ - **[2026.05.28]** The [***Ultra-FineWeb-L3***](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L3) dataset is released, containing **400B+ English tokens** and **200B+ Chinese tokens**.
38
+ - **[2026.05.25]** [***MiniCPM5-1B***](https://huggingface.co/openbmb/MiniCPM5-1B) is released! Ultra-FineWeb serves as its core pre-training web dataset.
39
+ - **[2026.02.08]** The [***UltraData***](https://ultradata.openbmb.cn/) platform is now live, introducing the [L0-L4 tiered data management framework](https://arxiv.org/abs/2602.09003).
40
  - **[2025.06.16]** The **Ultra-FineWeb-classifier** is now available on Hugging Face: [openbmb/Ultra-FineWeb-classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier). 🚀🚀🚀
41
+ - **[2025.06.06]** **Ultra-FineWeb-en** and **Ultra-FineWeb-zh** are now available on Hugging Face, released alongside the [MiniCPM4 Series](https://huggingface.co/collections/openbmb/minicpm4) models.
42
+ - **[2025.05.15]** **Ultra-FineWeb** tops the Hugging Face Datasets Trending list, reaching the #1 spot! ⭐️⭐️⭐️
43
+ - **[2025.05.09]** The **Ultra-FineWeb** technical report is available on [arXiv](https://arxiv.org/abs/2505.05427). 🔥🔥🔥
44
 
45
  ## 💡 Highlights
46
 
 
82
  - Pred score: {Pred score}
83
  ```
84
 
85
+ ### Folder inference
86
 
87
  Assume the input folder is `data/input`, the key of the content is `content`, and the output folder is `data/output`. User can run the [`scripts/local_scripts/infer_folder.py`](scripts/local_scripts/infer_folder.py) script to infer the folder:
88
  ```bash
README_ZH.md ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultra-FineWeb-Classifier
2
+
3
+ <div align="center">
4
+ <img src="assets/ultra-fineweb-logo.png" width="600"/>
5
+ </div>
6
+
7
+ <p align="center">
8
+ <a href="https://arxiv.org/abs/2505.05427">📜 技术报告</a> |
9
+ <a href="https://huggingface.co/datasets/openbmb/Ultra-FineWeb">🤗 Ultra-FineWeb</a> |
10
+ <a href="https://huggingface.co/collections/openbmb/ultradata">📦 UltraData 合集</a> |
11
+ <a href="https://ultradata.openbmb.cn/">🌐 UltraData</a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://huggingface.co/openbmb/Ultra-FineWeb-classifier/blob/main/README.md">English</a> |
16
+ 中文
17
+ </p>
18
+
19
+ ## 📚 简介
20
+
21
+ ***Ultra-FineWeb-Classifier*** 是一组轻量级中英文质量分类器,用于从大规模网页语料中筛选高质量文档。该分类器通过 [Ultra-FineWeb 技术报告](https://arxiv.org/abs/2505.05427)提出的高效验证式过滤流水线构建,并基于 [fastText](https://fasttext.cc/) 实现,可在网页规模数据上进行高效、低成本推理。
22
+
23
+ 本仓库分别提供英文和中文分类器权重。我们将其应用于 FineWeb 和 Chinese FineWeb,构建出更高质量的网页预训练数据集 [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb),包含约 **1T 英文 tokens** 与 **120B 中文 tokens**。Ultra-FineWeb 是 [MiniCPM4 系列](https://huggingface.co/collections/openbmb/minicpm4)与 [MiniCPM5 系列](https://huggingface.co/collections/openbmb/minicpm5)的核心预训练网页数据集。
24
+
25
+ - [Ultra-FineWeb-L1](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1):经过基础清洗、规则过滤、敏感字段替换与去重的 **L1 过滤数据**。
26
+ - [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb):包含约 **1T 英文 tokens** 与 **120B 中文 tokens** 的 **L2 精选数据**。
27
+ - [Ultra-FineWeb-Classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier):用于网页语料质量筛选的轻量级中英文分类器。(**当前仓库**)
28
+ - [Ultra-FineWeb-L3](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L3):通过问答对生成与多风格改写构建的 **L3 合成与增强数据**,包含 **400B+ 英文 tokens** 与 **200B+ 中文 tokens**。
29
+
30
+ ## 📢 最新动态
31
+
32
+ - **[2026.08.20]** [***Ultra-FineWeb-L1***](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L1) 数据集正式发布,并同步发布由 **Ultra-FineWeb-Classifier** 筛选得到的 L2 精选数据。🚀🚀🚀
33
+ - **[2026.05.28]** [***Ultra-FineWeb-L3***](https://huggingface.co/datasets/openbmb/Ultra-FineWeb-L3) 数据集正式发布,包含 **400B+ 英文 tokens** 与 **200B+ 中文 tokens**。
34
+ - **[2026.05.25]** [***MiniCPM5-1B***](https://huggingface.co/openbmb/MiniCPM5-1B) 正式发布!Ultra-FineWeb 是其核心预训练网页数据集。
35
+ - **[2026.02.08]** [***UltraData***](https://ultradata.openbmb.cn/) 平台正式上线,并发布 [L0-L4 分级数据管理框架](https://arxiv.org/abs/2602.09003)。
36
+ - **[2025.06.16]** **Ultra-FineWeb-Classifier** 已在 Hugging Face 上线:[openbmb/Ultra-FineWeb-classifier](https://huggingface.co/openbmb/Ultra-FineWeb-classifier)。🚀🚀🚀
37
+ - **[2025.06.06]** **Ultra-FineWeb-en** 与 **Ultra-FineWeb-zh** 已在 Hugging Face 发布,并与 [MiniCPM4 系列](https://huggingface.co/collections/openbmb/minicpm4)模型同步开源。
38
+ - **[2025.05.15]** **Ultra-FineWeb** 登上 Hugging Face Datasets Trending 榜首!⭐️⭐️⭐️
39
+ - **[2025.05.09]** **Ultra-FineWeb** 技术报告已在 [arXiv](https://arxiv.org/abs/2505.05427) 发布。🔥🔥🔥
40
+
41
+ ## 💡 亮点
42
+
43
+ > **摘要:** 随着大语言模型(LLM)的快速发展,数据质量已成为提升模型性能的关键因素。模型驱动的数据过滤逐渐成为获取高质量数据的主要途径,但仍面临两大挑战:(1)缺乏高效的数据验证策略,难以及时反馈数据质量;(2)训练分类器所用的种子数据选择缺乏明确标准,过度依赖人工经验,带来主观性。针对第一个挑战,我们提出高效验证策略,以极低计算成本快速评估数据对 LLM 训练的影响。针对第二个挑战,我们在「高质量种子数据有利于 LLM 训练」的假设下,结合上述验证策略优化正负样本选择,并提出高效数据过滤流水线。该流水线不仅提升过滤效率、分类器质量与鲁棒性,还显著降低实验与推理成本。此外,我们采用基于 *fastText* 的轻量分类器,将过滤流水线应用于 *FineWeb* 与 *Chinese FineWeb*,构建出更高质量的 ***Ultra-FineWeb*** 数据集。实验结果表明,基于 Ultra-FineWeb 训练的 LLM 在多项基准上显著优于对照组,验证了该流水线在提升数据质量与训练效率方面的有效性。
44
+
45
+ <div align="center">
46
+ <img src="assets/ultra-fineweb-pipeline.png" width="600"/>
47
+ </div>
48
+
49
+ - **高效验证策略:** 以极低计算成本快速评估数据对 LLM 训练性能的影响,显著提升高质量数据过滤实验的效率。
50
+ - **高质量种子样本选择:** 结合验证策略优化正负种子样本选择,降低主观性并提升分类器质量与鲁棒性。
51
+ - **轻量级双语分类器:** 基于 fastText 的中英文分类器可在大规模网页语料上进行高效、低成本推理。
52
+
53
+ ## 🚀 使用方法
54
+
55
+ 请在仓库根目录运行以下命令。将 `LANGUAGE` 设置为 `en` 或 `zh`,即可选择对应的分类器。
56
+
57
+ ### 单篇文本推理
58
+
59
+ 将待评分文本写入 [`scripts/local_scripts/single_content.txt`](scripts/local_scripts/single_content.txt),然后运行:
60
+
61
+ ```bash
62
+ LANGUAGE=en
63
+ TOKENIZER_PATH=local_tokenizer
64
+ CONTENT_FILE=scripts/local_scripts/single_content.txt
65
+
66
+ python scripts/local_scripts/infer_single_content.py --language ${LANGUAGE} --tokenizer-path ${TOKENIZER_PATH} --content-file ${CONTENT_FILE}
67
+ ```
68
+
69
+ `TOKENIZER_PATH` 默认使用 `local_tokenizer`,也可直接设置为 `deepseek-ai/DeepSeek-V2`。终端输出格式如下:
70
+
71
+ ```text
72
+ Content: {用户输入的文本}
73
+
74
+ Normalized content: {标准化后的文本}
75
+
76
+ - Pred label: {预测标签}
77
+ - Pred score: {预测分数}
78
+ ```
79
+
80
+ ### 文件夹批量推理
81
+
82
+ 文件夹推理脚本可批量处理目录中的数据文件。以下示例从 `data/input` 读取数据,使用名为 `content` 的文档字段,并将结果写入 `data/output`:
83
+
84
+ ```bash
85
+ LANGUAGE=en
86
+ DATA_PATH=data/input
87
+ SAVE_PATH=data/output
88
+ CONTENT_KEY=content
89
+ TOKENIZER_PATH=local_tokenizer
90
+ PROCESSES_NUM=64
91
+ WRITE_BATCH_SIZE=100
92
+
93
+ python scripts/local_scripts/infer_folder.py \
94
+ --language ${LANGUAGE} \
95
+ --data-path ${DATA_PATH} \
96
+ --save-path ${SAVE_PATH} \
97
+ --content-key ${CONTENT_KEY} \
98
+ --tokenizer-path ${TOKENIZER_PATH} \
99
+ --processes-num ${PROCESSES_NUM} \
100
+ --write-batch-size ${WRITE_BATCH_SIZE}
101
+ ```
102
+
103
+ 默认进程数为 64,默认写入批次大小为 100;如有需要,可在命令末尾添加可选参数 `--inplace`。
104
+
105
+ ### Spark 推理
106
+
107
+ 如需进行分布式推理,请参考 [`scripts/spark_scripts/spark_infer.py`](scripts/spark_scripts/spark_infer.py) 提供的 Spark 集群示例。
108
+
109
+ ### 注意事项
110
+
111
+ - `fasttext` 依赖 `numpy<2.0`。
112
+ - [`config.json`](config.json) 是占位配置文件,其中的参数用于 fastText 训练。
113
+
114
+ ## ❤️ 致谢
115
+
116
+ - ***Ultra-FineWeb-Classifier*** 基于 [fastText](https://fasttext.cc/) 构建。
117
+ - 英文过滤流水线应用于 [FineWeb](https://huggingface.co/datasets/HuggingFaceFW/fineweb)。
118
+ - 中文过滤流水线应用于由 [IndustryCorpus2](https://huggingface.co/datasets/BAAI/IndustryCorpus2)、[MiChao](https://opendatalab.com/OpenDataLab/MiChao)、[WuDao](https://data.baai.ac.cn/details/WuDaoCorporaText)、[SkyPile](https://huggingface.co/datasets/Skywork/SkyPile-150B)、[WanJuan](https://opendatalab.com/OpenDataLab/WanJuanCC)、[ChineseWebText](https://huggingface.co/datasets/CASIA-LM/ChineseWebText2.0)、[TeleChat](https://huggingface.co/datasets/Tele-AI/TeleChat-PTD) 与 [CCI3](https://huggingface.co/datasets/BAAI/CCI3-Data) 等数据集构建的中文语料。
119
+
120
+ 感谢这些优秀开源工作,正是开源社区的贡献让 Ultra-FineWeb 成为可能!🙌
121
+
122
+ ## 🌟 引用
123
+
124
+ 若本工作对您的研究有帮助,欢迎引用:
125
+
126
+ ```bibtex
127
+ @misc{wang2025ultrafineweb,
128
+ title={{Ultra-FineWeb}: Efficient Data Filtering and Verification for High-Quality LLM Training Data},
129
+ 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},
130
+ year={2025},
131
+ eprint={2505.05427},
132
+ archivePrefix={arXiv},
133
+ primaryClass={cs.CL},
134
+ }
135
+ ```
136
+
137
+ ## 💳 许可证
138
+
139
+ 本项目基于 [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) 许可证发布。
assets/ultra-fineweb-logo.png CHANGED

Git LFS Details

  • SHA256: 54c47827869b1ae0e7a93a91e7837eaed5148fc494302b9bf44f4f95def6dce0
  • Pointer size: 130 Bytes
  • Size of remote file: 56.3 kB

Git LFS Details

  • SHA256: 5a78c002094d2d8c04eaaf3b3b0aa21fd4013628c477163d904b56693016546c
  • Pointer size: 131 Bytes
  • Size of remote file: 141 kB