arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.09807cs.SE
收藏

基于机器学习的API参考文献知识识别

On Using Machine Learning to Identify Knowledge in API Reference Documentation

Davide Fucci, Alireza Mollaalizadehbahnemiri, Walid Maalej

摘要:

使用JavaDoc等API参考文档是软件开发不可或缺的一部分。以前的研究引入了一种基础分类法,将API文档知识分为12种类型,包括有关API的功能,结构和质量的知识。我们研究如何以及现代文本分类方法可以自动识别包含特定知识类型的文档。我们比较了传统的机器学习(k-NN和SVM)和深度学习方法,这些方法是在手动注释的Java和.NET API文档(n = 5,574)上训练的。当单独地对知识类型进行分类时(即,多个二进制分类器)的最佳AUPRC高达87%。深度学习和SVM分类器似乎是互补的。对于四种知识类型(概念,控制,模式和非信息),SVM明显优于深度学习,另一方面,对于识别其余类型更准确。当一次考虑多个知识类型时(即,多标签分类)深度学习优于原始基线和传统机器学习,实现了高达79%的MacroAUC。我们还比较了使用在通用文本语料库和StackOverflow上预训练的嵌入的分类器,但没有观察到显着的改进。最后,为了评估分类器的通用性,我们在一个不同的、看不见的Python文档数据集上重新测试了它们。功能、概念、目的、模式和指令的分类器似乎从Java和.NET推广到Python文档。与其余类型相关的准确性似乎是API特有的。我们讨论了我们的结果,以及它们如何为支持开发人员共享和访问API知识的工具的开发提供信息。发表文章:https://doi.org/10.1145/3338906.3338943

英文摘要:

Using API reference documentation like JavaDoc is an integral part of software development. Previous research introduced a grounded taxonomy that organizes API documentation knowledge in 12 types, including knowledge about the Functionality, Structure, and Quality of an API. We study how well modern text classification approaches can automatically identify documentation containing specific knowledge types. We compared conventional machine learning (k-NN and SVM) and deep learning approaches trained on manually annotated Java and .NET API documentation (n = 5,574). When classifying the knowledge types individually (i.e., multiple binary classifiers) the best AUPRC was up to 87%. The deep learning and SVM classifiers seem complementary. For four knowledge types (Concept, Control, Pattern, and Non-Information), SVM clearly outperforms deep learning which, on the other hand, is more accurate for identifying the remaining types. When considering multiple knowledge types at once (i.e., multi-label classification) deep learning outperforms naïve baselines and traditional machine learning achieving a MacroAUC up to 79%. We also compared classifiers using embeddings pre-trained on generic text corpora and StackOverflow but did not observe significant improvements. Finally, to assess the generalizability of the classifiers, we re-tested them on a different, unseen Python documentation dataset. Classifiers for Functionality, Concept, Purpose, Pattern, and Directive seem to generalize from Java and .NET to Python documentation. The accuracy related to the remaining types seems API-specific. We discuss our results and how they inform the development of tools for supporting developers sharing and accessing API knowledge. Published article: https://doi.org/10.1145/3338906.3338943

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

↑