计算机应用与软件2026,Vol.43Issue(2):8-15,31,9.DOI:10.3969/j.issn.1000-386x.2026.02.002
基于提示学习的API评论知识图谱构建方法
CONSTRUCTION METHOD OF API REVIEWS KNOWLEDGE GRAPH BASED ON PROMPT LEARNING
摘要
Abstract
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.关键词
API评论/提示学习/知识图谱Key words
API reviews/Prompt learning/Knowledge graph分类
信息技术与安全科学引用本文复制引用
杨延军,刘名威,彭鑫,赵文耘..基于提示学习的API评论知识图谱构建方法[J].计算机应用与软件,2026,43(2):8-15,31,9.基金项目
国家自然科学基金项目(61972098). (61972098)