A data generation method and device, computer equipment and storage medium

By training a deep learning model and generating a model using users' historical behavior data, the problem of lack of personalization in data queries in existing technologies is solved, and query results that are more in line with users' interests are generated.

CN117725164BActive Publication Date: 2026-11-06XIAOHONGSHU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310913576.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2026-11-06
Estimated Expiration
2043-07-24

AI Technical Summary

Technical Problem

Existing data query methods cannot meet users' personalized needs, and query results generated by search engines or question-and-answer systems lack personalized consideration.

Method used

By acquiring sample datasets, extracting sample features, and inputting them into an improved deep learning model for training, a data generation model is generated, which uses users' historical behavior data to generate personalized query results.

Benefits of technology

It improves the personalization of data queries, and the generated query results are more in line with users' interests and needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117725164B_ABST
    Figure CN117725164B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data generation method and device, computer equipment and a storage medium. The method comprises: obtaining a sample data set, the sample data set comprising a plurality of sample data, each sample data being a triple data, the triple data comprising sample user data, a sample query word and a sample query document corresponding to the sample query word, wherein the sample user data comprises a user identifier and historical behavior data of the user; extracting sample features from each sample data of the sample data set, inputting the sample features into an improved deep learning model for training, and obtaining a data generation model; obtaining query data and historical behavior data of a user corresponding to the query data, and inputting the query data and the historical behavior data of the user corresponding to the query data into the data generation model to generate query result data corresponding to the query data. In this way, data meeting the personalized needs of a user can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a data generation method, apparatus, computer device, and storage medium. Background Technology

[0002] With the development of computer technology, there are increasingly more technologies for data querying, mainly in two ways: one is that users can query data through existing query systems such as search engines or chatbots. Users can enter a query term into a search engine, and the search engine can output search results for that term; for example, the query term can be a question, and the search results can be answers. The other way is to generate query results for the query term using a model. However, the results obtained through search engines are limited in terms of both data and quantity. Currently, the query results generated by models are relatively broad and cannot meet the personalized needs of users. Therefore, how to better query data has become a research focus. Summary of the Invention

[0003] This application provides a data generation method, apparatus, computer device, and storage medium, which can be trained to obtain a data generation model that meets the personalized needs of users, so as to generate data that meets the personalized needs of users.

[0004] In a first aspect, embodiments of this application provide a data generation method, including:

[0005] Obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, sample query terms, and sample query documents corresponding to the sample query terms. The sample user data includes user identifiers and user historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information.

[0006] Extract sample features from each sample data in the sample dataset, and input the sample features into an improved deep learning model for training to obtain a data generation model;

[0007] Obtain the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0008] Secondly, embodiments of this application provide a data generation apparatus, including:

[0009] The acquisition unit is used to acquire a sample dataset, which includes multiple sample data, each sample data being a triplet data. The triplet data includes sample user data, sample query terms, and sample query documents corresponding to the sample query terms. The sample user data includes user identifiers and user historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information.

[0010] The training unit is used to extract sample features from each sample data in the sample dataset and input the sample features into the improved deep learning model for training to obtain the data generation model.

[0011] The generation unit is used to acquire the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0012] Thirdly, embodiments of this application provide a computer device, the computer device including: a processor and a memory, the processor being configured to execute the method described in the first aspect above.

[0013] Fourthly, embodiments of this application also provide a computer-readable storage medium storing program instructions that, when executed, implement the method described in the first aspect above.

[0014] The embodiments of this application are possible. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating a data generation method provided in an embodiment of this application;

[0017] Figure 2 This is a flowchart illustrating another data generation method provided in an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of the structure of a data generation model provided in an embodiment of this application;

[0019] Figure 4This is a schematic diagram of the structure of a data generation device provided in an embodiment of this application;

[0020] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0022] Currently, the main methods for data retrieval are through question-and-answer systems and search engines. Question-and-answer systems primarily involve users inputting questions and the system outputting answers. Search engines, on the other hand, allow users to input keywords into the search engine. Search engines can find relevant web pages or generate query data using models. However, the query data generated by these models is based solely on the question (or query term) itself and does not consider personalized needs such as user interests.

