Enriching Query Semantics for Code Search with Reinforcement Learning

Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior s...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:arXiv.org 2021-05
Hauptverfasser: Wang, Chaozheng, Zhenghao Nong, Gao, Cuiyun, Li, Zongjie, Zeng, Jichuan, Xing, Zhenchang, Liu, Yang
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title arXiv.org
container_volume
creator Wang, Chaozheng
Zhenghao Nong
Gao, Cuiyun
Li, Zongjie
Zeng, Jichuan
Xing, Zhenchang
Liu, Yang
description Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models.
format Article
fullrecord <record><control><sourceid>proquest</sourceid><recordid>TN_cdi_proquest_journals_2530248553</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2530248553</sourcerecordid><originalsourceid>FETCH-proquest_journals_25302485533</originalsourceid><addsrcrecordid>eNqNjc0KwjAQhIMgWLTvsOC5EDet9l4qHrz4cy8lbm2K3WiSIr69OfgAngbm-4aZiQSV2mRljrgQqfeDlBK3OywKlYi6Zmd0b_gOp4ncBy40thyM9tBZB5W9Uaxap3t4m9DDmQxHoGkkDnCMhON2JeZd-_CU_nIp1vv6Wh2yp7OviXxoBjs5jqjBQknMy3iu_rO-ZYY6vQ</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>2530248553</pqid></control><display><type>article</type><title>Enriching Query Semantics for Code Search with Reinforcement Learning</title><source>Freely Accessible Journals</source><creator>Wang, Chaozheng ; Zhenghao Nong ; Gao, Cuiyun ; Li, Zongjie ; Zeng, Jichuan ; Xing, Zhenchang ; Liu, Yang</creator><creatorcontrib>Wang, Chaozheng ; Zhenghao Nong ; Gao, Cuiyun ; Li, Zongjie ; Zeng, Jichuan ; Xing, Zhenchang ; Liu, Yang</creatorcontrib><description>Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models.</description><identifier>EISSN: 2331-8422</identifier><language>eng</language><publisher>Ithaca: Cornell University Library, arXiv.org</publisher><subject>Descriptions ; Enrichment ; Queries ; Searching ; Semantics ; Source code</subject><ispartof>arXiv.org, 2021-05</ispartof><rights>2021. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>776,780</link.rule.ids></links><search><creatorcontrib>Wang, Chaozheng</creatorcontrib><creatorcontrib>Zhenghao Nong</creatorcontrib><creatorcontrib>Gao, Cuiyun</creatorcontrib><creatorcontrib>Li, Zongjie</creatorcontrib><creatorcontrib>Zeng, Jichuan</creatorcontrib><creatorcontrib>Xing, Zhenchang</creatorcontrib><creatorcontrib>Liu, Yang</creatorcontrib><title>Enriching Query Semantics for Code Search with Reinforcement Learning</title><title>arXiv.org</title><description>Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models.</description><subject>Descriptions</subject><subject>Enrichment</subject><subject>Queries</subject><subject>Searching</subject><subject>Semantics</subject><subject>Source code</subject><issn>2331-8422</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2021</creationdate><recordtype>article</recordtype><sourceid>BENPR</sourceid><recordid>eNqNjc0KwjAQhIMgWLTvsOC5EDet9l4qHrz4cy8lbm2K3WiSIr69OfgAngbm-4aZiQSV2mRljrgQqfeDlBK3OywKlYi6Zmd0b_gOp4ncBy40thyM9tBZB5W9Uaxap3t4m9DDmQxHoGkkDnCMhON2JeZd-_CU_nIp1vv6Wh2yp7OviXxoBjs5jqjBQknMy3iu_rO-ZYY6vQ</recordid><startdate>20210520</startdate><enddate>20210520</enddate><creator>Wang, Chaozheng</creator><creator>Zhenghao Nong</creator><creator>Gao, Cuiyun</creator><creator>Li, Zongjie</creator><creator>Zeng, Jichuan</creator><creator>Xing, Zhenchang</creator><creator>Liu, Yang</creator><general>Cornell University Library, arXiv.org</general><scope>8FE</scope><scope>8FG</scope><scope>ABJCF</scope><scope>ABUWG</scope><scope>AFKRA</scope><scope>AZQEC</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>HCIFZ</scope><scope>L6V</scope><scope>M7S</scope><scope>PIMPY</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>PRINS</scope><scope>PTHSS</scope></search><sort><creationdate>20210520</creationdate><title>Enriching Query Semantics for Code Search with Reinforcement Learning</title><author>Wang, Chaozheng ; Zhenghao Nong ; Gao, Cuiyun ; Li, Zongjie ; Zeng, Jichuan ; Xing, Zhenchang ; Liu, Yang</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-proquest_journals_25302485533</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2021</creationdate><topic>Descriptions</topic><topic>Enrichment</topic><topic>Queries</topic><topic>Searching</topic><topic>Semantics</topic><topic>Source code</topic><toplevel>online_resources</toplevel><creatorcontrib>Wang, Chaozheng</creatorcontrib><creatorcontrib>Zhenghao Nong</creatorcontrib><creatorcontrib>Gao, Cuiyun</creatorcontrib><creatorcontrib>Li, Zongjie</creatorcontrib><creatorcontrib>Zeng, Jichuan</creatorcontrib><creatorcontrib>Xing, Zhenchang</creatorcontrib><creatorcontrib>Liu, Yang</creatorcontrib><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>Materials Science &amp; Engineering Collection</collection><collection>ProQuest Central (Alumni Edition)</collection><collection>ProQuest Central UK/Ireland</collection><collection>ProQuest Central Essentials</collection><collection>ProQuest Central</collection><collection>Technology Collection (ProQuest)</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central Korea</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Engineering Collection</collection><collection>Engineering Database</collection><collection>Publicly Available Content Database</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central China</collection><collection>Engineering Collection</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Wang, Chaozheng</au><au>Zhenghao Nong</au><au>Gao, Cuiyun</au><au>Li, Zongjie</au><au>Zeng, Jichuan</au><au>Xing, Zhenchang</au><au>Liu, Yang</au><format>book</format><genre>document</genre><ristype>GEN</ristype><atitle>Enriching Query Semantics for Code Search with Reinforcement Learning</atitle><jtitle>arXiv.org</jtitle><date>2021-05-20</date><risdate>2021</risdate><eissn>2331-8422</eissn><abstract>Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models.</abstract><cop>Ithaca</cop><pub>Cornell University Library, arXiv.org</pub><oa>free_for_read</oa></addata></record>
fulltext fulltext
identifier EISSN: 2331-8422
ispartof arXiv.org, 2021-05
issn 2331-8422
language eng
recordid cdi_proquest_journals_2530248553
source Freely Accessible Journals
subjects Descriptions
Enrichment
Queries
Searching
Semantics
Source code
title Enriching Query Semantics for Code Search with Reinforcement Learning
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-02-06T05%3A22%3A07IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=document&rft.atitle=Enriching%20Query%20Semantics%20for%20Code%20Search%20with%20Reinforcement%20Learning&rft.jtitle=arXiv.org&rft.au=Wang,%20Chaozheng&rft.date=2021-05-20&rft.eissn=2331-8422&rft_id=info:doi/&rft_dat=%3Cproquest%3E2530248553%3C/proquest%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_pqid=2530248553&rft_id=info:pmid/&rfr_iscdi=true