基于提示学习的API评论知识图谱构建方法OA
CONSTRUCTION METHOD OF API REVIEWS KNOWLEDGE GRAPH BASED ON PROMPT LEARNING
API(Application Programming Interface)是现代软件开发中提升效率的重要组件,开发者经常在问答社区的评论中学习不同类型的API知识,由此引发一系列对API评论进行分类的研究工作.然而相关工作在分类时均需要大量标注数据,成本较高.为此,提出一种基于提示学习的API评论知识图谱构建方法,能够将评论分类任务转化为模型擅长的单词预测任务从而提升分类效果.相对于基线方法,该方法的F1 指标提升 16.1%~21%,召回率提升30.6%~36.2%.此外,所提出的知识图谱结构可以将不同帖子中的API评论按照不同粒度、不同类别、去冗余地整合在一起.并且通过实验证明所建知识图谱能够有效帮助开发者学习相关API知识.
Application programming interfaces(API)are important software components to improve development efficiency in modern software development.Developers often learn different types of API knowledge from comments in question-and-answer communities such as Stack Overflow,which leads to many research works on API comments classification.However,existing works need to use a large amount of manually labeled data in the classification which is of high cost.To solve these problems,this paper proposes a method for constructing an API reviews knowledge graph based on prompt learning.This method improved the classification effect by converting the review classification task into the masked token prediction that the model was good at.Compared with baseline methods,our F1 metric was increased by 16.1%~21%,and the recall was increased by 30.6%~36.2%.In addition,the knowledge graph structure proposed in this paper could integrate API comments in different posts according to different granularities and categories,and eliminate redundancy.The experiments prove that API reviews knowledge graph can effectively help developers learn API knowledge.
杨延军;刘名威;彭鑫;赵文耘
复旦大学计算机科学技术学院 上海 200438||上海市数据科学重点实验室 上海 200438复旦大学计算机科学技术学院 上海 200438||上海市数据科学重点实验室 上海 200438复旦大学计算机科学技术学院 上海 200438||上海市数据科学重点实验室 上海 200438复旦大学计算机科学技术学院 上海 200438||上海市数据科学重点实验室 上海 200438
信息技术与安全科学
API评论提示学习知识图谱
API reviewsPrompt learningKnowledge graph
《计算机应用与软件》 2026 (2)
8-15,31,9
国家自然科学基金项目(61972098).
评论