paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Recommending Analogical APIs via Knowledge Graph Embedding

通过知识图谱嵌入推荐类比 API
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 该论文研究库迁移中的类比 API 推荐,属于代码推荐与开发者工具,与用户关注的静态分析、LLM/Agent 与程序分析交叉、浮点程序分析及贝叶斯程序分析无直接关系。其方法基于知识图谱嵌入,也不涉及 LLM/Agent 改进程序分析。引用 12 inbox
Mingwei Liu, Yanjun Yang, Yiling Lou, Xin Peng, Zhong Zhou, Xueying Du, Tianyong Yang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 KGE4AR,用统一 API 知识图谱及其嵌入表示实现可扩展的类比 API 推荐,显著优于现有方法。

库迁移需要用不同库替换现有库并保持软件行为不变,其关键步骤是为目标功能找到类比 API;由于库与 API 数量庞大,人工查找耗时且易错。已有的自动化类比 API 推荐技术(尤其是基于文档的方法)存在文档语义理解不完整与可扩展性差的问题。本文提出 KGE4AR,一种基于文档、使用知识图谱(KG)嵌入的类比 API 推荐方法。它引入统一的 API 知识图谱,全面表示文档知识并捕获高层语义,随后将该统一 API 知识图谱嵌入为向量,以支持高效、可扩展的相似度计算。作者在 35,773 个 Java 库上分「有目标库」与「无目标库」两种场景进行评估,KGE4AR 明显优于当前最优技术,MRR 分别提升 47.1%–143.0% 与 11.7%–80.6%,并展现出随库数量增长的可扩展性。

问题
库迁移中为所需功能寻找类比 API 十分常见,但受库与 API 数量庞大所限,人工查找耗时且易错;现有基于文档的自动推荐方法存在文档语义理解不完整和可扩展性不足的缺陷。
方法
提出 KGE4AR:构建统一的 API 知识图谱以完整表示文档知识并捕获高层语义,再将该知识图谱嵌入为向量,从而进行高效、可扩展的相似度计算以推荐类比 API。
评估
在 35,773 个 Java 库上分「有目标库」和「无目标库」两种场景进行评估,与当前最优技术比较 MRR 等指标,并考察随库数量增长的可扩展性。
原文摘要(Abstract)

Library migration, which replaces the current library with a different one to retain the same software behavior, is common in software evolution. An essential part of this is finding an analogous API for the desired functionality. However, due to the multitude of libraries/APIs, manually finding such an API is time-consuming and error-prone. Researchers created automated analogical API recommendation techniques, notably documentation-based methods. Despite potential, these methods have limitations, e.g., incomplete semantic understanding in documentation and scalability issues. In this study, we present KGE4AR, a novel documentation-based approach using knowledge graph (KG) embedding for recommending analogical APIs during library migration. KGE4AR introduces a unified API KG to comprehensively represent documentation knowledge, capturing high-level semantics. It further embeds this unified API KG into vectors for efficient, scalable similarity calculation. We assess KGE4AR with 35,773 Java libraries in two scenarios, with and without target libraries. KGE4AR notably outperforms state-of-the-art techniques (e.g., 47.1%-143.0% and 11.7%-80.6% MRR improvements), showcasing scalability with growing library counts.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2308-11422,
  title = {Recommending Analogical APIs via Knowledge Graph Embedding},
  author = {Mingwei Liu and Yanjun Yang and Yiling Lou and Xin Peng and Zhong Zhou and Xueying Du and Tianyong Yang},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616305}
}