Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for converting natural language into SQL (Structured Query Language) statement based on deep learning

A natural language and deep learning technology, applied in the field of obtaining lightweight models, can solve the problems of algorithm time complexity and space complexity need to be improved, inference speed is not fast enough, training time is long, etc., and the method is simple, clear, fast, The effect of small computing resources and improved computing speed

Pending Publication Date: 2022-08-09
BEIJING INSTITUTE OF TECHNOLOGYGY
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] (1) The algorithm is only for the English WikiSQL data set, and can only solve the simple SQL statement generation, only select a single column, and only handle a single AND or OR in the conditional clause;
[0008] (2) X-SQL can only effectively handle English NL2SQL tasks, and the accuracy rate of Chinese NL2SQL tasks is low;
[0009] (3) X-SQL uses a large-scale NLP pre-training model MT-DNN as an encoder. The training time is long, the model calculation consumes a lot of resources, the reasoning speed is not fast enough, and the time complexity and space complexity of the algorithm need to be improved.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for converting natural language into SQL (Structured Query Language) statement based on deep learning

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0047] Given a data table T to be queried "List of transaction information in major cities" and a natural language query question Q "How many cities have the transaction volume in the past four weeks less than 3574 sets and the chain ratio is lower than 69.7%", the Chinese-English NL2SQL based on deep learning The specific implementation details of the model algorithm are as follows:

[0048] Get the target natural language query question text and the column name of the data table, the data example is as follows: "[CLS] cities with a volume of less than 3574 sets in the past four weeks and less than 69.7% month-on-month have several [SEP] cities [SEP] in the past four weeks Weekly Average Transaction [SEP] MoM [SEP]”;

[0049] The SQL statement obtained through the NL2SQL model is as follows: SELECT COUNT city FROM TABLE WHERE chain ratio < 69.7 AND weekly average transaction in the past 4 weeks < 3574;

[0050] The obtained SQL query statement is queried in the query databas...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a method for converting a natural language into an SQL (Structured Query Language) statement based on deep learning, in particular to a technology for obtaining a lightweight model by using a knowledge distillation method, and belongs to the technical fields of database intelligent retrieval, question and answer systems and the like. According to the NL2SQL algorithm based on deep learning, coding training is conducted on natural languages of English and Chinese based on a BERT pre-training model to obtain an NL2SQL model, then a knowledge distillation method is used for obtaining a lightweight NL2SQL model, the model is trained according to a provided NL2SQL task data set, and after natural language questions are input, corresponding SQL statements can be inferred; according to the method, Chinese and English NL2SQL tasks can be processed; the calculation resource consumption of the model is reduced, and the reasoning speed is increased.

Description

technical field [0001] The invention relates to a method for converting natural language into SQL statements based on deep learning, in particular to a light-weight model technology using a knowledge distillation method, and belongs to the technical fields of database intelligent retrieval, question answering system and the like. Background technique [0002] In real life, people are usually accompanied by the generation of massive data in the process of work and life, such as file management, online shopping, banking and so on. In this process, a large amount of structured and semi-structured data is generated, which is generally stored, managed and utilized effectively by using relational databases. Structured Query Language SQL (StructuredQuery Language) is a general-purpose, highly functional database manipulation language. Therefore, the process of querying data in a relational database usually requires interaction by using the SQL query language. However, using SQL q...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/2452G06F16/22G06F16/2455G06F40/30G06F40/253G06N5/02G06N20/00
CPCG06F16/24522G06F16/2282G06F16/2455G06F40/30G06F40/253G06N5/02G06N20/00
Inventor 杨晓春李佳钰王国仁张志威
Owner BEIJING INSTITUTE OF TECHNOLOGYGY
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products