Skip to main content

Context-Dependent Text-to-SQL Generation with Intermediate Representation

  • Conference paper
  • First Online:
PRICAI 2023: Trends in Artificial Intelligence (PRICAI 2023)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 14325))

Included in the following conference series:

  • 708 Accesses

Abstract

In recent years, the Text-to-SQL task has become a research hotspot in semantic analysis. Among them, context-dependent Text-to-SQL task has received more and more attention as it meets the needs of actual scenarios. The core of the problem is how to use historical interaction information and database schema to understand the context. Most existing research ignores the structure of SQL queries and introduces low-level information such as variable names and parameters, and the mismatch problem between intents expressed in utterance and the implementation details in SQL still exists. In this paper, SemQL is applied to serve as an intermediate representation between utterance and SQL, meanwhile, the Coarse-to-Fine neural architecture is adopted to decompose decoding process of SemQL into two stages. We validated the performance of our model on SParC and CoSQL datasets, which outperforms the existing ones and achieves excellent results on both datasets.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Zelle, J.M., Mooney, R.J.: Learning to parse database queries using inductive logic programming. In: Proceedings of the Thirteenth National Conference on Artificial Intelligence and Eighth Innovative Applications of Artificial Intelligence Conference, AAAI 96, IAAI 96, Portland, Oregon, USA, August 4–8, 1996, vol. 2, pp. 1050–1055. AAAI Press/The MIT Press (1996)

    Google Scholar 

  2. Zhong, V., Xiong, C., Socher, R.: Seq2SQL: generating structured queries from natural language using reinforcement learning. CoRR abs/1709.00103 (2017)

    Google Scholar 

  3. Yu, T., et al.: Spider: a large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pp. 3911–3921. Association for Computational Linguistics (2018)

    Google Scholar 

  4. Zhang, X., Yin, F., Ma, G., Ge, B., Xiao, W.: M-SQL: multi-task representation learning for single-table text2SQL generation. IEEE Access 8, 43156–43167 (2020)

    Article  Google Scholar 

  5. Kelkar, A., Relan, R., Bhardwaj, V., Vaichal, S., Relan, P.: Bertrand-DR: improving text-to-SQL using a discriminative re-ranker. CoRR abs/2002.00557 (2020)

    Google Scholar 

  6. Cao, R., Chen, L., Chen, Z., Zhao, Y., Zhu, S., Yu, K.: LGESQL: line graph enhanced text-to-SQL model with mixed local and non-local relations. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1–6, 2021, pp. 2541–2555. Association for Computational Linguistics (2021)

    Google Scholar 

  7. LeClair, A., Haque, S., Wu, L., McMillan, C.: Improved code summarization via a graph neural network. In: ICPC 2020: 28th International Conference on Program Comprehension, Seoul, Republic of Korea, July 13–15, 2020, pp. 184–195. ACM (2020)

    Google Scholar 

  8. Huang, J., Wang, Y., Wang, Y., Dong, Y., Xiao, Y.: Relation aware semi-autoregressive semantic parsing for NL2SQL. CoRR abs/2108.00804 (2021)

    Google Scholar 

  9. Yu, T., et al.: SParC: cross-domain semantic parsing in context. In: Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 4511–4523. Association for Computational Linguistics (2019)

    Google Scholar 

  10. Yu, T., et al.: CoSQL: a conversational text-to-SQL challenge towards cross-domain natural language interfaces to databases. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3–7, 2019, pp. 1962–1979. Association for Computational Linguistics (2019)

    Google Scholar 

  11. Zhang, R., et al.: Editing-based SQL query generation for cross-domain context-dependent questions. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3–7, 2019, pp. 5337–5348. Association for Computational Linguistics (2019)

    Google Scholar 

  12. Cai, Y., Wan, X.: IGSQL: database schema interaction graph based neural model for context-dependent text-to-SQL generation. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16–20, 2020, pp. 6903–6912. Association for Computational Linguistics (2020)

    Google Scholar 

  13. Yu, W., Chang, T., Guo, X., Wang, M., Wang, X.: An interaction-modeling mechanism for context-dependent text-to-SQL translation based on heterogeneous graph aggregation. Neural Netw. 142, 573–582 (2021)

    Article  Google Scholar 

  14. Dong, L., Lapata, M.: Coarse-to-fine decoding for neural semantic parsing. In: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15–20, 2018, Volume 1: Long Papers, pp. 731–742. Association for Computational Linguistics (2018)

    Google Scholar 

  15. Lei, W., et al.: Re-examining the role of schema linking in text-to-SQL. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16–20, 2020, pp. 6943–6954. Association for Computational Linguistics (2020)

    Google Scholar 

  16. Guo, J., et al.: Towards complex text-to-SQL in cross-domain database with intermediate representation. In: Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 4524–4535. Association for Computational Linguistics (2019)

    Google Scholar 

  17. Hui, B., et al.: Improving text-to-SQL with schema dependency learning. CoRR abs/2103.04399 (2021)

    Google Scholar 

  18. Chen, Z., et al.: ShadowGNN: graph projection neural network for text-to-SQL parser. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6–11, 2021, pp. 5567–5577. Association for Computational Linguistics (2021)

    Google Scholar 

  19. Rubin, O., Berant, J.: SmBoP: semi-autoregressive bottom-up semantic parsing. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6–11, 2021, pp. 311–324. Association for Computational Linguistics (2021)

    Google Scholar 

  20. Devlin, J., Chang, M., Lee, K., Toutanova, K.: BERT: pre-training of deep bidirectional transformers for language understanding. In: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2–7, 2019, Volume 1 (Long and Short Papers), pp. 4171–4186. Association for Computational Linguistics (2019)

    Google Scholar 

  21. Hwang, W., Yim, J., Park, S., Seo, M.: A comprehensive exploration on WikiSQL with table-aware word contextualization. CoRR abs/1902.01069 (2019)

    Google Scholar 

  22. Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7–9, 2015, Conference Track Proceedings (2015)

    Google Scholar 

Download references

Acknowledgement

This work was supported by National Natural Science Foundation of China (No.61962039) and Inner Mongolia Natural Science Foundation (No.2019MS06032).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Junfeng Zhao .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Gao, X., Zhao, J. (2024). Context-Dependent Text-to-SQL Generation with Intermediate Representation. In: Liu, F., Sadanandan, A.A., Pham, D.N., Mursanto, P., Lukose, D. (eds) PRICAI 2023: Trends in Artificial Intelligence. PRICAI 2023. Lecture Notes in Computer Science(), vol 14325. Springer, Singapore. https://doi.org/10.1007/978-981-99-7019-3_21

Download citation

  • DOI: https://doi.org/10.1007/978-981-99-7019-3_21

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-99-7018-6

  • Online ISBN: 978-981-99-7019-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics