Improved NL2SQL method based on generative large language model

The invention is suitable for the technical field of natural language processing, and provides an improved NL2SQL method based on a generative large language model, which comprises the following steps: S1, preprocessing table information of a database; s2, preprocessing the natural language question...

Full description

Saved in:
Bibliographic Details
Main Authors XU JIWEI, DUAN CHUNXIAN, FU ZHUO, HAN XIAOLE, LI XIAOCHAO, CHEN SHENGPENG, LEI ZHEN, LIU MENGJUN, XIA WEI, WANG JINGPEI, LI YING, WANG FENG, LIU GAO
Format Patent
LanguageChinese
English
Published 29.09.2023
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:The invention is suitable for the technical field of natural language processing, and provides an improved NL2SQL method based on a generative large language model, which comprises the following steps: S1, preprocessing table information of a database; s2, preprocessing the natural language question sentences; s3, matching a target table; s4, outputting a large language model result; and S5, extracting the SQL statement and outputting the SQL statement. According to the method, the generative large language model is used, the prompt statement is constructed in a thinking chain mode to improve the matching precision, end-to-end retraining is not needed, and the method is better in applicability in an actual production environment in which a database table structure is frequently updated. Besides, the database query semantic recognition problem under the multi-table repeated column interference environment in the actual production environment is solved by adopting a mode of pre-calculating table and column weig
Bibliography:Application Number: CN202311070932