Skip to main content

Learning Seq2Seq Model with Dynamic Schema Linking for NL2SQL

  • Conference paper
  • First Online:
CCKS 2022 - Evaluation Track (CCKS 2022)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1711))

Included in the following conference series:

  • 537 Accesses

Abstract

NL2SQL (Natural Language to SQL) is a cutting-edge problem in the field of semantic parsing and TableQA. “CCKS2022: Financial NL2SQL Evaluation” raises a challenging scenario for building NL2SQL systems in the financial domain. To deal with the problem of small-scale data and the requirement of adapting to financial scenarios, we propose an NL2SQL approach to automatically converts natural language questions into SQL queries to achieve accurate table question answering. We use cross-validation and schema linking method that fuses table-column-value information to make full use of all the training data. Then we train a Transformer-based Seq2Seq semantic parsing model with T5 as pre-training model to understand common questions in the financial field and parse the database’s tables, attributes, foreign keys and other complex relationships, and finally generate SQL queries. Experiments are conducted to test the effectiveness of our strategy. Our best ensemble model achieves EM score of 0.287 on testing set and ranks 2nd in the competition.

X. Ning and Y. Zhao—The first two authors contributed equally to the work.

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 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.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

References

  1. Hyeonji, K., et al.: Natural language to SQL: where are we today? In: Proceedings of the VLDB Endowment, vol. 13.10, pp. 1737–1750 (2020)

    Google Scholar 

  2. Zhong, V., Xiong, C., Socher, R.: Seq2sql: generating structured queries from natural language using reinforcement learning. In: 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: EMNLP, pp. 3911–3921 (2018)

    Google Scholar 

  4. He, P., Mao, Y., Chakrabarti, K., et al.: X-SQL: reinforce schema representation with context. arXiv:1908.08113 (2019)

  5. Xuan, K., Wang, Y., Wang, Y., et al.: Sead: end-to-end text-to-sql generation with schema-aware denoising. arXiv:2105.07911 (2021)

  6. Guo, J., et al.: Towards complex text-to-sql in cross-domain database with intermediate representation. In: ACL, pp. 4524–4535 (2019)

    Google Scholar 

  7. Wang, B., Shin, R., Liu, X., et al.: RAT-SQL: relation-aware schema encoding and linking for text-to-SQL parsers. In: ACL (2020)

    Google Scholar 

  8. Dou, L., Gao, Y., Pan, M., et al.: UniSAr: A Unified Structure-Aware Autoregressive Language Model for Text-to-SQL. arXiv:2203.07781 (2022)

  9. Hui, B., Shi, X., Geng, R., et al.: Improving text-to-sql with schema dependency learning. arXiv:2103.04399 (2021)

  10. Raffel, C., Shazeer, N., Roberts, A., et al.: Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res. 21(140), 1–67 (2020)

    MathSciNet  MATH  Google Scholar 

  11. Vaswani, A., et al.: Attention is all you need. In: Proceedings of the 31st International Conference on Neural Information Processing Systems (NIPS'17), pp. 6000–6010. Curran Associates Inc., Red Hook, NY, USA (2017)

    Google Scholar 

  12. t5-base-Chinese. https://huggingface.co/lemon234071/t5-base-Chinese. Accessed 2021

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jie liu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 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

Ning, X., Zhao, Y., liu, J. (2022). Learning Seq2Seq Model with Dynamic Schema Linking for NL2SQL. In: Zhang, N., Wang, M., Wu, T., Hu, W., Deng, S. (eds) CCKS 2022 - Evaluation Track. CCKS 2022. Communications in Computer and Information Science, vol 1711. Springer, Singapore. https://doi.org/10.1007/978-981-19-8300-9_16

Download citation

  • DOI: https://doi.org/10.1007/978-981-19-8300-9_16

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-19-8299-6

  • Online ISBN: 978-981-19-8300-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics