arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.02702cs.SE
收藏

使用多特征分数改进的具有代码示例的编程解决方案的检索

Improved Retrieval of Programming Solutions With Code Examples Using a Multi-featured Score

Rodrigo F. Silva, M. Masudur Rahman, Carlos Eduardo Dantas, Chanchal Roy, Foutse Khomh, Marcelo A. Maia

摘要:

开发人员经常依赖代码搜索引擎来获得他们的编程任务的解决方案。然而,由于存在几个问题,找到包含代码示例及其解释的预期解决方案具有挑战性。在搜索关键字(查询)和相应的解决方案之间存在词汇不匹配。由于反义词和否定,相似的词袋可能会增加语义差距。此外,由搜索引擎检索的文档可能不包含同时包含代码示例及其解释的解决方案。因此,我们提出CRAR(人群答案推荐)来规避这些问题,旨在提高从Stack Overflow中检索相关答案的能力,其中不仅包含给定任务的预期代码示例,还包含它们的解释。给定一个编程任务,我们研究了将信息检索技术与一组特征相结合以增强重要线程的排名(即,包含问题及其答案的单元),然后选择包含在这些线程中的相关答案,包括语义特征,如词嵌入和句子嵌入,例如卷积神经网络(CNN)。CRAR还利用Stack Overflow讨论的社交方面(如受欢迎程度)来选择任务的相关答案。我们的实验评估表明,不同功能的组合比单独使用更好。我们还比较了检索性能与最先进的CROKAGE(人群知识答案生成器),这也是一个系统,旨在从堆栈溢出检索相关的答案。我们发现,CRAR优于CROKAGE在平均倒数排名和平均召回小和中等的效果大小,分别。

英文摘要:

Developers often depend on code search engines to obtain solutions for their programming tasks. However, finding an expected solution containing code examples along with their explanations is challenging due to several issues. There is a vocabulary mismatch between the search keywords (the query) and the appropriate solutions. Semantic gap may increase for similar bag of words due to antonyms and negation. Moreover, documents retrieved by search engines might not contain solutions containing both code examples and their explanations. So, we propose CRAR (Crowd Answer Recommender) to circumvent those issues aiming at improving retrieval of relevant answers from Stack Overflow containing not only the expected code examples for the given task but also their explanations. Given a programming task, we investigate the effectiveness of combining information retrieval techniques along with a set of features to enhance the ranking of important threads (i.e., the units containing questions along with their answers) for the given task and then selects relevant answers contained in those threads, including semantic features, like word embeddings and sentence embeddings, for instance, a Convolutional Neural Network (CNN). CRAR also leverages social aspects of Stack Overflow discussions like popularity to select relevant answers for the tasks. Our experimental evaluation shows that the combination of the different features performs better than each one individually. We also compare the retrieval performance with the state-of-art CROKAGE (Crowd Knowledge Answer Generator), which is also a system aimed at retrieving relevant answers from Stack Overflow. We show that CRAR outperforms CROKAGE in Mean Reciprocal Rank and Mean Recall with small and medium effect sizes, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