While having options could be liberating, too many options could lead to the sub-optimal solution being chosen. This is not an exception in the software engineering domain. Nowadays, API has become imperative in making software developers' life easier. APIs help developers implement a function faster and more efficiently. However, given the large number of open-source libraries to choose from, choosing the right APIs is not a simple task. Previous studies on API recommendation leverage natural language (query) to identify which API would be suitable for the given task. However, these studies only consider one source of input, i.e., GitHub or Stack Overflow, independently. There are no existing approaches that utilize Stack Overflow to help generate better API sequence recommendations from queries obtained from GitHub. Therefore, in this study, we aim to provide a framework that could improve the result of the API sequence recommendation by leveraging information from Stack Overflow. In this work, we propose PICASO, which leverages a bi-encoder to do contrastive learning and a cross-encoder to build a classification model in order to find a semantically similar Stack Overflow post given an annotation (i.e., code comment). Subsequently, PICASO then uses the Stack Overflow's title as a query expansion. PICASO then uses the extended queries to fine-tune a CodeBERT, resulting in an API sequence generation model. Based on our experiments, we found that incorporating the Stack Overflow information into CodeBERT would improve the performance of API sequence generation's BLEU-4 score by 10.8%.
An Empirical Study of OpenAI API Discussions on Stack Overflow
School of Artificial Intelligence and Computer Science, Nantong University(人工智能与计算机科学学院,南通大学);State Key Lab. for Novel Software Technology, Nanjing University(新型软件技术国家重点实验室,南京大学);Chang Chien College, Nantong University(长进学院,南通大学);Computer School, Beijing Information Science and Technology University(计算机学院,北京信息科技大学)
本文首次对 Stack Overflow 上 2,874 个 OpenAI API 相关讨论进行实证研究,通过人工分类和主题建模识别开发人员面临的主要挑战,并为开发者、LLM 供应商和研究者提出可操作建议。
RACK: Automatic API Recommendation using Crowdsourced Knowledge
传统的代码搜索引擎通常不能很好地执行自然语言查询,因为它们主要应用关键字匹配。因此,这些引擎需要精心设计的查询,其中包含有关代码搜索编程API的信息。不幸的是,现有的研究表明,准备一个有效的代码搜索查询是既具有挑战性和耗时的开发人员。在本文中,我们提出了一种新的API推荐技术--RACK,它通过利用Stack Overflow的众包知识中的关键字-API关联,为代码搜索的自然语言查询推荐相关API列表。我们首先使用11个核心Java包和来自Stack Overflow的344 K Java帖子进行探索性研究来激励我们的技术。使用150个代码搜索查询随机选择的三个Java教程网站的实验表明,我们的技术建议正确的API类的前10名的结果约79%的查询,这是非常有前途的。与最先进技术的两个变体的比较还表明,RACK不仅在Top-K准确率方面,而且在平均平均精确率和平均召回率方面都大大优于它们。
An exploratory analysis of Community-based Question-Answering Platforms and GPT-3-driven Generative AI: Is it the end of online community-based learning?