RepoBench
收藏资源简介:
RepoBench是一个专为评估仓库级别代码自动补全系统设计的新基准,支持Python和Java语言,包含三个相互关联的评估任务:RepoBench-R(检索)、RepoBench-C(代码补全)和RepoBench-P(管道)。该数据集由10,345个Python历史仓库和14,956个Java历史仓库组成,用于训练数据,以及1,075个Python新仓库和594个Java新仓库作为测试数据。RepoBench旨在通过模拟真实编程场景,评估模型处理长且复杂的上下文的能力,推动代码智能领域的持续创新。
RepoBench is a novel benchmark specifically designed for evaluating repository-level code completion systems, supporting both Python and Java programming languages. It encompasses three interrelated evaluation tasks: RepoBench-R (Retrieval), RepoBench-C (Code Completion), and RepoBench-P (Pipeline). The dataset comprises 10,345 historical Python repositories and 14,956 historical Java repositories for training, along with 1,075 new Python repositories and 594 new Java repositories as test data. RepoBench aims to evaluate models' ability to handle long and complex contexts by simulating real-world programming scenarios, and promote continuous innovation in the field of code intelligence.
数据集概述
数据集版本
- RepoBench v1.1:包含最新的代码数据,适用于Python和Java。
- Python数据集链接:🤗 Repobench Python V1.1
- Java数据集链接:🤗 Repobench Java V1.1
数据加载
下载数据
-
测试数据:
- 下载链接:Google Drive
- 命令行下载: bash gdown --id 1HvFFnOybTKEJCrEypWh4ftmW6DZBaiK_ --output ./archive_data/test.zip unzip ./archive_data/test.zip -d ./archive_data/ rm ./archive_data/test.zip
-
训练数据(可选):
- 下载链接:Google Drive
- 命令行下载: bash gdown --id 179TXJBfMMbP9FDC_hsdpGLQPmN6iB4vY --output ./archive_data/train.zip unzip ./archive_data/train.zip -d ./archive_data/ rm ./archive_data/train.zip
数据加载方法
-
导入
load_data函数: python from archive_data.utils import load_data -
调用函数加载数据: python data = load_data(split, task, language, settings, length)
-
参数说明:
split:数据集分割,可选train或test。task:任务类型,可选retrieval、completion或pipeline。language:编程语言,可选python或java。settings:设置类型,可选cross_file_first、cross_file_random或in_file,可组合使用。length:(可选)完成任务的长度,可选2k或8k。
-
示例: python data = load_data(split=test, task=completion, language=python, settings=[cross_file_first, cross_file_random, in_file], length=8k)
数据集设置
cross_file_first:屏蔽首次使用不同文件模块的行。cross_file_random:随机屏蔽使用不同文件模块的行(非首次使用)。in_file:随机屏蔽没有跨文件依赖的行。
数据泄露警告
- 数据泄露/记忆风险:测试数据包含2023年2月9日至2023年8月3日之间的GitHub代码。如果模型训练数据包含此时间段内的代码,可能存在数据泄露和记忆风险。
许可证和所有权
- 许可证验证:数据集中的代码许可证可能未经过仔细验证。如果发现许可证问题或希望移除包含的代码,请及时联系。

- 1RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems加州大学圣地亚哥分校 · 2023年



