Datasets:
Tasks:
Text Retrieval
Modalities:
Text
Formats:
parquet
Sub-tasks:
document-retrieval
Languages:
English
Size:
1M - 10M
License:
File size: 6,181 Bytes
c84cd2e 0baafd4 c84cd2e 0baafd4 c84cd2e fff469e c84cd2e 0baafd4 c84cd2e fff469e c84cd2e fff469e c84cd2e fff469e c84cd2e | 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 | ---
pretty_name: Training · CoRNStack Python
license: apache-2.0
language:
- en
multilinguality:
- monolingual
task_categories:
- text-retrieval
task_ids:
- document-retrieval
tags:
- train
- retrieval
- code
configs:
- config_name: corpus
data_files:
- split: train
path: corpus/train-*.parquet
- config_name: hard-negatives
data_files:
- split: train
path: hard-negatives/train-*.parquet
- config_name: qrels
data_files:
- split: train
path: qrels/train-*.parquet
- config_name: queries
data_files:
- split: train
path: queries/train-*.parquet
- config_name: teacher-scores
data_files:
- split: train
path: teacher-scores/train-*.parquet
---
# CoRNStack Python — Training, unified schema
A seeded sample of [`nomic-ai/cornstack-python-v1`](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1/tree/25fb04bd3537983a622d01104a967a5a7f9eaef8), made into retrieval **training** pairs and reshaped into the strict schema shared by every dataset in this collection. One of the 15 domain sources (code, medical, science, finance, legal) added to the collection's general sources.
| | |
|---|---|
| Source | [`nomic-ai/cornstack-python-v1`](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1/tree/25fb04bd3537983a622d01104a967a5a7f9eaef8) @ `25fb04bd3537` |
| Task | query → Python function |
| Domain · languages | code · eng |
| Queries / documents / qrels | 59,994 / 712,486 / 59,994 |
| Qrels per query | min 1 · mean 1.0 · max 1 |
| Score values | 2 ×59,994 (2: the first positive, 1: any other) |
| Layout | `queries` · `corpus` · `qrels` · `hard-negatives` · `teacher-scores`, split `train` |
| Splits | `corpus`: train · `hard-negatives`: train · `qrels`: train · `queries`: train · `teacher-scores`: train |
| Hard negatives | sources: `dataset`, `dense` · 6,407,253 rows |
| Teacher scores | none yet (0 rows): `jinaai/jina-reranker-v3.5` scores come next |
| Ids | `sha1(text)[:20]`; identical texts collapse to one document / query |
| License | `apache-2.0` |
## Schema
| config | columns | rules |
|---|---|---|
| `queries` | `id: string`, `text: string` | ids unique and non-empty; every query has ≥ 1 qrel |
| `corpus` | `id: string`, `title: string`, `text: string` | `title` is always present (`""` when the source has none) |
| `qrels` | `query-id: string`, `corpus-id: string`, `score: int32` | referential integrity to both tables; no duplicate pairs; no floats |
| `hard-negatives` | `query-id: string`, `corpus-id: string`, `rank: int32`, `source: string` | one row per negative; `(query-id, corpus-id, source)` unique; never a labelled positive of the same query |
| `teacher-scores` | `query-id: string`, `corpus-id: string`, `teacher: string`, `score: float32` | one row per scored pair (positives included); a row *means* scored — never a placeholder |
Files are Parquet, sorted by id, zstd-compressed, sharded at 500 MB. Every rule above is checked before publishing; `provenance.json` records the source revision, what changed, and the output file hashes.
## What changed from the source
- **sampled**: a seeded random sample (seed 1) of up to 60,000 pairs, streamed through a shuffle buffer of 50,000
- **reshaped**: the natural-language query (`query`) is the query, the function (`document`) the document
- **negatives the source provides**: up to 15 of the row's own mined negatives (`negatives`) (hard-negatives `source` = `dataset`)
- **decontaminated (exact)**: a pair was dropped when its normalised query equals any evaluation query, or a positive equals a document of a test or dev corpus; a repeated query keeps its first pair
- **decontaminated (near-duplicates)**: 3 passages that nearly copy an evaluation document some evaluation query judges relevant, and 3 queries that nearly copy an evaluation query (word 13-grams for passages, 8-grams for queries; at least half shared with one text of the 23 test sets (BEIR, RTEB, LitSearch) or the 6 dev sets) were removed, and with them 6 queries in total; near copies of evaluation-corpus documents that no evaluation query judges relevant were kept
- **text**: leading and trailing whitespace stripped; otherwise as converted above
- **ids** re-keyed to `sha1(text)[:20]`: 0 documents and 0 queries collapsed into identical texts
- added a `title` column filled with `""` (the source has none)
## Hard negatives and teacher scores
Filled by the collection's annotation pipeline (`annotation=jina35`). **Interim**: the candidates are final, the teacher scores are still to come.
- **Candidates**: dense retrieval with `jinaai/jina-embeddings-v5-text-small` over this corpus to depth 1,000; 100 candidates per query drawn from the rank windows 1–30 (30), 31–100 (30), 101–300 (20), 301–1000 (20), the query's labelled positives excluded. `rank` is the dense rank; `source` is `dense` for a mined row and `dataset` for a negative the source labels itself.
- **Teacher scores**: none yet. `teacher-scores` holds 0 rows until the `jinaai/jina-reranker-v3.5` scores (listwise, as in the other repositories) are filled in; `datasets` cannot return a 0-example split, so read that file with `pyarrow` / `pandas` meanwhile. The candidates stay.
| configs | queries | hard negatives | teacher scores |
|---|---:|---:|---:|
| `hard-negatives` · `teacher-scores` | 59,994 (all) | 6,407,253 (452,100 dataset, 5,955,153 dense) | 0 |
## Load it
```python
from datasets import load_dataset
queries = load_dataset("Hyukkyu/train-cornstack-python", "queries", split="train")
corpus = load_dataset("Hyukkyu/train-cornstack-python", "corpus", split="train")
qrels = load_dataset("Hyukkyu/train-cornstack-python", "qrels", split="train")
negatives = load_dataset("Hyukkyu/train-cornstack-python", "hard-negatives", split="train")
scores = load_dataset("Hyukkyu/train-cornstack-python", "teacher-scores", split="train")
```
## License and attribution
The data is redistributed under the source's terms — `apache-2.0`. All credit belongs to the original authors; see the source repository (https://huggingface.co/datasets/nomic-ai/cornstack-python-v1). This repository is an independent repackaging.
|