hotchpotch commited on
Commit
7153731
·
verified ·
1 Parent(s): c12665d

Update dataset README for reranking_hybrid candidates

Browse files
Files changed (1) hide show
  1. README.md +83 -75
README.md CHANGED
@@ -1,65 +1,66 @@
1
  ---
2
  configs:
3
- - config_name: bm25
4
  data_files:
5
  - split: NanoCodeRAGLibraryDocumentationSolutions
6
- path: bm25/NanoCodeRAGLibraryDocumentationSolutions-*
7
  - split: NanoCodeRAGOnlineTutorials
8
- path: bm25/NanoCodeRAGOnlineTutorials-*
9
  - split: NanoCodeRAGProgrammingSolutions
10
- path: bm25/NanoCodeRAGProgrammingSolutions-*
11
  - split: NanoCodeRAGStackoverflowPosts
12
- path: bm25/NanoCodeRAGStackoverflowPosts-*
13
- - config_name: corpus
14
  data_files:
15
  - split: NanoCodeRAGLibraryDocumentationSolutions
16
- path: corpus/NanoCodeRAGLibraryDocumentationSolutions-*
17
  - split: NanoCodeRAGOnlineTutorials
18
- path: corpus/NanoCodeRAGOnlineTutorials-*
19
  - split: NanoCodeRAGProgrammingSolutions
20
- path: corpus/NanoCodeRAGProgrammingSolutions-*
21
  - split: NanoCodeRAGStackoverflowPosts
22
- path: corpus/NanoCodeRAGStackoverflowPosts-*
23
- - config_name: harrier_oss_v1_270m
 
24
  data_files:
25
  - split: NanoCodeRAGLibraryDocumentationSolutions
26
- path: harrier_oss_v1_270m/NanoCodeRAGLibraryDocumentationSolutions-*
27
  - split: NanoCodeRAGOnlineTutorials
28
- path: harrier_oss_v1_270m/NanoCodeRAGOnlineTutorials-*
29
  - split: NanoCodeRAGProgrammingSolutions
30
- path: harrier_oss_v1_270m/NanoCodeRAGProgrammingSolutions-*
31
  - split: NanoCodeRAGStackoverflowPosts
32
- path: harrier_oss_v1_270m/NanoCodeRAGStackoverflowPosts-*
33
- - config_name: qrels
34
  data_files:
35
  - split: NanoCodeRAGLibraryDocumentationSolutions
36
- path: qrels/NanoCodeRAGLibraryDocumentationSolutions-*
37
  - split: NanoCodeRAGOnlineTutorials
38
- path: qrels/NanoCodeRAGOnlineTutorials-*
39
  - split: NanoCodeRAGProgrammingSolutions
40
- path: qrels/NanoCodeRAGProgrammingSolutions-*
41
  - split: NanoCodeRAGStackoverflowPosts
42
- path: qrels/NanoCodeRAGStackoverflowPosts-*
43
- - config_name: queries
44
  data_files:
45
  - split: NanoCodeRAGLibraryDocumentationSolutions
46
- path: NanoCodeRAGLibraryDocumentationSolutions/queries/test.parquet
47
  - split: NanoCodeRAGOnlineTutorials
48
- path: NanoCodeRAGOnlineTutorials/queries/test.parquet
49
  - split: NanoCodeRAGProgrammingSolutions
50
- path: NanoCodeRAGProgrammingSolutions/queries/test.parquet
51
  - split: NanoCodeRAGStackoverflowPosts
52
- path: NanoCodeRAGStackoverflowPosts/queries/test.parquet
53
  - config_name: reranking_hybrid
54
  data_files:
55
  - split: NanoCodeRAGLibraryDocumentationSolutions
56
- path: reranking_hybrid/NanoCodeRAGLibraryDocumentationSolutions-*
57
  - split: NanoCodeRAGOnlineTutorials
58
- path: reranking_hybrid/NanoCodeRAGOnlineTutorials-*
59
  - split: NanoCodeRAGProgrammingSolutions
60
- path: reranking_hybrid/NanoCodeRAGProgrammingSolutions-*
61
  - split: NanoCodeRAGStackoverflowPosts
62
- path: reranking_hybrid/NanoCodeRAGStackoverflowPosts-*
63
  language:
