Quarry
收藏资源简介:
Quarry是一个用于自然语言查询到代码函数检索的基准数据集,其查询语句是通过合成方式生成的,描述了预期的代码行为,而非原始的issue文本。该数据集不适用于补丁定位任务。版本1.0包含6,525条查询记录和3,411个任务,覆盖11种编程语言:C、C++、C#、Go、Java、JavaScript、PHP、Python、Rust、Scala和TypeScript。数据集的发布版本将两个不重叠的收集批次合并为一个测试集。数据集提供标签和仓库引用,但不包含源代码,用户需自行签出指定上游仓库的修订版本。数据集包含四个配置:queries(查询文本和检索修订版本)、tasks(任务元数据、语言、修订版本和关联的查询ID)、gold_preimage(检索修订版本下的函数级标签)和gold_postimage(后图像记录)。函数级标签包括仓库、修订版本、路径、符号或完全限定方法名以及行范围。评估指标采用严格all-gold micro recall@5/10/20/50,对所有6,525条查询计算平均召回率。数据集采用CC BY 4.0许可证,归因于BrokkAI并链接此仓库。
Quarry is a benchmark dataset for natural language query to code function retrieval. The queries are generated synthetically, describing expected code behavior rather than raw issue text. This dataset is not suitable for patch localization tasks. Version 1.0 contains 6,525 query records and 3,411 tasks covering 11 programming languages: C, C++, C#, Go, Java, JavaScript, PHP, Python, Rust, Scala, and TypeScript. The released version merges two non-overlapping collection batches into a single test set. The dataset provides labels and repository references, but does not include source code; users need to check out the revisions of the specified upstream repositories themselves. The dataset includes four configurations: queries (query text and retrieval revision), tasks (task metadata, language, revision, and associated query IDs), gold_preimage (function-level labels under the retrieval revision), and gold_postimage (post-image records). Function-level labels include repository, revision, path, symbol or fully qualified method name, and line range. The evaluation metric is strict all-gold micro recall@5/10/20/50, computing average recall across all 6,525 queries. The dataset is licensed under CC BY 4.0, attributed to BrokkAI with a link to this repository.
Quarry 数据集概述
Quarry 是一个自然语言查询→代码函数检索基准测试数据集,其查询语句是通过合成方式生成的行为描述,不包含原始问题文本(issue text),也不是补丁定位基准。
基本信息
| 属性 | 详情 |
|---|---|
| 许可证 | CC BY 4.0 |
| 任务类型 | 文本检索 |
| 语言 | 代码(多语言) |
| 数据规模 | 1K < n < 10K |
| 版本 | 1.0 |
数据集内容
规模与覆盖范围:
- 共包含 6,525 条查询和 3,411 个任务的函数级标注(gold labels)
- 覆盖 11 种编程语言:C、C++、C#、Go、Java、JavaScript、PHP、Python、Rust、Scala、TypeScript
- 数据来源于真实代码版本(real code revisions)
- 提供标注标签和仓库引用信息,不包含源代码本身
数据集结构(4 个配置):
| 配置名称 | 行数 | 用途 |
|---|---|---|
queries |
6,525 | 行为查询文本和检索版本 |
tasks |
3,411 | 任务元数据、语言、版本及关联查询 ID |
gold_preimage |
6,525 | 检索版本下的函数级标注 |
gold_postimage |
6,525 | 收集阶段保留的配套映像记录 |
各配置可通过 (repo, task_id) 或 (repo, task_id, query_id) 进行关联。
评估协议
- 核心指标:严格全标注微平均召回率(strict all-gold micro recall@5/10/20/50)
- 对所有 6,525 条查询计算扁平平均值,同时提供三阶段(查询→任务→仓库→语言)宏聚合结果
- 文档格式:自由函数使用
{path}/{function_name}加源代码的头部结构;类方法使用swerank_document_text()渲染器格式
基准结果(部分模型)
| 模型 | 参数量 | recall@5 | recall@20 | recall@50 |
|---|---|---|---|---|
| Muninn | 346M | 61.4 | 82.6 | 90.7 |
| voyage-code-3 | API | 59.1 | 81.8 | 90.4 |
| voyage-4 | API | 59.0 | 80.8 | 90.0 |
| SweRank-Large | 7B | 58.5 | 80.6 | 89.6 |
| Nemotron-3-Embed-1B | 1B | 58.3 | 79.9 | 88.7 |
| bge-code-v1 | 1.5B | 58.2 | 79.8 | 88.7 |
许可证说明
- 数据集(查询和标注)采用 CC BY 4.0 许可证,引用时需注明 BrokkAI 并链接本仓库
quarry_eval.py及harness/下的所有 Python 代码采用 Apache License 2.0 许可证- 引用的源代码不重新分发,保留各自上游仓库的许可证
- 校验和、行数、版本及来源信息记录在
RELEASE_MANIFEST.json中





