Method and system for context-specific generative model answers from context-specific queries
A method including receiving a context-specific query, specific to the user, from a user device of a user. The method also includes creating a computer-readable data structure for storing data. The computer-readable data structure is specific to the context-specific query. The method also includes determining a feature related to the context-specific query. The method also includes retrieving a user value for the feature. The user value is retrieved from a data repository storing user-specific data that includes the user value. The method also includes modifying the computer-readable data structure to generate a modified computer-readable data structure by adding the feature and the user value for the feature to the computer-readable data structure. The method also includes applying a generative model to the modified computer-readable data structure to generate an output. The output includes a context-specific answer to the context-specific query. The method also includes returning the output.
1 . A method comprising:
receiving a context-specific query from a user device of a user, wherein the context-specific query is specific to the user;
applying a classification model to the context-specific query to generate a numerical prediction whether a general answer answers the context-specific query;
creating, responsive to the numerical prediction satisfying a threshold value, a computer-readable data structure for storing data, wherein the computer-readable data structure is specific to the context-specific query, wherein the numerical prediction satisfying the threshold value indicates that the general answer fails to answer the context-specific query;
determining a feature related to the context-specific query;
retrieving a user value for the feature, wherein the user value is retrieved from a data repository storing user-specific data that includes the user value;
modifying the computer-readable data structure to generate a modified computer-readable data structure by adding the feature and the user value for the feature to the computer-readable data structure;
applying a generative model to the modified computer-readable data structure to generate an output comprising a context-specific answer to the context-specific query; and
returning the output.
2 . The method of claim 1 , further comprising:
applying, prior to applying the generative model to the modified computer-readable data structure, a search algorithm to a content knowledge base to retrieve information related to the context-specific query, wherein the search algorithm searches the content knowledge base based on the context-specific query,
wherein applying the generative model further comprises applying the generative model to a combination of the information and the computer-readable data structure to generate the output.
3 . The method of claim 2 , wherein an answer to the context-specific query is absent from the content knowledge base.
4 . The method of claim 1 , wherein the computer-readable data structure comprises a structured language file comprising key-value pairs, and wherein modifying the computer-readable data structure comprises adding the feature as a key of one of the key-value pairs and adding the user value as a value of one of the key-value pairs.
5 . The method of claim 1 , wherein determining the feature comprises:
applying a contextualizer to the context-specific query to return one or more features predicted to be related to the context-specific query, the one or more features including the feature.
6 . The method of claim 5 , wherein the contextualizer comprises one of the generative model, a multi-label classification model, and a large language model different than the generative model.
7 . The method of claim 1 , wherein determining the feature comprises:
determining a number of features of a plurality of features to return as the feature; and
using the number of features as the feature.
8 . The method of claim 7 , wherein determining the number of features comprises:
applying, based on the context-specific query, a large language model to a content knowledge base to return the number of features.
9 . The method of claim 7 , wherein determining the number of features comprises:
selecting a pre-determined number of features based on a type of the context-specific query.
10 . The method of claim 7 , further comprising:
displaying a feedback prompt to the user;
receiving a feedback value from the user device; and
modifying, based on the feedback value, the number of features to return as the feature.
11 . The method of claim 1 , wherein the user value comprises protected information, and wherein the method further comprises abstracting the user value to generate an abstracted user value used as the abstracted user value.
12 . The method of claim 11 , wherein abstracting comprises determining a bin comprising a range of values within which the user value falls, and returning the bin as the abstracted user value.
13 . A system comprising:
a computer processor;
a data repository in communication with the computer processor, the data repository storing:
a context-specific query received from a user device of a user, wherein the context-specific query is specific to the user,
a computer-readable data structure for storing data, wherein the computer-readable data structure is specific to the context-specific query,
a feature related to the context-specific query,
a user value for the feature,
user-specific data that includes the user value,
a modified computer-readable data structure modified with the feature and the user value for the feature, and
an output comprising a context-specific answer to the context-specific query;
a server controller in communication with the computer processor and programmed to:
receive the context-specific query,
applying a classification model to the context-specific query to generate a numerical prediction whether a general answer answers the context-specific query,
create, responsive to the numerical prediction satisfying a threshold value, the computer-readable data structure, wherein the numerical prediction satisfying the threshold value indicates that the general answer fails to answer the context-specific query,
determine the feature related to the context-specific query,
retrieve the user value for the feature, wherein the user value is retrieved from the user-specific data,
modify the computer-readable data structure to generate the modified computer-readable data structure, and
return the output; and
a generative model in communication with the computer processor and programmed to:
generate the output.
14 . The system of claim 13 ,
wherein the server controller is further programmed to apply, prior to applying the generative model to the modified computer-readable data structure, a search algorithm to a content knowledge base to retrieve information related to the context-specific query, wherein the search algorithm searches the content knowledge base based on the context-specific query, and
wherein applying the generative model further comprises applying the generative model to a combination of the information and the computer-readable data structure to generate the output.
15 . The system of claim 13 , wherein the computer-readable data structure comprises a structured language file comprising key-value pairs, and wherein modifying the computer-readable data structure comprises adding the feature as a key of one of the key-value pairs and adding the user value as a value of one of the key-value pairs.
16 . The system of claim 13 , wherein determining the feature comprises:
applying a contextualizer to the context-specific query to return one or more features predicted to be related to the context-specific query, the one or more features including the feature.
17 . The system of claim 16 , wherein the contextualizer comprises one of the generative model, a multi-label classification model, and a large language model different than the generative model.
18 . The system of claim 13 , wherein determining the feature comprises:
applying, based on the context-specific query, a large language model to a content knowledge base to return a number of features as the feature; and
using the number of features as the feature.
19 . A non-transitory computer readable storage medium storing program code which, when executed by a computer processor, performs a computer-implemented method comprising:
receiving a context-specific query from a user device of a user, wherein the context-specific query is specific to the user;
applying a classification model to the context-specific query to generate a numerical prediction whether a general answer answers the context-specific query;
creating, responsive to the numerical prediction satisfying a threshold value, a computer-readable data structure for storing data, wherein the computer-readable data structure is specific to the context-specific query, wherein the numerical prediction satisfying the threshold value indicates that the general answer fails to answer the context-specific query;
determining a feature related to the context-specific query;
retrieving a user value for the feature, wherein the user value is retrieved from a data repository storing user-specific data that includes the user value;
modifying the computer-readable data structure to generate a modified computer-readable data structure by adding the feature and the user value for the feature to the computer-readable data structure;
applying a generative model to the modified computer-readable data structure to generate an output comprising a context-specific answer to the context-specific query; and
returning the output.