64
  - code
65
  tags:
@@ -67,6 +68,9 @@ tags:
67
  - retrieval
68
  - nano
69
  - bm25
 
 
 
70
  dataset_info:
71
  - config_name: bm25
72
  features:
@@ -195,81 +199,85 @@ dataset_info:
195
  download_size: 940041
196
  dataset_size: 934608
197
  ---
198
-
199
  # NanoCodeRAG
200
 
201
- This dataset is a Nano-style retrieval dataset. Nano-series evaluation can be run easily with the [HAKARI-Bench](https://github.com/hotchpotch/hakari-bench).
202
-
203
- NanoCodeRAG is derived from CodeRAG. It follows the Hugging Face Datasets layout convention used by [sentence-transformers/NanoBEIR-en](https://huggingface.co/datasets/sentence-transformers/NanoBEIR-en): each Nano split has separate `corpus`, `queries`, and `qrels` tables, and BM25 candidates are provided separately in a `bm25` table. This layout follows the NanoBEIR-style evaluation approach summarized in [NanoBEIR](https://huggingface.co/blog/sionic-ai/eval-sionic-nano-beir).
204
 
205
  NanoCodeRAG contains 4 Nano retrieval splits derived from CodeRAG. Each split keeps up to 200 eligible queries and up to 10000 corpus documents, with exact duplicate query and document text removed where the generator records that policy.
206
 
207
- ## Source Links
208
 
209
- - Source benchmark: `CodeRAG`
210
- - `code-rag-bench/library-documentation`: https://huggingface.co/datasets/code-rag-bench/library-documentation
211
- - `code-rag-bench/online-tutorials`: https://huggingface.co/datasets/code-rag-bench/online-tutorials
212
- - `code-rag-bench/programming-solutions`: https://huggingface.co/datasets/code-rag-bench/programming-solutions
213
- - `code-rag-bench/stackoverflow-posts`: https://huggingface.co/datasets/code-rag-bench/stackoverflow-posts
 
 
 
 
 
 
214
 
215
  ## Data Layout
216
 
217
- This dataset uses four Hugging Face Datasets configs:
218
 
219
  - `corpus`: documents with `_id` and `text`
220
  - `queries`: queries with `_id` and `text`
221
  - `qrels`: positive relevance labels with `query-id` and `corpus-id`
222
  - `bm25`: BM25 candidate lists with `query-id` and `corpus-ids`
 
 
223
 
224
- Each config uses the same Nano split names. If the actual generated dataset uses a different schema, config name, path layout, or field name, revise this section before publishing the README.
225
 
226
- ## Construction Steps
227
 
228
- This dataset was built as follows. If the actual generation procedure differs, revise this section before publishing the README.
 
 
229
 
230
- 1. Use CodeRAG as the upstream benchmark or dataset family.
231
- 2. Load the source datasets recorded in `manifest.json` and per-split metadata files.
232
- 3. Use the source benchmark evaluation split, preferring `test` when available as the source evaluation split policy.
233
- 4. Create one Nano split for each selected source retrieval task.
234
- 5. Keep up to 200 eligible queries per Nano split.
235
- 6. Include qrels-positive documents for the selected queries.
236
- 7. Fill the corpus from source corpus order up to 10000 documents.
237
- 8. Remove exact duplicate document text within each split. If a removed duplicate was referenced by qrels, rewrite qrels to the kept document id when the generator records that policy.
238
- 9. Store document title and body as a single `text` field when the source provides both.
239
- 10. Generate BM25 top-100 candidates with the tokenization policy recorded per split.
240
- 11. If a qrels-positive document is missing from the raw BM25 result, insert it into the final `bm25` candidate list by replacing a tail non-positive candidate.
241
 
242
- ## BM25 Subset Policy
243
 
244
- The `bm25` config is a candidate subset for first-stage retrieval and reranking. It is not a separate source dataset. Each row contains one query id and a ranked list of corpus ids.
245
 
246
- BM25 candidates are generated from the selected corpus for each split. The configured candidate cap is top-100. When a qrels-positive document is not present in the raw BM25 result, the missing positive is forced into the final candidate list by replacing a tail candidate that is not positive for that query. Candidate ids are kept unique after replacement.
 
 
 
 
 
247
 
248
- ## Split Mapping
249
 
250
- | Nano split | Source task | Source dataset | Queries | Corpus | Qrels |
251
- |---|---|---|---:|---:|---:|
252
- | `NanoCodeRAGLibraryDocumentationSolutions` | `CodeRAGLibraryDocumentationSolutions` | `code-rag-bench/library-documentation` | 200 | 8683 | 200 |
253
- | `NanoCodeRAGOnlineTutorials` | `CodeRAGOnlineTutorials` | `code-rag-bench/online-tutorials` | 200 | 9997 | 200 |
254
- | `NanoCodeRAGProgrammingSolutions` | `CodeRAGProgrammingSolutions` | `code-rag-bench/programming-solutions` | 200 | 984 | 200 |
255
- | `NanoCodeRAGStackoverflowPosts` | `CodeRAGStackoverflowPosts` | `code-rag-bench/stackoverflow-posts` | 200 | 10000 | 200 |
256
 
257
- ## BM25 nDCG@10
258
 
259
- `nDCG@10` is computed from the included BM25 ranking against the included qrels.
 
 
 
 
 
 
260
 
261
- Tokenizer policy summary: `whitespace:python`.
262
 
263
- | Nano split | Tokenizer | Forced BM25 positives | BM25 nDCG@10 |
264
- |---|---|---:|---:|
265
- | `NanoCodeRAGLibraryDocumentationSolutions` | `whitespace:python` | 85 | 0.2279 |
266
- | `NanoCodeRAGOnlineTutorials` | `whitespace:python` | 17 | 0.7472 |
267
- | `NanoCodeRAGProgrammingSolutions` | `whitespace:python` | 149 | 0.0138 |
268
- | `NanoCodeRAGStackoverflowPosts` | `whitespace:python` | 10 | 0.6902 |
269
 
270
- ## Skipped Tasks
271
 
272
- No source tasks were skipped.
 
 
 
 
273
 
274
  ## License
275
 
 
1
  ---
2
  configs:
3
+ - config_name: corpus
4
  data_files:
5
  - split: NanoCodeRAGLibraryDocumentationSolutions
6
+ path: corpus/NanoCodeRAGLibraryDocumentationSolutions.parquet
7
  - split: NanoCodeRAGOnlineTutorials
8
+ path: corpus/NanoCodeRAGOnlineTutorials.parquet
9
  - split: NanoCodeRAGProgrammingSolutions
10
+ path: corpus/NanoCodeRAGProgrammingSolutions.parquet
11
  - split: NanoCodeRAGStackoverflowPosts
12
+ path: corpus/NanoCodeRAGStackoverflowPosts.parquet
13
+ - config_name: queries
14
  data_files:
15
  - split: NanoCodeRAGLibraryDocumentationSolutions
16
+ path: queries/NanoCodeRAGLibraryDocumentationSolutions.parquet
17
  - split: NanoCodeRAGOnlineTutorials
18
+ path: queries/NanoCodeRAGOnlineTutorials.parquet
19
  - split: NanoCodeRAGProgrammingSolutions
20
+ path: queries/NanoCodeRAGProgrammingSolutions.parquet
21
  - split: NanoCodeRAGStackoverflowPosts
22
+ path: queries/NanoCodeRAGStackoverflowPosts.parquet
23
+ default: true
24
+ - config_name: qrels
25
  data_files:
26
  - split: NanoCodeRAGLibraryDocumentationSolutions
27
+ path: qrels/NanoCodeRAGLibraryDocumentationSolutions.parquet
28
  - split: NanoCodeRAGOnlineTutorials
29
+ path: qrels/NanoCodeRAGOnlineTutorials.parquet
30
  - split: NanoCodeRAGProgrammingSolutions
31
+ path: qrels/NanoCodeRAGProgrammingSolutions.parquet
32
  - split: NanoCodeRAGStackoverflowPosts
33
+ path: qrels/NanoCodeRAGStackoverflowPosts.parquet
34
+ - config_name: bm25
35
  data_files:
36
  - split: NanoCodeRAGLibraryDocumentationSolutions
37
+ path: bm25/NanoCodeRAGLibraryDocumentationSolutions.parquet
38
  - split: NanoCodeRAGOnlineTutorials
39
+ path: bm25/NanoCodeRAGOnlineTutorials.parquet
40
  - split: NanoCodeRAGProgrammingSolutions
41
+ path: bm25/NanoCodeRAGProgrammingSolutions.parquet
42
  - split: NanoCodeRAGStackoverflowPosts
43
+ path: bm25/NanoCodeRAGStackoverflowPosts.parquet
44
+ - config_name: harrier_oss_v1_270m
45
  data_files:
46
  - split: NanoCodeRAGLibraryDocumentationSolutions
47
+ path: harrier_oss_v1_270m/NanoCodeRAGLibraryDocumentationSolutions.parquet
48
  - split: NanoCodeRAGOnlineTutorials
49
+ path: harrier_oss_v1_270m/NanoCodeRAGOnlineTutorials.parquet
50
  - split: NanoCodeRAGProgrammingSolutions
51
+ path: harrier_oss_v1_270m/NanoCodeRAGProgrammingSolutions.parquet
52
  - split: NanoCodeRAGStackoverflowPosts
53
+ path: harrier_oss_v1_270m/NanoCodeRAGStackoverflowPosts.parquet
54
  - config_name: reranking_hybrid
55
  data_files:
56
  - split: NanoCodeRAGLibraryDocumentationSolutions
57
+ path: reranking_hybrid/NanoCodeRAGLibraryDocumentationSolutions.parquet
58
  - split: NanoCodeRAGOnlineTutorials
59
+ path: reranking_hybrid/NanoCodeRAGOnlineTutorials.parquet
60
  - split: NanoCodeRAGProgrammingSolutions
61
+ path: reranking_hybrid/NanoCodeRAGProgrammingSolutions.parquet
62
  - split: NanoCodeRAGStackoverflowPosts
63
+ path: reranking_hybrid/NanoCodeRAGStackoverflowPosts.parquet
64
  language:
65
  - code
66
  tags:
 
68
  - retrieval
69
  - nano
70
  - bm25
71
+ - dense-retrieval
72
+ - reranking
73
+ - hakari-bench
74
  dataset_info:
75
  - config_name: bm25
76
  features:
 
199
  download_size: 940041
200
  dataset_size: 934608
201
  ---
 
202
  # NanoCodeRAG
203
 
204
+ This dataset is a Nano-style retrieval dataset for [HAKARI-bench](https://github.com/hakari-bench/hakari-bench).
 
 
205
 
206
  NanoCodeRAG contains 4 Nano retrieval splits derived from CodeRAG. Each split keeps up to 200 eligible queries and up to 10000 corpus documents, with exact duplicate query and document text removed where the generator records that policy.
207
 
208
+ ## Usage
209
 
210
+ ```python
211
+ from datasets import load_dataset
212
+
213
+ dataset_id = "hakari-bench/NanoCodeRAG"
214
+ split = "NanoCodeRAGLibraryDocumentationSolutions"
215
+
216
+ queries = load_dataset(dataset_id, "queries", split=split)
217
+ corpus = load_dataset(dataset_id, "corpus", split=split)
218
+ qrels = load_dataset(dataset_id, "qrels", split=split)
219
+ reranking_candidates = load_dataset(dataset_id, "reranking_hybrid", split=split)
220
+ ```
221
 
222
  ## Data Layout
223
 
224
+ This dataset uses six Hugging Face Datasets configs:
225
 
226
  - `corpus`: documents with `_id` and `text`
227
  - `queries`: queries with `_id` and `text`
228
  - `qrels`: positive relevance labels with `query-id` and `corpus-id`
229
  - `bm25`: BM25 candidate lists with `query-id` and `corpus-ids`
230
+ - `harrier_oss_v1_270m`: dense candidate lists from `microsoft/harrier-oss-v1-270m`
231
+ - `reranking_hybrid`: RRF candidate lists built from `bm25` and `harrier_oss_v1_270m`
232
 
233
+ Each config has the same Nano split names.
234
 
235
+ ## Candidate Construction
236
 
237
+ - `bm25`: local BM25 top-500 with automatic language-aware tokenization. The resolved tokenizer is shown in the Candidate Quality table, for example `wordseg@ja`.
238
+ - `harrier_oss_v1_270m`: dense top-500 from `microsoft/harrier-oss-v1-270m`. In tables this is shown as `Dense`; Dense means `microsoft/harrier-oss-v1-270m` with the `web_search_query` prompt for queries and cosine similarity over normalized embeddings.
239
+ - `reranking_hybrid`: RRF over `bm25` and `harrier_oss_v1_270m` using `rrf_k=100`, keeping the RRF top-100.
240
 
241
+ Safeguard means rank 101 is appended only when RRF top-100 contains no qrels-positive document.
 
 
 
 
 
 
 
 
 
 
242
 
243
+ ## Split Statistics
244
 
245
+ Length statistics are character counts computed with `len(str(text))`.
246
 
247
+ | Nano split | Queries | Corpus | Qrels | Query chars avg | Query chars p50 | Query chars p75 | Doc chars avg | Doc chars p50 | Doc chars p75 |
248
+ |---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
249
+ | NanoCodeRAGLibraryDocumentationSolutions | 200 | 8683 | 200 | 397.4 | 110.0 | 127.2 | 2045.7 | 765.0 | 1842.5 |
250
+ | NanoCodeRAGOnlineTutorials | 200 | 9997 | 200 | 51.9 | 47.0 | 63.0 | 5722.5 | 3419.0 | 6795.0 |
251
+ | NanoCodeRAGProgrammingSolutions | 200 | 984 | 200 | 78.3 | 78.0 | 89.2 | 189.1 | 148.5 | 227.2 |
252
+ | NanoCodeRAGStackoverflowPosts | 200 | 10000 | 200 | 209.8 | 185.5 | 269.0 | 4735.0 | 2864.5 | 5301.0 |
253
 
254
+ ## Candidate Quality
255
 
256
+ `nDCG@10` and `Recall@100` are computed from the included candidate rankings against the included qrels, then reported as 0-100 scores such as `52.45`. `Recall@100` uses only the top 100 candidates; an optional rank-101 safeguard positive is not counted in `Recall@100`.
 
 
 
 
 
257
 
258
+ Dense means `microsoft/harrier-oss-v1-270m` with the `web_search_query` prompt and cosine similarity.
259
 
260
+ | Nano split | BM25 tokenizer | BM25 nDCG@10 | Dense nDCG@10 | Hybrid nDCG@10 | BM25 Recall@100 | Dense Recall@100 | Hybrid Recall@100 | Hybrid candidates | Safeguard positives |
261
+ |---|---|---:|---:|---:|---:|---:|---:|---:|---:|
262
+ | Mean | - | 58.23 | 82.96 | 66.85 | 80.50 | 95.12 | 97.75 | - | 18 |
263
+ | NanoCodeRAGLibraryDocumentationSolutions | regex | 68.67 | 76.45 | 75.44 | 92.00 | 92.50 | 94.50 | 100-101 | 11 |
264
+ | NanoCodeRAGOnlineTutorials | regex | 81.75 | 90.27 | 86.73 | 97.00 | 95.50 | 100.00 | 100 | 0 |
265
+ | NanoCodeRAGProgrammingSolutions | regex | 5.12 | 76.46 | 21.51 | 36.50 | 96.50 | 96.50 | 100-101 | 7 |
266
+ | NanoCodeRAGStackoverflowPosts | regex | 77.37 | 88.65 | 83.73 | 96.50 | 96.00 | 100.00 | 100 | 0 |
267
 
268
+ ## Hybrid Safeguard Summary
269
 
270
+ - Safeguard positives: 18
271
+ - Rows limited by corpus size: 0
272
+ - Metadata file: `reranking_hybrid_metadata.json`
 
 
 
273
 
274
+ ## Source Links
275
 
276
+ - Source benchmark: `CodeRAG`
277
+ - `code-rag-bench/library-documentation`: https://huggingface.co/datasets/code-rag-bench/library-documentation
278
+ - `code-rag-bench/online-tutorials`: https://huggingface.co/datasets/code-rag-bench/online-tutorials
279
+ - `code-rag-bench/programming-solutions`: https://huggingface.co/datasets/code-rag-bench/programming-solutions
280
+ - `code-rag-bench/stackoverflow-posts`: https://huggingface.co/datasets/code-rag-bench/stackoverflow-posts
281
 
282
  ## License
283