Text-to-SQL Error Correction with Language Models of Code

  • 2023-05-28 16:32:26
  • Ziru Chen, Shijie Chen, Michael White, Raymond Mooney, Ali Payani, Jayanth Srinivasa, Yu Su, Huan Sun
  • 0


Despite recent progress in text-to-SQL parsing, current semantic parsers arestill not accurate enough for practical use. In this paper, we investigate howto build automatic text-to-SQL error correction models. Noticing thattoken-level edits are out of context and sometimes ambiguous, we proposebuilding clause-level edit models instead. Besides, while most language modelsof code are not specifically pre-trained for SQL, they know common datastructures and their operations in programming languages such as Python. Thus,we propose a novel representation for SQL queries and their edits that adheresmore closely to the pre-training corpora of language models of code. Our errorcorrection model improves the exact set match accuracy of different parsers by2.4-6.5 and obtains up to 4.3 point absolute improvement over two strongbaselines. Our code and data are available athttps://github.com/OSU-NLP-Group/Auto-SQL-Correction.


Quick Read (beta)

loading the full paper ...