| 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 | |
| ## 引用 | |
| 如果使用该数据集,请注明来源或引用本项目。 | |