code-v1 / README.md
owenqwenllmwine's picture
Upload folder using huggingface_hub
267dbbf verified
|
Raw
History Blame Contribute Delete
11.6 kB
---
pretty_name: Code Corpus code-v1
language:
- code
- en
license: other
license_name: mixed-open-licenses
task_categories:
- text-generation
size_categories:
- 1M<n<10M
source_datasets:
- extended
annotations_creators:
- no-annotation
language_creators:
- found
multilinguality:
- multilingual
tags:
- code
- text
- datasets
- pretraining
- continued-pretraining
- software-engineering
configs:
- config_name: default
default: true
data_files:
- split: train
path: "*/*.jsonl.gz"
---
# Dataset Card for Code Corpus `code-v1`
## Dataset Description
### Dataset Summary
Code Corpus `code-v1` is a token-balanced collection of source code, commit messages and
diffs, programming Q&A, and technical text. It is intended for language-model pretraining
and continued pretraining. All examples use a common JSONL schema with per-record
provenance, license metadata, exact token counts, and content hashes.
The released dataset contains **2 billion tokens**, **2,541,336 documents**, and **46**
gzip-compressed shards totaling **2.91 GB** (2,905,546,899 bytes; 2.71 GiB).
Exact source totals and the complete shard inventory are recorded in
[`manifest.json`](manifest.json).
### Supported Tasks
The dataset is designed for causal language modeling over code and technical text. It is
not an instruction-tuning dataset and does not include labels, preference pairs, or a
held-out evaluation split.
### Languages
The corpus contains many programming languages and predominantly English natural-language
content. Other human languages may occur in source comments, commit messages, repository
content, and upstream technical-text collections. The `language` field describes a
programming language when upstream metadata is available; it is not a human-language tag.
## Dataset Structure
### Data Instances
Each line in a decompressed shard is an independent JSON object:
```json
{
"id": "29266961adb8c59a77001330377561454f9d82e5dadfeff7445a14ae147ac453",
"text": "// source code, technical text, or a commit message and diff",
"source": "stackv2_edu",
"source_id": "6396980ea790ba1a35f35ff6269bb0d8d0b58ddf",
"language": "JavaScript",
"license": "MIT",
"url": "https://raw.githubusercontent.com/...",
"repository": "owner/repository",
"path": "/path/to/file.js",
"created": "2020-03-02 08:38:22",
"metadata": {},
"content_sha256": "72f9484f64be497baa6bd276fbfdbed13e43735445f0aedb635907314d223ceb",
"chunk_index": 0,
"token_count": 599
}
```
CommitPack examples format `text` as a natural-language commit message followed by a
unified diff.
### Data Fields
| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Stable SHA-256 record identifier. |
| `text` | string | Model training text. |
| `source` | string | Source name matching a recipe entry and shard directory. |
| `source_id` | string or null | Upstream example identifier. |
| `language` | string or null | Upstream or detected programming language. |
| `license` | string or null | Upstream license label for the example. |
| `url` | string or null | Original or raw-content URL when available. |
| `repository` | string or null | Repository name when available. |
| `path` | string or null | Path within the repository when available. |
| `created` | string or null | Upstream timestamp; formatting varies by source. |
| `metadata` | object | Source-specific provenance and attributes. |
| `content_sha256` | string | SHA-256 hash used for exact content deduplication. |
| `chunk_index` | integer | Zero-based index when a long document is split. |
| `token_count` | integer | Exact `text` token count using the configured tokenizer. |
Missing provenance is represented as `null`, not inferred. Consumers should allow
source-specific keys in `metadata`.
### Data Splits
There is one `train` split. The recipe targets the following token mixture:
| Source | Upstream dataset | Share | Nominal tokens |
| --- | --- | ---: | ---: |
| `stackv2_edu` | [`common-pile/stackv2_edu_filtered`](https://huggingface.co/datasets/common-pile/stackv2_edu_filtered) | 65.0% | 1,300,000,000 |
| `stackv2_production` | [`common-pile/stackv2`](https://huggingface.co/datasets/common-pile/stackv2) | 10.0% | 200,000,000 |
| `commitpack` | [`bigcode/commitpackft`](https://huggingface.co/datasets/bigcode/commitpackft) | 8.0% | 160,000,000 |
| `stackexchange_programming` | [`common-pile/stackexchange_filtered`](https://huggingface.co/datasets/common-pile/stackexchange_filtered) | 7.0% | 140,000,000 |
| `arxiv_cs_math` | [`common-pile/arxiv_papers_filtered`](https://huggingface.co/datasets/common-pile/arxiv_papers_filtered) | 5.0% | 100,000,000 |
| `repository_docs` | [`common-pile/stackv2_edu_filtered`](https://huggingface.co/datasets/common-pile/stackv2_edu_filtered) | 2.9% | 58,000,000 |
| `python_peps` | [`common-pile/python_enhancement_proposals_filtered`](https://huggingface.co/datasets/common-pile/python_enhancement_proposals_filtered) | 0.1% | 2,000,000 |
| `wikimedia` | [`common-pile/wikimedia_filtered`](https://huggingface.co/datasets/common-pile/wikimedia_filtered) | 2.0% | 40,000,000 |
If an upstream source is exhausted before filling its nominal allocation, the shortfall is
assigned to `stackv2_edu`. The manifest records the realized source proportions;
[`recipe.json`](recipe.json) records the target mixture and selection rules.
### Loading the Dataset
After upload to the Hub:
```python
from datasets import load_dataset
dataset = load_dataset("owenqwenllmwine/code-v1", split="train")
```
To load this directory locally:
```python
dataset = load_dataset(
"json",
data_files="data/*/train-*.jsonl.gz",
split="train",
)
```
The card's default configuration maps all compressed JSONL shards to the `train` split.
## Dataset Creation
### Curation Rationale
The recipe emphasizes educational source code while retaining smaller amounts of
production code, code changes, programming discussions, repository documentation, papers,
standards, and general text. Source shares are allocated by tokenizer tokens rather than
document count or compressed size.
### Source Data
The data is derived from the upstream Hugging Face datasets linked above. The recipe uses
seed `42`, a 10,000-example streaming shuffle buffer, a minimum document length of 32
tokens, and a maximum chunk length of 32,768 tokens. Token counts use
`Qwen/Qwen3.5-0.8B-Base`.
Processing includes:
- normalization into the common record schema;
- exact cross-source deduplication;
- long-document chunking;
- redaction of private-key blocks and common live-token patterns; and
- filtering of empty, repetitive, minified, generated, and common vendor-path content.
Educational code excludes documentation and notebooks. Production code additionally
excludes common text, lock, source-map, and tabular files. Programming Q&A is restricted
to selected programming-focused Stack Exchange sites. The exact filters are recorded in
the recipe.
### Annotations
No new labels or human annotations were created. Language, license, provenance, and other
attributes are retained or normalized from upstream metadata.
### Personal and Sensitive Information
Public source code and technical discussions can contain names, email addresses, usernames,
URLs, credentials, or other personal and sensitive information. Automated secret-pattern
redaction reduces some credential exposure but is not comprehensive. No dedicated PII
removal or privacy audit has been performed.
## Considerations for Using the Data
### Intended Use
Appropriate uses include language-model pretraining, continued pretraining, and research on
code and technical text. Users should retain provenance where needed for attribution and
perform additional filtering, decontamination, or safety review appropriate to their use
case.
### Out-of-Scope Use
The corpus should not be treated as a source of verified, secure, up-to-date, or executable
code. It is not suitable by itself for model evaluation, supervised instruction tuning, or
applications that require factual correctness or license uniformity.
### Biases, Risks, and Limitations
- Repository popularity, public availability, upstream sampling, and filtering choices
affect which languages, communities, and software practices are represented.
- Examples may contain vulnerabilities, obsolete APIs, incorrect answers, toxic language,
personal data, or other undesirable upstream artifacts.
- Exact duplicates are removed, but near-duplicates and benchmark contamination may remain.
- Language, license, timestamp, and provenance coverage varies by source.
- The buffered streaming shuffle is deterministic for the recorded configuration but is
not a global random permutation.
- Several upstream revisions are unpinned, so the metadata may not be sufficient to recreate
identical upstream streams in the future.
## Licensing Information
This is a mixed-license dataset. Applicable terms vary by example and may include
permissive software licenses, public-domain material, open-content licenses, CC BY-SA, and
other licenses present in mixed-code sources. Per-record license and provenance information
is retained in `license`, `url`, `repository`, and `metadata`.
Users are responsible for reviewing and complying with the applicable terms, including
attribution and share-alike requirements. License labels are inherited from upstream
metadata and have not been independently verified. This dataset card is not legal advice.
## Additional Information
### Dataset Curators
Owen Qwen
### Citation
```bibtex
@misc{qwen2026codev1,
author = {Owen Qwen},
title = {Code Corpus code-v1},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/owenqwenllmwine/code-v1}
}
```
### Upstream Dataset Citations
All seven unique upstream dataset repositories are linked in [Data Splits](#data-splits).
The six `common-pile` datasets share the Common Pile citation. The Stack V2-derived code
also uses The Stack V2 citation, while CommitPackFT uses the OctoPack citation.
```bibtex
@article{kandpal2025common,
title = {The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text},
author = {Nikhil Kandpal and others},
journal = {arXiv preprint arXiv:2506.05209},
year = {2025},
url = {https://arxiv.org/abs/2506.05209}
}
@article{lozhkov2024starcoder2,
title = {StarCoder 2 and The Stack v2: The Next Generation},
author = {Anton Lozhkov and others},
journal = {arXiv preprint arXiv:2402.19173},
year = {2024},
url = {https://arxiv.org/abs/2402.19173}
}
@article{muennighoff2023octopack,
title = {OctoPack: Instruction Tuning Code Large Language Models},
author = {Niklas Muennighoff and Qian Liu and Armel Zebaze and Qinkai Zheng and
Binyuan Hui and Terry Yue Zhuo and Swayam Singh and Xiangru Tang and
Leandro von Werra and Shayne Longpre},
journal = {arXiv preprint arXiv:2308.07124},
year = {2023},
url = {https://arxiv.org/abs/2308.07124}
}
```
These scholarly citations do not replace the attribution, notice, or share-alike
requirements of the licenses attached to individual records.
### Reproducibility
[`manifest.json`](manifest.json) records the build timestamp, requested and realized token
counts, document and filter statistics, upstream revisions, tokenizer, and shard inventory.
[`recipe.json`](recipe.json) contains the complete source weights, filters, and processing
configuration for the release.