CPC G06F 16/24522 (2019.01) [G06F 16/2433 (2019.01); G06F 40/247 (2020.01)] | 12 Claims |
1. A method of converting a natural language query into a structured query language (SQL) query, the method being performed by a device for converting the natural language query into the SQL query in which the device comprises an SQL conversion model generator for generating an SQL conversion model, and the SQL conversion model generator includes a training data manager, an SQL converter, an SQL verifier and an SQL conversion model trainer, the method comprising:
an operation A of labeling, by the training data manager, natural language queries included in training data, wherein the operation A comprises extracting a plurality of keywords included in the natural language queries and labeling the plurality of extracted keywords with a plurality of tags based on SQL grammar;
an operation B of converting, by the SQL converter, the natural language queries into second SQL queries by applying the natural language queries to the SQL conversion model, wherein the operation B comprises generating the SQL conversion model for generating the second SQL queries on the basis of the natural language queries, a database schema, and labeled tags of the training data, and converting the natural language queries of the training data into the second SQL queries on the basis of the SQL conversion model;
an operation C of verifying, by the SQL verifier, the second SQL queries; and
an operation D of comparing, by a SQL conversion model trainer, the second SQL queries with third SQL queries corresponding to the natural language queries of the training data to train the SQL conversion model.
|