Personalization techniques for code generation platforms
Systems and methods are disclosed comprising techniques for personalization in code generation. A platform determines a user persona based on contextual information regarding a user associated with a natural language query. If a corresponding ontology entry is not found, wherein the code unit is identified based on the determined user persona, the platform applies an artificial intelligence model to generate a code unit by prompting the artificial intelligence model with the at least a portion of the natural language query and one or more of the user role information, the historical interaction pattern information, or the determined user persona. The generated code unit is executed against a data source to generate a result set. Responsive to detecting a feedback item in connection with the result set or the code unit, the platform enables incremental training of the artificial intelligence model. Code units can be modified based on additional feedback items.
1 . One or more non-transitory, computer-readable storage media comprising instructions recorded thereon, wherein the instructions, when executed by at least one data processor of a system, cause the system to incrementally train an artificial intelligence model structured to generate personalized code units, the artificial intelligence model comprising a set of memory units and activation functions linking memory units in the set of memory units updatable to improve generated code unit accuracy, the instructions comprising:
receiving a natural language query;
determining a user persona based on contextual information regarding a user associated with the natural language query, the contextual information comprising at least one of: (i) user role information, or (ii) historical interaction pattern information;
responsive to determining that at least a portion of the natural language query matches an ontology entry, accessing a corresponding code unit associated with the ontology entry, wherein the code unit is identified based on the determined user persona;
responsive to determining that at least a portion of the natural language query does not match an ontology entry, applying the artificial intelligence model to generate the code unit by prompting the artificial intelligence model with the at least a portion of the natural language query and at least two of: (i) the user role information, (ii) the historical interaction pattern information, or (iii) the determined user persona;
executing the code unit against a data source to generate a result set; and
responsive to detecting a feedback item in connection with the result set or the code unit, incrementally training the artificial intelligence model using the detected feedback item, wherein incrementally training the artificial intelligence model comprises causing the artificial intelligence model to update, responsive to the detected feedback item, the set of memory units and the activation functions linking the memory units in the set of memory units.
2 . The one or more non-transitory, computer-readable storage media of claim 1 , wherein the code unit comprises one or more of a data selection statement, an entity linking clause, a result set filtering clause, or a result set organization clause.
3 . The one or more non-transitory, computer-readable storage media of claim 1 , wherein the detected feedback item comprises an upvote or a downvote, the instructions further comprising:
responsive to determining that a number of upvotes relating to the code unit meets or exceeds a predetermined threshold, adding the code unit to the ontology and linking the code unit with the user persona.
4 . The one or more non-transitory, computer-readable storage media of claim 1 , wherein the instructions further cause the system to prioritize persona-relevant code units by:
performing similarity matching using retrieval-augmented generation to identify a semantic relationship between at least a portion of the natural language query and the ontology entry; and
weighting the similarity matching based on the determined user persona.
5 . The one or more non-transitory, computer-readable storage media of claim 1 , wherein determining the user persona comprises:
using query history associated with the user to generate a prediction regarding one or more of a data domain preference, a visualization type preference, or a query complexity preference of the user;
applying a trained machine learning classification model to the data domain preference, the visualization type preference, or the query complexity preference of the user to generate a classifier; and
using the classifier, determining the user persona.
6 . The one or more non-transitory, computer-readable storage media of claim 1 , the instructions further comprising:
responsive to detecting an additional feedback item comprising a modification to the code unit, updating the ontology entry to store the modification to the code unit.
7 . The one or more non-transitory, computer-readable storage media of claim 1 , the instructions further comprising:
based on the detected user persona, applying compute logic to the generated result set, the compute logic comprising one or more of a data aggregation operation, a summarization operation, execution of an additional code unit, or applying a highlighting schema to the generated result set.
8 . The one or more non-transitory, computer-readable storage media of claim 1 , the instructions further comprising:
responsive to detecting an additional feedback item comprising a modification to the code unit, update the ontology entry to store the modification to the code unit.
9 . A computer-implemented method to incrementally train an artificial intelligence model structured to generate personalized code units, the artificial intelligence model comprising a set of memory units and activation functions linking memory units in the set of memory units updatable to improve generated code unit accuracy, the method comprising:
receiving a natural language query;
determining a user persona based on contextual information regarding a user associated with the natural language query, the contextual information comprising at least one of: (i) user role information, or (ii) historical interaction pattern information;
responsive to determining that at least a portion of the natural language query matches an ontology entry, accessing a corresponding code unit associated with the ontology entry, wherein the code unit is identified based on the determined user persona;
responsive to determining that at least a portion of the natural language query does not match an ontology entry, applying the artificial intelligence model to generate the code unit by prompting the artificial intelligence model with the at least a portion of the natural language query and at least two of: (i) the user role information, (ii) the historical interaction pattern information, or (iii) the determined user persona;
executing the code unit against a data source to generate a result set; and
responsive to detecting a feedback item in connection with the result set or the code unit, incrementally training the artificial intelligence model using the detected feedback item, wherein incrementally training the artificial intelligence model comprises causing the artificial intelligence model to update, responsive to the detected feedback item, the set of memory units and the activation functions linking the memory units in the set of memory units.
10 . The computer-implemented method of claim 9 , wherein the code unit comprises one or more of a data selection statement, an entity linking clause, a result set filtering clause, or a result set organization clause.
11 . The computer-implemented method of claim 9 , wherein the detected feedback item comprises an upvote or a downvote, the method further comprising:
responsive to determining that a number of upvotes relating to the code unit meets or exceeds a predetermined threshold, adding the code unit to the ontology and linking the code unit with the user persona.
12 . The computer-implemented method of claim 9 , the method further comprising prioritizing persona-relevant code units by:
performing similarity matching using retrieval-augmented generation to identify a semantic relationship between at least a portion of the natural language query and the ontology entry; and
weighting the similarity matching based on the determined user persona.
13 . The computer-implemented method of claim 9 , wherein determining the user persona comprises:
using query history associated with the user to generate a prediction regarding one or more of a data domain preference, a visualization type preference, or a query complexity preference of the user;
applying a trained machine learning classification model to the data domain preference, the visualization type preference, or the query complexity preference of the user to generate a classifier; and
using the classifier, determining the user persona.
14 . The computer-implemented method of claim 9 , the method further comprising:
responsive to detecting an additional feedback item comprising a modification to the code unit, updating the ontology entry to store the modification to the code unit.
15 . The computer-implemented method of claim 9 , the method further comprising:
based on the detected user persona, applying compute logic to the generated result set, the compute logic comprising one or more of a data aggregation operation, a summarization operation, execution of an additional code unit, or applying a highlighting schema to the generated result set.
16 . A computing system comprising at least one data processor and at least one memory having instructions recorded thereon, wherein the instructions, when executed by the at least one data processor, cause the computing system to incrementally train an artificial intelligence model structured to generate personalized code units, the artificial intelligence model comprising a set of memory units and activation functions linking memory units in the set of memory units updatable to improve generated code unit accuracy, by performing operations to:
receive a natural language query;
determine a user persona based on contextual information regarding a user associated with the natural language query, the contextual information comprising at least one of: (i) user role information, or (ii) historical interaction pattern information;
responsive to determining that at least a portion of the natural language query matches an ontology entry, access a corresponding code unit associated with the ontology entry, wherein the code unit is identified based on the determined user persona;
responsive to determining that at least a portion of the natural language query does not match an ontology entry, apply the artificial intelligence model to generate the code unit by prompting the artificial intelligence model with the at least a portion of the natural language query and at least two of: (i) the user role information, (ii) the historical interaction pattern information, or (iii) the determined user persona;
execute the code unit against a data source to generate a result set; and
responsive to detecting a feedback item in connection with the result set or the code unit, incrementally train the artificial intelligence model using the detected feedback item, wherein incrementally training the artificial intelligence model comprises causing the artificial intelligence model to update, responsive to the detected feedback item, the set of memory units and the activation functions linking the memory units in the set of memory units.
17 . The computing system of claim 16 , wherein the code unit comprises one or more of a data selection statement, an entity linking clause, a result set filtering clause, or a result set organization clause.
18 . The computing system of claim 16 , wherein the detected feedback item comprises an upvote or a downvote, the operations further comprising:
responsive to determining that a number of upvotes relating to the code unit meets or exceeds a predetermined threshold, add the code unit to the ontology and linking the code unit with the user persona.
19 . The computing system of claim 16 , wherein the operations further comprise causing the computing system to prioritize persona-relevant code units, comprising:
perform similarity matching using retrieval-augmented generation to identify a semantic relationship between at least a portion of the natural language query and the ontology entry; and
weight the similarity matching based on the determined user persona.
20 . The computing system of claim 16 , wherein determining the user persona comprises operations to:
use query history associated with the user to generate a prediction regarding one or more of a data domain preference, a visualization type preference, or a query complexity preference of the user;
apply a trained machine learning classification model to the data domain preference, the visualization type preference, or the query complexity preference of the user to generate a classifier; and
using the classifier, determine the user persona.