US 12,130,808 B2
Device and method for converting natural language query into SQL query
Dong Hwan Kim, Seoul (KR); Han Soo Kim, Bucheon-si (KR); Ah Rim Sohn, Seoul (KR); Jun Hyeok Park, Seoul (KR); In Je Seong, Seoul (KR); and Sun Young Lee, Seoul (KR)
Assigned to 42Maru Inc., Seoul (KR)
Filed by 42Maru Inc., Seoul (KR)
Filed on Dec. 1, 2021, as Appl. No. 17/539,502.
Claims priority of application No. 10-2021-0166794 (KR), filed on Nov. 29, 2021.
Prior Publication US 2023/0169074 A1, Jun. 1, 2023
Int. Cl. G06F 16/2452 (2019.01); G06F 16/242 (2019.01); G06F 40/247 (2020.01)
CPC G06F 16/24522 (2019.01) [G06F 16/2433 (2019.01); G06F 40/247 (2020.01)] 12 Claims
OG exemplary drawing
 
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.