A method and device for generating SQL statements based on natural language
A natural language and sentence technology, applied in the field of data processing, can solve problems such as insufficient data analysis and processing capabilities, and achieve the effect of strong data analysis and processing capabilities and wide application prospects
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0030] The embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0031] see figure 1 , the present invention generates the method for SQL statement according to natural language as follows:
[0032] 1) For natural language N, use some sentence vector generation methods to get sentence vector N s .
[0033] 2) For the table descriptions of all the tables in the database to be checked, use the sentence vector generation method to obtain the description vector T of each table i .
[0034] 3) Use the vector correlation calculation method to calculate the description vector T of each table i and natural language sentence vector N s The correlation between, select the top n tables with the highest correlation as candidates, and n is a preset parameter.
[0035] 4) For the natural language N, use the semantic analysis algorithm to convert it into a corresponding SQL template, in the form of "select{agg}([...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 