[0023] Therefore, this application proposes a data generation method for this situation, applicable to scenarios such as dialogue systems, search engines, and question-answering systems. The method involves acquiring a sample dataset, which includes multiple sample data sets, each consisting of a triplet. Each triplet includes sample user data, a sample query term, and the corresponding sample query document. The sample user data includes a user identifier and the user's historical behavior data, including historical document clicks and historical search query terms. Sample features are extracted from each sample data set and input into an improved deep learning model for training, resulting in a data generation model. The method then acquires the query data and inputs it into the data generation model to generate query result data corresponding to the query data. Query result data generated in this way can meet users' personalized query data needs.

[0024] The data generation method provided in this application embodiment can be applied to a data generation device, which can be installed in a computer device. In some embodiments, the computer device may include, but is not limited to, smart terminal devices such as smartphones, tablets, laptops, desktop computers, in-vehicle smart terminals, and smartwatches.

[0025] The data generation method provided in the embodiments of this application will be illustrated below with reference to the accompanying drawings.

[0026] Please see details. Figure 1 , Figure 1 This is a flowchart illustrating a data generation method provided in an embodiment of this application. The data generation method in this embodiment can be executed by a data generation device, which can be located in a computer device.

[0027] S101: Obtain the sample dataset, which includes multiple sample data. Each sample data is a triplet data, which includes sample user data, sample query term, and the sample query document corresponding to the sample query term.

[0028] In this embodiment of the application, the computer device can acquire a sample dataset, which includes multiple sample data, each sample data being a triplet data, which includes sample user data, sample query term, and sample query document corresponding to the sample query term. The sample user data includes a user identifier and the user's historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information.

[0029] The user identifier may include, but is not limited to, any one or more characters such as text, numbers, and letters. The user's historical clicked document information may include, but is not limited to, the number of times and time information of historical clicked documents within a certain period of time. The user's historical search query information may include, but is not limited to, the user's historical search query information within a certain period of time. In some embodiments, the sample query term and the sample query document corresponding to the sample query term may include, but is not limited to, any one or more text data such as text, letters, and numbers.

[0030] As users search for a query term, the search engine returns multiple documents. Users click to access these documents and may then engage in interactive behaviors such as liking or saving them. If such interactions occur, it indicates that the document is relevant to the query term and aligns with the user's interests. Therefore, using this triplet data—comprising sample user data, sample query terms, and corresponding sample query documents—can help train a data generation model that meets user personalization needs.

[0031] S102: Extract sample features from each sample data in the sample dataset, and input the sample features into the improved deep learning model for training to obtain the data generation model.

[0032] In this embodiment, a computer device can extract sample features from each sample data in the sample dataset and input these features into an improved deep learning model for training to obtain a data generation model. In some embodiments, the improved deep learning model includes an encoder and a decoder. The encoder includes an embedding layer and two self-attention layers. The encoder is used to encode user identifier features and user historical behavior data features in the sample user features to obtain a sample user feature vector. The decoder is used to decode the sample user feature vector obtained by the encoder and the query term in the triple data in the sample data to generate query result data corresponding to the query term.

[0033] In one embodiment, when extracting sample features from each sample data in the sample dataset, the computer device may extract sample user features from sample users in the triple data of each sample data in the sample dataset, extract sample query term features from sample query terms in the triple data of each sample data, and extract sample query document features from sample query documents in the triple data of each sample data. The sample user features include user identifier features and user historical behavior data features. The sample features are determined based on the sample user features, the sample query term features, and the sample query document features.

[0034] S103: Obtain the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0035] In this embodiment of the application, the computer device can obtain the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0036] In one embodiment, when a computer device obtains data to be queried and the historical behavior data of the user corresponding to the data to be queried, it may obtain the user identifier of the data to be queried and determine the historical behavior data of the user corresponding to the user identifier based on the user identifier of the data to be queried.

[0037] In one embodiment, when a computer device inputs the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried, it can input the user identifier of the data to be queried and the historical behavior data of the user corresponding to the user identifier into the encoder of the data generation model to obtain the user feature vector of the data to be queried; and input the data to be queried and the user feature vector of the data to be queried into the decoder of the data generation model to generate query result data corresponding to the data to be queried.

[0038] This application embodiment can obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, a sample query term, and a corresponding sample query document. The sample user data includes a user identifier and the user's historical behavior data, including the user's historical clicked document information and historical search query term information. Sample features are extracted from each sample data in the sample dataset, and these features are input into an improved deep learning model for training, resulting in a data generation model. Query data is then obtained and input into the data generation model to generate query result data corresponding to the query data. This method allows for the training of a data generation model that meets personalized needs, improving model reliability, and further enabling the generation of query result data that satisfies users' personalized requirements.

