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 StackOverflow, 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.