SWE-bench Enhanced with CWE Security Hints

这是 SWE-bench Verified 数据集的增强版本,包含了详细的 CWE(Common Weakness Enumeration)安全提示。

数据集描述

  • 任务: astropy__astropy-12907
  • 仓库: astropy/astropy
  • Hints 长度: 0 字符

增强内容

原始 SWE-bench 任务的 hints 字段已被增强,包含:

  1. 任务特定提示: 指向可能的 bug 位置和修复方向
  2. CWE-754: Improper Check for Unusual or Exceptional Conditions(异常条件检查不足)
  3. CWE-682: Incorrect Calculation(计算错误)

每个 CWE 包含:

  • 详细描述
  • 缓解措施
  • 代码示例
  • 最佳实践

CWE 覆盖

本数据集中的任务映射到以下 CWE:

  • CWE-754
  • CWE-682

使用方法

使用 mini-extra

mini-extra swebench-single \
  --config config/swebench_with_hints.yaml \
  --subset 你的用户名/swebench-enhanced-cwe \
  --split test \
  --instance 0 \
  --model gpt-4 \
  --yolo

使用 Python

from datasets import load_dataset

dataset = load_dataset("你的用户名/swebench-enhanced-cwe", split="test")
print(dataset[0]['hints_text'])  # 查看增强的 hints

数据格式

每个样本包含以下字段:

  • instance_id: 任务唯一标识
  • repo: GitHub 仓库
  • base_commit: 基础提交哈希
  • problem_statement: 问题描述
  • hints_text: 增强的提示(含 CWE 安全指导)⭐
  • test_patch: 测试补丁
  • FAIL_TO_PASS: 应该从失败变为通过的测试
  • PASS_TO_PASS: 应该保持通过的测试

引用

如果使用此数据集,请引用原始 SWE-bench:

@inproceedings{jimenez2024swebench,
  title={SWE-bench: Can Language Models Resolve Real-world Github Issues?},
  author={Carlos E. Jimenez and John Yang and Alexander Wettig and Shunyu Yao and Kexin Pei and Ofir Press and Karthik Narasimhan},
  booktitle={ICLR},
  year={2024}
}

许可

MIT License - 与 SWE-bench 保持一致

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support