CPC G06F 16/3331 (2019.01) | 20 Claims |
1. A method of optimizing query input for generating a set of code using a large language model (LLM), the method comprising:
receiving, by a processor, a user query input by a user for querying the LLM to generate the set of code corresponding to a user-defined coding language;
determining, by the processor, a set of primitive queries from the user query using an NLP model,
wherein the set of primitive queries are determined by determining:
at least one of: a compound phrase and/or a complex phrase in the user query, and
one or more of: a set of input keywords, a set of conditional keywords and a set of output keywords;
determining, by the processor, metadata from the set of primitive queries,
wherein the metadata comprises a number of input keywords in the set of input keywords, a number of conditional keywords in the set of conditional keywords, a number of lines of code, and/or a number of for loops;
determining, by the processor, a query type from a set of predefined query types of the user query using a machine learning model,
wherein the machine learning model is trained to classify the user query as one of the set of predefined query types;
optimizing, by the processor, the set of primitive queries to determine an optimized query based on the query type and the metadata using the NLP model and a historical database,
wherein the historical database comprises a plurality of historical query-outputs corresponding to each of a plurality of historical queries and corresponding metadata of the plurality of historical query-outputs and the plurality of historical queries; and
determining, by the processor, the set of code corresponding to the user-defined coding language based on the query type and the optimized query by querying the LLM.
|