Update dataset card body for conrnstack-samples (keep metadata)
Browse files
README.md
CHANGED
|
@@ -278,3 +278,101 @@ configs:
|
|
| 278 |
- split: train
|
| 279 |
path: ruby-v1-pair-2M/train-*
|
| 280 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
- split: train
|
| 279 |
path: ruby-v1-pair-2M/train-*
|
| 280 |
---
|
| 281 |
+
|
| 282 |
+
# conrnstack-samples
|
| 283 |
+
|
| 284 |
+
`conrnstack-samples` is a compact, sampled version of CoRNStack for code-focused embedding training, reranker training, and retrieval experiments.
|
| 285 |
+
|
| 286 |
+
Source dataset and paper:
|
| 287 |
+
- CoRNStack collection: https://huggingface.co/collections/nomic-ai/cornstack
|
| 288 |
+
- CoRNStack paper: https://huggingface.co/papers/2412.01007
|
| 289 |
+
|
| 290 |
+
## Why this dataset
|
| 291 |
+
|
| 292 |
+
CoRNStack is large. This dataset provides smaller, practical subsets for faster iteration and lower-cost experiments.
|
| 293 |
+
|
| 294 |
+
Important notes:
|
| 295 |
+
- This is a sampled dataset, not the full CoRNStack distribution.
|
| 296 |
+
- If you need maximum coverage or full-scale training, use the original CoRNStack collection.
|
| 297 |
+
|
| 298 |
+
## Config layout
|
| 299 |
+
|
| 300 |
+
Each language is published as **two separate configs**:
|
| 301 |
+
- `{lang}-v1-pair-2M`
|
| 302 |
+
- `{lang}-v1-hard-negatives-100k`
|
| 303 |
+
|
| 304 |
+
Each config uses split `train`.
|
| 305 |
+
|
| 306 |
+
### `{lang}-v1-pair-2M`
|
| 307 |
+
Fields:
|
| 308 |
+
- `query`
|
| 309 |
+
- `document`
|
| 310 |
+
|
| 311 |
+
Target rows per language: ~2,000,000
|
| 312 |
+
|
| 313 |
+
### `{lang}-v1-hard-negatives-100k`
|
| 314 |
+
Fields:
|
| 315 |
+
- `query`
|
| 316 |
+
- `positive`
|
| 317 |
+
- `negative_1`
|
| 318 |
+
- `negative_2`
|
| 319 |
+
- `negative_3`
|
| 320 |
+
- `negative_4`
|
| 321 |
+
- `negative_5`
|
| 322 |
+
- `negative_6`
|
| 323 |
+
- `negative_7`
|
| 324 |
+
|
| 325 |
+
Target rows per language: ~100,000
|
| 326 |
+
|
| 327 |
+
## Included configs
|
| 328 |
+
|
| 329 |
+
| Config | Rows | Type |
|
| 330 |
+
| --- | ---: | --- |
|
| 331 |
+
| go-v1-pair-2M | 2,000,000 | pair |
|
| 332 |
+
| go-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 333 |
+
| java-v1-pair-2M | 2,000,000 | pair |
|
| 334 |
+
| java-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 335 |
+
| javascript-v1-pair-2M | 2,000,000 | pair |
|
| 336 |
+
| javascript-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 337 |
+
| php-v1-pair-2M | 2,000,000 | pair |
|
| 338 |
+
| php-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 339 |
+
| python-v1-pair-2M | 2,000,000 | pair |
|
| 340 |
+
| python-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 341 |
+
| ruby-v1-pair-2M | 2,000,000 | pair |
|
| 342 |
+
| ruby-v1-hard-negatives-100k | 100,000 | hard-negatives |
|
| 343 |
+
|
| 344 |
+
## Quick usage
|
| 345 |
+
|
| 346 |
+
```python
|
| 347 |
+
from datasets import load_dataset
|
| 348 |
+
|
| 349 |
+
pair_ds = load_dataset("hotchpotch/conrnstack-samples", "python-v1-pair-2M", split="train")
|
| 350 |
+
hard_ds = load_dataset("hotchpotch/conrnstack-samples", "python-v1-hard-negatives-100k", split="train")
|
| 351 |
+
|
| 352 |
+
print(pair_ds.column_names, len(pair_ds))
|
| 353 |
+
print(hard_ds.column_names, len(hard_ds))
|
| 354 |
+
```
|
| 355 |
+
|
| 356 |
+
## Creation process (rough)
|
| 357 |
+
|
| 358 |
+
For each language:
|
| 359 |
+
1. Read CoRNStack shard files (`shard-*.jsonl.gz`).
|
| 360 |
+
2. Count lines per shard and allocate per-shard targets.
|
| 361 |
+
3. Build pair data via random line-index sampling with valid string `query`/`document`.
|
| 362 |
+
4. Build hard-negative data from disjoint rows:
|
| 363 |
+
- valid string `query`/`document`
|
| 364 |
+
- `negatives` contains at least 7 unique non-empty strings
|
| 365 |
+
- sample 7 negatives per row
|
| 366 |
+
- cap output via reservoir sampling
|
| 367 |
+
|
| 368 |
+
Default seed is fixed (`42`) for reproducibility under identical source snapshots and parameters.
|
| 369 |
+
|
| 370 |
+
## License
|
| 371 |
+
|
| 372 |
+
This dataset follows CoRNStack and is released under **Apache-2.0**.
|
| 373 |
+
|
| 374 |
+
## Citation and attribution
|
| 375 |
+
|
| 376 |
+
If you use this dataset, please cite and attribute CoRNStack:
|
| 377 |
+
- Paper: https://huggingface.co/papers/2412.01007
|
| 378 |
+
- Collection: https://huggingface.co/collections/nomic-ai/cornstack
|