Software programming requires both API reference (know-what) knowledge and programming task (know-how) knowledge. Lots of programming know-what and know-how knowledge is documented in text, for example, API reference documentation and programming tutorials. To improve knowledge accessibility and usage, several recent studies use Natural Language Processing (NLP) methods to construct API know-what knowledge graph (API-KG) and programming task know-how knowledge graph (Task-KG) from software documentation. Although being promising, current API-KG and Task-KG are independent of each other, and thus are void of inherent connections between the two types of knowledge. Our empirical study on Stack Overflow questions confirms that only 36% of the API usage problems can be answered by the know-how or the know-what knowledge alone, while the rest questions require a fusion of both. Inspired by this observation, we make the first attempt to fuse API-KG and Task-KG by API entity linking. This fusion creates nine categories of API semantic relations and two types of task semantic relations which are not present in the stand-alone API-KG or Task-KG. According to the definitions of these new API and task semantic relations, our approach dives deeper than the surface-level API linking of API-KG and Task-KG, and infers nine categories of API semantic relations from task descriptions and two types of task semantic relations with the assistance of API-KG, which enrich the declaration or syntactic relations in the current API-KG and Task-KG. Our fused and semantically-enriched API-Task KG supports coherent API/Task-centric knowledge search by text or code queries.
翻译:软件开发需要同时具备API参考(know-what)知识与编程任务(know-how)知识。大量编程know-what与know-how知识以文本形式记录,例如API参考文档和编程教程。为提升知识的可访问性与实用性,近期多项研究利用自然语言处理(NLP)方法,从软件文档中构建了API know-what知识图谱(API-KG)与编程任务know-how知识图谱(Task-KG)。尽管这些方法颇具前景,但当前API-KG与Task-KG相互独立,因而缺失两类知识间的内在关联。我们对Stack Overflow问题的实证研究表明,仅36%的API使用问题可单独通过know-how或know-what知识解答,其余问题则需要两类知识的融合。受此启发,我们首次尝试通过API实体链接实现API-KG与Task-KG的融合。该融合生成了独立API-KG或Task-KG中不存在的九类API语义关系与两类任务语义关系。基于这些新型API与任务语义关系的定义,我们的方法超越了API-KG与Task-KG的表面级API链接,从任务描述中推断出九类API语义关系,并借助API-KG推导出两类任务语义关系,从而丰富了当前API-KG与Task-KG中的声明或语法关系。融合且语义增强后的API-Task KG支持通过文本或代码查询实现一致的API/任务中心化知识搜索。