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

NS3:神经符号语义代码搜索

NS3: Neuro-Symbolic Semantic Code Search

University of Southern California(南加州大学);National Polytechnic University of Armenia(亚美尼亚国立理工大学);Microsoft Research Cambridge(微软剑桥研究院);USC Information Sciences Institute(南加州大学信息科学研究所);Google Research(谷歌研究院)

Shushan Arakelyan, Anna Hakhverdyan, Miltiadis Allamanis, Luis Garcia, Christophe Hauser, Xiang Ren

摘要:

语义代码搜索是检索给定其功能的文本描述的代码段的任务。最近的工作集中在使用文本和代码的神经嵌入之间的相似性度量。然而,目前的语言模型被称为斗争与较长的,合成的文本,和多步推理。为了克服这一限制,我们建议补充查询句子的布局,其语义结构。语义布局用于将最终的推理决策分解为一系列较低级别的决策。我们使用神经模块网络架构来实现这一想法。我们将我们的模型-NS 3(神经符号语义搜索)-与一些基线进行比较,包括最先进的语义代码检索方法,并在两个数据集上进行评估- CodeSearchNet和Code Search以及问答。我们证明了我们的方法在更精确的代码检索的结果,我们研究了我们的模块化设计处理组合查询时的有效性。

英文摘要:

Semantic code search is the task of retrieving a code snippet given a textual description of its functionality. Recent work has been focused on using similarity metrics between neural embeddings of text and code. However, current language models are known to struggle with longer, compositional text, and multi-step reasoning. To overcome this limitation, we propose supplementing the query sentence with a layout of its semantic structure. The semantic layout is used to break down the final reasoning decision into a series of lower-level decisions. We use a Neural Module Network architecture to implement this idea. We compare our model - NS3 (Neuro-Symbolic Semantic Search) - to a number of baselines, including state-of-the-art semantic code retrieval methods, and evaluate on two datasets - CodeSearchNet and Code Search and Question Answering. We demonstrate that our approach results in more precise code retrieval, and we study the effectiveness of our modular design when handling compositional queries.

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

↑