[0039] Please see details. Figure 2 , Figure 2 This is a flowchart illustrating another data generation method provided in this application embodiment. The data generation method of this application embodiment can be executed by a data generation device, which is disposed in a computer device, as explained above. Specifically, the method of this application embodiment includes the following steps.

[0040] S201: Obtain the sample dataset, which includes multiple sample data. Each sample data is a triplet data, which includes sample user data, sample query term, and the sample query document corresponding to the sample query term.

[0041] S202: Extract sample user features, sample query term features, and sample query document features from the triplet data of each sample data in this sample dataset.

[0042] In this embodiment of the application, the computer device can extract sample user features from the sample users of the triple data of each sample data in the sample dataset, extract sample query term features from the sample query terms of the triple data of each sample data, and extract sample query document features from the sample query documents of the triple data of each sample data. The sample user features include user identification features and user historical behavior data features.

[0043] S203: Determine the features of the sample based on the user features, the query term features, and the query document features, and input the sample features into the improved deep learning model for training to obtain the data generation model.

[0044] In this embodiment of the application, the computer device can determine the sample features based on the sample user features, the sample query term features, and the sample query document features, and input the sample features into an improved deep learning model for training to obtain a data generation model.

[0045] In one embodiment, when a computer device determines the sample features based on the sample user features, the sample query term features, and the sample query document features, it can directly determine the sample user features, the sample query term features, and the sample query document features as the sample features.

[0046] In one optional implementation, when determining the sample feature based on the sample user feature, the sample query term feature, and the sample query document feature, the computer device may perform a fusion process on the sample user feature, the sample query term feature, and the sample query document feature to determine the fused feature as the sample feature. In some embodiments, the fusion process may be a vector fusion of the sample user feature, the sample query term feature, and the sample query document feature.

[0047] In one embodiment, the improved deep learning model includes an encoder and a decoder. When the computer device trains the improved deep learning model by inputting the sample features into the sample user features to obtain a data generation model, it can input the user identifier features and the user's historical behavior data features from the sample user features into the encoder of the improved deep learning model to obtain a sample user feature vector; input the sample query term and the sample user feature vector into the decoder of the improved deep learning model to obtain the query result of the sample query term; and train the improved deep learning model using the query result of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model.

[0048] In one embodiment, the encoder includes an embedding layer and a self-attention layer. When the computer device inputs the user identification feature and the user's historical behavior data feature from the sample user features into the encoder of the improved deep learning model to obtain the sample user feature vector, it can input the user identification feature from the sample user features into the embedding layer of the encoder of the improved deep learning model to obtain the user identification feature vector; input the user's historical behavior data feature from the sample user features into the self-attention layer of the encoder to obtain the historical behavior data feature vector; and determine the user identification feature vector and the historical behavior data feature vector as the sample user feature vector.

[0049] In one embodiment, the user's historical behavior data features include the user's historical click document features and the user's historical search query term features. The encoder's self-attention layer includes a first self-attention layer and a second self-attention layer. When the computer device inputs the user's historical behavior data features from the sample user features into the encoder's self-attention layer to obtain a historical behavior data feature vector, it can input the user's historical click document features into the encoder's first self-attention layer to obtain a historical click document feature vector; and input the user's historical search query term features into the encoder's second self-attention layer to obtain a historical search query term feature vector. The historical click document feature vector and the historical search query term feature vector are determined as the historical behavior data feature vector.

[0050] Specifically, it can be... Figure 3 Let's take an example to illustrate. Figure 3 This is a schematic diagram of the structure of a data generation model provided in an embodiment of this application, such as... Figure 3As shown, the model can include an encoder and a decoder. The encoder consists of three neural networks, including an embedding layer and two self-attention layers (i.e., the first self-attention layer and the second self-attention layer). The embedding layer takes user identifier features as input and outputs a user identifier feature vector representing the user's interests. The first self-attention layer takes m document vectors (i.e., historical clicked document features) as input and outputs m vectors (i.e., historical clicked document feature vectors). Each input document vector corresponds to a document recently clicked or interacted with by the user, and the vector is represented by a vector extracted from the document text using a model (such as the BERT model). The second self-attention layer takes n query term vectors recently searched by the user (i.e., historical search query term features) as input and outputs n vectors (i.e., historical search query term feature vectors). Each query term vector corresponds to a query term recently searched by the user, and the vector is represented by a vector extracted from the query term text using the BERT model. The vectors output from the three neural networks of the encoder are used as keys and values ​​and input to the decoder network. The decoder network takes each character of the query term as input and generates each character of the query result data (such as the answer) corresponding to that query term.

