跳到正文
arXiv (AI + Vision + Imaging)· Musfiqur Rahman, SayedHassan Khatoonabadi, Emad Shihab·· 8 天前AI 评分22

OpenClassGen:面向LLM研究的大规模真实Python类语料库

OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Research

AI 导读

OpenClassGen发布了一个从2,970个工程化开源项目中提取的324,843个Python类的大规模语料库,每个条目包含人工编写的类及其骨架(类与方法签名及docstring),并附带覆盖复杂度、耦合、内聚和继承特性的27项静态代码指标。

正文 · 原文

arXiv:2504.15564v4 Announce Type: replace-cross Abstract: Existing class-level code generation datasets are either synthetic (ClassEval: 100 classes) or insufficient in scale for modern training needs (RealClassEval: 400 classes), hindering robust evaluation and empirical analysis. We present OpenClassGen, a large-scale corpus of 324,843 Python classes extracted from 2,970 engineered open-source projects. Each entry pairs a human-written class with its corresponding skeleton, which comprises class and method signatures with associated docstrings, and is enriched with 27 static code metrics covering complexity, coupling, cohesion, and inheritance properties. Unlike prior benchmarks that require repository-level context resolution, OpenClassGen provides self-contained class skeletons that serve as complete generation specifications. We demonstrate the corpus's utility by evaluating three LLMs (GPT-o4-mini, Claude-4-Sonnet, Qwen-3-Coder) on a curated, executable subset of 300 classes, enriched with test suites achieving 58% branch coverage. Results show strong semantic similarity (CodeBERTScore-F3: 0.89) but moderate functional correctness (pass rate: 0.33), with substantial variance across models. This variance, along with diverse class characteristics, confirms that OpenClassGen enables meaningful differentiation of LLM capabilities. The dataset supports diverse use cases, including fine-tuning, retrieval-augmented generation, difficulty modelling, and failure mode analysis. The complete dataset and curation scripts are publicly available at https://zenodo.org/records/18409150.

来源:arXiv (AI + Vision + Imaging) · arxiv.org