Generate with CodeXHug: 一个增强模型卡片代码使用模式的数据集
Generate with CodeXHug: A Dataset to Enhance Model Cards with Code Usage Patterns
AI总结:
提出CodeXHug数据集,从HuggingFace和GitHub收集预训练模型及其代码使用模式,通过统计分析和聚类提取代表性代码模式,以支持开发者理解和使用PTMs。
摘要:
预训练模型(PTMs)在软件工程社区中越来越受欢迎。模型仓库(如HuggingFace)促进了它们的使用,这些仓库收集、存储和维护各种PTMs。然而,这些模型在实际项目中的实际采用情况仍是一个未解决的问题,即许多模型被用于玩具项目或仅作为HF仓库的镜像。此外,大多数可用的模型卡片和包含关键使用信息的文本文档不包含解释性代码模式,从而增加了新手的难度。因此,我们认为需要一个与PTMs相关的精选代码库,以支持有兴趣在其项目中使用它们的开发者和实践者。在本文中,我们提出了CodeXHug,一个精选的数据集,包含在GitHub生态系统中使用的HuggingFace PTMs及其相关代码使用模式。从最新的HF转储开始,我们首先进行数据整理,收集带有标签和模型卡片的PTMs。然后,查询GitHub平台以找到已识别PTMs的实际使用情况,结果得到7,325个不同模型和20,545个Python文件。为了展示CodeXHug的具体应用,我们提出了一个使用场景,通过统计分析和聚类技术应用于相关代码片段,专注于提取特定PTMs的代表性代码使用模式。
英文摘要:
Pre-trained models (PTMs) are becoming increasingly popular in the software engineering community. Their usage is facilitated by model repositories, e.g., HuggingFace, which collect, store, and maintain a wide range of PTMs. However, the actual adoption of these models in real-world projects is still an open question, i.e., many of them are used in toy projects or simply as a mirror for the HF repository. In addition, most of the available model cards and textual documents that contain critical information about their usage do not include explanatory code patterns, thus increasing the difficulty for newcomers. Thus, we see the need for a curated codebase related to PTMs to support developers and practitioners who are interested in using them in their projects. In this paper, we present CodeXHug, a curated dataset of HuggingFace PTMs exploited in the Github ecosystem and the related code usage patterns. Starting from the latest HF dump, we first conduct a data curation to collect PTMs with a tag and a model card. Then, the Github platform has been queried to find actual usages of the identified PTMs, resulting in 7,325 different models and 20,545 Python files. To demonstrate a concrete application of CodeXHug, we propose a usage scenario focused on extracting representative code usage patterns for specific PTMs through a statistical analysis and clustering techniques applied to relevant code snippets.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。