[0051] In one embodiment, when a computer device trains an improved deep learning model using the query results of the sample query term and the corresponding sample query document to obtain the data generation model, it can compare the query results of the sample query term with the corresponding sample query document and determine the loss function value based on the comparison result. If the loss function value is greater than a function threshold, the model parameters of the improved deep learning model are adjusted based on the loss function value. The sample features are then input into the deep learning model after adjusting the model parameters for retraining. When the loss function value obtained from the retraining is less than the function threshold, the data generation model is determined to be obtained.

[0052] S204: Obtain the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0053] This application embodiment uses historical query data of interest to the user and the query term as input to generate query result data for the query term. This query result data is not only related to the query term but also conforms to the user's interests, which helps to improve the reliability of the data generation model trained based on the query result data, so that the query result data generated by the data generation model can meet the user's personalized needs.

[0054] Please see Figure 4 ,Figure 4 This is a schematic diagram of the structure of a data generation device provided in an embodiment of this application. Specifically, the device is disposed in a computer device, and the device includes: an acquisition unit 401, a training unit 402, and a generation unit 403;

[0055] The acquisition unit 401 is used to acquire a sample dataset, which includes multiple sample data, each sample data being a triplet data, the triplet data including sample user data, sample query term and sample query document corresponding to the sample query term, wherein the sample user data includes user identifier and user historical behavior data, the user historical behavior data including user historical click document information and user historical search query term information;

[0056] Training unit 402 is used to extract sample features from each sample data in the sample dataset and input the sample features into the improved deep learning model for training to obtain a data generation model;

[0057] The generation unit 403 is used to acquire the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0058] Furthermore, when the training unit 402 extracts sample features from each sample data in the sample dataset, it is specifically used for:

[0059] Sample user features are extracted from the sample users in the triple data of each sample data in the sample dataset, sample query term features are extracted from the sample query terms in the triple data of each sample data, and sample query document features are extracted from the sample query documents in the triple data of each sample data. The sample user feature vector includes user identifier features and user historical behavior data features.

[0060] The sample features are determined based on the sample user features, the sample query term features, and the sample query document features.

[0061] Furthermore, the improved deep learning model includes an encoder and a decoder; when the training unit 402 inputs the sample features into the improved deep learning model for training to obtain the data generation model, it is specifically used for:

[0062] The user identifier features and the user's historical behavior data features from the sample user features are input into the encoder of the improved deep learning model to obtain the sample user feature vector;

[0063] The sample query term and the sample user feature vector are input into the decoder of the improved deep learning model to obtain the query result of the sample query term;

[0064] The improved deep learning model is trained using the query results of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model.

[0065] Furthermore, the encoder includes an embedding layer and a self-attention layer; when the training unit 402 inputs the user identifier features and the user's historical behavior data features from the sample user features into the encoder of the improved deep learning model to obtain the sample user feature vector, it is specifically used for:

[0066] The user identifier features in the sample user features are input into the embedding layer of the encoder of the improved deep learning model to obtain the user identifier feature vector;

[0067] The historical behavior data features of users in the sample user features are input into the self-attention layer of the encoder to obtain the historical behavior data feature vector;

[0068] The user identifier feature vector and the historical behavior data feature vector are determined as the sample user feature vector.

[0069] Furthermore, the user's historical behavior data features include the user's historical clicked document features and the user's historical search query term features, and the encoder's self-attention layer includes a first self-attention layer and a second self-attention layer; when the training unit 402 inputs the user's historical behavior data features from the sample user features into the encoder's self-attention layer to obtain the historical behavior data feature vector, it is specifically used for:

[0070] The user's historical click document features are input into the first self-attention layer of the encoder to obtain the historical click document feature vector;

[0071] The user's historical search query term features are input into the second self-attention layer of the encoder to obtain the historical search query term feature vector;

