语义码搜索的Siamese网络评价
Evaluation of Siamese Networks for Semantic Code Search
摘要:
随着开放存储库和论坛数量的增加,使用自然语言进行语义代码搜索变得越来越普遍。然而,由于1)代码和用户查询之间的有限共享词汇以及2)对用户查询及其与代码语法的关系的语义理解不足,由这样的系统返回的结果的准确性可能较低。暹罗网络非常适合学习数据之间的这种联合关系,但尚未在代码搜索的背景下进行探索。在这项工作中,我们通过探索多个提取网络架构来评估Siamese网络。这些网络独立处理代码和文本描述,然后将它们传递给暹罗网络,以学习公共空间中的嵌入。我们在两个不同的数据集上进行了实验,发现Siamese网络可以作为网络上的强正则化器,从代码和文本中提取丰富的信息,这反过来又有助于在代码搜索上实现令人印象深刻的性能,击败$2$程序设计语言的先前基线。我们还分析了这些网络的嵌入空间,并为充分利用Siamese网络进行语义代码搜索提供了方向。
英文摘要:
With the increase in the number of open repositories and discussion forums, the use of natural language for semantic code search has become increasingly common. The accuracy of the results returned by such systems, however, can be low due to 1) limited shared vocabulary between code and user query and 2) inadequate semantic understanding of user query and its relation to code syntax. Siamese networks are well suited to learning such joint relations between data, but have not been explored in the context of code search. In this work, we evaluate Siamese networks for this task by exploring multiple extraction network architectures. These networks independently process code and text descriptions before passing them to a Siamese network to learn embeddings in a common space. We experiment on two different datasets and discover that Siamese networks can act as strong regularizers on networks that extract rich information from code and text, which in turn helps achieve impressive performance on code search beating previous baselines on $2$ programming languages. We also analyze the embedding space of these networks and provide directions to fully leverage the power of Siamese networks for semantic code search.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。