Hyukkyu commited on
Commit
c84cd2e
·
verified ·
1 Parent(s): 92eb217

CoRNStack Python: the unified schema (domain-v1, miner scores)

Browse files
README.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: Training · CoRNStack Python
3
+ license: apache-2.0
4
+ language:
5
+ - en
6
+ multilinguality:
7
+ - monolingual
8
+ task_categories:
9
+ - text-retrieval
10
+ task_ids:
11
+ - document-retrieval
12
+ tags:
13
+ - train
14
+ - retrieval
15
+ - code
16
+ configs:
17
+ - config_name: corpus
18
+ data_files:
19
+ - split: train
20
+ path: corpus/train-*.parquet
21
+ - config_name: hard-negatives
22
+ data_files:
23
+ - split: train
24
+ path: hard-negatives/train-*.parquet
25
+ - config_name: qrels
26
+ data_files:
27
+ - split: train
28
+ path: qrels/train-*.parquet
29
+ - config_name: queries
30
+ data_files:
31
+ - split: train
32
+ path: queries/train-*.parquet
33
+ - config_name: teacher-scores
34
+ data_files:
35
+ - split: train
36
+ path: teacher-scores/train-*.parquet
37
+ ---
38
+ # CoRNStack Python — Training, unified schema
39
+
40
+ 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.
41
+
42
+ | | |
43
+ |---|---|
44
+ | Source | [`nomic-ai/cornstack-python-v1`](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1/tree/25fb04bd3537983a622d01104a967a5a7f9eaef8) @ `25fb04bd3537` |
45
+ | Task | query → Python function |
46
+ | Domain · languages | code · eng |
47
+ | Queries / documents / qrels | 59,983 / 712,475 / 59,983 |
48
+ | Qrels per query | min 1 · mean 1.0 · max 1 |
49
+ | Score values | 2 ×59,983 (2: the first positive, 1: any other) |
50
+ | Layout | `queries` · `corpus` · `qrels` · `hard-negatives` · `teacher-scores`, split `train` |
51
+ | Splits | `corpus`: train · `hard-negatives`: train · `qrels`: train · `queries`: train · `teacher-scores`: train |
52
+ | Hard negatives | sources: `dataset`, `dense` · 4,006,722 rows |
53
+ | Teacher scores | `jinaai/jina-embeddings-v5-text-small` (the miner's cosine, not a reranker) · 4,066,705 rows (positives included) |
54
+ | Ids | `sha1(text)[:20]`; identical texts collapse to one document / query |
55
+ | License | `apache-2.0` |
56
+
57
+ ## Schema
58
+
59
+ | config | columns | rules |
60
+ |---|---|---|
61
+ | `queries` | `id: string`, `text: string` | ids unique and non-empty; every query has ≥ 1 qrel |
62
+ | `corpus` | `id: string`, `title: string`, `text: string` | `title` is always present (`""` when the source has none) |
63
+ | `qrels` | `query-id: string`, `corpus-id: string`, `score: int32` | referential integrity to both tables; no duplicate pairs; no floats |
64
+ | `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 |
65
+ | `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 |
66
+
67
+ 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.
68
+
69
+ ## What changed from the source
70
+
71
+ - **sampled**: a seeded random sample (seed 1) of up to 60,000 pairs, streamed through a shuffle buffer of 50,000
72
+ - **reshaped**: the natural-language query (`query`) is the query, the function (`document`) the document
73
+ - **negatives the source provides**: up to 15 of the row's own mined negatives (`negatives`) (hard-negatives `source` = `dataset`)
74
+ - **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
75
+ - **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
76
+ - **text**: leading and trailing whitespace stripped; otherwise as converted above
77
+ - **ids** re-keyed to `sha1(text)[:20]`: 0 documents and 0 queries collapsed into identical texts
78
+ - added a `title` column filled with `""` (the source has none)
79
+
80
+ ## Hard negatives and teacher scores
81
+
82
+ 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:
83
+
84
+ - **Corpus**: the source's own passages (its positives and the negatives it provides), not a larger collection.
85
+ - **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).
86
+ - **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.
87
+
88
+ | configs | queries | hard negatives | teacher scores |
89
+ |---|---:|---:|---:|
90
+ | `hard-negatives` · `teacher-scores` | 59,983 (all) | 4,006,722 (452,048 dataset, 3,554,674 dense) | 4,066,705 |
91
+
92
+ ## Load it
93
+
94
+ ```python
95
+ from datasets import load_dataset
96
+ queries = load_dataset("Hyukkyu/train-cornstack-python", "queries", split="train")
97
+ corpus = load_dataset("Hyukkyu/train-cornstack-python", "corpus", split="train")
98
+ qrels = load_dataset("Hyukkyu/train-cornstack-python", "qrels", split="train")
99
+ negatives = load_dataset("Hyukkyu/train-cornstack-python", "hard-negatives", split="train")
100
+ scores = load_dataset("Hyukkyu/train-cornstack-python", "teacher-scores", split="train")
101
+ ```
102
+
103
+ ## License and attribution
104
+
105
+ 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.
corpus/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b0224d3e24418517a080f9953f647d2a133d20acd55de4c55f683ee6dd3274a
3
+ size 131538050
hard-negatives/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d74e9581d579c9d8aca3d6424c17d70a7027bdb4c845726b678216cfc24b9bd6
3
+ size 49095009
provenance.json ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": "CoRNStack Python",
3
+ "benchmark": "train",
4
+ "repo": "train-cornstack-python",
5
+ "conversion": "2026-09-29",
6
+ "source": {
7
+ "path": "nomic-ai/cornstack-python-v1",
8
+ "revision": "25fb04bd3537983a622d01104a967a5a7f9eaef8",
9
+ "url": "https://huggingface.co/datasets/nomic-ai/cornstack-python-v1/tree/25fb04bd3537983a622d01104a967a5a7f9eaef8",
10
+ "configs": [],
11
+ "file": null
12
+ },
13
+ "license": {
14
+ "card": "apache-2.0",
15
+ "upstream_checked": true
16
+ },
17
+ "languages": [
18
+ "eng"
19
+ ],
20
+ "domain": "code",
21
+ "byte_preserving_text": false,
22
+ "symmetric": false,
23
+ "layout": {
24
+ "subsets": null,
25
+ "splits": [
26
+ "train"
27
+ ],
28
+ "split_map": null
29
+ },
30
+ "id_scheme": "sha1(text)[:20]",
31
+ "sampling": {
32
+ "cap": 60000,
33
+ "seed": 1,
34
+ "shuffle_buffer": 50000
35
+ },
36
+ "inputs": {
37
+ "queries": 60000,
38
+ "corpus": 712489,
39
+ "qrels": 60000,
40
+ "hard_negatives": 4029107,
41
+ "teacher_scores": 4089107
42
+ },
43
+ "decontamination": {
44
+ "exact": "the normalised query equals an evaluation query, or a positive equals a test / dev corpus document (convert_domain.py)",
45
+ "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)",
46
+ "flagged_passages": 14,
47
+ "flagged_queries": 3,
48
+ "queries_dropped": 17
49
+ },
50
+ "normalize": {
51
+ "title_added": true,
52
+ "collapsed_queries": 0,
53
+ "collapsed_documents": 0,
54
+ "collapsed_with_other_titles": 0,
55
+ "negatives_that_were_positives_dropped": 0,
56
+ "score_spread_max": 0.0
57
+ },
58
+ "stats": {
59
+ "n_queries": 59983,
60
+ "n_corpus": 712475,
61
+ "n_qrels": 59983,
62
+ "qrels_per_query": {
63
+ "min": 1,
64
+ "mean": 1.0,
65
+ "max": 1
66
+ },
67
+ "score_values": {
68
+ "2": 59983
69
+ },
70
+ "corpus_with_title": 0,
71
+ "n_hard_negatives": 4006722,
72
+ "sources": {
73
+ "dense": 3554674,
74
+ "dataset": 452048
75
+ },
76
+ "negatives_per_query": 66.8,
77
+ "n_teacher_scores": 4066705,
78
+ "teachers": [
79
+ "jinaai/jina-embeddings-v5-text-small"
80
+ ],
81
+ "avg_query_chars": 82.9,
82
+ "avg_doc_chars": 512.1
83
+ },
84
+ "files": {
85
+ "queries": {
86
+ "train": [
87
+ {
88
+ "path": "queries/train-00000-of-00001.parquet",
89
+ "rows": 59983,
90
+ "bytes": 3037712,
91
+ "sha256": "b6d26cef8fe86012e2e7770937881661d0f71267a7f0260e6c7a9c9c18651043"
92
+ }
93
+ ]
94
+ },
95
+ "corpus": {
96
+ "train": [
97
+ {
98
+ "path": "corpus/train-00000-of-00001.parquet",
99
+ "rows": 712475,
100
+ "bytes": 131538050,
101
+ "sha256": "9b0224d3e24418517a080f9953f647d2a133d20acd55de4c55f683ee6dd3274a"
102
+ }
103
+ ]
104
+ },
105
+ "qrels": {
106
+ "train": [
107
+ {
108
+ "path": "qrels/train-00000-of-00001.parquet",
109
+ "rows": 59983,
110
+ "bytes": 1446999,
111
+ "sha256": "1e8f701bc7f7421ff395e08370fc34514c4e5873db28d0912d186f299e9c0724"
112
+ }
113
+ ]
114
+ },
115
+ "hard-negatives": {
116
+ "train": [
117
+ {
118
+ "path": "hard-negatives/train-00000-of-00001.parquet",
119
+ "rows": 4006722,
120
+ "bytes": 49095009,
121
+ "sha256": "d74e9581d579c9d8aca3d6424c17d70a7027bdb4c845726b678216cfc24b9bd6"
122
+ }
123
+ ]
124
+ },
125
+ "teacher-scores": {
126
+ "train": [
127
+ {
128
+ "path": "teacher-scores/train-00000-of-00001.parquet",
129
+ "rows": 4066705,
130
+ "bytes": 61263455,
131
+ "sha256": "5f78beca05bab44e78ccbab8ac690d6989f270a5413775b21639cb530f3bc004"
132
+ }
133
+ ]
134
+ }
135
+ }
136
+ }
qrels/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e8f701bc7f7421ff395e08370fc34514c4e5873db28d0912d186f299e9c0724
3
+ size 1446999
queries/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6d26cef8fe86012e2e7770937881661d0f71267a7f0260e6c7a9c9c18651043
3
+ size 3037712
teacher-scores/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f78beca05bab44e78ccbab8ac690d6989f270a5413775b21639cb530f3bc004
3
+ size 61263455