[0072] The historical clicked document feature vector and the historical search query term feature vector are determined as the historical behavior data feature vector.

[0073] Furthermore, when the training unit 402 trains the improved deep learning model using the query results of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model, it is specifically used for:

[0074] The query results of the sample query term are compared with the sample query documents corresponding to the sample query term, and the loss function value is determined based on the comparison results.

[0075] If the loss function value is greater than the function threshold, the model parameters of the improved deep learning model are adjusted according to the loss function value.

[0076] The sample features are input into the deep learning model after adjusting the model parameters and retrained. When the loss function value obtained from the retraining is less than the function threshold, the data generation model is determined.

[0077] Furthermore, when the generation unit 403 acquires the data to be queried and the historical behavior data of the user corresponding to the data to be queried, it is specifically used for:

[0078] Obtain the user identifier of the data to be queried, and determine the historical behavior data of the user corresponding to the user identifier based on the user identifier of the data to be queried;

[0079] When the generation unit 403 inputs the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model, and generates query result data corresponding to the data to be queried, it is specifically used for:

[0080] The user identifier of the data to be queried and the historical behavior data of the user corresponding to the user identifier are input into the encoder of the data generation model to obtain the user feature vector of the data to be queried.

[0081] The data to be queried and the user feature vector of the data to be queried are input into the decoder of the data generation model to generate query result data corresponding to the data to be queried.

[0082] This application embodiment can obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, a sample query term, and a corresponding sample query document. The sample user data includes a user identifier and the user's historical behavior data, including the user's historical clicked document information and historical search query term information. Sample features are extracted from each sample data in the sample dataset, and these features are input into an improved deep learning model for training, resulting in a data generation model. Query data is then obtained and input into the data generation model to generate query result data corresponding to the query data. This method allows for the training of a data generation model that meets personalized needs, improving model reliability, and further enabling the generation of query result data that satisfies users' personalized requirements.

[0083] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Specifically, the computer device includes: a memory 501 and a processor 502.

[0084] In one embodiment, the computer device further includes a data interface 503 for transmitting data information between the computer device and other devices.

[0085] The memory 501 may include volatile memory; the memory 501 may also include non-volatile memory; the memory 501 may also include a combination of the above types of memory. The processor 502 may be a central processing unit (CPU). The processor 502 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), or any combination thereof.

[0086] The memory 501 is used to store programs, and the processor 502 can call the programs stored in the memory 501 to perform the following steps:

[0087] Obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, sample query terms, and sample query documents corresponding to the sample query terms. The sample user data includes user identifiers and user historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information.

[0088] Extract sample features from each sample data in the sample dataset, and input the sample features into an improved deep learning model for training to obtain a data generation model;

[0089] Obtain the data to be queried and the historical behavior data of the user corresponding to the data to be queried, and input the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried.

[0090] Furthermore, when the processor 502 extracts sample features from each sample data in the sample dataset, it is specifically used for:

[0091] Sample user features are extracted from the sample users in the triple data of each sample data in the sample dataset, sample query term features are extracted from the sample query terms in the triple data of each sample data, and sample query document features are extracted from the sample query documents in the triple data of each sample data. The sample user feature vector includes user identifier features and user historical behavior data features.

[0092] The sample features are determined based on the sample user features, the sample query term features, and the sample query document features.

[0093] Furthermore, the improved deep learning model includes an encoder and a decoder; when the processor 502 inputs the sample features into the improved deep learning model for training to obtain the data generation model, it is specifically used for:

[0094] The user identifier features and the user's historical behavior data features from the sample user features are input into the encoder of the improved deep learning model to obtain the sample user feature vector;

[0095] The sample query term and the sample user feature vector are input into the decoder of the improved deep learning model to obtain the query result of the sample query term;

[0096] The improved deep learning model is trained using the query results of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model.

[0097] Furthermore, the encoder includes an embedding layer and a self-attention layer; when the processor 502 inputs the user identifier features and the user's historical behavior data features from the sample user features into the encoder of the improved deep learning model to obtain the sample user feature vector, it is specifically used for:

[0098] The user identifier features in the sample user features are input into the embedding layer of the encoder of the improved deep learning model to obtain the user identifier feature vector;

[0099] The historical behavior data features of users in the sample user features are input into the self-attention layer of the encoder to obtain the historical behavior data feature vector;

