NextWealth/Python-DPO-Large
收藏数据集卡片:Python-DPO
数据集描述
- 数据集名称: Python-DPO
- 数据集版本: 较大版本
- 创建工具: Argilla
数据字段
每个数据实例包含以下字段:
- instruction: 问题描述/需求
- chosen_code: 选定的最优Python代码解决方案
- rejected_code-1: 一个次优的被拒绝解决方案
- rejected_code-2: 另一个次优的被拒绝解决方案
- preference: 对指令的排名/偏好
数据实例
数据实例示例如下:
json { "chosen_code": "def max_nth_column(tuple_list, n): """ Finds the maximum of nth column from the given tuple list.
Args: tuple_list: A list of tuples. n: The column number.
Returns: The maximum value in nth column. """
Check if the column number is valid.
if n u003c 0 or n u003e= len(tuple_list[0]): raise ValueError("Invalid column number.")
Find the maximum value in nth column.
max_value = float(u0027-infu0027) for tup in tuple_list: if tup[n] u003e max_value: max_value = tup[n]
return max_value tuple_list = [(1, 2, 3), (4, 5, 6), (7, 8, 9)] N = 1
print(max_nth_column(tuple_list, N))", "instruction": "Write a function to find the maximum of nth column from the given tuple list.", "preference": [ { "status": "submitted", "user_id": "71125d9d-c9ab-43c2-ac20-6ad565134ec3", "value": { "rank": [ 1, 2, 3 ], "value": [ "chosen_code", "rejected_1", "rejected_2" ] } } ], "rejected_code-1": "def max_column(tuples, col): return max(x[col] for x in tuples)
Testing with some example data
data = [(1, 2, 3), (4, 5, 6), (7, 8, 9)] print(max_column(data, 0)) # Outputs: 5 print(max_column(data, 1)) # Outputs: 6", "rejected_code-2": "def max_of_nth(test_list, N): res = max([sub[N] for sub in test_list]) return (res)
test_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] N = 1 print(max_of_nth(test_list, N))" }
数据集创建
数据集来源
- 问题描述来源: MBPP数据集
- 代码解决方案生成模型: Codegemma-7b-it 和 Magicoder-S-DS-6.7B
标注过程
标注工具
用于评估代码质量的工具包括:
- pylama: 集成多种代码检查工具,如Isort, Pydocstyle, Pylint, Mypy, Pycodestyle, McCabe, 和 eradicate。
- pytest: 用于单元测试的框架。
- bandit: 专注于代码安全性的工具。
- Profiling tools: 如Cprofiler,用于性能分析。



