jenyag/repo-code-completion
收藏Hugging Face2024-01-18 更新2024-03-04 收录
下载链接:
https://hf-mirror.com/datasets/jenyag/repo-code-completion
下载链接
链接失效反馈官方服务:
资源简介:
---
license: apache-2.0
dataset_info:
- config_name: alphabetical_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 590554966
num_examples: 224
download_size: 236538429
dataset_size: 590554966
- config_name: alphabetical_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 560157388
num_examples: 224
download_size: 226511858
dataset_size: 560157388
- config_name: alphabetical_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 114370147
num_examples: 224
download_size: 22096586
dataset_size: 114370147
- config_name: file_length_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 590554966
num_examples: 224
download_size: 239093262
dataset_size: 590554966
- config_name: file_length_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 560157388
num_examples: 224
download_size: 228632512
dataset_size: 560157388
- config_name: file_length_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 114370147
num_examples: 224
download_size: 22181715
dataset_size: 114370147
- config_name: function_class_mask_half_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 316335006
num_examples: 224
download_size: 0
dataset_size: 316335006
- config_name: function_class_mask_half_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 315664977
num_examples: 224
download_size: 127938122
dataset_size: 315664977
- config_name: function_class_mask_half_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 101260211
num_examples: 224
download_size: 17862587
dataset_size: 101260211
- config_name: function_class_mask_one_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 90116249
num_examples: 224
download_size: 13554986
dataset_size: 90116249
- config_name: function_class_mask_one_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 105054619
num_examples: 224
download_size: 15624970
dataset_size: 105054619
- config_name: function_class_mask_one_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 87046937
num_examples: 224
download_size: 12999652
dataset_size: 87046937
- config_name: half_memory_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 334960024
num_examples: 224
download_size: 123799195
dataset_size: 334960024
- config_name: half_memory_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 311325289
num_examples: 224
download_size: 115444406
dataset_size: 311325289
- config_name: half_memory_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 99351776
num_examples: 224
download_size: 18008844
dataset_size: 99351776
- config_name: imports_first_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 590554966
num_examples: 224
download_size: 236389259
dataset_size: 590554966
- config_name: imports_first_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 560157388
num_examples: 224
download_size: 226465503
dataset_size: 560157388
- config_name: imports_first_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 114370147
num_examples: 224
download_size: 22077336
dataset_size: 114370147
- config_name: naive_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 590554966
num_examples: 224
download_size: 236382094
dataset_size: 590554966
- config_name: naive_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 560157388
num_examples: 224
download_size: 226480268
dataset_size: 560157388
- config_name: naive_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 114370147
num_examples: 224
download_size: 22084803
dataset_size: 114370147
- config_name: path_distance_composer_all_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 590554966
num_examples: 224
download_size: 236585246
dataset_size: 590554966
- config_name: path_distance_composer_non_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 560157388
num_examples: 224
download_size: 226460548
dataset_size: 560157388
- config_name: path_distance_composer_py_context
features:
- name: repo_id
dtype: int64
- name: repo_name
dtype: string
- name: project_context
dtype: string
- name: file_context
list:
- name: content
dtype: string
- name: type
dtype: string
- name: gt
sequence: string
- name: metainfo_separator
dtype: string
splits:
- name: test
num_bytes: 114370147
num_examples: 224
download_size: 22014753
dataset_size: 114370147
- config_name: function_class_mask_half_composer_all_context
data_files:
- split: test
path: data/function_class_mask_half_composer/all_context/test-*
- config_name: function_class_mask_half_composer_non_py_context
data_files:
- split: test
path: data/function_class_mask_half_composer/non_py_context/test-*
- config_name: function_class_mask_half_composer_py_context
data_files:
- split: test
path: data/function_class_mask_half_composer/py_context/test-*
- config_name: imports_first_composer_all_context
data_files:
- split: test
path: data/imports_first_composer/all_context/test-*
- config_name: imports_first_composer_non_py_context
data_files:
- split: test
path: data/imports_first_composer/non_py_context/test-*
- config_name: imports_first_composer_py_context
data_files:
- split: test
path: data/imports_first_composer/py_context/test-*
- config_name: alphabetical_composer_all_context
data_files:
- split: test
path: data/alphabetical_composer/all_context/test-*
- config_name: alphabetical_composer_non_py_context
data_files:
- split: test
path: data/alphabetical_composer/non_py_context/test-*
- config_name: alphabetical_composer_py_context
data_files:
- split: test
path: data/alphabetical_composer/py_context/test-*
- config_name: naive_composer_all_context
data_files:
- split: test
path: data/naive_composer/all_context/test-*
- config_name: naive_composer_non_py_context
data_files:
- split: test
path: data/naive_composer/non_py_context/test-*
- config_name: naive_composer_py_context
data_files:
- split: test
path: data/naive_composer/py_context/test-*
- config_name: path_distance_composer_all_context
data_files:
- split: test
path: data/path_distance_composer/all_context/test-*
- config_name: path_distance_composer_non_py_context
data_files:
- split: test
path: data/path_distance_composer/non_py_context/test-*
- config_name: path_distance_composer_py_context
data_files:
- split: test
path: data/path_distance_composer/py_context/test-*
default: True
- config_name: file_length_composer_all_context
data_files:
- split: test
path: data/file_length_composer/all_context/test-*
- config_name: file_length_composer_non_py_context
data_files:
- split: test
path: data/file_length_composer/non_py_context/test-*
- config_name: file_length_composer_py_context
data_files:
- split: test
path: data/file_length_composer/py_context/test-*
- config_name: half_memory_composer_all_context
data_files:
- split: test
path: data/half_memory_composer/all_context/test-*
- config_name: half_memory_composer_non_py_context
data_files:
- split: test
path: data/half_memory_composer/non_py_context/test-*
- config_name: half_memory_composer_py_context
data_files:
- split: test
path: data/half_memory_composer/py_context/test-*
- config_name: function_class_mask_one_composer_all_context
data_files:
- split: test
path: data/function_class_mask_one_composer/all_context/test-*
- config_name: function_class_mask_one_composer_non_py_context
data_files:
- split: test
path: data/function_class_mask_one_composer/non_py_context/test-*
- config_name: function_class_mask_one_composer_py_context
data_files:
- split: test
path: data/function_class_mask_one_composer/py_context/test-*
---
# Repository Level Code Completion Dataset for Evaluation
This is a dataset of repository snapshots before a commit where a python file has been added. One needs to complete added file with given content of repository composed in different ways.
## How to load the data
1. via [`load_dataset`](https://huggingface.co/docs/datasets/v2.14.3/en/package_reference/loading_methods#datasets.load_dataset):
```
from datasets import load_dataset
data_files = # choose from the table below
dataset = load_dataset("jenyag/repo-code-completion", data_files=data_files, split="train")
```
#### Options for `data_files`:
| | **all_context** | **non_py_context** | **py_context** |
|----|----|----|----|
| **function class mask half composer** | data/function_class_mask_half_composer/all_context/test-* | data/function_class_mask_half_composer/non_py_context/test-* | data/function_class_mask_half_composer/py_context/test-* |
| **imports first composer** | data/imports_first_composer/all_context/test-* | data/imports_first_composer/non_py_context/test-* | data/imports_first_composer/py_context/test-* |
| **alphabetical composer** | data/alphabetical_composer/all_context/test-* | data/alphabetical_composer/non_py_context/test-* | data/alphabetical_composer/py_context/test-* |
| **naive composer** | data/naive_composer/all_context/test-* | data/naive_composer/non_py_context/test-* | data/naive_composer/py_context/test-* |
| **path distance composer** | data/path_distance_composer/all_context/test-* | data/path_distance_composer/non_py_context/test-* | data/path_distance_composer/py_context/test-* |
| **file length composer** | data/file_length_composer/all_context/test-* | data/file_length_composer/non_py_context/test-* | data/file_length_composer/py_context/test-* |
| **half memory composer** | data/half_memory_composer/all_context/test-* | data/half_memory_composer/non_py_context/test-* | data/half_memory_composer/py_context/test-* |
| **function class mask one composer** | data/function_class_mask_one_composer/all_context/test-* | data/function_class_mask_one_composer/non_py_context/test-* | data/function_class_mask_one_composer/py_context/test-* |
## How to get the full context for the specific line
```
for datapoint in dataset:
project_context = datapoint['project_context'] # The project context may be quite long
for file_context_dict, ground_truth in zip(datapoint['file_context'], datapoint['gt']):
file_context = file_context_dict['content']
full_context = project_context + file_context
```
提供机构:
jenyag原始信息汇总
数据集概述
数据集配置
配置名称:alphabetical_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 590554966num_examples: 224
- 下载大小:236538429
- 数据集大小:590554966
配置名称:alphabetical_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 560157388num_examples: 224
- 下载大小:226511858
- 数据集大小:560157388
配置名称:alphabetical_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 114370147num_examples: 224
- 下载大小:22096586
- 数据集大小:114370147
配置名称:file_length_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 590554966num_examples: 224
- 下载大小:239093262
- 数据集大小:590554966
配置名称:file_length_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 560157388num_examples: 224
- 下载大小:228632512
- 数据集大小:560157388
配置名称:file_length_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 114370147num_examples: 224
- 下载大小:22181715
- 数据集大小:114370147
配置名称:function_class_mask_half_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 316335006num_examples: 224
- 下载大小:0
- 数据集大小:316335006
配置名称:function_class_mask_half_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 315664977num_examples: 224
- 下载大小:127938122
- 数据集大小:315664977
配置名称:function_class_mask_half_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 101260211num_examples: 224
- 下载大小:17862587
- 数据集大小:101260211
配置名称:function_class_mask_one_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 90116249num_examples: 224
- 下载大小:13554986
- 数据集大小:90116249
配置名称:function_class_mask_one_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 105054619num_examples: 224
- 下载大小:15624970
- 数据集大小:105054619
配置名称:function_class_mask_one_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 87046937num_examples: 224
- 下载大小:12999652
- 数据集大小:87046937
配置名称:half_memory_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 334960024num_examples: 224
- 下载大小:123799195
- 数据集大小:334960024
配置名称:half_memory_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 311325289num_examples: 224
- 下载大小:115444406
- 数据集大小:311325289
配置名称:half_memory_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 99351776num_examples: 224
- 下载大小:18008844
- 数据集大小:99351776
配置名称:imports_first_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 590554966num_examples: 224
- 下载大小:236389259
- 数据集大小:590554966
配置名称:imports_first_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 560157388num_examples: 224
- 下载大小:226465503
- 数据集大小:560157388
配置名称:imports_first_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 114370147num_examples: 224
- 下载大小:22077336
- 数据集大小:114370147
配置名称:naive_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 590554966num_examples: 224
- 下载大小:236382094
- 数据集大小:590554966
配置名称:naive_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 560157388num_examples: 224
- 下载大小:226480268
- 数据集大小:560157388
配置名称:naive_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 114370147num_examples: 224
- 下载大小:22084803
- 数据集大小:114370147
配置名称:path_distance_composer_all_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 590554966num_examples: 224
- 下载大小:236585246
- 数据集大小:590554966
配置名称:path_distance_composer_non_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 560157388num_examples: 224
- 下载大小:226460548
- 数据集大小:560157388
配置名称:path_distance_composer_py_context
- 特征:
repo_id: int64repo_name: stringproject_context: stringfile_context: listcontent: stringtype: string
gt: sequencemetainfo_separator: string
- 分割:
test:num_bytes: 114370147num_examples: 224
- 下载大小:22014753
- 数据集大小:114370147
搜集汇总
数据集介绍

构建方式
在代码智能与软件工程领域,代码补全任务对提升开发效率至关重要。该数据集专为评估仓库级别的代码补全能力而设计,其构建基于提交前仓库快照中新增Python文件的场景。数据集包含多种配置,每种配置对应一种独特的上下文组合方式,例如按字母顺序、文件长度、路径距离或导入语句优先等策略组织仓库内容。此外,还区分了全上下文、仅非Python文件上下文及仅Python文件上下文三种模式,以模拟不同粒度的项目背景。每个数据点记录仓库标识、项目上下文、文件上下文列表、真实补全内容及元信息分隔符,形成结构化评估样本。
特点
该数据集呈现出多维度的评测特性。其核心在于通过八种不同的上下文组合器(如功能类掩码、记忆限制等)模拟真实开发中的信息检索挑战,每种组合器均提供三种上下文粒度选择,总计形成24种评估配置。数据集的规模虽小但精炼,每种配置包含224个测试样本,文件大小从数十MB到近600MB不等,覆盖了从简单到复杂的补全场景。特别地,项目上下文与文件上下文的分离设计允许研究者灵活控制模型可用的仓库信息量,从而深入探究上下文对补全性能的影响。
使用方法
使用该数据集需通过HuggingFace Datasets库加载,首先从预定义的24种数据文件路径中选择目标配置,例如'data/naive_composer/all_context/test-*'对应朴素组合器的全上下文模式。加载后,每个数据点包含project_context字段提供仓库级背景,file_context字段为文件列表,gt字段为对应的真实补全序列。典型用法是遍历数据集,将project_context与各file_context拼接形成完整上下文,用于评估模型在给定仓库信息下补全新增文件的能力。该流程支持批量化测试,便于对比不同组合策略对代码补全模型的影响。
背景与挑战
背景概述
在软件工程与人工智能的交叉领域,代码补全技术正经历着从局部语法预测到全局语义理解的深刻变革。jenyag/repo-code-completion数据集由研究团队于近年构建,旨在系统评估模型在仓库级别代码补全任务上的表现。该数据集的核心创新在于,它不再局限于单文件或函数内部的补全,而是要求模型根据仓库中其他文件的上下文信息,预测新增Python文件的内容。通过模拟开发者实际编程时面对的多文件依赖关系,该数据集为评估模型对项目整体结构和语义的理解能力提供了标准化的测试基准。其影响力体现在推动了代码补全研究从孤立片段向仓库级协作的范式转变,为后续大语言模型在复杂软件工程场景中的应用奠定了评测基础。
当前挑战
该数据集所面临的挑战首先体现在领域问题的复杂性上:仓库级代码补全要求模型不仅要理解局部语法,还需捕捉跨文件的类型引用、函数调用及架构模式,这对模型的长期依赖建模和上下文推理能力提出了极高要求。其次,构建过程本身亦充满困难,如何从海量Git提交中精准筛选出新增Python文件的快照,并确保不同仓库间上下文表示的一致性,是确保数据质量的关键。此外,数据集设计了多种上下文组织策略(如按导入顺序、字母顺序、路径距离等),以模拟不同信息排列对补全效果的影响,但如何平衡这些策略的覆盖度与评测的公平性,仍是持续存在的技术难题。
常用场景
经典使用场景
在软件工程与自然语言处理交叉领域,代码补全任务旨在根据已有代码上下文预测缺失的代码片段。jenyag/repo-code-completion数据集专为评估仓库级别的代码补全性能而设计,其核心特色在于提供了多种上下文组织策略——如按字母顺序排列、按文件路径距离排序、按文件长度排序等——以及针对Python与非Python文件的差异化处理。研究者可基于该数据集,系统性地比较不同上下文构建方法对代码补全模型的影响,从而探索最优的上下文表征方式。该数据集包含丰富的项目级与文件级上下文信息,为训练和评估大语言模型在真实仓库场景下的代码理解与生成能力提供了标准化基准。
实际应用
在实际开发场景中,该数据集直接服务于智能代码编辑器的核心功能——仓库级代码补全。通过模拟开发者在提交新文件前需要根据已有仓库代码完成编码的真实情境,该数据集可帮助优化集成开发环境(IDE)中的代码建议系统。例如,基于该数据集训练的模型能够理解项目中其他模块的函数调用关系、类继承结构或变量依赖,从而在开发者编写新文件时提供更符合项目整体架构的代码片段。这种能力显著提升了大型软件项目中的编码效率,减少了因跨文件上下文缺失导致的错误补全。
衍生相关工作
该数据集衍生了多个经典研究工作,主要集中在代码上下文表征学习与仓库级代码理解领域。例如,研究者基于该数据集提出了多种上下文排序策略(如路径距离优先、文件长度优先),并验证了这些策略对Transformer架构模型补全性能的影响。此外,围绕该数据集衍生的工作还包括:对比不同上下文类型(全上下文、仅Python上下文、非Python上下文)对模型效果的差异,以及探索半掩码策略(如函数类掩码)在代码补全中的有效性。这些工作进一步推动了代码智能领域从单文件补全向仓库级协同理解的范式转变。
以上内容由遇见数据集搜集并总结生成



