paper-with-me

홈 › Papers

Learning Deep Semantic Model for Code Search using CodeSearchNet Corpus

2022-01-27 · Chen Wu, Ming Yan

Semantic code search is the task of retrieving relevant code snippet given a natural language query. Different from typical information retrieval tasks, code search requires to bridge the semantic gap between the programming language and natural language, for better describing intrinsic concepts and semantics. Recently, deep neural network for code search has been a hot research topic. Typical methods for neural code search first represent the code snippet and query text as separate embeddings, and then use vector distance (e.g. dot-product or cosine) to calculate the semantic similarity between them. There exist many different ways for aggregating the variable length of code or query tokens into a learnable embedding, including bi-encoder, cross-encoder, and poly-encoder. The goal of the query encoder and code encoder is to produce embeddings that are close with each other for a related pair of query and the corresponding desired code snippet, in which the choice and design of encoder is very significant. In this paper, we propose a novel deep semantic model which makes use of the utilities of not only the multi-modal sources, but also feature extractors such as self-attention, the aggregated vectors, combination of the intermediate representations. We apply the proposed model to tackle the CodeSearchNet challenge about semantic code search. We align cross-lingual embedding for multi-modality learning with large batches and hard example mining, and combine different learned representations for better enhancing the representation learning. Our model is trained on CodeSearchNet corpus and evaluated on the held-out data, the final model achieves 0.384 NDCG and won the first place in this benchmark. Models and code are available at https://github.com/overwindows/SemanticCodeSearch.git.

📄 PDF Abstract BibTeX arXiv:2201.11313

Code (1)

overwindows/semanticcodesearch 공식 구현 tf

Tasks

Code SearchInformation RetrievalRepresentation LearningRetrievalSemantic SimilaritySemantic Textual Similarity

Similar Papers 제목 키워드 기반

CodeSearchNet Challenge: Evaluating the State of Semantic Code Search

2019-09-20 · Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis 외

Semantic code search is the task of retrieving relevant code given a natural language query. While related to other information retrieval tasks, it requires bridging the gap between the language used in code (often abbre…

4kCode SearchInformation RetrievalNatural Language Queries+1

Bag-of-Words Baselines for Semantic Code Search

2021-08-01 · ACL (NLP4Prog) 2021 8 · Xinyu Zhang, Ji Xin, Andrew Yates, Jimmy Lin

The task of semantic code search is to retrieve code snippets from a source code corpus based on an information need expressed in natural language. The semantic gap between natural language and programming languages has …

Code SearchInformation RetrievalNatural Language QueriesRetrieval

Multimodal Representation for Neural Code Search

2021-07-02 · Jian Gu, Zimin Chen, Martin Monperrus

Semantic code search is about finding semantically relevant code snippets for a given natural language query. In the state-of-the-art approaches, the semantic similarity between code and query is quantified as the distan…

Code SearchSemantic SimilaritySemantic Textual Similarity

GAP-Gen: Guided Automatic Python Code Generation

2022-01-19 · Junchen Zhao, Yurun Song, Junlin Wang, Ian G. Harris

Automatic code generation from natural language descriptions can be highly beneficial during the process of software development. In this work, we propose GAP-Gen, a Guided Automatic Python Code Generation method based o…

Code Generation

Code Search based on Context-aware Code Translation

2022-02-16 · Weisong Sun, Chunrong Fang, Yuchen Chen, Guanhong Tao 외

Code search is a widely used technique by developers during software development. It provides semantically similar implementations from a large code corpus to developers based on their queries. Existing techniques levera…

Code SearchCode TranslationTranslation