|
| 1 | +--- |
| 2 | +dataset_info: |
| 3 | + features: |
| 4 | + - name: Source |
| 5 | + dtype: string |
| 6 | + - name: Date |
| 7 | + dtype: int64 |
| 8 | + - name: Text |
| 9 | + dtype: string |
| 10 | + - name: Token_count |
| 11 | + dtype: int64 |
| 12 | + splits: |
| 13 | + - name: train |
| 14 | + num_bytes: 8122744210 |
| 15 | + num_examples: 6366648 |
| 16 | + download_size: 3707767805 |
| 17 | + dataset_size: 8122744210 |
| 18 | +configs: |
| 19 | +- config_name: default |
| 20 | + data_files: |
| 21 | + - split: train |
| 22 | + path: data/train-* |
| 23 | +pretty_name: Project_CodeNet |
| 24 | +size_categories: |
| 25 | +- 1M<n<10M |
| 26 | +task_categories: |
| 27 | +- text-generation |
| 28 | +language: |
| 29 | +- code |
| 30 | +license: other |
| 31 | +--- |
| 32 | + |
| 33 | +# Project_CodeNet |
| 34 | + |
| 35 | +## Overview |
| 36 | + |
| 37 | +This dataset is constructed from the **Project CodeNet** corpus, consisting of competitive programming submissions collected from online judges. |
| 38 | + |
| 39 | +We extract a large-scale code corpus designed for pretraining language models, with a focus on: |
| 40 | +- clean executable code |
| 41 | +- temporal metadata (submission time) |
| 42 | +- minimal preprocessing to preserve the original distribution |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## Dataset Statistics |
| 47 | + |
| 48 | +- **Total samples:** ~6.37M |
| 49 | +- **Total tokens:** ~3.06B |
| 50 | +- **Average tokens per sample:** 480.44 |
| 51 | + |
| 52 | +### Token Length Distribution |
| 53 | +- P50: 162 tokens |
| 54 | +- P90: 679 tokens |
| 55 | +- P95: 1035 tokens |
| 56 | +- P99: 2702 tokens |
| 57 | +--- |
| 58 | + |
| 59 | +## Construction |
| 60 | + |
| 61 | +### Source |
| 62 | +- Project CodeNet https://github.com/IBM/Project_CodeNet |
| 63 | + |
| 64 | +### Filtering Rules |
| 65 | + |
| 66 | +We apply the following steps: |
| 67 | + |
| 68 | +1. **Keep only Accepted submissions** |
| 69 | + - Removes incorrect or incomplete code. |
| 70 | + |
| 71 | +2. **Deduplication at metadata level** |
| 72 | + - For each `(problem_id, user_id, language)`, keep the **last accepted submission** |
| 73 | + - This approximates the user's final solution |
| 74 | + |
| 75 | +3. **No content-based deduplication** |
| 76 | + - Similar solutions across users are preserved |
| 77 | + - Reflects real-world submission distribution |
| 78 | + |
| 79 | +4. **No balancing** |
| 80 | + - Language and temporal distributions are kept as-is |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Fields |
| 85 | + |
| 86 | +Each sample contains: |
| 87 | + |
| 88 | +| Field | Description | |
| 89 | +|------|------------| |
| 90 | +| `Source` | Dataset name (`Project_CodeNet`) | |
| 91 | +| `Date` | Submission year | |
| 92 | +| `Text` | Source code | |
| 93 | +| `Token_count` | Token count computed using `tiktoken` | |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## Tokenization |
| 98 | + |
| 99 | +- Tokenizer: `tiktoken` |
| 100 | +- Encoding: `cl100k_base` |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## Distribution Characteristics |
| 105 | + |
| 106 | +### Language Distribution |
| 107 | +The dataset is highly skewed toward C++: |
| 108 | + |
| 109 | +- C++ dominates (~60%) |
| 110 | +- Python is the second largest (~23%) |
| 111 | +- Other languages form a long tail |
| 112 | + |
| 113 | +### Temporal Distribution |
| 114 | +The dataset is heavily concentrated in recent years: |
| 115 | + |
| 116 | +- Majority of samples from **2019–2020** |
| 117 | +- Reflects real submission activity in CodeNet |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Important Notes |
| 122 | + |
| 123 | +- This dataset preserves the **original submission distribution** of CodeNet. |
| 124 | +- It is **not balanced** across languages or time. |
| 125 | +- It is primarily composed of **competitive programming code**, which may differ from production software code. |
| 126 | +- Some level of **near-duplicate solutions** exists due to similar problem-solving strategies. |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## Intended Use |
| 131 | + |
| 132 | +- Pretraining code language models |
| 133 | +- Studying temporal evolution of programming patterns |
| 134 | +- Benchmarking under real-world distribution settings |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## Limitations |
| 139 | + |
| 140 | +- Not representative of general software engineering code |
| 141 | +- Strong bias toward: |
| 142 | + - competitive programming tasks |
| 143 | + - algorithmic problem solving |
| 144 | +- Language and temporal imbalance |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## License |
| 149 | + |
| 150 | +Please refer to the original **Project CodeNet** dataset for licensing details. |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## Citation |
| 155 | + |
| 156 | +If you use this dataset, please cite Project CodeNet: |
| 157 | + |
| 158 | +@article{puri2021project, |
| 159 | +title={Project CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks}, |
| 160 | +author={Puri, Ruchir and others}, |
| 161 | +year={2021} |
| 162 | +} |
| 163 | + |
0 commit comments