google-research-datasets/mbpp|Python编程数据集|代码生成数据集
收藏数据集概述
基本信息
- 数据集名称: Mostly Basic Python Problems (mbpp)
- 语言: 英语
- 许可证: CC-BY-4.0
- 多语言性: 单语种
- 大小类别: n<1K
- 源数据集: 原始数据
- 任务类别: 文本到文本生成
- 标签: 代码生成
数据集结构
配置
-
full:
- 特征:
task_id: int32text: stringcode: stringtest_list: sequence of stringtest_setup_code: stringchallenge_test_list: sequence of string
- 分割:
train: 374个样本, 176879字节test: 500个样本, 244104字节validation: 90个样本, 42405字节prompt: 10个样本, 4550字节
- 下载大小: 236069字节
- 数据集大小: 467938字节
- 特征:
-
sanitized:
- 特征:
source_file: stringtask_id: int32prompt: stringcode: stringtest_imports: sequence of stringtest_list: sequence of string
- 分割:
train: 120个样本, 63453字节test: 257个样本, 132720字节validation: 43个样本, 20050字节prompt: 7个样本, 3407字节
- 下载大小: 115422字节
- 数据集大小: 219630字节
- 特征:
数据实例
-
full: json { "task_id": 1, "text": "Write a function to find the minimum cost path to reach (m, n) from (0, 0) for the given cost matrix cost[][] and a position (m, n) in cost[][].", "code": "R = 3 C = 3 def min_cost(cost, m, n): tc = [[0 for x in range(C)] for x in range(R)] tc[0][0] = cost[0][0] for i in range(1, m+1): tc[i][0] = tc[i-1][0] + cost[i][0] for j in range(1, n+1): tc[0][j] = tc[0][j-1] + cost[0][j] for i in range(1, m+1): for j in range(1, n+1): tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] return tc[m][n]", "test_list": [ "assert min_cost([[1, 2, 3], [4, 8, 2], [1, 5, 3]], 2, 2) == 8", "assert min_cost([[2, 3, 4], [5, 9, 3], [2, 6, 4]], 2, 2) == 12", "assert min_cost([[3, 4, 5], [6, 10, 4], [3, 7, 5]], 2, 2) == 16" ], "test_setup_code": "", "challenge_test_list": [] }
-
sanitized: json { "source_file": "Benchmark Questions Verification V2.ipynb", "task_id": 2, "prompt": "Write a function to find the shared elements from the given two lists.", "code": "def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res) ", "test_imports": [], "test_list": [ "assert set(similar_elements((3, 4, 5, 6),(5, 7, 4, 10))) == set((4, 5))", "assert set(similar_elements((1, 2, 3, 4),(5, 4, 3, 7))) == set((3, 4))", "assert set(similar_elements((11, 12, 14, 13),(17, 15, 14, 13))) == set((13, 14))" ] }
数据字段
source_file: 未知text/prompt: 编程任务描述code: 编程任务的解决方案test_setup_code/test_imports: 执行测试所需的代码导入test_list: 验证解决方案的测试列表challenge_test_list: 进一步探测解决方案的更具挑战性的测试列表
数据分割
- full 和 sanitized 版本各有四个分割:
trainevaluationtestprompt(用于少样本提示,不用于训练)
数据集创建
- 创建理由: 为了评估代码生成功能,需要一组简单的编程任务及其解决方案,该数据集提供了这一点。
- 源数据: 数据集是从零开始手动创建的,由Google内部的众包努力创建。
- 注释: 完整数据集首先创建,然后一部分经过第二轮改进任务描述。
使用数据的注意事项
- 确保在安全环境中执行生成的Python代码,因为生成的代码可能有害。
- 社会影响: 该数据集可以更好地评估代码生成模型,从而在使用此类模型时减少问题。
- 已知限制: 任务描述可能不够表达,不足以解决任务。
sanitized分割旨在通过第二轮注释者改进数据集来解决此问题。
附加信息
-
数据集策展人: Google Research
-
许可证信息: CC-BY-4.0
-
引用信息:
@article{austin2021program, title={Program Synthesis with Large Language Models}, author={Austin, Jacob and Odena, Augustus and Nye, Maxwell and Bosma, Maarten and Michalewski, Henryk and Dohan, David and Jiang, Ellen and Cai, Carrie and Terry, Michael and Le, Quoc and others}, journal={arXiv preprint arXiv:2108.07732}, year={2021} }
-
贡献者: @lvwerra




