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.


翻译:语义代码搜索是重新获取代码片断的任务, 给其功能提供文本描述 。 最近的工作侧重于在文本和代码的神经嵌入和代码之间使用相似度量。 但是, 已知当前语言模型与较长的、 组成文本和多步推理相挣扎。 为了克服这一限制, 我们提议用语义结构的布局来补充查询句。 语义布局用于将最终推理决定分解成一系列较低层次的决定 。 我们使用神经模块网络架构来实施这个想法。 我们比较了我们的模型 - NS3( 神经- 系统搜索) - 与一系列基线, 包括最先进的语义代码检索方法, 并评估两个数据集 - 代码SearchNet 和代码搜索及回答。 我们展示了我们的方法在更精确的代码检索中的结果, 我们在处理组成查询时研究模块设计的有效性 。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
专知会员服务
26+阅读 · 2021年4月2日
专知会员服务
61+阅读 · 2020年3月19日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
【ICIG2021】Check out the hot new trailer of ICIG2021 Symposium8
中国图象图形学学会CSIG
0+阅读 · 2021年11月16日
【ICIG2021】Latest News & Announcements of the Plenary Talk2
中国图象图形学学会CSIG
0+阅读 · 2021年11月2日
【ICIG2021】Latest News & Announcements of the Plenary Talk1
中国图象图形学学会CSIG
0+阅读 · 2021年11月1日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
SE(3)-Equivariant Reconstruction from Light Field
Arxiv
0+阅读 · 2022年12月30日
VIP会员
相关VIP内容
专知会员服务
26+阅读 · 2021年4月2日
专知会员服务
61+阅读 · 2020年3月19日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
相关资讯
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
【ICIG2021】Check out the hot new trailer of ICIG2021 Symposium8
中国图象图形学学会CSIG
0+阅读 · 2021年11月16日
【ICIG2021】Latest News & Announcements of the Plenary Talk2
中国图象图形学学会CSIG
0+阅读 · 2021年11月2日
【ICIG2021】Latest News & Announcements of the Plenary Talk1
中国图象图形学学会CSIG
0+阅读 · 2021年11月1日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员