Data query result sorting method and system integrating large model and incremental learning
By integrating large models and incremental learning, the shortcomings of the existing technology in understanding user query intentions and semantic information are solved, and more efficient and personalized sorting of data query results is achieved.
Patent Information
- Application Number
- CN202510019190.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-01-07
AI Technical Summary
Existing data query methods have shortcomings in understanding user query intentions and semantic information, which makes it difficult for the relevance and sorting quality of query results to meet user needs.
The data query result sorting method that integrates the big model and incremental learning is used to understand the user query intention through the pre-trained big model, build a preliminary data query model, calculate the correlation score between user query problems and inventory data, and perform incremental optimization and fusion sorting on this basis.
It improves query accuracy and efficiency, enhances the robustness and generalization capabilities of the user query satisfaction model, and realizes personalized optimization and dynamic improvement of query results.
Smart Images

Figure CN119415680B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information management technology, and specifically to a data query result sorting method and system integrating a large model and incremental learning. Background Art
[0002] With the rapid development of Internet technology, how to quickly and accurately query the information users need from massive amounts of information data is a challenge facing search engines and recommendation systems. Traditional data query methods are mainly based on keyword matching, which cannot deeply understand the user's query intent and the semantic information of the data. The relevance and ranking quality of the query results are difficult to meet user needs.
[0003] The patent application with publication number CN117743664A discloses a data query method, which includes obtaining a query request; extracting keywords from the query description information included in the query request to obtain one or more query parameters; searching for multiple query sub-services matching one or more query parameters; selecting a target query sub-service from multiple query sub-services, wherein the load of the target query sub-service is less than the load of other query sub-services, or, among one or more query parameters, the number of query parameters that can be queried by the target query sub-service is greater than the number of query parameters that can be queried by other query sub-services; calling the target query sub-service, performing data query based on one or more query parameters, obtaining query data, and outputting the query data. However, the existing methods still have the following deficiencies: limited query understanding ability, the traditional bag-of-words model lacks semantic understanding ability, and it is difficult to accurately characterize user intent; and the simple use of a static deep semantic model cannot flexibly adapt to changes in query intent. The sorting features are single, and most sorting models only consider the relevance between the query and the document, ignoring factors such as importance, diversity, and novelty, resulting in serious homogeneity of sorting results. User feedback is not fully utilized. Existing methods rarely consider user feedback on query results, fail to establish the association between user preferences and satisfaction, and fail to achieve personalized optimization. The update strategy lacks flexibility. For query results with poor user feedback, there is a lack of effective incremental update mechanism, which makes it impossible to dynamically optimize and improve query quality.
[0004] In view of this, the present invention proposes a data query result ranking method that integrates large models and incremental learning. Summary of the invention
[0005] To achieve the above objectives, the present invention provides a data query result sorting method and system integrating a large model and incremental learning. The specific technical solutions are as follows:
[0006] The data query result ranking method integrating large models and incremental learning includes:
[0007] Based on the pre-trained large model, understand and query the questions input by users, build a preliminary data query model, calculate the relevance score between the user query questions and inventory data, and sort them in reverse order of relevance scores as preliminary data query results;
[0008] Randomly insert low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sort the preliminary data query results and output them to the user;
[0009] Collect user query behavior data in historical data query events, train a user query satisfaction model based on the LSTM model, and predict user satisfaction with the current query results;
[0010] Based on the predicted user satisfaction with the current query results, a query optimization strategy is constructed to incrementally optimize the current query results, and incremental data query results are constructed in the buffer, and incremental data query results that have not been pushed to the user are stored in the buffer;
[0011] In the buffer, the incrementally optimized current query results are merged with the preliminary data query results, and the data results with low relevance scores are removed. The fused data query results are sorted according to the relevance scores, and the sorted fused data query results are output.
[0012] Further, the large model is pre-trained; the large model is adjusted, and the adjusted large model is used to semantically encode the query question input by the user; the query question is input into the large model, and the [CLS] vector is extracted as the query vector of the query question, which is recorded as ;
[0013] Using the adjusted large model to analyze inventory data Encode each inventory data in the , extract the semantic vector of the inventory data; adopt the average pooling method, that is, take the average of the hidden layer state of the inventory data as the vector of the entire inventory data ; Indicates A vector of inventory data, , Indicates the quantity of inventory data;
[0014] Calculating the query vector With each stock data vector constructing a multi-factor correlation calculation model, wherein the multi-factor correlation calculation model includes a basic correlation calculation model, a semantic matching calculation model, and an importance weight calculation model;
[0015] The basic correlation calculation model is used to calculate the basic correlation score , using the cosine similarity function to calculate the query vector and the stock data vector The similarity of the two vectors is used as the basic relevance score; the query vector after the cosine similarity calculation vector is normalized and the stock data vector Dot product, value range is [0,1], basic correlation score The calculation formula is as follows:
[0016] ;
[0017] in Represents the L2 norm of the vector; The value range of is [0,1], Indicates that the user input The problem is transformed into a vector representation. express The transpose of Indicates Candidate inventory data results.
[0018] Furthermore, the semantic matching calculation model is used to calculate the semantic matching score , calculate the query vector With stock data vector Semantic matching scores in large models:
[0019] ;
[0020] ;
[0021] in and Indicates that and The concatenated input sequence; and is the output layer parameter of the large model, express and The probability of matching in the current semantic space, is the activation function;
[0022] The importance weight calculation model is used to calculate the importance weight score , according to the importance of each word in the query question, the inventory data vector is weighted. First, the importance of each query word is calculated through the inverse document frequency, and the inverse document frequency IDF value of the query word is normalized as the weight, and multiplied with each dimension of the inventory data vector to obtain the weighted inventory data vector representation; the inner product of the weighted data result vector and the query vector is calculated to obtain the weighted importance weight score :
[0023] ;
[0024] ;
[0025] ;
[0026] in, For query words The inverse document frequency of is the normalized weight coefficient; for Middle The word vector corresponding to the query word; is the weighted inventory data vector representation; m represents the total number of query terms;
[0027] The multi-factor correlation calculation model is used to calculate the composite correlation score , by weighted summation, based on the basic relevance score , semantic matching score , Importance Weight Rating , calculate the composite relevance score :
[0028] ;
[0029] in Base relevance scores , semantic matching score , Importance Weight Rating The weighting coefficient of
[0030] Based on composite relevance score Sort the search results of all inventory data in descending order to get a sorted result list .
[0031] Furthermore, set the insertion ratio of low relevance score data results , the K-means clustering algorithm is used to divide the low-relevance scoring data results into multiple semantic categories; the K-means clustering algorithm divides the low-relevance scoring data results into multiple semantic categories according to the inventory data vector The geometric distance relationship in the embedding space is automatically classified, and the number of clusters is Pick Order of magnitude, among which is the total number of low-correlation scoring data results; the clustering process takes minimizing the sum of squares of the Euclidean distances from samples within the class to the cluster center as the objective function and uses an iterative optimization method to solve it;
[0032] from Sampling in clusters Low correlation score data results, among which The number of results for inserting low relevance scores is given by Calculated; represents the floor function;
[0033] The sampled The low-correlation score data results are inserted into the preliminary data query result list to form a new sorting result; an exponential decay insertion position allocation strategy is adopted; the The position of the result to be inserted The calculation formula is:
[0034] ;
[0035] in, is a hyperparameter that controls the shape of the exponential decay curve;
[0036] The preliminary data query results after inserting the low-relevance score data results are rearranged. Randomize the position of For the The rearranged data query results are output to the user.
[0037] Furthermore, user query behavior data in historical data query events are collected, and a user query satisfaction model based on the LSTM model is trained, including: the query behavior data includes click data, browsing data and feedback data; the click data includes the query results clicked , click order and click timestamp ; The browsing data is included in the query results Duration of stay on , Browse content progress ; The feedback data includes the user's subjective rating of the query results ;
[0038] Clean and preprocess the collected query behavior data; remove outliers and duplicate records; normalize numerical features to eliminate dimensional effects;
[0039] Arrange the query behavior data of a single user in a single query event into a behavior sequence in chronological order ;in To query the total number of steps, represents the tth query event; each query event Contains information in multiple dimensions, including query vector, number of query results, click data, browsing data, and feedback data;
[0040] Perform feature engineering on behavior sequence data, build a user query satisfaction model, and , extract query question features , Data result characteristics , User behavior characteristics , concatenate the three types of features into a high-dimensional vector ; Through linear transformation Mapping , get the event The hidden layer feature vector ; According to the time sequence of the query, The hidden layer feature vectors in the query events are arranged into a matrix , as the input sequence of the LSTM model; Indicates The feature vector corresponding to the query event;
[0041] Use a multi-layer LSTM model to Perform feature extraction and satisfaction modeling; in the LSTM model, after Sequential transmission of the layer LSTM, the hidden layer state of the last layer LSTM Contains the entire sequence of behaviors The entire behavior sequence is mapped to a scalar value through the fully connected output layer , as the predicted user satisfaction score :
[0042] ;
[0043] in, is the Sigmoid activation function, and is the output layer parameter of the LSTM model; The value range is (0,1).
[0044] Furthermore, after the user query satisfaction model is trained, the query behavior data of the current user is input into the user query satisfaction model to predict the user's satisfaction score for the current query result, and the current query result is incrementally updated according to the satisfaction score;
[0045] According to the query behavior data of the current user, the predicted user satisfaction score based on the user query satisfaction model is used to set the user satisfaction standard value , if the predicted current user satisfaction score Less than the user satisfaction standard value , the current query results are incrementally optimized according to the query optimization strategy.
[0046] Further, according to the query optimization strategy, the incremental optimization of the current query result includes: using different mapping strategies to map the same query question into an incremental query vector different from the initial query. , for the query vector Perform vector semantic expansion to obtain incremental query vectors :
[0047] ;
[0048] in, represents the original query vector; represents the incremental query vector, i.e., the new query vector after semantic expansion; Represents a random noise vector, which is used to introduce a small amount of random disturbance; is a weight coefficient between 0 and 1, used to control the influence of the original query vector and the random noise vector;
[0049] Increment the query vector Input into the big model, calculate the correlation score between the user query question and the inventory data, and calculate the updated basic correlation calculation score , calculate the updated semantic matching score And the updated importance weight score ; and calculate the updated composite relevance score according to the preliminary data query model :
[0050] ;
[0051] The data query results after the incremental query are merged with the preliminary data query results in the buffer, sorted in reverse order according to the same relevance score standard, and the low-relevance score data query results in the preliminary sorting are deleted. When the user clicks to update the query results, the merged query results are output to the user.
[0052] A data query result sorting system integrating a large model and incremental learning, which is used to implement the above-mentioned data query result sorting method integrating a large model and incremental learning, including: a preliminary query module, an adversarial sample module, a user query satisfaction module, an incremental query module and an incremental fusion module;
[0053] The preliminary query module, based on the pre-trained large model, understands and queries the questions input by the user, builds a preliminary data query model, calculates the relevance score between the user's query question and the inventory data, and arranges the results in reverse order of the relevance score as preliminary data query results;
[0054] The adversarial sample module randomly inserts low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sorts the preliminary data query results and outputs them to the user;
[0055] The user query satisfaction module collects the query data of users in historical data query events, trains a user query satisfaction model based on the LSTM model, and predicts the user's satisfaction with the current query result;
[0056] The incremental query module constructs a query optimization strategy based on the predicted user satisfaction with the query result, incrementally optimizes the current query result, constructs incremental data query results in a buffer, and stores incremental data query results that have not been pushed to the user in the buffer;
[0057] The incremental fusion module fuses the incremental optimized data query results with the preliminary data query results in the buffer, removes the data results with low correlation scores, sorts the fused data query results according to the correlation scores, and outputs the sorted fused data query results.
[0058] An electronic device comprises: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; the processor executes the data query result sorting method of integrating a large model and incremental learning by calling the computer program stored in the memory.
[0059] A computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the data query result sorting method that integrates a large model with incremental learning.
[0060] Beneficial effects of the present invention: The present invention uses a pre-trained large model to understand the user's query intention, build a preliminary data query model, calculate the correlation between the query and the result, and improve the query accuracy and efficiency.
[0061] The present invention inserts low-relevance score data results into preliminary data query results as adversarial samples, optimizes the user query satisfaction model, and improves the model's robustness and generalization ability.
[0062] The present invention collects user historical query behavior data, trains an LSTM model to predict user satisfaction, personalizes and optimizes query results, and improves user search experience.
[0063] The present invention incrementally optimizes query results according to predicted user satisfaction, caches the optimized results, flexibly adjusts query strategies, and balances query quality and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A flow chart of a method for sorting data query results that integrates a large model and incremental learning provided by the present invention;
[0065] Figure 2 This is a structural diagram of the data query result sorting system that integrates the large model and incremental learning provided by the present invention. DETAILED DESCRIPTION
[0066] In order to better understand the present invention, a more detailed description will be made of various aspects of the present invention with reference to the accompanying drawings. It should be understood that these detailed descriptions are only descriptions of exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.
[0067] In the accompanying drawings, the size, dimensions and shapes of the elements have been slightly adjusted for ease of illustration. The accompanying drawings are for illustration only and are not strictly drawn to scale. As used herein, the terms "substantially", "approximately" and similar terms are used as terms of approximation, not as terms of degree, and are intended to illustrate the inherent deviations in measurements or calculations that will be recognized by those of ordinary skill in the art. In addition, in the present invention, the order in which the steps are described does not necessarily represent the order in which these processes occur in actual operation, unless otherwise specified or can be derived from the context.
[0068] It should also be understood that expressions such as "comprises", "including", "having", "includes" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features rather than just the individual elements in the list. In addition, when describing embodiments of the present invention, "may" is used to mean "one or more embodiments of the present invention". And, the term "exemplary" is intended to refer to an example or illustration.
[0069] Unless otherwise defined, all terms (including engineering terms and scientific and technological terms) used in this document have the same meaning as commonly understood by ordinary technicians in the field to which the present invention belongs. It should also be understood that unless otherwise clearly stated in the present invention, words defined in commonly used dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.
[0070] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0071] Example 1
[0072] Reference Figure 1 , which is the first embodiment of the present invention, provides a data query result ranking method that integrates large models and incremental learning.
[0073] S1: Based on the pre-trained large model, understand and query the questions input by the user, build a preliminary data query model, calculate the relevance score between the user query question and the inventory data, and arrange the relevance scores in reverse order as the preliminary data query results.
[0074] The RoBERTa model is selected as the pre-trained large model; the RoBERTa model is based on BERT and uses optimization strategies such as dynamic masking, larger batch size, more training data, and longer training time.
[0075] RoBERTa is adjusted to adapt to the query-document relevance discrimination task; the adjustment process adopts the method of full parameter adjustment, that is, the parameters of all layers of the RoBERTa model are trained to make full use of the pre-trained weights; the adjusted training parameters are set as: 10 training rounds, the optimizer uses the Adam optimizer, and the learning rate is set to 2e-5; the model parameters are optimized by minimizing the binary cross entropy loss function so that it can accurately judge the relevance of the query question and the inventory data.
[0076] The adjusted RoBERTa model is used to semantically encode the query question input by the user; the query question is input into the model, and its [CLS] vector is extracted. The [CLS] vector is the hidden layer state of the first tag in the last layer of the Transformer encoder, which is used as the semantic vector representation of the query, denoted as .
[0077] Using the adjusted RoBERTa model on the inventory data Encode each inventory data in and extract its semantic vector representation; adopt the average pooling method, that is, take the average of the hidden layer states of the inventory data as the vector of the inventory data .
[0078] Computational query problems With each stock data vector A semantic relevance score is constructed; a multi-factor relevance calculation model is constructed, wherein the multi-factor relevance calculation model includes a basic relevance calculation model, a semantic matching calculation model, and an importance weight calculation model.
[0079] In order to fully consider multiple aspects of semantic relevance, a calculation scheme for composite relevance scoring is designed, which integrates three factors: basic relevance, semantic matching and importance weight.
[0080] The basic correlation calculation model is used to calculate the basic correlation score , using the cosine similarity function to calculate the query vector and the stock data vector The similarity of is used as the basic relevance score; the cosine similarity is the query vector calculated after normalizing the vector and the stock data vector Dot product, value range is [0,1], basic correlation score The calculation formula is as follows:
[0081] ;
[0082] in represents the L2 norm of the vector, Indicates that the user input The problem is transformed into a vector representation. express The transpose of Indicates Candidate inventory data results; The value range is [0,1], the larger the value, the and The closer they are in the vector space, the higher the query relevance.
[0083] The semantic matching calculation model is used to calculate the semantic matching score , calculate the query vector With stock data vector Semantic matching scores in large models:
[0084] ;
[0085] ;
[0086] in and Indicates that and The concatenated input sequence; and is the output layer parameter of the large model, express and The probability of matching in the current semantic space, is the activation function.
[0087] The importance weight calculation model is used to calculate the importance weight score , weight the data result vector according to the importance of each word in the query question, highlighting the key information most relevant to the user's intention; first, calculate the importance of each query word through the inverse document frequency (IDF). The larger the inverse document frequency IDF value, the lower the frequency of the word in the large model corpus and the greater the amount of information it carries; normalize the inverse document frequency IDF value of the query word as the weight, and multiply it with each dimension of the document vector to obtain the weighted data result vector representation; calculate the inner product between the weighted data result vector and the original query vector to obtain the weighted importance weight score ;
[0088] ;
[0089] ;
[0090] ;
[0091] in, For query words The inverse document frequency of is the normalized weight coefficient; for Middle The word vector corresponding to the query word; is the weighted inventory data vector representation; m represents the total number of query terms; The importance of different query words is taken into consideration, and the key information most relevant to the core intent is highlighted.
[0092] The multi-factor correlation calculation model is used to calculate the composite correlation score , by weighted summation, based on the basic relevance score , semantic matching score , Importance Weight Rating , calculate the composite relevance score :
[0093] ;
[0094] in is the weighting coefficient of the three scores, which can be obtained through experience setting or learning; On the basis of basic relevance, the influence of semantic matching and keyword weight is further integrated.
[0095] Based on composite relevance score Sort the search results of all inventory data in descending order to get a sorted result list ; The higher the relevance score, the higher the ranking of the query result, and the higher the relevance to the query question.
[0096] By leveraging the semantic understanding capabilities of the pre-trained large model, a multi-factor correlation evaluation mechanism is constructed, which comprehensively considers the degree of match between the query and the data, the importance differences, etc., to generate high-quality preliminary query results, providing a good foundation for subsequent optimization.
[0097] S2: Randomly insert low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sort the preliminary data query results and output them to the user.
[0098] Set the insertion ratio of low relevance score data results , for example, 10%, which means that 10% of the query results with low relevance scores are inserted into the sorted data query result list. The low relevance score data results are the composite relevance scores. Search results for data below a certain value.
[0099] The K-means clustering algorithm is used to divide the data results into several semantic categories; the K-means clustering algorithm divides the data results into several semantic categories according to the inventory data vector. The geometric distance relationship in the embedding space is automatically classified, so that the semantics of the results within the class are similar, and the semantics of the results between classes are quite different; the number of clusters It can be estimated based on the data size, generally Order of magnitude, among which is the total number of low-correlation scoring data results; the clustering process takes the sum of squared Euclidean distances from samples within the class to the cluster center as the objective function and uses an iterative optimization method to solve it.
[0100] from Sampling in clusters Low correlation score data results, among which The number of results for inserting low relevance scores is given by Calculated; Represents the floor function; the sampling process takes into account the distribution of the number of clustering results. The probability of sampling from the class with a large number of results is greater, and the probability of sampling from the class with a small number of results is smaller, so as to reflect the diversity of the result space.
[0101] The sampled The low-relevance score data results are inserted into the preliminary data query result list to form a new sorting result; in order to make the distribution of low-relevance score data results in the sorting list more natural and reasonable, an exponential decay insertion position allocation strategy is adopted; the later the sorting list is, the smaller the interval for inserting low-relevance score data results is, which is in line with user browsing habits; the The position of the result to be inserted The calculation formula is:
[0102] ;
[0103] in, is a hyperparameter that controls the shape of the exponential decay curve.
[0104] Rearrange the preliminary data query results after inserting the low-relevance score data results. Randomize the position of Indicates At the same time, a striking mark (such as a different background color) is added to these results to remind the user that these are exploratory results additionally inserted by the system; and the rearranged data query results are output to the user.
[0105] S3: Collect user query behavior data in historical data query events, train a user query satisfaction model based on the LSTM model, and predict user satisfaction with the current query results.
[0106] The query behavior data includes click data, browsing data and feedback data; the click data includes the query results clicked , click order and click timestamp ; The browsing data is included in the query results Duration of stay on , Browse content progress ; The feedback data includes the user's subjective rating of the query results .
[0107] Clean and preprocess the collected query behavior data; remove outliers (such as abnormally long or short click times) and duplicate records; normalize numerical features to eliminate dimensional effects.
[0108] Arrange the query behavior data of a single user in a single query event into a behavior sequence in chronological order ;in To query the total number of steps, if the sequence is too long, it will be truncated to the nearest indivual; Indicates the tth query event. Each query event Contains information in multiple dimensions, such as query terms, data results, behavior types, and query intensity.
[0109] Perform feature engineering on behavior sequence data, build a user query satisfaction model, and , extract query question features , Data result characteristics , User behavior characteristics , concatenate the three types of features into a high-dimensional vector ; Through linear transformation Mapping , get the event The hidden layer feature vector ; According to the time sequence of the query, The hidden layer feature vectors in the query events are arranged into a matrix , as the input sequence of the LSTM model; Indicates The feature vector corresponding to the query event;
[0110] Use a multi-layer LSTM model to Perform feature extraction and satisfaction modeling; LSTM can effectively capture long-distance dependencies in sequence data and explore the temporal dynamic evolution of user behavior through gating mechanisms and memory units;
[0111] In the LSTM model, after The sequential transmission of the LSTM layer, the hidden layer state of the last LSTM layer Contains the entire sequence of behaviors The entire behavior sequence is mapped to a scalar value through the fully connected output layer , as the predicted user satisfaction score :
[0112] ;
[0113] in, is the Sigmoid activation function, and is the output layer parameter of the LSTM model; The value range of is (0,1), and the closer it is to 1, the more satisfied the user is with the current search results.
[0114] After the model training is completed, it can be used for online ranking result satisfaction prediction; the current user's query behavior data is input into the model to predict the user's satisfaction score for the current output query data, and the data query results are incrementally updated based on the satisfaction score.
[0115] Based on the user's historical query behavior data, the satisfaction prediction model is trained to fully tap the user's implicit feedback information. LSTM is used to capture the dynamic evolution of the behavior sequence, and satisfaction is modeled from multiple perspectives such as query, result, and behavior to make the prediction more accurate and comprehensive.
[0116] S4: Based on the predicted user satisfaction with the query results, a query optimization strategy is constructed to incrementally optimize the data query results, and incremental data query results are constructed in a buffer, and the incremental data query results that have not been pushed to the user are stored in the buffer.
[0117] According to the query behavior data of the current user, the user satisfaction is predicted based on the LSTM model, and the user satisfaction standard value is set , if the predicted current user satisfaction Less than the user satisfaction standard value , then the data query results are incrementally optimized according to the query optimization strategy.
[0118] Introduce satisfaction prediction into query optimization, and adaptively adjust query strategies according to the user's satisfaction with the current results. For queries with low satisfaction, generate incremental queries through semantic expansion and other methods, and continuously try to optimize and improve user experience.
[0119] S5: In the buffer, the incrementally optimized current query results are merged with the preliminary data query results, and the data results with low relevance scores are removed. The merged data query results are sorted according to the relevance scores, and the sorted merged data query results are output.
[0120] Construct query optimization strategies to incrementally optimize data query results, and use different mapping strategies to map the same query problem into incremental query vectors that are different from the initial query. , for the query vector Perform vector semantic expansion to obtain incremental query vectors :
[0121] ;
[0122] in, represents the original query vector; represents the incremental query vector, i.e., the new query vector after semantic expansion; Represents a random noise vector, which is used to introduce a small amount of random perturbation; it can be generated by adding a small random offset to the original query vector; is a weight coefficient between 0 and 1, used to control the influence of the original query vector and the noise vector; The closer the value of is to 1, the more similar the incremental query vector is to the original query vector; The closer the value of is to 0, the more the incremental query vector is affected by random noise.
[0123] Increment the query vector Input into the big model, calculate the correlation score between the user query question and the inventory data, and calculate the updated basic correlation calculation score , calculate the updated semantic matching score And the updated importance weight score ; and calculate the updated composite relevance score according to the preliminary data query model :
[0124] ;
[0125] The data query results after the incremental query are merged with the preliminary data query results in the buffer, sorted in reverse order according to the same relevance score standard, and the low-relevance score data query results in the preliminary sorting are deleted. When the user clicks to update the query results, the merged query results are output to the user.
[0126] The preliminary results and incremental optimization results are integrated in the buffer, and the query list is updated dynamically; low-relevance scoring data results are removed to improve the overall quality; at the same time, the stability of the preliminary results is retained to avoid drastic fluctuations caused by the optimization process, and a dynamic balance of the query results is achieved.
[0127] Example 2
[0128] Reference Figure 2 , which is the second embodiment of the present invention, provides a data query result ranking system that integrates large models and incremental learning.
[0129] The system includes: a preliminary query module, an adversarial sample module, a user query satisfaction module, an incremental query module and an incremental fusion module.
[0130] The preliminary query module, based on the pre-trained large model, understands and queries the questions input by the user, constructs a preliminary data query model, calculates the correlation score between the user query question and the data results, and arranges the results in reverse order of the correlation score as the preliminary data query results.
[0131] The adversarial sample module randomly inserts low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sorts the preliminary data query results and outputs them to the user.
[0132] The user query satisfaction module collects user query data in historical data query events, trains a user query satisfaction model built based on the LSTM model, and predicts user satisfaction with the current query result.
[0133] The incremental query module constructs a query optimization strategy based on the predicted user satisfaction with the query result, incrementally optimizes the current query result, constructs incremental data query results in a buffer, and stores the incremental data query results that have not been pushed to the user in the buffer.
[0134] The incremental fusion module fuses the incremental optimized data query results with the preliminary data query results in the buffer, removes the data results with low correlation scores, sorts the fused data query results according to the correlation scores, and outputs the sorted fused data query results.
[0135] Example 3
[0136] The present invention also provides an electronic device. The electronic device may include one or more processors and one or more memories. The memories store computer-readable codes, and when the computer-readable codes are executed by the one or more processors, the data query result ranking method integrating the large model and incremental learning as described above may be executed.
[0137] The method or system according to the embodiment of the present invention may also be implemented with the aid of the architecture of the electronic device of the present invention.
[0138] An electronic device may include a bus, one or more CPUs, read-only memory (ROM), random access memory (RAM), a communication port for connecting to a network, input / output components, a hard disk, and the like.
[0139] A storage device in an electronic device, such as a ROM or a hard disk, can store the data query result sorting method that integrates a large model and incremental learning provided by the present invention.
[0140] The method for sorting data query results by integrating a large model with incremental learning includes: based on a pre-trained large model, understanding and querying questions input by users, building a preliminary data query model, calculating the correlation score between the user query question and inventory data, and arranging the results in reverse order of the correlation score as preliminary data query results; randomly inserting low-correlation score data results in proportion into the preliminary data query results as adversarial samples of a user query satisfaction model, and sorting the preliminary data query results to the user; collecting user query data in historical data query events, training a user query satisfaction model built based on an LSTM model, and predicting user satisfaction with current query results; building a query optimization strategy based on the predicted user satisfaction with the query results, incrementally optimizing the current query results, and building incremental data query results in a buffer, storing the incremental data query results that have not been pushed to the user in the buffer; fusing the incrementally optimized data query results with the preliminary data query results in the buffer, while removing the low-correlation score data results, sorting the fused data query results according to the correlation score, and outputting the sorted fused data query results.
[0141] Furthermore, the electronic device may also include a user interface. Of course, the architecture of the present invention is only exemplary, and when implementing different devices, one or more components in the electronic device disclosed in the present invention may be omitted according to actual needs.
[0142] Example 4
[0143] The invention also discloses a computer-readable storage medium.
[0144] The computer-readable storage medium has computer-readable instructions stored thereon.
[0145] When the computer-readable instructions are executed by the processor, the data query result ranking method integrating the large model and incremental learning according to the embodiment of the present invention described with reference to the above drawings can be executed.
[0146] The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. In addition, according to an embodiment of the present invention, the process described above with reference to the flowchart may be implemented as a computer software program.
[0147] For example, the present invention provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided by the present invention, for example: based on a pre-trained large model, understand and query the questions input by the user, build a preliminary data query model, calculate the correlation score between the user query question and the inventory data, and arrange them in reverse order according to the correlation score as the preliminary data query result; randomly insert low-correlation score data results in proportion into the preliminary data query result as adversarial samples of the user query satisfaction model, and sort the preliminary data query results and output them to the user; collect the query data of users in historical data query events, train the user query satisfaction model built based on the LSTM model, and predict the user's satisfaction with the current query result; according to the predicted user satisfaction with the query result, build a query optimization strategy, incrementally optimize the current query result, and build incremental data query results in a buffer, and store the incremental data query results that have not been pushed to the user in the buffer; merge the incremental optimized data query results with the preliminary data query results in the buffer, and remove the low-correlation score data results at the same time, sort the fused data query results according to the correlation score, and output the sorted fused data query results.
[0148] When the computer program is executed by the central processing unit (CPU), the above functions defined in the method of the present invention are performed. The method, apparatus, and device of the present invention may be implemented in many ways. For example, the method, apparatus, and device of the present invention may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware.
[0149] The above sequence for the steps of the method is for illustration only, and the steps of the method of the present invention are not limited to the sequence specifically described above unless otherwise specifically stated.
[0150] In addition, in some embodiments, the present invention can also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present invention. Therefore, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
[0151] In addition, the parts of the above technical solutions provided in the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0152] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data query result ranking method integrating a large model and incremental learning, characterized in that: include: Based on the pre-trained large model, understand and query the questions input by users, build a preliminary data query model, calculate the relevance score between the user query questions and inventory data, and sort them in reverse order of relevance scores as preliminary data query results; Randomly insert low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sort the preliminary data query results and output them to the user; Collect user query behavior data in historical data query events, train a user query satisfaction model based on the LSTM model, and predict user satisfaction with the current query results; Based on the predicted user satisfaction with the current query results, a query optimization strategy is constructed to incrementally optimize the current query results, and incremental data query results are constructed in the buffer, and incremental data query results that have not been pushed to users are stored in the buffer; In the buffer, the incrementally optimized current query results are merged with the preliminary data query results, and the data results with low relevance scores are removed. The merged data query results are sorted according to the relevance scores, and the sorted merged data query results are output; Pre-train the big model; adjust the big model and use the adjusted big model to semantically encode the query questions input by the user; Input the query question into the big model and extract the [CLS] vector as the query vector of the query question, denoted as ; Using the adjusted large model to analyze inventory data Encode each inventory data in the , extract the semantic vector of the inventory data; adopt the average pooling method, that is, take the average of the hidden layer state of the inventory data as the vector of the entire inventory data ; Indicates A vector of inventory data, , Indicates the quantity of inventory data; Calculating the query vector A vector with each stock data constructing a multi-factor correlation calculation model, wherein the multi-factor correlation calculation model includes a basic correlation calculation model, a semantic matching calculation model, and an importance weight calculation model; The basic correlation calculation model is used to calculate the basic correlation score , using the cosine similarity function to calculate the query vector and the stock data vector The similarity of the two vectors is used as the basic relevance score; the query vector after the cosine similarity calculation vector is normalized and the stock data vector Dot product, value range is [0,1], basic correlation score The calculation formula is as follows: ; in Represents the L2 norm of the vector; The value range of is [0,1], Indicates that the user input The problem is transformed into a vector representation. express The transpose of Indicates Candidate inventory data results.
2. The data query result sorting method integrating large model and incremental learning according to claim 1 is characterized in that: The semantic matching calculation model is used to calculate the semantic matching score , calculate the query vector With stock data vector Semantic matching scores in large models: ; ; in and Indicates that and The concatenated input sequence; and is the output layer parameter of the large model, express and The probability of matching in the current semantic space, is the activation function; The importance weight calculation model is used to calculate the importance weight score , according to the importance of each word in the query question, the inventory data vector is weighted. First, the importance of each query word is calculated through the inverse document frequency, and the inverse document frequency IDF value of the query word is normalized as the weight, and multiplied with each dimension of the inventory data vector to obtain the weighted inventory data vector representation; the inner product of the weighted data result vector and the query vector is calculated to obtain the weighted importance weight score : ; ; ; in, For query words The inverse document frequency of is the normalized weight coefficient; for Middle The word vector corresponding to the query word; is the weighted inventory data vector representation; m represents the total number of query terms; The multi-factor correlation calculation model is used to calculate the composite correlation score , by weighted summation, based on the basic relevance score , semantic matching score , Importance Weight Rating , calculate the composite relevance score : ; in Base relevance scores , semantic matching score , Importance Weight Rating The weighting coefficient of Based on composite relevance score Sort the search results of all inventory data in descending order to get a sorted result list .
3. The data query result sorting method integrating large model and incremental learning according to claim 2 is characterized in that: Set the insertion ratio of low relevance score data results , the low-correlation scoring data results are divided into multiple semantic categories through the K-means clustering algorithm; the K-means clustering algorithm divides the low-correlation scoring data results into multiple semantic categories according to the inventory data vector The geometric distance relationship in the embedding space is automatically classified, and the number of clusters is Pick Order of magnitude, among which is the total number of low-correlation scoring data results; the clustering process takes minimizing the sum of squares of the Euclidean distances from samples within the class to the cluster center as the objective function and uses an iterative optimization method to solve it; from Sampling in clusters Low correlation score data results, among which The number of results for inserting low relevance scores is given by Calculated; represents the floor function; The sampled The low-correlation score data results are inserted into the preliminary data query result list to form a new sorting result; an exponential decay insertion position allocation strategy is adopted; the The position of the result to be inserted The calculation formula is: ; in, is a hyperparameter that controls the shape of the exponential decay curve; The preliminary data query results after inserting the low-relevance score data results are rearranged. Randomize the position of For the The rearranged data query results are output to the user.
4. The data query result sorting method integrating large model and incremental learning according to claim 3 is characterized in that: Collect user query behavior data in historical data query events, and train a user query satisfaction model based on the LSTM model, including: the query behavior data includes click data, browsing data and feedback data; the click data includes the query results clicked , click order and click timestamp ; The browsing data is included in the query results Duration of stay on , Browse content progress ; The feedback data includes the user's subjective rating of the query results ; Clean and preprocess the collected query behavior data; remove outliers and duplicate records; normalize numerical features to eliminate dimensional effects; Arrange the query behavior data of a single user in a single query event into a behavior sequence in chronological order ;in To query the total number of steps, represents the tth query event; each query event Contains information in multiple dimensions, including query vector, number of query results, click data, browsing data, and feedback data; Perform feature engineering on behavior sequence data, build a user query satisfaction model, and , extract query question features , Data result characteristics , User behavior characteristics , concatenate the three types of features into a high-dimensional vector ; Through linear transformation Mapping , get the event The hidden layer feature vector ; According to the time sequence of the query, The hidden layer feature vectors in the query events are arranged into a matrix , as the input sequence of the LSTM model; Indicates The feature vector corresponding to the query event; Use a multi-layer LSTM model to Perform feature extraction and satisfaction modeling; in the LSTM model, after Sequential transmission of the layer LSTM, the hidden layer state of the last layer LSTM Contains the entire sequence of behaviors The entire behavior sequence is mapped to a scalar value through the fully connected output layer , as the predicted user satisfaction score : ; in, is the Sigmoid activation function, and is the output layer parameter of the LSTM model; The value range is (0,1).
5. The data query result sorting method integrating large model and incremental learning according to claim 4 is characterized in that: After the user query satisfaction model is trained, the query behavior data of the current user is input into the user query satisfaction model to predict the user's satisfaction score for the current query result, and the current query result is incrementally updated according to the satisfaction score; According to the query behavior data of the current user, the predicted user satisfaction score based on the user query satisfaction model is used to set the user satisfaction standard value , if the predicted current user satisfaction score Less than the user satisfaction standard value , the current query results are incrementally optimized according to the query optimization strategy.
6. The data query result sorting method integrating large model and incremental learning according to claim 5 is characterized in that: According to the query optimization strategy, the incremental optimization of the current query result includes: using different mapping strategies to map the same query question into incremental query vectors different from the initial query , for the query vector Perform vector semantic expansion to obtain incremental query vectors : ; in, represents the original query vector; represents the incremental query vector, i.e., the new query vector after semantic expansion; Represents a random noise vector, which is used to introduce a small amount of random disturbance; is a weight coefficient between 0 and 1, used to control the influence of the original query vector and the random noise vector; Increment the query vector Input into the big model, calculate the correlation score between the user query question and the inventory data, and calculate the updated basic correlation calculation score , calculate the updated semantic matching score And the updated importance weight score ; and calculate the updated composite relevance score according to the preliminary data query model : ; The data query results after the incremental query are merged with the preliminary data query results in the buffer, sorted in reverse order according to the same relevance score standard, and the low-relevance score data query results in the preliminary sorting are deleted. When the user clicks to update the query results, the merged query results are output to the user.
7. A data query result sorting system integrating a large model and incremental learning, which is used to implement the data query result sorting method integrating a large model and incremental learning as described in any one of claims 1 to 6, characterized in that: It includes: preliminary query module, adversarial sample module, user query satisfaction module, incremental query module and incremental fusion module; The preliminary query module, based on the pre-trained large model, understands and queries the questions input by the user, builds a preliminary data query model, calculates the relevance score between the user's query question and the inventory data, and arranges the results in reverse order of the relevance score as preliminary data query results; The adversarial sample module randomly inserts low-relevance score data results in proportion into the preliminary data query results as adversarial samples of the user query satisfaction model, and sorts the preliminary data query results and outputs them to the user; The user query satisfaction module collects the query data of users in historical data query events, trains a user query satisfaction model based on the LSTM model, and predicts the user's satisfaction with the current query result; The incremental query module constructs a query optimization strategy based on the predicted user satisfaction with the query result, incrementally optimizes the current query result, constructs incremental data query results in a buffer, and stores incremental data query results that have not been pushed to the user in the buffer; The incremental fusion module fuses the incremental optimized data query results with the preliminary data query results in the buffer, removes the data results with low correlation scores, sorts the fused data query results according to the correlation scores, and outputs the sorted fused data query results.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a computer program that can be called by the processor; the processor executes the data query result sorting method of integrating a large model and incremental learning as described in any one of claims 1 to 6 by calling the computer program stored in the memory.
9. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer executes the data query result sorting method of integrating a large model and incremental learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data query method
CN117743664A
Artificial intelligence data search and distribution method and system
CN118467851A