Translating Natural Language Queries to SQL Using the T5 Model (2312.12414v1)
Abstract: This paper presents the development process of a natural language to SQL model using the T5 model as the basis. The models, developed in August 2022 for an online transaction processing system and a data warehouse, have a 73\% and 84\% exact match accuracy respectively. These models, in conjunction with other work completed in the research project, were implemented for several companies and used successfully on a daily basis. The approach used in the model development could be implemented in a similar fashion for other database environments and with a more powerful pre-trained LLM.
- R. Rashed Mohassel, A. Fung, F. Mohammadi, and K. Raahemifar, “A survey on Advanced Metering Infrastructure,” International Journal of Electrical Power and Energy Systems, vol. 63, pp. 473–484, 2014.
- A. Wong, D. Joiner, C. Chiu, M. Elsayed, K. Pereira, Y. Khmelevsky, and J. Mahony, “A Survey of Natural Language Processing Implementation for Data Query Systems,” in RASSE 2021 - IEEE International Conference on Recent Advances in Systems Science and Engineering, Proceedings, 2021.
- K. Affolter, K. Stockinger, and A. Bernstein, “A comparative survey of recent natural language interfaces for databases,” VLDB Journal, vol. 28, no. 5, pp. 793–819, 10 2019.
- H. Li, J. Zhang, C. Li, and H. Chen, “RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL,” in Proceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence (AAAI), 2 2023. [Online]. Available: http://arxiv.org/abs/2302.05965
- J. Li, B. Hui, R. Cheng, B. Qin, C. Ma, N. Huo, F. Huang, W. Du, L. Si, and Y. Li, “Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsing,” 1 2023. [Online]. Available: http://arxiv.org/abs/2301.07507
- M. Pourreza and D. Rafiei, “DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction,” arXiv preprint arXiv:2304.11015, 4 2023. [Online]. Available: http://arxiv.org/abs/2304.11015
- D. Joiner, M. Clement, S. Chan, K. Pereira, A. Wong, Y. Khmelevsky, J. Mahony, and M. Ferri, “DW vs OLTP Performance Optimization in the Cloud on PostgreSQL (A Case Study),” in RASSE 2022 - IEEE International Conference on Recent Advances in Systems Science and Engineering, Symposium Proceedings, 2022.
- M. Uma, V. Sneha, G. Sneha, J. Bhuvana, and B. Bharathi, “Formation of SQL from Natural Language Queryusing NLP,” in 2019 International Conference on Computational Intelligence in Data Science (ICCIDS). IEEE, 2019.
- N. Deng, Y. Chen, and Y. Zhang, “Recent Advances in Text-to-SQL: A Survey of What We Have and What We Expect,” arXiv preprint arXiv:2208.10099., 8 2022. [Online]. Available: http://arxiv.org/abs/2208.10099
- T. Yu, R. Zhang, K. Yang, M. Yasunaga, D. Wang, Z. Li, J. Ma, I. Li, Q. Yao, S. Roman, Z. Zhang, and D. Radev, “Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task,” arXiv preprint arXiv:1809.08887, 9 2018. [Online]. Available: http://arxiv.org/abs/1809.08887
- Q. Li, L. Li, Q. Li, and J. Zhong, “A Comprehensive Exploration on Spider with Fuzzy Decision Text-to-SQL Model,” IEEE Transactions on Industrial Informatics, vol. 16, no. 4, pp. 2542–2550, 4 2020.
- T. Guo and H. Gao, “Content Enhanced BERT-based Text-to-SQL Generation,” arXiv preprint arXiv:1910.07179, 10 2019. [Online]. Available: http://arxiv.org/abs/1910.07179
- V. Zhong, C. Xiong, and R. Socher, “Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning,” arXiv preprint arXiv:1709.00103., 8 2017. [Online]. Available: http://arxiv.org/abs/1709.00103
- Y. Mellah, E. H. Ettifouri, A. Rhouati, W. Dahhane, T. Bouchentouf, and M. G. Belkasmi, “SQL Generation from Natural Language Using Supervised Learning and Recurrent Neural Networks,” in Lecture Notes in Networks and Systems. Springer, 2021, vol. 144, pp. 175–183.
- B. Bogin, M. Gardner, and J. Berant, “Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing,” arXiv preprint arXiv:1905.06241., 5 2019. [Online]. Available: http://arxiv.org/abs/1905.06241
- Z. Chen, L. Chen, Y. Zhao, R. Cao, Z. Xu, S. Zhu, and K. Yu, “ShadowGNN: Graph Projection Neural Network for Text-to-SQL Parser,” arXiv preprint arXiv:2104.04689, 4 2021. [Online]. Available: http://arxiv.org/abs/2104.04689
- B. Hui, R. Geng, L. Wang, B. Qin, B. Li, J. Sun, and Y. Li, “S2SQL: Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parsers,” arXiv preprint arXiv:2203.06958., 3 2022. [Online]. Available: http://arxiv.org/abs/2203.06958
- R. Cai, J. Yuan, B. Xu, and Z. Hao, “SADGA: Structure-Aware Dual Graph Aggregation Network for Text-to-SQL,” Neural Information Processing Systems, 34, 7664-7676., vol. 34, pp. 7664–7676, 10 2021. [Online]. Available: http://arxiv.org/abs/2111.00653
- B. Wang, R. Shin, X. Liu, O. Polozov, and M. Richardson, “RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers,” arXiv preprint arXiv:1911.04942, 11 2019. [Online]. Available: http://arxiv.org/abs/1911.04942
- J. Pennington, R. Socher, and C. D. Manning, “GloVe: Global Vectors for Word Representation,” in Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), 2014, pp. 1532–1543. [Online]. Available: http://nlp.
- S. Ferreira, G. Leitão, I. Silva, A. Martins, and P. Ferrari, “Evaluating human-machine translation with attention mechanisms for industry 4.0 environment SQL-based systems,” in IEEE International Workshop on Metrology for Industry 4.0 & IoT, 2020, pp. 229–234.
- H. Vathsala and S. Koolagudi, “NLP2SQL Using Semi-supervised Learning,” in Advanced Computing: 10th International Conference, IACC 2020, Panaji, Goa, India, December 5–6, 2020 , Revised Selected Papers, Part I 10. Springer, 2021, pp. 288–299.
- X. Xu, C. Liu, and D. Song, “SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning,” arXiv preprint arXiv:1711.04436, 11 2017. [Online]. Available: http://arxiv.org/abs/1711.04436
- H. Wang, J. Li, H. Wu, E. Hovy, and Y. Sun, “Pre-Trained Language Models and Their Applications,” Engineering, 9 2022.
- U. Brunner and K. Stockinger, “ValueNet: A Natural Language-to-SQL System that Learns from Database Information,” in 2021 IEEE 37th International Conference on Data Engineering (ICDE, 2021, pp. 2177–2182. [Online]. Available: https://yale-lily.github.io/spider
- W. Hwang, J. Yim, S. Park, and M. Seo, “A Comprehensive Exploration on WikiSQL with Table-Aware Word Contextualization,” arXiv preprint arXiv:1902.01069, 2 2019. [Online]. Available: http://arxiv.org/abs/1902.01069
- D. Choi, M. C. Shin, E. Kim, and D. R. Shin, “RYANSQL: Recursively Applying Sketch-based Slot Fillings for Complex Text-to-SQL in Cross-Domain Databases,” Computational Linguistics, vol. 47, no. 2, pp. 309–332, 4 2020. [Online]. Available: http://arxiv.org/abs/2004.03125
- J. Guo, Z. Zhan, Y. Gao, Y. Xiao, J.-G. Lou, T. Liu, and D. Zhang, “Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation,” arXiv preprint arXiv:1905.08205, 5 2019. [Online]. Available: http://arxiv.org/abs/1905.08205
- R. Cao, L. Chen, Z. Chen, Y. Zhao, S. Zhu, and K. Yu, “LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations,” arXiv preprint arXiv:2106.01093., 6 2021. [Online]. Available: http://arxiv.org/abs/2106.01093
- Y. Elazar, N. Kassner, S. Ravfogel, A. Ravichander, E. Hovy, H. Schütze, S. Schütze, and Y. Goldberg, “Measuring and Improving Consistency in Pretrained Language Models,” Transactions of the Association for Computational Linguistics, vol. 9, pp. 1012–1031, 2021. [Online]. Available: https://doi.org/10.1162/tacl
- J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” arXiv preprint arXiv:1810.04805., 10 2018. [Online]. Available: http://arxiv.org/abs/1810.04805
- R. Zhang, T. Yu, H. Y. Er, S. Shim, E. Xue, X. V. Lin, T. Shi, C. Xiong, R. Sovher, and D. Radev, “Editing-Based SQL Query Generation for Cross-Domain Context-Dependent Questions,” arXiv preprint arXiv:1909.00786., 2019.
- J. Ma, Z. Yan, S. Pang, Y. Zhang, and J. Shen, “Mention Extraction and Linking for SQL Query Generation,” arXiv preprint arXiv:2012.10074, 12 2020. [Online]. Available: http://arxiv.org/abs/2012.10074http://dx.doi.org/10.18653/v1/2020.emnlp-main.563
- X. V. Lin, R. Socher, and C. Xiong, “Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsing,” arXiv preprint arXiv:2012.12627, 12 2020. [Online]. Available: http://arxiv.org/abs/2012.12627
- P. Shaw, M.-W. Chang, P. Pasupat, and K. Toutanova, “Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?” arXiv preprint arXiv:2010.12725., 10 2020. [Online]. Available: http://arxiv.org/abs/2010.12725
- C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu, “Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer,” The Journal of Machine Learning Research, vol. 21, no. 1, pp. 5485–5551, 10 2019. [Online]. Available: http://arxiv.org/abs/1910.10683
- T. Xie, C. H. Wu, P. Shi, R. Zhong, T. Scholak, M. Yasunaga, C.-S. Wu, M. Zhong, P. Yin, S. I. Wang, V. Zhong, B. Wang, C. Li, C. Boyle, A. Ni, Z. Yao, D. Radev, C. Xiong, L. Kong, R. Zhang, N. A. Smith, L. Zettlemoyer, and T. Yu, “UnifiedSKG: Unifying and Multi-Tasking Structured Knowledge Grounding with Text-to-Text Language Models,” arXiv preprint arXiv:2201.05966, 1 2022. [Online]. Available: http://arxiv.org/abs/2201.05966
- T. Scholak, N. Schucher, and D. Bahdanau, “PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models,” arXiv preprint arXiv:2109.05093, 9 2021. [Online]. Available: http://arxiv.org/abs/2109.05093
- J. Qi, J. Tang, Z. He, X. Wan, Y. Cheng, C. Zhou, X. Wang, Q. Zhang, and Z. Lin, “RASAT: Integrating Relational Structures into Pretrained Seq2Seq Model for Text-to-SQL,” arXiv preprint arXiv:2205.06983., 5 2022. [Online]. Available: http://arxiv.org/abs/2205.06983
- Y. Zhao, J. Jiang, Y. Hu, W. Lan, H. Zhu, A. Chauhan, A. Li, L. Pan, J. Wang, C.-W. Hang, S. Zhang, M. Dong, J. Lilien, P. Ng, Z. Wang, V. Castelli, and B. Xiang, “Importance of Synthesizing High-quality Data for Text-to-SQL Parsing,” arXiv preprint arXiv:2212.08785, 12 2022. [Online]. Available: http://arxiv.org/abs/2212.08785
- L. Zeng, S. H. K. Parthasarathi, and D. Hakkani-Tur, “N-Best Hypotheses Reranking for Text-To-SQL Systems,” in IEEE Spoken Language Technology Workshop (SLT), 10 2022, pp. 663–670. [Online]. Available: http://arxiv.org/abs/2210.10668
- Q. Liu, Z. Ye, T. Yu, P. Blunsom, and L. Song, “Augmenting Multi-Turn Text-to-SQL Datasets with Self-Play,” arXiv preprint arXiv:2210.12096, 10 2022. [Online]. Available: http://arxiv.org/abs/2210.12096
- A. Liu, X. Hu, L. Wen, and P. S. Yu, “A comprehensive evaluation of ChatGPT’s zero-shot Text-to-SQL capability,” arXiv preprint arXiv:2303.13547., 3 2023. [Online]. Available: http://arxiv.org/abs/2303.13547
Collections
Sign up for free to add this paper to one or more collections.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.