StaQC: A Systematically Mined Question-Code Dataset from Stack Overflow

By Ziyu Yao, Daniel S. Weld, Wei-Peng Chen, Huan Sun. 2018

113 citations recorded by the source corpus.

Stack Overflow (SO) has been a great source of natural language questions and their code solutions (i.e., question-code pairs), which are critical for many tasks including code retrieval and annotation. In most existing research, question-code pairs were collected heuristically and tend to have low quality. In this paper, we investigate a new problem of systematically mining question-code pairs from Stack Overflow (in contrast to heuristically collecting them). It is formulated as predicting whether or not a code snippet is a standalone solution to a question. We propose a novel Bi-View Hierarchical Neural Network which can capture both the programming content and the textual context of a code snippet (i.e., two views) to make a prediction. On two manually annotated datasets in Python and SQL domain, our framework substantially outperforms heuristic methods with at least 15% higher F1 and accuracy. Furthermore, we present StaQC (Stack Overflow Question-Code pairs), the largest dataset to date of ~148K Python and ~120K SQL question-code pairs, automatically mined from SO using our framework. Under various case studies, we demonstrate that StaQC can greatly help develop data-hungry models for associating natural language with programming language

Subfields: Artificial Intelligence, Information Systems, Evaluation & Benchmarks, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Graham Neubig
  2. Nan Duan
  3. Luke S. Zettlemoyer
  4. Jianfeng Gao
  5. Mohit Bansal
  6. Frank F. Xu
  7. Miltiadis Allamanis
  8. Percy Liang

In Information Systems

  1. Prem Devanbu
  2. Graham Neubig
  3. Nan Duan
  4. Daya Guo
  5. Neel Sundaresan
  6. Toufique Ahmed
  7. Alexey Svyatkovskiy
  8. Miltiadis Allamanis

In Evaluation & Benchmarks

  1. Neel Sundaresan
  2. Michele Tufano
  3. Alexey Svyatkovskiy
  4. Rajarshi Das
  5. Luke S. Zettlemoyer
  6. Shao Kun Deng
  7. Zhengbao Jiang
  8. Marc Brockschmidt

In Code Generation & Program Synthesis

  1. Graham Neubig
  2. Frank F. Xu
  3. Bogdan Vasilescu
  4. Marc Brockschmidt
  5. Michael D. Ernst
  6. Ge Li
  7. Luke S. Zettlemoyer
  8. Chenglong Wang

Citations in the corpus