US 12,265,529 B1
Context-dependent query generation
Arjun Roychowdhury, McLean, VA (US)
Assigned to Capital One Services, LLC, McLean, VA (US)
Filed by Capital One Services, LLC, McLean, VA (US)
Filed on Sep. 28, 2023, as Appl. No. 18/477,227.
Int. Cl. G06F 16/00 (2019.01); G06F 16/21 (2019.01); G06F 16/242 (2019.01); G06F 16/28 (2019.01)
CPC G06F 16/2433 (2019.01) [G06F 16/212 (2019.01); G06F 16/285 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A system for generating a query adapted to a custom schema for database-stored data, the system comprising one or more processors and one or more media, the one or more media storing program instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
configuring a query-generating first language model with a schema for data in a target database and a set of model queries;
configuring an error-detecting second language model with the schema and a set of erroneous model queries;
determining a candidate context used to identify databases based on a set of user-provided inputs;
determining a match between the candidate context and a stored context associated with the schema;
in response to a determination of the match between the candidate context and the stored context associated with the schema, generating, with the query-generating first language model, an initial query based on the set of user-provided inputs, wherein generating the initial query comprises generating a candidate query;
identifying an indicated portion of the initial query by providing, as a second input, the initial query to the error-detecting second language model;
generating an issue indicator of the initial query based on the indicated portion of the initial query to identify the indicated portion, wherein generating the issue indicator comprises:
providing the candidate query to the error-detecting second language model to obtain an indicator set, wherein the indicator set is generated based on the candidate query, and wherein the indicator set comprises the issue indicator;
determining whether the indicator set satisfies a set of indicator criteria; and
selecting the candidate query as the initial query based on a determination that the first indicator set satisfies the set of indicator criteria; and
generating an updated query based on the issue indicator.