| CPC G06F 16/24522 (2019.01) [G06F 16/212 (2019.01); G06F 40/58 (2020.01)] | 18 Claims |

|
1. A method for training and using a model to generate a structured query language (SQL) output using a natural language input, the method comprising:
training the model by:
receiving a training data set comprising natural language queries, corresponding SQL statements, and a corresponding database;
extracting query-specific schema from the corresponding database;
embedding the natural language queries and the query-specific schema to generate initialized embeddings, wherein each initialized embedding corresponds to a natural language query of the natural language queries, and wherein the corresponding SQL statement is one of the corresponding SQL statements;
generating subgraphs based on the initialized embeddings and the natural language queries;
generating, using a graph neural network (GNN), refined outputs based on the subgraphs, wherein the GNN is trained using the subgraphs as inputs; and
training a transformer model using the refined outputs and the natural language queries to obtain a trained model;
receiving a user input, wherein the user input comprises a user natural language query;
identifying a target database based on the user input;
generating a subgraph input based on the user input and a database schema associated with the target database;
generating, using the subgraph input and the user input as inputs to the trained model, a SQL query; and
performing, based on the user input and the SQL query, an action from an action set.
|