File size: 1,438 Bytes
8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 dcac981 8629262 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | ---
language:
- en
- zh
license: mit
size_categories:
- 1K<n<10K
pretty_name: HumanEval-LeetCode Input-Only
configs:
- config_name: default
data_files:
- split: train
path: "train.jsonl"
- split: test
path: "test.jsonl"
---
# HumanEval-LeetCode Input-Only
本数据集由 LeetCode 题目自动转换而来,目标是生成 HumanEval 风格的 **Input-Only** 提示(prompt)。每条样本包含题目描述与函数签名,描述中的 Input/Output 被转换成 `>>> func(...)` / `>>> output` 的交互式示例,便于直接用于代码生成评测或训练。
## 数据格式
每行是一个 JSON 对象(JSONL):
- `task_id`:题目唯一标识
- `prompt`:包含函数签名与 docstring 的完整提示
示例字段:
- `task_id`: string
- `prompt`: string
## 生成流程(概述)
1. 读取 LeetCode 题目(题目描述 + starter code)。
2. 提取函数名。
3. 将题目描述中的 Input/Output 转为:
- `>>> func(inputs...)`
- `>>> output`
4. 输出为 JSONL。
## 数据划分
- `train.jsonl`
- `test.jsonl`
## 使用方式
Python 读取示例:
```python
import json
with open("train.jsonl", "r", encoding="utf-8") as f:
for line in f:
item = json.loads(line)
print(item["task_id"], item["prompt"][:80])
break
```
## 许可协议
MIT
## 引用
如果使用该数据集,请注明来源或引用本项目。
|