Datasets:
Tasks:
Text Retrieval
Formats:
parquet
Sub-tasks:
document-retrieval
Languages:
English
Size:
10M - 100M
License:
CoRNStack Python: the unified schema (domain-v1, miner scores)
Browse filesFiles changed (7)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105---pretty_name: Training · CoRNStack Pythonlicense: apache-2.0language:- enmultilinguality:- monolingualtask_categories:- text-retrievaltask_ids:- document-retrievaltags:- train- retrieval- codeconfigs:- 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,983 / 712,475 / 59,983 || Qrels per query | min 1 · mean 1.0 · max 1 || Score values | 2 ×59,983 (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` · 4,006,722 rows || Teacher scores | `jinaai/jina-embeddings-v5-text-small` (the miner's cosine, not a reranker) · 4,066,705 rows (positives included) || 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)**: 14 passages and 3 queries that nearly copy a text of an evaluation set (word 13-grams for passages, 8-grams for queries; at least half shared with one text of the 23 test corpora (BEIR, RTEB, LitSearch) and the 3 dev corpora) were removed, and with them 17 queries in total- **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 owner's domain pipeline (`convert_domain.py`, `mine_domain.py`), not yet by the annotation pipeline of the other repositories in this collection:
- **Corpus**: the source's own passages (its positives and the negatives it provides), not a larger collection.- **Candidates**: dense retrieval with `jinaai/jina-embeddings-v5-text-small` (full length) over that corpus to depth 300; 60 candidates per query drawn from the rank windows 1–30 (30), 31–100 (20), 101–300 (10), the query's positives excluded. `rank` is the dense rank; `source` is `dense` for a mined row and `dataset` for a negative the source labels itself (ranked after the mined ones).- **Teacher scores**: the miner's cosine between the query and passage embeddings, one row per (query, positive) and per (query, candidate), `teacher` = `jinaai/jina-embeddings-v5-text-small`. **Not a reranker**: the other repositories carry `jinaai/jina-reranker-v3.5` scores. Re-mining with the collection's plan (100 candidates to depth 1,000) and re-scoring with that reranker are under way; they will replace these two tables, and this section will say so.
| configs | queries | hard negatives | teacher scores ||---|---:|---:|---:|| `hard-negatives` · `teacher-scores` | 59,983 (all) | 4,006,722 (452,048 dataset, 3,554,674 dense) | 4,066,705 |
## Load it
```pythonfrom datasets import load_datasetqueries = 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.123version https://git-lfs.github.com/spec/v1oid sha256:9b0224d3e24418517a080f9953f647d2a133d20acd55de4c55f683ee6dd3274asize 131538050123version https://git-lfs.github.com/spec/v1oid sha256:d74e9581d579c9d8aca3d6424c17d70a7027bdb4c845726b678216cfc24b9bd6size 49095009123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136{ "task": "CoRNStack Python", "benchmark": "train", "repo": "train-cornstack-python", "conversion": "2026-09-29", "source": { "path": "nomic-ai/cornstack-python-v1", "revision": "25fb04bd3537983a622d01104a967a5a7f9eaef8", "url": "https://huggingface.co/datasets/nomic-ai/cornstack-python-v1/tree/25fb04bd3537983a622d01104a967a5a7f9eaef8", "configs": [], "file": null }, "license": { "card": "apache-2.0", "upstream_checked": true }, "languages": [ "eng" ], "domain": "code", "byte_preserving_text": false, "symmetric": false, "layout": { "subsets": null, "splits": [ "train" ], "split_map": null }, "id_scheme": "sha1(text)[:20]", "sampling": { "cap": 60000, "seed": 1, "shuffle_buffer": 50000 }, "inputs": { "queries": 60000, "corpus": 712489, "qrels": 60000, "hard_negatives": 4029107, "teacher_scores": 4089107 }, "decontamination": { "exact": "the normalised query equals an evaluation query, or a positive equals a test / dev corpus document (convert_domain.py)", "near_duplicate": "word 13-gram shingles of passages, 8-grams of queries, a fixed 1/4 sample; flagged at >= half (and >= 4) shared with one text of the 23 test corpora and the 3 dev corpora (data/tmp/domain_overlap_flagged.py)", "flagged_passages": 14, "flagged_queries": 3, "queries_dropped": 17 }, "normalize": { "title_added": true, "collapsed_queries": 0, "collapsed_documents": 0, "collapsed_with_other_titles": 0, "negatives_that_were_positives_dropped": 0, "score_spread_max": 0.0 }, "stats": { "n_queries": 59983, "n_corpus": 712475, "n_qrels": 59983, "qrels_per_query": { "min": 1, "mean": 1.0, "max": 1 }, "score_values": { "2": 59983 }, "corpus_with_title": 0, "n_hard_negatives": 4006722, "sources": { "dense": 3554674, "dataset": 452048 }, "negatives_per_query": 66.8, "n_teacher_scores": 4066705, "teachers": [ "jinaai/jina-embeddings-v5-text-small" ], "avg_query_chars": 82.9, "avg_doc_chars": 512.1 }, "files": { "queries": { "train": [ { "path": "queries/train-00000-of-00001.parquet", "rows": 59983, "bytes": 3037712, "sha256": "b6d26cef8fe86012e2e7770937881661d0f71267a7f0260e6c7a9c9c18651043" } ] }, "corpus": { "train": [ { "path": "corpus/train-00000-of-00001.parquet", "rows": 712475, "bytes": 131538050, "sha256": "9b0224d3e24418517a080f9953f647d2a133d20acd55de4c55f683ee6dd3274a" } ] }, "qrels": { "train": [ { "path": "qrels/train-00000-of-00001.parquet", "rows": 59983, "bytes": 1446999, "sha256": "1e8f701bc7f7421ff395e08370fc34514c4e5873db28d0912d186f299e9c0724" } ] }, "hard-negatives": { "train": [ { "path": "hard-negatives/train-00000-of-00001.parquet", "rows": 4006722, "bytes": 49095009, "sha256": "d74e9581d579c9d8aca3d6424c17d70a7027bdb4c845726b678216cfc24b9bd6" } ] }, "teacher-scores": { "train": [ { "path": "teacher-scores/train-00000-of-00001.parquet", "rows": 4066705, "bytes": 61263455, "sha256": "5f78beca05bab44e78ccbab8ac690d6989f270a5413775b21639cb530f3bc004" } ] } }}123version https://git-lfs.github.com/spec/v1oid sha256:1e8f701bc7f7421ff395e08370fc34514c4e5873db28d0912d186f299e9c0724size 1446999123version https://git-lfs.github.com/spec/v1oid sha256:b6d26cef8fe86012e2e7770937881661d0f71267a7f0260e6c7a9c9c18651043size 3037712123version https://git-lfs.github.com/spec/v1oid sha256:5f78beca05bab44e78ccbab8ac690d6989f270a5413775b21639cb530f3bc004size 61263455README.mdAdded+105
corpus/train-00000-of-00001.parquetAdded+3
hard-negatives/train-00000-of-00001.parquetAdded+3
provenance.jsonAdded+136
qrels/train-00000-of-00001.parquetAdded+3
queries/train-00000-of-00001.parquetAdded+3
teacher-scores/train-00000-of-00001.parquetAdded+3