MrtinoRG commited on
Commit
396eb23
·
verified ·
1 Parent(s): 6231e6f

Overwrite defaults + add visible note

Browse files
Files changed (1) hide show
  1. README.md +221 -3
README.md CHANGED
@@ -69,8 +69,226 @@ configs:
69
  path: starcoder-chemistry-default/test-*
70
  - split: val
71
  path: starcoder-chemistry-default/val-*
72
- license: apache-2.0
 
73
  tags:
74
- - code
75
  - chemistry
76
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  path: starcoder-chemistry-default/test-*
70
  - split: val
71
  path: starcoder-chemistry-default/val-*
72
+ license:
73
+ - apache-2.0
74
  tags:
 
75
  - chemistry
76
+ - scientific-code
77
+ - simulation-code
78
+ - computational-chemistry
79
+ - materials-science
80
+ annotations_creators:
81
+ - expert-generated
82
+ language_creators:
83
+ - expert-generated
84
+ language:
85
+ - en
86
+ multilinguality:
87
+ - monolingual
88
+ size_categories:
89
+ - 1M<n<10M
90
+ source_datasets:
91
+ - codeparrot/github-code
92
+ - bigcode/the-stack
93
+ task_categories:
94
+ - text-generation
95
+ task_ids:
96
+ - language-modeling
97
+ pretty_name: ChemPile-Code
98
+ dataset_version: 1.0.0
99
+ dataset_release_date: '2025-05-18'
100
+ dataset_citation: "@article{mirza2025chempile0,\n title = {ChemPile: A 250GB Diverse
101
+ and Curated Dataset for Chemical Foundation Models},\n author = {Adrian Mirza
102
+ and Nawaf Alampara and Martiño Ríos-García and others},\n year = {2025},\n \
103
+ \ journal = {arXiv preprint arXiv:2505.12534}\n}"
104
+ ---
105
+ # ChemPile-Code
106
+
107
+ <div align="center">
108
+
109
+ ![ChemPile Logo](CHEMPILE_LOGO.png)
110
+
111
+ [![Dataset](https://img.shields.io/badge/🤗%20Hugging%20Face-Dataset-yellow)](https://huggingface.co/datasets/jablonkagroup/chempile-code)
112
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
113
+ [![Paper](https://img.shields.io/badge/📄-Paper-red)](https://arxiv.org/abs/2505.12534)
114
+
115
+ *A comprehensive collection of filtered scientific code from chemistry, biology, and materials science*
116
+
117
+ </div>
118
+
119
+ ## 📋 Dataset Summary
120
+
121
+ ChemPile-Code includes filtered code from popular datasets such as the Stack and GitHub-code. It is designed to provide a rich source of scientific coding from fields such as chemistry, biology, and materials science. The dataset is part of the ChemPile project, and aims to create a comprehensive collection of chemistry code for training language models. The filtering process is keyword-based, focusing on packages and libraries relevant to chemistry, biology, and materials science. Those keywords include simulation packages such as LAMMPS, GROMACS, and OpenMM, as well as libraries like RDKit, ASE, and MDTraj, or plotting programmes like VMD or PyMOL. To avoid duplicates, exact hash matching was used to filter out identical code snippets.
122
+
123
+ ### 📊 Dataset Statistics
124
+
125
+ | Subset | Tokens | Documents | Description |
126
+ |--------|--------|-----------|-------------|
127
+ | CodeParrot GitHub-Code Chemistry Python | 1.8B | 208K | Python code from GitHub repositories |
128
+ | StarCoder Chemistry | 16.1B | 2.06M | Python code from the Stack dataset |
129
+ | **Total** | **~17.9B** | **~2.27M** | Scientific code snippets |
130
+
131
+ ## 🗂️ Dataset Configurations
132
+
133
+ The dataset includes different subsets available as Hugging Face configurations:
134
+
135
+ - `codeparrot_github-code-chemistry-python-default`
136
+ - `starcoder-chemistry-default`
137
+
138
+ ## 📜 License
139
+
140
+ All content is released under the **Apache 2.0** license, which allows for:
141
+ - ✅ Free use and distribution
142
+ - ✅ Commercial use
143
+ - ✅ Modification and derivatives
144
+ - ⚠️ Attribution required
145
+
146
+ ## 📖 Dataset Details
147
+
148
+ ### 📚 CodeParrot
149
+
150
+ **Source**: CodeParrot is a subset of GitHub code, that we specifically filtered for chemistry-related content
151
+
152
+ **Coverage**: Python code from the GitHub Code dataset
153
+
154
+ **Extraction Method**: Keyword-based filtering focusing on chemistry, biology, and materials science packages and libraries
155
+
156
+ **Fields**:
157
+ - `text`: The code snippet
158
+ - `repo_name`: The name of the repository where the code snippet was found
159
+ - `path`: The path to the file within the repository
160
+ - `language`: The programming language of the code snippet
161
+ - `license`: The license of the repository
162
+ - `size`: The size of the code snippet in bytes
163
+ - `keyword`: A list of keywords that were used to filter the code snippet
164
+ - `text_hash`: A hash of the code snippet to avoid duplicates
165
+
166
+ **Statistics**: 208K code snippets with a total of over 1.8B tokens
167
+
168
+ ### ⚗️ StarCoder
169
+
170
+ **Source**: StarCoder is a subset of the Stack dataset, that we specifically filtered for chemistry-related content
171
+
172
+ **Coverage**: Python code from the Stack dataset
173
+
174
+ **Extraction Method**: Keyword-based filtering with exact hash matching to avoid duplicates
175
+
176
+ **Fields**:
177
+ - `text`: The code snippet
178
+ - `repo_name`: The name of the repository where the code snippet was found
179
+ - `keyword`: A list of keywords that were used to filter the code snippet
180
+ - `text_hash`: A hash of the code snippet to avoid duplicates
181
+
182
+ **Statistics**: 2.06M code snippets with a total of over 16.1B tokens
183
+
184
+ ## 🚀 Quick Start
185
+
186
+ ```python
187
+ from datasets import load_dataset, get_dataset_config_names
188
+
189
+ # Print available configs for the dataset
190
+ configs = get_dataset_config_names("jablonkagroup/chempile-code")
191
+ print(f"Available configs: {configs}")
192
+ # Available configs: ['codeparrot_github-code-chemistry-python-default', 'starcoder-chemistry-default']
193
+
194
+ dataset = load_dataset("jablonkagroup/chempile-code", name=configs[0])
195
+ # Loading config: codeparrot_github-code-chemistry-python-default
196
+
197
+ print(dataset)
198
+ # DatasetDict({
199
+ # train: Dataset({
200
+ # features: ['text', 'repo_name', 'path', 'language', 'license', 'size', 'keyword', 'text_hash'],
201
+ # num_rows: 186878
202
+ # })
203
+ # test: Dataset({
204
+ # features: ['text', 'repo_name', 'path', 'language', 'license', 'size', 'keyword', 'text_hash'],
205
+ # num_rows: 10383
206
+ # })
207
+ # val: Dataset({
208
+ # features: ['text', 'repo_name', 'path', 'language', 'license', 'size', 'keyword', 'text_hash'],
209
+ # num_rows: 10382
210
+ # })
211
+ # })
212
+
213
+ split_name = list(dataset.keys())[0]
214
+ sample = dataset[split_name][0]
215
+ print(sample)
216
+ # {
217
+ # 'text': 'import moogli
218
+ except Exception as e:...
219
+ # 'repo_name': 'BhallaLab/moose',
220
+ # 'path': 'moose-examples/paper-2015/Fig2_elecModels/Fig2C.py',
221
+ # 'language': 'Python',
222
+ # 'license': 'gpl-3.0',
223
+ # 'size': 14223,
224
+ # 'keyword': ['MOOSE', 'NEURON'],
225
+ # 'text_hash': '5eb6a5a439a675762a02c12cdff996e6a0d98f6ee874773cba2951727562aac5'
226
+ # }
227
+ ```
228
+
229
+ ## 🎯 Use Cases
230
+
231
+ - **🤖 Code Generation**: Training models for scientific code generation and completion
232
+ - **🔬 Scientific Computing**: Building systems for computational chemistry and materials science
233
+ - **🔍 Code Search**: Advanced scientific code repository search and analysis
234
+ - **📝 Documentation**: Automated code documentation and analysis for scientific software
235
+ - **🧠 Domain Adaptation**: Adapting models to scientific computing paradigms and libraries
236
+
237
+ ## ⚠️ Limitations & Considerations
238
+
239
+ - **Language**: Primarily Python code (monolingual dataset)
240
+ - **Scope**: Focused on scientific computing; may include domain-specific jargon and advanced concepts
241
+ - **Quality**: Variable quality across sources; some code may be incomplete or contain errors
242
+ - **Bias**: Reflects biases present in open-source scientific software development
243
+ - **License**: Mixed licenses from source repositories - check individual `license` field
244
+ - **Duplicates**: Hash-based deduplication applied but some semantic duplicates may remain
245
+
246
+ ## 🛠️ Data Processing Pipeline
247
+
248
+ 1. **Collection**: Automated extraction from GitHub-code and Stack datasets
249
+ 2. **Filtering**: Keyword-based filtering for chemistry, biology, and materials science relevance
250
+ 3. **Deduplication**: Exact hash matching to remove identical code snippets
251
+ 4. **Quality Control**: Automated filtering and validation
252
+ 5. **Standardization**: Consistent formatting and metadata extraction
253
+ 6. **Validation**: Train/validation/test splits and quality checks
254
+
255
+ ## 🏗️ ChemPile Collection
256
+
257
+ This dataset is part of the **ChemPile** collection, a comprehensive open dataset containing over 75 billion tokens of curated chemical data for training and evaluating general-purpose models in the chemical sciences.
258
+
259
+ ### Collection Overview
260
+ - **📊 Scale**: 75+ billion tokens across multiple modalities
261
+ - **🧬 Modalities**: Structured representations (SMILES, SELFIES, IUPAC, InChI), scientific text, executable code, and molecular images
262
+ - **🎯 Design**: Integrates foundational educational knowledge with specialized scientific literature
263
+ - **🔬 Curation**: Extensive expert curation and validation
264
+ - **📈 Benchmarking**: Standardized train/validation/test splits for robust evaluation
265
+ - **🌐 Availability**: Openly released via Hugging Face
266
+
267
+ ## 📄 Citation
268
+
269
+ If you use this dataset in your research, please cite:
270
+
271
+ ```bibtex
272
+ @article{mirza2025chempile0,
273
+ title = {ChemPile: A 250GB Diverse and Curated Dataset for Chemical Foundation Models},
274
+ author = {Adrian Mirza and Nawaf Alampara and Martiño Ríos-García and others},
275
+ year = {2025},
276
+ journal = {arXiv preprint arXiv:2505.12534}
277
+ }
278
+ ```
279
+
280
+ ## 👥 Contact & Support
281
+
282
+ - **Paper**: [arXiv:2505.12534](https://arxiv.org/abs/2505.12534)
283
+ - **Dataset**: [Hugging Face](https://huggingface.co/datasets/jablonkagroup/chempile-code)
284
+ - **Issues**: Please report data issues or questions via the Hugging Face dataset page
285
+
286
+ ---
287
+
288
+ <div align="center">
289
+
290
+ ![ChemPile Logo](CHEMPILE_LOGO.png)
291
+
292
+ <i>Part of the ChemPile project - Advancing AI for Chemical Sciences</i>
293
+
294
+ </div>