cr_taxonomy_dataset
收藏资源简介:
本数据集是Code Review Comment Taxonomy项目的一部分,旨在构建一个全面、统一的代码审查评论语料库,用于代码审查评论的分类(经验分类法)及相关研究。数据集通过融合25个公开的代码审查评论数据集构建而成,经过严格的预处理流程,包括格式统一、精确去重和语义去重,最终包含747,352条独特的代码审查评论。数据分为两大组成部分:一是Corpus(语料)部分,包含10个数据集共712,140条评论,主要用作模型训练语料;二是Benchmark(评测集)部分,包含15个数据集共35,212条评论,这些数据集通常带有额外的标注(如质量评分、情感、类别、是否有用等),用于模型评估和基准测试。数据集采用统一的JSONL格式,每条记录包含代码仓库信息(repo)、提交哈希(commit_id)、评论唯一标识(comment_id)、文件路径(file_path)、代码差异块(diff_hunk)、评论文本(comment)、编程语言(lang)等核心字段,并保留了原始数据集的来源信息(source_datasets)和划分信息(split)。数据覆盖了多种编程语言,以Java(31.4%)和Python(5.1%)为主,但大部分(56.9%)语言信息未知。数据划分中,测试集(test)占61.3%,训练集(train)占35.1%,验证集(valid)占3.6%。该数据集适用于多种与代码审查自动化相关的任务,例如代码审查评论的自动生成、分类(如按意图、质量、情感分类)、质量评估、重复检测以及基于代码审查评论的软件工程实证研究。
This dataset is part of the Code Review Comment Taxonomy project, aiming to build a comprehensive and unified corpus of code review comments for classification (empirical taxonomy) and related research. It is constructed by merging 25 publicly available code review comment datasets, undergoing rigorous preprocessing including format unification, exact deduplication, and semantic deduplication, resulting in 747,352 unique code review comments. The dataset consists of two main components: the Corpus portion, containing 712,140 comments from 10 datasets, primarily used as training data for models; and the Benchmark portion, containing 35,212 comments from 15 datasets, which often include additional annotations (e.g., quality scores, sentiment, categories, usefulness) for model evaluation and benchmarking. The dataset uses a unified JSONL format, with each record containing core fields such as repository info (repo), commit hash (commit_id), unique comment identifier (comment_id), file path (file_path), code diff hunk (diff_hunk), comment text (comment), programming language (lang), while preserving source dataset information (source_datasets) and split info (split). It covers multiple programming languages, predominantly Java (31.4%) and Python (5.1%), but most (56.9%) language information is unknown. In terms of data splits, the test set accounts for 61.3%, the training set for 35.1%, and the validation set for 3.6%. This dataset is suitable for various tasks related to code review automation, such as automatic generation of code review comments, classification (e.g., by intent, quality, sentiment), quality assessment, duplicate detection, and empirical software engineering research based on code review comments.
Code Review Comment 分类数据集
项目概述
本项目旨在收集市面上最全的 Code Review Comment 数据样本,应用分类方法,对 Code Review 的主要类型进行分类(empirical taxonomy),最终形成一个统一、去重的大规模数据集。
数据规模
- 融合后未去重数据:1,142,862 行(25 个数据集融合)
- 精确+语义去重后最终数据:747,352 行
- 唯一仓库数:691 个
数据集构成
训练语料(Core Corpus):10 个数据集,712,140 条
| # | 数据集 | 原始行数 | 关键特点 |
|---|---|---|---|
| 1 | CodeReviewer | 129,327 | 事实标准训练 corpus,FSE 2022 |
| 2 | CuREV | 5,000 | 质量评估标注 (Type/Nature/Civility),MSR 2025 |
| 3 | ContextCRBench | 58,096 | 唯一带完整 code context |
| 4 | Gerrit | 16,429 | OpenStack/LibreOffice/Eclipse/GerritHub |
| 5 | Tufano | 167,797 | 早期 baseline,Java,ICSE 2022 |
| 6 | ContextualCodeReview | 60,845 | Java,带方法级上下文 |
| 7 | CROP | 86,737 | 11 个 Gerrit 项目,含 inline comment |
| 8 | SAILCRCoverage | 165,168 | Qt/VTK Gerrit,MSR 2014 |
| 9 | CRC-Py | 13,726 | 5 类 13 子类分类 |
| 10 | CleanCodeReview | 10,022 | 16 类 / 5 超组分类 |
评测/标注集(Benchmark):15 个数据集,35,212 条
| # | 数据集 | 原始行数 | 分类标签/标注 |
|---|---|---|---|
| 11 | CodeReviewQA | 899 | 无分类标签 |
| 12 | CodeFuse-CR-Bench | 12,881 | 无分类标签 |
| 13 | SeRe | 6,729 | Security 相关标注,ICSE 2026 |
| 14 | CR-ESEM23 | 1,694 | category + comment_group + usefulness,ESEM 2023 |
| 15 | AACR-Bench | 2,133 | positive/negative 二分类,ICML 2026 |
| 16 | RevHelper | 363 | useful/non-useful 二分类,MSR 2017 |
| 17 | ConfusionCR | 2,714 | confusion/non-confusion 二分类 |
| 18 | TooNoisy | 270 | Valid/Noisy 二分类 |
| 19 | c-CRAB | 595 | 无分类标签,ICSE 2025 |
| 20 | SWRench | 910 | change_type 分类(如 F.2 Logic) |
| 21 | EvaCRC | 2,910 | Emotion/Question/Evaluation/Suggestion + Grade,ESEC/FSE 2023 |
| 22 | CR Smell | 439 | 9 类(6 smell + 3 intent),有 diff_hunk |
| 23 | TestingMeetsCR | 581 | Code improvement/Defect/Knowledge Transfer/Misc 及细粒度子类,ICSE 2018 |
| 24 | DesignDiscussions | 2,359 | is_design + design_label,ESEM 2018 |
| 25 | ArchAwareness | 836 | 变更类型 + 架构感知(author_aware/comments_aware/not_aware),SANER 2017 |
预处理流程
Step 1:原始格式 → 统一 JSONL
每个数据集由独立的转换脚本(scripts/convert_<dataset>.py)转换为统一 Schema,包含 source_datasets、repo、commit_id、pr_number、comment_id、file_path、diff_hunk、comment、lang、created_at、extra_fields、in_benchmark 等字段。语言名称进行了标准化处理。
Step 2:融合(merge_all.py)
将 10 个 Corpus 数据集和 15 个 Benchmark 数据集纯拼接合并,为每行构建唯一键和内容哈希,标记是否属于 Benchmark 数据集。结果:1,142,862 行。
Step 3:精确去重(dedup_exact.py)
- 唯一键去重:对存在 repo、commit_id、comment_id 三字段的行,按三元组去重
- 内容哈希去重:对 SHA256(normalized_diff + normalized_comment) 相同的行去重 结果:1,142,862 → 747,356 行(移除 395,506 条)
Step 4:语义去重(dedup_semantic.py)
跨数据集近似重复检测:按 (repo, comment前50字符) 分桶,仅在跨数据集桶内计算 Jaccard token 相似度(comment ≥ 0.85 且 diff ≥ 0.9 视为重复)。结果:747,356 → 747,352 行(移除 4 条)
Step 5:统计(compute_stats.py)
数据分布统计
按数据集类型分布
| 类型 | 行数 | 占比 |
|---|---|---|
| Corpus | 712,140 | 95.3% |
| Benchmark | 35,212 | 4.7% |
重要数据集贡献排名(Top 10)
| 数据集 | 行数 | 占比 | 类型 |
|---|---|---|---|
| Tufano | 167,797 | 22.5% | corpus |
| SAILCRCoverage | 165,168 | 22.1% | corpus |
| CodeReviewer | 129,327 | 17.3% | corpus |
| CROP | 86,737 | 11.6% | corpus |
| ContextualCodeReview | 60,845 | 8.2% | corpus |
| ContextCRBench | 58,096 | 7.8% | corpus |
| Gerrit | 16,429 | 2.2% | corpus |
| CRC-Py | 13,726 | 1.8% | corpus |
| CodeFuse-CR-Bench | 12,881 | 1.7% | benchmark |
| CleanCodeReview | 10,022 | 1.3% | corpus |
按 Split 分布
| Split | 行数 | 占比 |
|---|---|---|
| test | 459,952 | 61.3% |
| train | 262,648 | 35.1% |
| valid | 26,862 | 3.6% |
注意:252 行的 split 字段为列表(如 ["test", "valid"]),使用时需注意潜在的 train/test 泄露。
按语言分布
| 语言 | 行数 | 占比 |
|---|---|---|
| unknown | 424,263 | 56.9% |
| java | 234,476 | 31.4% |
| python | 37,881 | 5.1% |
| go | 14,490 | 1.9% |
| c_sharp | 10,962 | 1.5% |
| cpp | 7,451 | 1.0% |
| c | 7,166 | 1.0% |
| rust | 4,593 | 0.6% |
| javascript | 2,504 | 0.3% |
| typescript | 2,356 | 0.3% |
| ruby | 1,054 | 0.1% |
| php | 156 | <0.1% |




