The use of packaged libraries can significantly shorten the software development cycle by improving the quality and readability of code. In this paper, we present a recommendation engine called Librarian for open source libraries. A candidate library package is recommended for a given context if: 1) it has been frequently used with the imported libraries in the program; 2) it has similar functionality to the imported libraries in the program; 3) it has similar functionality to the developer's implementation, and 4) it can be used efficiently in the context of the provided code. We apply the state-of-the-art CodeBERT-based model for analysing the context of the source code to deliver relevant library recommendations to users.
翻译:使用打包库能通过提升代码的质量与可读性显著缩短软件开发周期。本文提出一个名为Librarian的开源库推荐引擎。对于给定上下文,候选库包的推荐依据如下条件:1)该包在程序中与已导入库被频繁联合使用;2)该包与程序中已导入库具有相似功能;3)该包与开发者实现的功能相似;4)该包能在所提供代码的上下文中被高效使用。我们采用基于CodeBERT的最先进模型分析源代码上下文,向用户提供相关的库推荐。