jamie8johnson commited on
Commit
60c0e9b
·
verified ·
1 Parent(s): bdffc15

Fix dataset viewer (configs block) + correct row count + add example row (#1290)

Browse files
Files changed (1) hide show
  1. README.md +50 -16
README.md CHANGED
@@ -1,4 +1,9 @@
1
  ---
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: query
@@ -23,7 +28,7 @@ dataset_info:
23
  dtype: string
24
  splits:
25
  - name: train
26
- num_examples: 200000
27
  license: mit
28
  task_categories:
29
  - text-retrieval
@@ -43,7 +48,7 @@ Balanced code search training dataset with call graph metadata.
43
 
44
  ## Overview
45
 
46
- 200,000 (query, code) pairs across 9 programming languages, extracted from ~5,000 high-quality GitHub repositories using [cqs](https://github.com/jamie8johnson/cqs) semantic code indexing.
47
 
48
  **Unique features:**
49
  - **Perfectly balanced**: 22,222 pairs per language
@@ -53,27 +58,56 @@ Balanced code search training dataset with call graph metadata.
53
 
54
  ## Intended Use
55
 
56
- Training code search embedding models (e.g., E5-base-v2 LoRA fine-tuning). The call graph metadata enables:
 
57
  - **False-negative filtering**: skip hard negatives that are callers/callees of the positive
58
  - **Structural training signals**: teach embeddings that callers are semantically related
59
 
60
  ## Dataset Structure
61
 
62
  Each record contains:
63
- - `query`: Natural language description (from cqs NL generation)
64
- - `positive`: Source code (truncated to 2000 chars)
65
- - `language`: Programming language
66
- - `function_name`: Function/method name
67
- - `file`: Source file path
68
- - `repo`: GitHub repository
69
- - `callers`: List of functions that call this function (up to 20)
70
- - `callees`: List of functions this function calls (up to 20)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ## Creation
73
 
74
  Extracted using [cqs](https://github.com/jamie8johnson/cqs) v1.7.0:
75
- 1. Clone repos from GitHub (filtered by stars, size)
76
- 2. `cqs index` each repo (tree-sitter parsing, call graph extraction, NL generation)
77
- 3. Extract (NL, code) pairs from the cqs index
78
- 4. Balance to 22,222 per language
79
- 5. Attach call graph edges from the same index
 
 
 
 
1
  ---
2
+ configs:
3
+ - config_name: default
4
+ data_files:
5
+ - split: train
6
+ path: cqs-code-search-200k.jsonl
7
  dataset_info:
8
  features:
9
  - name: query
 
28
  dtype: string
29
  splits:
30
  - name: train
31
+ num_examples: 199998
32
  license: mit
33
  task_categories:
34
  - text-retrieval
 
48
 
49
  ## Overview
50
 
51
+ 199,998 (query, code) pairs across 9 programming languages, extracted from ~5,000 high-quality GitHub repositories using [cqs](https://github.com/jamie8johnson/cqs) semantic code indexing.
52
 
53
  **Unique features:**
54
  - **Perfectly balanced**: 22,222 pairs per language
 
58
 
59
  ## Intended Use
60
 
61
+ Training code search embedding models. This dataset produced both [`e5-base-v2-code-search`](https://huggingface.co/jamie8johnson/e5-base-v2-code-search) and [`bge-large-v1.5-code-search`](https://huggingface.co/jamie8johnson/bge-large-v1.5-code-search). The call graph metadata enables:
62
+
63
  - **False-negative filtering**: skip hard negatives that are callers/callees of the positive
64
  - **Structural training signals**: teach embeddings that callers are semantically related
65
 
66
  ## Dataset Structure
67
 
68
  Each record contains:
69
+
70
+ | Field | Type | Description |
71
+ |-------|------|-------------|
72
+ | `query` | string | Natural-language description (cqs NL generation) |
73
+ | `positive` | string | Source code (truncated to 2000 chars) |
74
+ | `language` | string | Programming language |
75
+ | `function_name` | string | Function/method name |
76
+ | `file` | string | Source file path |
77
+ | `repo` | string | GitHub repository (`owner/name`) |
78
+ | `source` | string | Provenance tag (e.g. `stack-cqs-index`) |
79
+ | `callers` | list[string] | Functions that call this one (up to 20) |
80
+ | `callees` | list[string] | Functions this one calls (up to 20) |
81
+
82
+ ### Example row
83
+
84
+ ```json
85
+ {
86
+ "query": "query: Test helper function to filter a collection of compilation database entries fn filter_entries<I>(filter: &SourceEntryFilter, entries: I) -> Vec<Entry> ...",
87
+ "positive": "passage: fn filter_entries<I>(filter: &SourceEntryFilter, entries: I) -> Vec<Entry>\n where I: IntoIterator<Item = Entry>,\n{\n entries.into_iter().filter(|entry| filter.should_include(entry)).collect()\n}",
88
+ "language": "rust",
89
+ "function_name": "filter_entries",
90
+ "file": "bear/src/output/clang/filter_sources.rs",
91
+ "repo": "rizsotto/Bear",
92
+ "source": "stack-cqs-index",
93
+ "callers": ["get_entries", "read_directories", "run", "test_filter_entries_method"],
94
+ "callees": ["filter", "into_iter", "should_include", "collect"]
95
+ }
96
+ ```
97
+
98
+ ## Files
99
+
100
+ - `cqs-code-search-200k.jsonl` — the dataset (199,998 rows, ~229 MB).
101
+ - `processing_manifest.jsonl` — per-repo extraction provenance (sidecar, not part of the dataset). One row per source repo with `{repo, language, status, pairs, edges, source_files, note}`.
102
 
103
  ## Creation
104
 
105
  Extracted using [cqs](https://github.com/jamie8johnson/cqs) v1.7.0:
106
+
107
+ 1. Clone repos from GitHub (filtered by stars, size).
108
+ 2. `cqs index` each repo (tree-sitter parsing, call graph extraction, NL query generation).
109
+ 3. Extract (NL, code) pairs from the cqs index.
110
+ 4. Balance to 22,222 per language.
111
+ 5. Attach call graph edges from the same index.
112
+
113
+ The dataset reflects the v1.7.0-era extraction pipeline. cqs has matured significantly since (current release: v1.33.0) — newer extractions would use higher-quality NL generation and richer metadata, but the underlying (query, code) pairs remain useful as-is for training general-purpose code-search embeddings.