arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.03365cs.SEcs.AIcs.CLcs.LG
收藏

利用生成式AI:通过生成的代码-注释对改进软件元数据分类

Leveraging Generative AI: Improving Software Metadata Classification with Generated Code-Comment Pairs

Sri Sivasubramaniya Nadar College of Engineering(斯里·西瓦苏布拉马尼亚·纳达尔工程学院)

Samah Syed, Angel Deborah S

AI总结:

本研究针对代码注释有用性二分类问题,结合BERT上下文嵌入与生成式AI扩充代码-注释对数据集,测试多种机器学习算法,验证了生成式AI提升分类模型效果的潜力。

摘要:

在软件开发中,代码注释对提升代码理解与协作效率起着关键作用。本研究针对将代码注释客观分类为“有用”或“无用”的挑战展开,提出了一种利用上下文嵌入(尤其是BERT)实现该分类过程自动化的新方案。我们通过引入生成的代码与注释对来完成这一任务。初始数据集包含9048对用C语言编写的代码与注释,均被标记为“有用”或“无用”。为扩充该数据集,我们额外获取了739行代码-注释对,并使用大语言模型架构(具体为BERT)生成标签。本研究的核心目标是构建能有效区分有用与无用代码注释的分类模型。我们采用了多种机器学习算法,包括逻辑回归、决策树、K近邻(KNN)、支持向量机(SVM)、梯度提升、随机森林以及一种神经网络。我们在原始种子数据集和扩充数据集上,分别使用精确率、召回率和F1值指标对每种算法进行了评估。本研究展示了生成式AI在提升二分类代码注释质量分类模型方面的潜力,为自然语言处理与软件工程领域的开发者和研究人员提供了有价值的见解。

英文摘要:

In software development, code comments play a crucial role in enhancing code comprehension and collaboration. This research paper addresses the challenge of objectively classifying code comments as "Useful" or "Not Useful." We propose a novel solution that harnesses contextualized embeddings, particularly BERT, to automate this classification process. We address this task by incorporating generated code and comment pairs. The initial dataset comprised 9048 pairs of code and comments written in C, labeled as either Useful or Not Useful. To augment this dataset, we sourced an additional 739 lines of code-comment pairs and generated labels using a Large Language Model Architecture, specifically BERT. The primary objective was to build classification models that can effectively differentiate between useful and not useful code comments. Various machine learning algorithms were employed, including Logistic Regression, Decision Tree, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Gradient Boosting, Random Forest, and a Neural Network. Each algorithm was evaluated using precision, recall, and F1-score metrics, both with the original seed dataset and the augmented dataset. This study showcases the potential of generative AI for enhancing binary code comment quality classification models, providing valuable insights for software developers and researchers in the field of natural language processing and software engineering.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