[0100] The user identifier feature vector and the historical behavior data feature vector are determined as the sample user feature vector.

[0101] Further, the user's historical behavior data features include the user's historical clicked document features and the user's historical search query term features, and the encoder's self-attention layer includes a first self-attention layer and a second self-attention layer; when the processor 502 inputs the user's historical behavior data features from the sample user features into the encoder's self-attention layer to obtain the historical behavior data feature vector, it is specifically used for:

[0102] The user's historical click document features are input into the first self-attention layer of the encoder to obtain the historical click document feature vector;

[0103] The user's historical search query term features are input into the second self-attention layer of the encoder to obtain the historical search query term feature vector;

[0104] The historical clicked document feature vector and the historical search query term feature vector are determined as the historical behavior data feature vector.

[0105] Furthermore, when the processor 502 trains the improved deep learning model using the query results of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model, it is specifically used for:

[0106] The query results of the sample query term are compared with the sample query documents corresponding to the sample query term, and the loss function value is determined based on the comparison results.

[0107] If the loss function value is greater than the function threshold, the model parameters of the improved deep learning model are adjusted according to the loss function value.

[0108] The sample features are input into the deep learning model after adjusting the model parameters and retrained. When the loss function value obtained from the retraining is less than the function threshold, the data generation model is determined.

[0109] Furthermore, when the processor 502 acquires the data to be queried and the historical behavior data of the user corresponding to the data to be queried, it is specifically used for:

[0110] Obtain the user identifier of the data to be queried, and determine the historical behavior data of the user corresponding to the user identifier based on the user identifier of the data to be queried;

[0111] When the processor 502 inputs the data to be queried and the historical behavior data of the user corresponding to the data to be queried into the data generation model to generate query result data corresponding to the data to be queried, it is specifically used for:

[0112] The user identifier of the data to be queried and the historical behavior data of the user corresponding to the user identifier are input into the encoder of the data generation model to obtain the user feature vector of the data to be queried.

[0113] The data to be queried and the user feature vector of the data to be queried are input into the decoder of the data generation model to generate query result data corresponding to the data to be queried.

[0114] This application embodiment can obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, a sample query term, and a corresponding sample query document. The sample user data includes a user identifier and the user's historical behavior data, including the user's historical clicked document information and historical search query term information. Sample features are extracted from each sample data in the sample dataset, and these features are input into an improved deep learning model for training, resulting in a data generation model. Query data is then obtained and input into the data generation model to generate query result data corresponding to the query data. This method allows for the training of a data generation model that meets personalized needs, improving model reliability, and further enabling the generation of query result data that satisfies users' personalized requirements.

[0115] Embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements this application. Figure 1 or Figure 2 The method described in the corresponding embodiment can also be implemented. Figure 4 The apparatus described in the embodiments corresponding to this application will not be repeated here.

[0116] The computer-readable storage medium can be an internal storage unit of the device described in any of the foregoing embodiments, such as the device's hard drive or memory. The computer-readable storage medium can also be an external storage device of the device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the device. Further, the computer-readable storage medium may include both internal and external storage units of the device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0117] Embodiments of this application also provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.

[0118] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0119] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of this application still fall within the scope of this invention.

Claims

1. A data generation method, characterized in that, include: Obtain a sample dataset, which includes multiple sample data, each of which is a triplet data. The triplet data includes sample user data, sample query terms, and sample query documents corresponding to the sample query terms. The sample user data includes user identifiers and user historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information. Sample user features are extracted from the sample users in the triplet data of each sample dataset, sample query term features are extracted from the sample query terms in the triplet data of each sample dataset, and sample query document features are extracted from the sample query documents in the triplet data of each sample dataset. The sample user features include user identifier features and user historical behavior data features. Sample features are determined based on the sample user features, the sample query term features, and the sample query document features, and the sample features are input into an improved deep learning model for training to obtain a data generation model. Obtain the query term and the historical behavior data of the user corresponding to the query term, and input the query term and the historical behavior data of the user corresponding to the query term into the data generation model to generate query result data corresponding to the query term; The improved deep learning model includes an encoder and a decoder; the step of training the improved deep learning model by inputting the sample features to obtain a data generation model includes: The user identifier features and the user's historical behavior data features from the sample user features are input into the encoder of the improved deep learning model to obtain the sample user feature vector; The sample query term and the sample user feature vector are input into the decoder of the improved deep learning model to obtain the query result of the sample query term; The improved deep learning model is trained using the query results of the sample query term and the sample query document corresponding to the sample query term to obtain the data generation model.

