US 12,487,998 B1
Contextual graph dynamics for natural language to SQL conversion
Shweta Goyal, Bangalore (IN); Kailash Talreja, Mumbai (IN); Sailendu Kumar Patra, Bangalore (IN); and Saurabh Jha, Austin, TX (US)
Assigned to Dell Products L.P., Round Rock, TX (US)
Filed by Dell Products L.P., Round Rock, TX (US)
Filed on Jul. 31, 2024, as Appl. No. 18/790,103.
Int. Cl. G06F 16/2452 (2019.01); G06F 16/21 (2019.01); G06F 40/58 (2020.01)
CPC G06F 16/24522 (2019.01) [G06F 16/212 (2019.01); G06F 40/58 (2020.01)] 18 Claims
OG exemplary drawing
 
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.