4gate/codeparrot_apps
收藏Hugging Face2025-12-04 更新2025-12-20 收录
下载链接:
https://hf-mirror.com/datasets/4gate/codeparrot_apps
下载链接
链接失效反馈官方服务:
资源简介:
This is copied from the `codeparrot/apps` which is not in Parquet format (meaning that if you are using Datasets>=4.0.0 you will fail to download it because it requires remote code).
You can find the origin dataset here: https://huggingface.co/datasets/codeparrot/apps
You can find the conversion code here: https://gist.github.com/4gatepylon/024853a9d279812e1f14be93242b3ef8#file-gistfile1-py-L1
NOTE that some of the solutions/input-output are empty. You can check as the code ^ does by looking for `len(element["solution"].strip()) == 0` and/or `len(element["input_output"].strip()) == 0`. Otherwise, these objects are JSON-decodeable strings which look, respectively like:
```
solutions: list[str] # each string is a python function/code you can run that would solve the problem
```
and
```
input_outputs: dict[str, list[list[str] | str | Any]]
# keys: "inputs" and "outputs" have same length
# usually the list items are lists of strings or are single strings
# (I haven't checked exhaustively)
```
Auto-generated docs below:
```
features:
- name: problem_id
dtype: int64
- name: question
dtype: string
- name: solutions
dtype: string
- name: input_output
dtype: string
- name: difficulty
dtype: string
- name: url
dtype: string
- name: starter_code
dtype: string
splits:
- name: test
num_bytes: 1226206337
num_examples: 5000
- name: train
num_bytes: 103144035
num_examples: 5000
download_size: 788823098
dataset_size: 1329350372
```
本数据集复刻自`codeparrot/apps`数据集,该原始数据集未采用Parquet格式(这意味着若你使用版本≥4.0.0的Datasets库,将无法直接下载该数据集,因其依赖远程代码执行)。
你可通过以下链接获取该原始数据集:https://huggingface.co/datasets/codeparrot/apps
格式转换代码可参见:https://gist.github.com/4gatepylon/024853a9d279812e1f14be93242b3ef8#file-gistfile1-py-L1
请注意,部分样例的解决方案与输入输出内容为空。你可如上述代码所示,通过校验`len(element["solution"].strip()) == 0`和/或`len(element["input_output"].strip()) == 0`来判定空内容。若非空,这些字段均为可JSON解码的字符串,具体格式分别如下:
solutions: list[str] # 每个字符串均为可运行以解决对应问题的Python函数或代码片段
以及
input_outputs: dict[str, list[list[str] | str | Any]]
# 键名为`inputs`与`outputs`的列表长度保持一致
# 列表元素通常为字符串列表或单个字符串
# (未做全量验证)
以下为自动生成的数据集元数据说明:
数据集特征:
- 字段名:problem_id,数据类型:int64
- 字段名:question,数据类型:string
- 字段名:solutions,数据类型:string
- 字段名:input_output,数据类型:string
- 字段名:difficulty,数据类型:string
- 字段名:url,数据类型:string
- 字段名:starter_code,数据类型:string
数据集划分:
- 划分名称:test,占用字节数:1226206337,样例总数:5000
- 划分名称:train,占用字节数:103144035,样例总数:5000
下载总大小:788823098
数据集总存储大小:1329350372
提供机构:
4gate