2. The method according to claim 1, characterized in that, The encoder includes an embedding layer and a self-attention layer; the process of inputting the user identifier features and the user's historical behavior data features from the sample user features into the encoder of the improved deep learning model to obtain the sample user feature vector includes: The user identifier features in the sample user features are input into the embedding layer of the encoder of the improved deep learning model to obtain the user identifier feature vector; The historical behavior data features of users in the sample user features are input into the self-attention layer of the encoder to obtain the historical behavior data feature vector; The user identifier feature vector and the historical behavior data feature vector are determined as the sample user feature vector.

3. The method according to claim 2, characterized in that, The user's historical behavior data features include the user's historical clicked document features and the user's historical search query term features. The encoder's self-attention layer includes a first self-attention layer and a second self-attention layer. The step of inputting the user's historical behavior data features from the sample user features into the encoder's self-attention layer to obtain a historical behavior data feature vector includes: The user's historical click document features are input into the first self-attention layer of the encoder to obtain the historical click document feature vector; The user's historical search query term features are input into the second self-attention layer of the encoder to obtain the historical search query term feature vector; The historical clicked document feature vector and the historical search query term feature vector are determined as the historical behavior data feature vector.

4. The method according to claim 2, characterized in that, The step of training the improved deep learning model using the query results of the sample query term and the corresponding sample query document to obtain the data generation model includes: The query results of the sample query term are compared with the sample query documents corresponding to the sample query term, and the loss function value is determined based on the comparison results. If the loss function value is greater than the function threshold, the model parameters of the improved deep learning model are adjusted according to the loss function value. The sample features are input into the deep learning model after adjusting the model parameters and retrained. When the loss function value obtained from the retraining is less than the function threshold, the data generation model is determined.

5. The method according to claim 1, characterized in that, The process of obtaining the query term and the historical behavior data of the user corresponding to the query term includes: Obtain the user identifier of the query term, and determine the historical behavior data of the user corresponding to the user identifier based on the user identifier of the query term; The step of inputting the query term and the historical behavior data of the user corresponding to the query term into the data generation model to generate query result data corresponding to the query term includes: The user identifier of the query term and the historical behavior data of the user corresponding to the user identifier are input into the encoder of the data generation model to obtain the user feature vector of the query term; The query term and its user feature vector are input into the decoder of the data generation model to generate query result data corresponding to the query term.

6. A data generation apparatus, characterized in that, include: The acquisition unit is used to acquire a sample dataset, which includes multiple sample data, each sample data being a triplet data. The triplet data includes sample user data, sample query terms, and sample query documents corresponding to the sample query terms. The sample user data includes user identifiers and user historical behavior data, which includes the user's historical clicked document information and the user's historical search query term information. The training unit is used to extract sample user features from the sample users in the triple data of each sample data in the sample dataset, extract sample query term features from the sample query terms in the triple data of each sample data, and extract sample query document features from the sample query documents in the triple data of each sample data. The sample user features include user identifier features and user historical behavior data features. Sample features are determined based on the sample user features, the sample query term features, and the sample query document features, and the sample features are input into an improved deep learning model for training to obtain a data generation model. The improved deep learning model includes an encoder and a decoder; the step of training the improved deep learning model by inputting the sample features to obtain a data generation model includes: The user identifier features and the user's historical behavior data features from the sample user features are input into the encoder of the improved deep learning model to obtain the sample user feature vector; The sample query term and the sample user feature vector are input into the decoder of the improved deep learning model to obtain the query result of the sample query term; The improved deep learning model is trained using the query results of the sample query terms and the sample query documents corresponding to the sample query terms to obtain the data generation model; The generation unit is used to acquire the query term and the historical behavior data of the user corresponding to the query term, and input the query term and the historical behavior data of the user corresponding to the query term into the data generation model to generate query result data corresponding to the query term.

7. A computer device, characterized in that, The device includes a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to perform the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed, implement the method as described in any one of claims 1-5.

9. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data model training method and apparatus

    CN105224623A

  • Enhanced searching using fine-tuned machine learning models

    US20240281446A1