A Knowledge-driven Intelligent Query Model and its Application in Tobacco Marketing Management
Xiao Chen, Liang Xiao, Feng Shen, Jianxia Chen, Shun Wang, Xinyu Liu, Wenxin Liu, Wanying Bao · 2025
Generating accurate SQL from natural language queries has been a long-standing challenge in the field of natural language processing (NLP). This problem's complexity lies not only in the system's ability to understand the user-inputted natural language query, but also its need for deep comprehension of the underlying database structure. Current research primarily focuses on fine-tuning large language model, which cannot enable the adaptability of these models to ever-changing business scenarios. We propose, in this paper, a knowledge-driven intelligent query model that utilizes natural language processing (NLP), knowledge graph, and large language model that together convert natural language queries into structured SQL queries in real-time. The knowledge graph is designed to match query scenarios to domain concepts and relationships that eventually facilitate the construction of SQL statements. The large language model can be fed with the most relevant cases chosen against the ongoing query request, and its generation of SQL statements governed by a quality control algorithm. A dual-path result validation and mutual learning module is further designed and situated between the knowledge graph and large language model, improving the query accuracy and adapting the model to suit future business needs in an intelligent manner. A tobacco marketing management system has been implemented on the basis of the model, and deployed in Jingzhou municipal tobacco marketing management, Hubei Province of China. The result proves to be effective in improving daily query productivity and data-driven decision support.