CoSQA: 20,000+ Web Queries for Code Search and Question Answering

Junjie Huang, Duyu Tang, Linjun Shou, Ming Gong, Ke Xu +3 more
5/27/2021
cs.CLcs.SE

Official code: Jun-jie-Huang/CoCLR (47 stars, Python, MIT, last commit 2022-11-02).

Abstract

Finding codes given natural language query isb eneficial to the productivity of software developers. Future progress towards better semantic matching between query and code requires richer supervised training resources.

Show full abstract

To remedy this, we introduce the CoSQA dataset.It includes 20,604 labels for pairs of natural language queries and codes, each annotated by at least 3 human annotators. We further introduce a contrastive learning method dubbed CoCLR to enhance query-code matching, which works as a data augmenter to bring more artificially generated training instances. We show that evaluated on CodeXGLUE with the same CodeBERT model, training on CoSQA improves the accuracy of code question answering by 5.1%, and incorporating CoCLR brings a further improvement of 10.5%.

View on arXivView PDF

Code Implementations(1)

MIT

Source Code for ACL-21 main conference paper "CoSQA: 20,000+ Web Queries for Code Search and Question Answering".

477PythonMay 24, 20214 years agoMIT

Similar Papers

Cite this paper

@article{huang2021cosqa,
  title  = {CoSQA: 20,000+ Web Queries for Code Search and Question Answering},
  author = {Junjie Huang and Duyu Tang and Linjun Shou and Ming Gong and Ke Xu and Daxin Jiang and Ming Zhou and Nan Duan},
  year   = {2021},
  eprint = {2105.13239},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.13239}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.13239.svg)](https://codeofpaper.com/paper/2105.13239)

Discussion