jamie8johnson's picture
Fix dataset viewer (configs block) + correct row count + add example row (#1290)
60c0e9b verified
metadata
configs:
  - config_name: default
    data_files:
      - split: train
        path: cqs-code-search-200k.jsonl
dataset_info:
  features:
    - name: query
      dtype: string
    - name: positive
      dtype: string
    - name: language
      dtype: string
    - name: function_name
      dtype: string
    - name: file
      dtype: string
    - name: repo
      dtype: string
    - name: source
      dtype: string
    - name: callers
      sequence:
        dtype: string
    - name: callees
      sequence:
        dtype: string
  splits:
    - name: train
      num_examples: 199998
license: mit
task_categories:
  - text-retrieval
language:
  - code
tags:
  - code-search
  - code-retrieval
  - call-graph
  - embedding-training
pretty_name: CQS Code Search 200K

CQS Code Search 200K

Balanced code search training dataset with call graph metadata.

Overview

199,998 (query, code) pairs across 9 programming languages, extracted from ~5,000 high-quality GitHub repositories using cqs semantic code indexing.

Unique features:

  • Perfectly balanced: 22,222 pairs per language
  • Call graph metadata: caller/callee names per function (from tree-sitter AST analysis)
  • Enriched NL queries: generated from type signatures, doc comments, and call context
  • 9 languages: Go, Java, JavaScript, PHP, Python, Ruby, Rust, TypeScript, C++

Intended Use

Training code search embedding models. This dataset produced both e5-base-v2-code-search and bge-large-v1.5-code-search. The call graph metadata enables:

  • False-negative filtering: skip hard negatives that are callers/callees of the positive
  • Structural training signals: teach embeddings that callers are semantically related

Dataset Structure

Each record contains:

Field Type Description
query string Natural-language description (cqs NL generation)
positive string Source code (truncated to 2000 chars)
language string Programming language
function_name string Function/method name
file string Source file path
repo string GitHub repository (owner/name)
source string Provenance tag (e.g. stack-cqs-index)
callers list[string] Functions that call this one (up to 20)
callees list[string] Functions this one calls (up to 20)

Example row

{
  "query": "query: Test helper function to filter a collection of compilation database entries fn filter_entries<I>(filter: &SourceEntryFilter, entries: I) -> Vec<Entry> ...",
  "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}",
  "language": "rust",
  "function_name": "filter_entries",
  "file": "bear/src/output/clang/filter_sources.rs",
  "repo": "rizsotto/Bear",
  "source": "stack-cqs-index",
  "callers": ["get_entries", "read_directories", "run", "test_filter_entries_method"],
  "callees": ["filter", "into_iter", "should_include", "collect"]
}

Files

  • cqs-code-search-200k.jsonl — the dataset (199,998 rows, ~229 MB).
  • 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}.

Creation

Extracted using cqs v1.7.0:

  1. Clone repos from GitHub (filtered by stars, size).
  2. cqs index each repo (tree-sitter parsing, call graph extraction, NL query generation).
  3. Extract (NL, code) pairs from the cqs index.
  4. Balance to 22,222 per language.
  5. Attach call graph edges from the same index.

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.