Method for translating big language model natural language problem to SQL (Structured Query Language) query based on cognitive enhancement
By adopting a large language model method based on cognitive enhancement in the translation process of natural language problems to SQL query, training keyword prediction classification models and combining with pattern link processing and other technologies, the problem of incomplete link innovation in the existing technology is solved, and more comprehensive translation results and better task performance are achieved.
Patent Information
- Application Number
- CN202510073091.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-01-14
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-27
AI Technical Summary
In the translation process of natural language problems to SQL query, the prior art focuses only on innovation in one link, while ignoring integrity and comprehensiveness, resulting in poor performance of large language models on this task.
The large language model method based on cognitive enhancement is adopted to train the translated data set through the keyword prediction classification model, and combine pattern link processing, SQL query processing and translation processing to optimize different links from natural language problems to SQL query tasks.
It significantly improves the performance of large language models in natural language problems to SQL query tasks, enhances the understanding of natural language problems and SQL language, and achieves a more comprehensive translation effect.
Smart Images

Figure CN120045583A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language, and particularly relates to a translation method for translating natural language questions into SQL queries based on a large language model with enhanced cognition. Background Art
[0002] The goal of the natural language question to SQL query (Text-to-SQL) translation technology is to convert natural language questions used by humans into corresponding SQL query statements. The value of this technology lies in that it can build a user-friendly database access interface for non-professional users, enabling them to conveniently obtain the required information from the database without mastering complex SQL syntax. With the rapid growth of data volume and the increasing complexity of database application scenarios, the need to query in natural language has become increasingly prominent. Especially in practical scenarios such as hospitals and schools, the application of Text-to-SQL technology is particularly important. In hospitals, medical staff can use this technology to quickly query patients' historical records and the storage status of drugs, and hospital administrators can quickly manage relevant information of all employees without in-depth understanding of the structure of the hospital database and the syntax structure of SQL queries. This technology not only ensures the efficient access and processing of information, but also improves the work efficiency of medical staff, thereby enhancing the quality of medical services. In schools, teachers and administrators can also use Text-to-SQL technology to quickly obtain students' grades, course arrangements, and attendance records through simple natural language questions, helping them conduct teaching management more effectively. This technology that combines natural language with database queries greatly reduces the usage threshold, enabling various institutions to utilize data more flexibly, support faster decision-making and response. In recent years, with the extensive development of large language models, the translation technology from natural language questions to SQL queries has advanced by leaps and bounds, and the accuracy and efficiency of translation have been continuously improved.
[0003] In large language model-based systems, it generally involves three steps: query preparation (SQL Preparation), SQL generation for translating natural language questions, and SQL correction. Existing technologies only focus on innovating one of these links, such as enhancing the large language model's understanding of natural language questions or improving the quality of the generated SQL queries, while ignoring the integrity and comprehensiveness of this process. Summary of the Invention
[0004] To solve the problems and deficiencies in the background art, the present invention provides a translation method for translating natural language questions into SQL queries based on a large language model with enhanced cognition. The present invention comprehensively and integrally improves the three links to maximize the performance of the large language model in this task.
[0005] The technical solution adopted by the present invention includes the following steps:
[0006] S1. Sequentially perform SQL statement processing and merging processing on the natural language questions proposed by users in the database to obtain a translation original data set.
[0007] S2. Sequentially perform screening processing, template processing, augmentation processing, and merging processing on the translation original data set to obtain a translation data set.
[0008] S3. Input the translation data set into a keyword prediction and classification model for training to obtain a trained keyword prediction and classification model.
[0009] S4. Sequentially perform pattern linking processing, keyword prediction and classification model processing, SQL query processing, and translation processing on the natural language question to be translated proposed by the user to obtain a cognition-enhanced natural language question, and sequentially perform two comparison processes and query processing on the cognition-enhanced natural language question to obtain the query result corresponding to the natural language question to be translated proposed by the user.
[0010] The specific steps of step S1 are as follows:
[0011] S11. Perform SQL statement processing on each natural language question proposed by the user in the database to obtain an SQL query statement corresponding to each natural language question.
[0012] S12. Combine each natural language question and the corresponding SQL query statement into a translation data pair, thereby obtaining a number of translation data pairs.
[0013] S13. Merge all translation data pairs to obtain a translation original data set.
[0014] The specific steps of step S2 are as follows:
[0015] S21. According to the preset augmented keywords, screen out the translation original data set without augmented keywords in the translation original data set obtained in step S1.
[0016] S22. Process the translation original data set without augmented keywords using a preset hint template to obtain a hint data set.
[0017] S23. Input the hint data set into a large language model for data augmentation processing to obtain a translation augmented data set.
[0018] S24. Merge the translation original data set screened out in step S21 and the translation augmented data set obtained in step S23 to obtain a translation data set.
[0019] The keyword prediction and classification model in step S3 uses a BERT neural network model or a RoBERTa neural network model.
[0020] Step S4 is specifically as follows:
[0021] S41. Perform pattern linking processing on the natural language question to be translated proposed by the user to obtain a pattern linking result, input the pattern linking result into the trained keyword prediction and classification model to obtain a keyword result, and then perform SQL query processing and translation processing on the keyword result in sequence to obtain a cognition-enhanced natural language question.
[0022] S42. Perform semantic consistency comparison processing, syntactic consistency comparison processing, and query processing on the cognition-enhanced natural language question in sequence to obtain a query result corresponding to the natural language question to be translated proposed by the user.
[0023] Step S41 is specifically as follows:
[0024] S411. Use a pattern linking classification model to perform pattern linking processing on the natural language question to be translated newly proposed by the user to obtain a pattern linking result.
[0025] S412. Input the pattern linking result into the keyword prediction and classification model trained in step S3 to obtain a keyword result.
[0026] S413. Input the pattern linking result, the keyword result, and the natural language question to be translated together into a large language model for SQL query processing to obtain a preliminary SQL query result.
[0027] S414. Input the preliminary SQL query result into the large language model to obtain a cognition-enhanced natural language question.
[0028] The pattern linking classification model in step S411 uses a RoBERTa neural network model.
[0029] Step S42 is specifically as follows:
[0030] S421. Perform semantic consistency comparison processing on the cognition-enhanced natural language question obtained in step S41 and the natural language question to be translated in step S41: If the comparison processing is consistent, return the preliminary SQL query result obtained in step S414. If the comparison processing is inconsistent, the large language model performs semantic correction on the preliminary SQL query result and obtains a semantically corrected SQL query result, and returns the corrected SQL query result.
[0031] S422. Input the SQL query result returned in step S421 into the database for comparison processing of syntax consistency: If the comparison processing shows consistency, use the SQL query result returned in step S421 as the final SQL query result. If the comparison processing shows inconsistency, the large language model corrects the syntax of the SQL query result returned in step S421 to obtain the SQL query result with corrected syntax, and use the SQL query result with corrected syntax as the final SQL query result.
[0032] S423. Input the final SQL query result into the large language model for query processing to obtain the query result corresponding to the natural language question to be translated raised by the user.
[0033] The large language models in step S23, step S413, step S414, step S421, step S422 and step S423 all adopt text language models.
[0034] The innovation of the present invention lies in first training the translation data set using a keyword prediction and classification model, then comprehensively processing the natural language question to be translated raised by the user into a cognition-enhanced natural language question, and then processing the cognition-enhanced natural language question to obtain the final result. The present invention realizes the beneficial effect of optimizing the large language model in different links of the natural language question to SQL query task, and has the advantage of enhancing the large language model's understanding of the natural language question to SQL query task and SQL language.
[0035] The beneficial effects of the present invention are as follows:
[0036] 1. By imitating the human thinking process and comprehensively optimizing the large language model in different links of the natural language question to SQL query task using the idea based on cognition enhancement, the performance of the large language model is improved.
[0037] 2. Enhance the large language model's understanding of the natural language question to SQL query task and SQL language. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flowchart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] The present invention will be described in more detail below with reference to the drawings and embodiments, but the present invention is not limited thereto. For those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as within the protection scope of the present invention. The content not described in detail in this specification belongs to the prior art well known to those of ordinary skill in the art.
[0040] As Figure 1As shown in the figure, Embodiment 1 of the present invention is carried out according to the following steps:
[0041] S1. Sequentially perform SQL statement processing and merging processing on the natural language questions proposed by the user in the database to obtain a translation original data set.
[0042] Specifically, step S1 is as follows:
[0043] S11. Perform SQL statement processing on each natural language question proposed by the user in the database to obtain an SQL query statement corresponding to each natural language question.
[0044] Specifically, SQL statement processing is to translate the natural language question into an SQL statement.
[0045] S12. Combine each natural language question and the corresponding SQL query statement into a translation data pair, thereby obtaining a number of translation data pairs.
[0046] The translation data pair can be obtained by combining the natural language question and the corresponding SQL query statement.
[0047] S13. Merge all the translation data pairs to obtain a translation original data set.
[0048] S2. Sequentially perform screening processing, template processing, augmentation processing and merging processing on the translation original data set to obtain a translation data set.
[0049] Specifically, step S2 is as follows:
[0050] S21. According to the preset augmentation keywords, screen out the translation original data set that does not contain augmentation keywords in the translation original data set obtained in step S1.
[0051] The augmentation keywords are SQL query statement keywords. The augmentation keywords are set according to the natural language questions proposed by the user in the database.
[0052] S22. Process the translation original data set that does not contain augmentation keywords with a preset prompt template to obtain a prompt data set.
[0053] The preset prompt template is: Please generate an augmented SQL query statement for the "SQL query statement keywords proposed by the user" according to the following natural language question: "The natural language question proposed by the user", and the current SQL query statement is: "The generated SQL query statement".
[0054] Among them, the "natural language question proposed by the user" is the text question proposed by the user in the translation original dataset. The "keywords of the SQL query statement specified by the user for augmentation" are the keywords of the SQL query statement specified by the user for augmentation. The "generated SQL query statement" is the corresponding SQL query statement obtained by processing the text question proposed by the user in the translation original dataset through SQL statement processing.
[0055] In a specific embodiment, the prompt template can be: Please generate an augmented SQL query statement with the ORDER BY keyword according to the following natural language question: "What are the ages and hometowns of each teacher?", and the current SQL query statement is: "SELECT age, hometown FROM teacher table".
[0056] S23. Input the prompt dataset into a large language model for data augmentation processing to obtain a translated augmented dataset.
[0057] S24. Combine the translated original dataset screened in step S21 and the translated augmented dataset obtained in step S23 to obtain a translated dataset.
[0058] S3. Input the translated dataset into a keyword prediction classification model for training to obtain a trained keyword prediction classification model.
[0059] The keyword prediction classification model in step S3 adopts a BERT neural network model or a RoBERTa neural network model.
[0060] S4. Perform pattern linking processing, keyword prediction classification model processing, SQL query processing, and translation processing on the natural language question to be translated proposed by the user in sequence to obtain a cognitive enhanced natural language question, and perform two comparison processes and query processing on the cognitive enhanced natural language question in sequence to obtain the query result corresponding to the natural language question to be translated proposed by the user.
[0061] Step S4 is specifically as follows:
[0062] S41. Perform pattern linking processing on the natural language question to be translated proposed by the user to obtain a pattern linking result, input the pattern linking result into the trained keyword prediction classification model to obtain a keyword result, and then perform SQL query processing and translation processing on the keyword result in sequence to obtain a cognitive enhanced natural language question.
[0063] Step S41 is specifically as follows:
[0064] S411. Adopt an existing pattern linking classification model to perform pattern linking processing on the natural language question to be translated newly proposed by the user to obtain a pattern linking result.
[0065] The pattern link classification model in step S411 uses the RoBERTa neural network model.
[0066] S412. Input the pattern link result into the keyword prediction classification model trained in step S3 to obtain the keyword result.
[0067] S413. Input the pattern link result, the keyword result, and the natural language question to be translated together into the large language model for SQL query processing to obtain the preliminary SQL query result.
[0068] S414. Input the preliminary SQL query result into the large language model to obtain the cognition-enhanced natural language question.
[0069] S42. Perform contrast processing of semantic consistency, contrast processing of syntactic consistency, and query processing on the cognition-enhanced natural language question in sequence to obtain the query result corresponding to the natural language question to be translated proposed by the user.
[0070] Step S42 is specifically as follows:
[0071] S421. Perform contrast processing of semantic consistency on the cognition-enhanced natural language question obtained in step S41 and the natural language question to be translated in step S41: If the contrast processing is consistent, return the preliminary SQL query result obtained in step S414. If the contrast processing is inconsistent, the large language model performs semantic correction on the preliminary SQL query result and obtains the semantically corrected SQL query result, and returns the corrected SQL query result.
[0072] Semantic correction means that the large language model modifies the semantics of the preliminary SQL query result to make the semantics the same as that of the natural language question to be translated.
[0073] S422. Input the SQL query result returned in step S421 into the database for contrast processing of syntactic consistency: If the contrast processing is consistent, use the SQL query result returned in step S421 as the final SQL query result. If the contrast processing is inconsistent, the large language model performs syntactic correction on the SQL query result returned in step S421 to obtain the syntactically corrected SQL query result, and use the syntactically corrected SQL query result as the final SQL query result.
[0074] Syntactic correction means that the large language model modifies the syntax of the preliminary SQL query result so that the syntax of the preliminary SQL query result has no errors. Syntax includes the syntax of the code and the use of keywords in the code, etc.
[0075] S423. Input the final SQL query result into the large language model for query processing to obtain the query result corresponding to the natural language question to be translated proposed by the user.
[0076] The natural language question is a question in text form proposed by the user. The database is a database for storing the natural language questions to be translated proposed by the user.
[0077] The large language models in step S23, step S413, step S414, step S421, step S422, and step S423 all adopt text language models, such as the GPT language model.
[0078] Example 2
[0079] D1. Perform SQL statement processing on each natural language question proposed by the user in the school personnel database to obtain the SQL query statement corresponding to each natural language question.
[0080] For example: If the natural language question is: What are the ages and hometowns of each teacher? The corresponding SQL query statement is: "SELECT age, hometown FROM teacher table". If the natural language question is: What courses does Teacher Zhang San teach? The corresponding SQL query statement is: "SELECT courses FROM course table WHERE teacher name = 'Zhang San'".
[0081] D2. Combine each natural language question and the corresponding SQL query statement into a translation data pair, thereby obtaining several translation data pairs.
[0082] For example: The form of the translation data pair is: What are the ages and hometowns of each teacher? SELECT age, hometown FROM teacher table. What courses does Teacher Zhang San teach? SELECT courses FROM course table WHERE teacher name = 'Zhang San'.
[0083] D3. Merge all the translation data pairs to obtain the original translation dataset.
[0084] For example: After merging, there are 500 translation data pairs in the school personnel database, which serve as the original translation dataset.
[0085] D4. The preset augmented keyword is ORDER BY. Filter out the original translation dataset that does not contain the augmented keyword from the original translation dataset.
[0086] For example: The SQL queries of the two translation data pairs "What are the ages and hometowns of each teacher? SELECT age, hometown FROM teacher table." and "What courses does Teacher Zhang San teach? SELECT courses FROM course table WHERE teacher name = 'Zhang San'" do not include the augmented keyword "ORDER BY".
[0087] D5. Process the original translation dataset without augmented keywords using a preset prompt template to obtain a prompt dataset.
[0088] For example, one of the obtained prompt data is: Please generate an augmented SQL query statement with the ORDER BY keyword based on the following natural language question: "What are the ages and hometowns of each teacher?", and the current SQL query statement is: "SELECT age, hometown FROM teacher table".
[0089] D6. Input the prompt dataset into the GPT language model for data augmentation processing to obtain a translated augmented dataset.
[0090] For example, one of the augmented data obtained is: "SELECT age, hometown FROM teacher table ORDER BY age LIMIT 1", and at the same time, the corresponding natural language question "What are the ages and hometowns of the teacher with the youngest age?" is returned.
[0091] D7. Combine the original translation dataset filtered in step D4 and the translated augmented dataset obtained in step D6 to obtain a translation dataset.
[0092] For example, "What are the ages and hometowns of the teacher with the youngest age? SELECT age, hometown FROM teacher table ORDER BY age LIMIT 1" "What courses is Teacher Zhang San teaching recently? SELECT courses FROM course table WHERE teacher name = 'Zhang San' ORDER BY start date LIMIT 1"
[0093] D8. Input the translation dataset into the BERT neural network model for training to obtain a trained BERT neural network model.
[0094] For example, the BERT neural network model is trained with 800 pieces of data, where 500 pieces of data come from the original translation dataset and 300 pieces of data come from the translated augmented dataset.
[0095] D9. Use the RoBERTa neural network model to perform pattern linking processing on the newly proposed natural language question to be translated by the user to obtain a pattern linking result.
[0096] Input the newly proposed natural language question to be translated ("Which teachers have not been assigned a teaching course?") and the database schema (course schedule, including columns for teacher ID, course ID, and age, where the course ID is the primary key, and teacher ID and course ID are foreign keys; teacher table, including columns for teacher ID, name, age, and hometown, where the teacher ID is the primary key; course table, including columns for course, course ID, and start date, where the course ID is the primary key) into the schema linking classification model, predict the probability that each table and column in the database schema will be used in the SQL query, and according to the threshold, retain the tables and columns with high probabilities: teacher table (retain the teacher name column), course schedule (retain the teacher ID column).
[0097] D10. Input the schema linking result into the trained BERT neural network model to obtain the keyword result.
[0098] The obtained keyword result is: SELECT, FROM, WHERE, NOT IN.
[0099] D11. Input the schema linking result, keyword result, and the natural language question to be translated together into the large language model for SQL query processing to obtain the preliminary SQL query result.
[0100] For example, one of the obtained preliminary SQL query results is: "SELECT teacher name FROM teacher table WHERE teacher ID NOT IN (SELECT teacher ID FROM course schedule);".
[0101] D12. Input the preliminary SQL query result into the large language model to obtain the cognition-enhanced natural language question.
[0102] For example, the obtained cognition-enhanced natural language question is "Which teachers do not need to conduct course teaching?".
[0103] D13. Perform a semantic consistency comparison between the obtained cognition-enhanced natural language question and the natural language question to be translated in step D9:
[0104] If the comparison result is consistent, return the preliminary SQL query result obtained in step D12.
[0105] If the comparison result is inconsistent, the large language model corrects the semantics of the preliminary SQL query result and obtains the semantically corrected SQL query result, and returns the corrected SQL query result.
[0106] The comparison processing results of the cognitive enhancement natural language question "Which teachers do not need to conduct course teaching?" and the new natural language question to be translated proposed by the user "Which teachers have not been assigned a teaching course?" are the same. Return the preliminary SQL query result obtained in step D12: "SELECT teacher name FROM teacher table WHERE teacher ID NOT IN (SELECT teacher ID FROM course arrangement table);".
[0107] D13. Input the SQL query result returned in step D13 into the database for comparison processing of syntactic consistency:
[0108] If the comparison processing is consistent, use the SQL query result returned in step D13 as the final SQL query result.
[0109] If the comparison processing is inconsistent, the large language model corrects the syntax of the SQL query result returned in step D13 to obtain the syntax-corrected SQL query result, and use the syntax-corrected SQL query result as the final SQL query result.
[0110] For example, the SQL query result returned in step D13 is successfully executed in the school personnel database and the correct execution result is obtained: 'Teacher Wang', 'Teacher Li', and the comparison processing result is consistent. The final SQL query result is: "SELECT teacher name FROM teacher table WHERE teacher ID NOT IN (SELECT teacher ID FROM course arrangement table);"
[0111] D14. Input the final SQL query result into the large language model for query processing to obtain the query result corresponding to the natural language question to be translated proposed by the user.
[0112] For example: The corresponding query results are: 1. Teacher Wang has not been assigned a teaching course; 2. Teacher Li has not been assigned a teaching course.
[0113] The innovation of the present invention lies in first training the translation data set using a keyword prediction classification model, then comprehensively processing the natural language question to be translated proposed by the user into a cognitive enhancement natural language question, and then processing the cognitive enhancement natural language question to obtain the final result. The present invention realizes the beneficial effect of optimizing different links of the large language model in the task of natural language question to SQL query, and has the advantage of enhancing the understanding of the large language model for the task of natural language question to SQL query and SQL language.
Claims
1. A method for translating natural language questions to SQL queries based on a cognitively enhanced large language model, characterized in that: The following steps are involved: S1. Process and merge SQL statements in sequence according to the natural language questions raised by users in the database to obtain the original translation data set; S2, performing screening processing, template processing, augmentation processing and merging processing on the original translation data set in sequence to obtain a translation data set; S3, inputting the translation data set into the keyword prediction classification model for training, and obtaining a trained keyword prediction classification model; S4. The natural language question to be translated proposed by the user is processed in sequence by pattern linking, keyword prediction and classification model, SQL query and translation to obtain a cognitively enhanced natural language question. The cognitively enhanced natural language question is processed in sequence by two comparisons and queries to obtain a query result corresponding to the natural language question to be translated proposed by the user.
2. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 1, characterized in that: The step S1 is specifically as follows: S11, performing SQL statement processing on each natural language question raised by the user in the database to obtain an SQL query statement corresponding to each natural language question; S12, combining each natural language question and the corresponding SQL query statement into a translation data pair, thereby obtaining a plurality of translation data pairs; S13. Merge all translation data pairs to obtain the original translation data set.
3. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 1, characterized in that: The step S2 is specifically as follows: S21, according to the preset augmented keywords, filter out the original translation data set that does not contain the augmented keywords from the original translation data set obtained in step S1; S22, processing the original translation data set without augmented keywords using a preset prompt template to obtain a prompt data set; S23, inputting the prompt data set into the large language model for data augmentation processing to obtain a translation augmented data set; S24, merging the original translation data set screened out in step S21 and the translation augmented data set obtained in step S23 to obtain a translation data set.
4. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 1, characterized in that: The keyword prediction classification model in step S3 adopts a BERT neural network model or a RoBERTa neural network model.
5. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 1, characterized in that: The step S4 is specifically as follows: S41, performing pattern linking processing on the natural language question to be translated proposed by the user to obtain a pattern linking result, inputting the pattern linking result into the trained keyword prediction classification model to obtain a keyword result, and then performing SQL query processing and translation processing on the keyword result in sequence to obtain a cognitive enhanced natural language question; S42, performing semantic consistency comparison processing, grammatical consistency comparison processing and query processing on the cognitive enhancement natural language question in sequence, and obtaining a query result corresponding to the natural language question to be translated raised by the user.
6. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 5, characterized in that: The step S41 is specifically as follows: S411, using a pattern linking classification model to perform pattern linking processing on a natural language question to be translated newly proposed by a user, to obtain a pattern linking result; S412, inputting the pattern linking result into the keyword prediction classification model trained in step S3 to obtain the keyword result; S413, inputting the pattern linking results, the keyword results and the natural language question to be translated into the large language model for SQL query processing to obtain preliminary SQL query results; S414. Input the preliminary SQL query results into the large language model to obtain cognitively enhanced natural language questions.
7. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 6, characterized in that: The pattern link classification model in step S411 adopts the RoBERTa neural network model.
8. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 5, characterized in that: The step S42 is specifically as follows: S421, performing a semantic consistency comparison process on the cognitive enhancement natural language question obtained in step S41 and the natural language question to be translated in step S41: If the comparison process is consistent, the preliminary SQL query result obtained in step S414 is returned; If the comparison process is inconsistent, the large language model performs semantic correction on the preliminary SQL query result and obtains a semantically corrected SQL query result, and returns the corrected SQL query result; S422: Input the SQL query result returned in step S421 into the database for syntax consistency comparison: If the comparison process is consistent, the SQL query result returned in step S421 is used as the final SQL query result; If the comparison process is inconsistent, the large language model performs grammatical correction on the SQL query result returned in step S421 to obtain a grammatically corrected SQL query result, and the grammatically corrected SQL query result is used as the final SQL query result; S423: Input the final SQL query result into the large language model for query processing to obtain the query result corresponding to the natural language question to be translated raised by the user.
9. The cognitively enhanced large language model natural language question to SQL query translation framework according to claim 3, characterized in that: The large language models in step S23, step S413, step S414, step S421, step S422 and step S423 all adopt text language models.
Citation Information
Cited By
Natural language to SQL conversion method and system based on dual encoder architecture
CN122547825A