一句话:通过显式识别并匹配功能描述与用户查询中的功能动词短语,提升 API 方法推荐效果。
基于文档的 API 检索常因功能描述与用户查询之间存在词汇鸿沟而效果不佳。本文假设显式识别并匹配二者细粒度结构可改善检索。作者对 14,733 个 JDK 和 Android API 方法的功能描述开展大规模实证研究,从中识别出 356 个功能动词,归为 87 个功能类别,并抽取 523 个动词短语模式。在此基础上提出 API 方法推荐方法 PreMA,通过显式匹配功能描述与用户查询中的功能动词短语实现推荐。评估表明,PreMA 识别功能描述句的功能类别准确率为 92.8%,短语模式准确率为 90.4%;在 API 检索任务中,相比基线方法,参与者能更准确地完成任务且重试次数更少。
Due to the lexical gap between functionality descriptions and user queries, documentation-based API retrieval often produces poor results.Verb phrases and their phrase patterns are essential in both describing API functionalities and interpreting user queries. Thus we hypothesize that API retrieval can be facilitated by explicitly recognizing and matching between the fine-grained structures of functionality descriptions and user queries. To verify this hypothesis, we conducted a large-scale empirical study on the functionality descriptions of 14,733 JDK and Android API methods. We identified 356 different functionality verbs from the descriptions, which were grouped into 87 functionality categories, and we extracted 523 phrase patterns from the verb phrases of the descriptions. Building on these findings, we propose an API method recommendation approach based on explicit matching of functionality verb phrases in functionality descriptions and user queries, called PreMA. Our evaluation shows that PreMA can accurately recognize the functionality categories (92.8%) and phrase patterns (90.4%) of functionality description sentences; and when used for API retrieval tasks, PreMA can help participants complete their tasks more accurately and with fewer retries compared to a baseline approach.
DOI 原文 ·
@inproceedings{paperbot5789,
title = {API method recommendation via explicit matching of functionality verb phrases},
author = {Wenkai Xie and Xin Peng and Mingwei Liu and Christoph Treude and Zhenchang Xing and Xiaoxin Zhang and Wenyun Zhao},
booktitle = {FSE},
year = {2020},
doi = {10.1145/3368089.3409731}
}