File size: 8,019 Bytes
df96913 6a07ded 1d1aa39 6a07ded 1d1aa39 6a07ded 1d1aa39 6a07ded df96913 5d958f2 df96913 5d958f2 ea1ed6a 863e5ec ea1ed6a 863e5ec ea1ed6a 863e5ec f7e432b cb7853c f7e432b cb7853c 76c7189 1c17e5d 76c7189 1c17e5d 76c7189 1c17e5d 6ec9964 9874d84 6ec9964 9874d84 d54686c 386aa66 d54686c 386aa66 d54686c 386aa66 38816d4 8e15040 38816d4 8e15040 118d4a2 8182929 118d4a2 8182929 118d4a2 8182929 f0743af e8336fc f0743af e8336fc 9742143 d1b6c6a 9742143 d1b6c6a 9742143 d1b6c6a e1d3bb2 51d1810 e1d3bb2 51d1810 df96913 6a07ded df96913 ea1ed6a f7e432b 76c7189 6ec9964 d54686c 38816d4 118d4a2 f0743af 9742143 e1d3bb2 54840da df96913 1b1e352 5b866df 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 514b94c 1b1e352 5b866df 1b1e352 514b94c 1b1e352 5b866df 514b94c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | ---
dataset_info:
- config_name: go-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 364025569
num_examples: 99663
download_size: 163830524
dataset_size: 364025569
- config_name: go-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1066841599
num_examples: 1992985
download_size: 438588731
dataset_size: 1066841599
- config_name: java-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 359305298
num_examples: 87504
download_size: 130012787
dataset_size: 359305298
- config_name: java-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1331514393
num_examples: 1752593
download_size: 480145623
dataset_size: 1331514393
- config_name: javascript-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 505829400
num_examples: 98025
download_size: 212768692
dataset_size: 505829400
- config_name: javascript-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1625855840
num_examples: 1960276
download_size: 704045988
dataset_size: 1625855840
- config_name: php-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 409600818
num_examples: 85460
download_size: 163986468
dataset_size: 409600818
- config_name: php-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1379318420
num_examples: 1710537
download_size: 522306657
dataset_size: 1379318420
- config_name: python-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 426330409
num_examples: 99535
download_size: 184706464
dataset_size: 426330409
- config_name: python-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1460994357
num_examples: 1990051
download_size: 644195658
dataset_size: 1460994357
- config_name: ruby-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 180626329
num_examples: 79040
download_size: 83095960
dataset_size: 180626329
- config_name: ruby-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 713529581
num_examples: 1583047
download_size: 304652631
dataset_size: 713529581
configs:
- config_name: go-v1-hard-negatives-100k
data_files:
- split: train
path: go-v1-hard-negatives-100k/train-*
- config_name: go-v1-pair-2M
data_files:
- split: train
path: go-v1-pair-2M/train-*
- config_name: java-v1-hard-negatives-100k
data_files:
- split: train
path: java-v1-hard-negatives-100k/train-*
- config_name: java-v1-pair-2M
data_files:
- split: train
path: java-v1-pair-2M/train-*
- config_name: javascript-v1-hard-negatives-100k
data_files:
- split: train
path: javascript-v1-hard-negatives-100k/train-*
- config_name: javascript-v1-pair-2M
data_files:
- split: train
path: javascript-v1-pair-2M/train-*
- config_name: php-v1-hard-negatives-100k
data_files:
- split: train
path: php-v1-hard-negatives-100k/train-*
- config_name: php-v1-pair-2M
data_files:
- split: train
path: php-v1-pair-2M/train-*
- config_name: python-v1-hard-negatives-100k
data_files:
- split: train
path: python-v1-hard-negatives-100k/train-*
- config_name: python-v1-pair-2M
data_files:
- split: train
path: python-v1-pair-2M/train-*
- config_name: ruby-v1-hard-negatives-100k
data_files:
- split: train
path: ruby-v1-hard-negatives-100k/train-*
- config_name: ruby-v1-pair-2M
data_files:
- split: train
path: ruby-v1-pair-2M/train-*
license: apache-2.0
---
# cornstack-samples
Filtered CoRNStack sample subsets for code retrieval training.
Source dataset and paper:
- CoRNStack collection: https://huggingface.co/collections/nomic-ai/cornstack
- CoRNStack paper: https://huggingface.co/papers/2412.01007
## What This Release Contains
This release keeps the original subset layout (6 languages x pair + hard-negatives) and applies a deterministic rule-based noise filter.
Important:
- Counts are post-filter counts, so they are slightly smaller than the nominal 2M / 100k targets.
- Data is published in normalized IR format.
## Config Layout And Schema
Each language is published as two configs with split `train`:
- `{lang}-v1-pair-2M`
- `{lang}-v1-hard-negatives-100k`
Schema:
- Pair configs: `query`, `pos`
- Hard-negative configs: `query`, `pos`, `negs` (list[string])
## Subsets And Row Counts (Post-filter)
| Subset (config name) | split | num_examples |
| --- | --- | ---: |
| `go-v1-pair-2M` | `train` | 1,992,985 |
| `go-v1-hard-negatives-100k` | `train` | 99,663 |
| `java-v1-pair-2M` | `train` | 1,752,593 |
| `java-v1-hard-negatives-100k` | `train` | 87,504 |
| `javascript-v1-pair-2M` | `train` | 1,960,276 |
| `javascript-v1-hard-negatives-100k` | `train` | 98,025 |
| `php-v1-pair-2M` | `train` | 1,710,537 |
| `php-v1-hard-negatives-100k` | `train` | 85,460 |
| `python-v1-pair-2M` | `train` | 1,990,051 |
| `python-v1-hard-negatives-100k` | `train` | 99,535 |
| `ruby-v1-pair-2M` | `train` | 1,583,047 |
| `ruby-v1-hard-negatives-100k` | `train` | 79,040 |
## Quick Usage
```python
from datasets import load_dataset
pair_ds = load_dataset("hotchpotch/cornstack-samples", "python-v1-pair-2M", split="train")
hard_ds = load_dataset("hotchpotch/cornstack-samples", "python-v1-hard-negatives-100k", split="train")
print(pair_ds.column_names, len(pair_ds))
print(hard_ds.column_names, len(hard_ds))
```
## License
This dataset follows CoRNStack and is released under **Apache-2.0**.
## Citation And Attribution
If you use this dataset, please cite and attribute CoRNStack:
- Paper: https://huggingface.co/papers/2412.01007
- Collection: https://huggingface.co/collections/nomic-ai/cornstack
## Noise Filtering Algorithm (Rule-based)
The following deterministic rules are applied before publishing this release.
1. Prefix-based noisy query removal
A row is dropped if `query` starts with any of the following prefixes:
- `TODO`
- `GET /`
- `POST /`
- `PUT /`
- `DELETE /`
- `Display a listing of the resource.`
- `Store a newly created resource in storage.`
- `Show the form for editing the specified resource.`
- `Update the specified resource in storage.`
- `Show the form for creating a new resource.`
- `Remove the specified resource from storage.`
- `Display the specified resource.`
- `Transform the resource into an array.`
- `Autogenerated method stub`
- `Auto generated`
- `this down() migration is autogenerated`
- `this up() migration is autogenerated`
- `"/ renamed from:"`
- `"/ access modifiers changed from:"`
2. Minimum positive-document length
A row is dropped if the positive side is shorter than 30 characters.
- Pair task: `document` length >= 30 required
- Hard-negatives task: `positive` length >= 30 required
3. Hard-negative validity constraint
For hard-negative configs, at least one valid negative must remain after normalization (`min_negs = 1`).
This filtering is purely rule-based (no model scoring), targeting high-noise templates and low-information positives while preserving broad retrieval coverage.
|