Research Article

Application of a Large Language Model Incorporating Semantic Information of Data in the SQL Generation Task

Nianlong Zhang*
School of Computer Science and Technology, Zhejiang Normal University, Jinhua, Zhejiang, China

* Corresponding author: [email protected]

Abstract

In the era of big data, data analysis is crucial to enterprise decision-making, but the traditional SQL query writing poses a challenge for non-professionals. With the rapid development of NLP technology, large language models (LLM) such as BERT and GPT have shown strong capabilities. In this paper, the template filling method is used to study the NI2SQL task in the single table scenario and design query templates containing multiple slot bits. The experimental results show that the constructed model achieves high logical form accuracy (LX) and execution accuracy (EX) in both the validation set and the test set, and improves the fault tolerance through fuzzy matching. In addition, the model also performs well in each sub-task, and the introduction of word and table field similarity (sim) further improves the accuracy of conditional value prediction.

Keywords: large language model; SQL generation; data semantic information; natural language processing
Published: February 21, 2025
DOI: 10.54254/2755-2721/2025.21094
Volume: ACE Vol.118
pp. 141-144
Download PDF

References

  1. Zhang Q , Dong J , Chen H ,et al.Structure Guided Large Language Model for SQL Generation[J]. 2024.
  2. Wu Z .Large Language Model Based Semantic Parsing for Intelligent Database Query Engine[J].Journal of Computer and Communications, 2024, 12(10):13.DOI:10.4236/jcc.2024.1210001.
  3. Di Martino B , Graziano M , Colucci Cante L .Semantic, Business Process andNatural Language Processing foreBuilding[C]//International Conference on Complex, Intelligent, and Software Intensive Systems.Springer, Cham, 2024.DOI:10.1007/978-3-031-70011-8_35.
  4. Peng H .Chinese Natural Language Processing: From Text Categorization to Machine Translation[J].Applied Mathematics and Nonlinear Sciences, 2024, 9(1).DOI:10.2478/amns-2024-1860.
  5. Nakpih C I .A modified Vector Space Model for semantic information retrieval[J].Natural Language Processing Journal, 2024, 8.DOI:10.1016/j.nlp.2024.100081.