Data processing method and apparatus based on multi-task model
By using feature extraction and fusion layer processing in a multi-task model, the dependency problem between task objectives is solved, the prediction accuracy of multi-task learning is improved, and the performance of recommendation and prediction systems is enhanced.
Patent Information
- Application Number
- CN202310645170.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-06-01
AI Technical Summary
Existing multi-task learning models fail to effectively consider the dependencies between task objectives, resulting in poor learning performance and inaccurate output results.
By extracting shared features through the feature extraction layer of the multi-task model and then using the feature fusion layer to fuse the shared features with the initial task features to generate target task features, the dependency problem between task targets is solved and the prediction accuracy of the model is improved.
It achieves more accurate prediction results for multi-task models, improving the performance of recommendation and prediction systems.
Smart Images

Figure CN116644383B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of artificial intelligence, and in particular to a model training method based on a multi-task model. BACKGROUND
[0002] With the development of artificial intelligence technology, the research on machine learning is also more and more in-depth, and it is found that the data between many tasks can be shared. In order to be able to share the underlying data and get the prediction results of multiple tasks at a time, various multi-task learning models have emerged. Multi-task learning refers to giving multiple learning tasks, all or part of which are related but not completely the same, and the goal of multi-task learning is to improve the performance of each task by using the knowledge contained in multiple tasks. The most commonly used scenarios of multi-task learning include search, prediction, recommendation, etc. In these scenarios, there is a dependency between different task objectives, for example, click rate prediction and conversion rate prediction. The current multi-task learning model does not take into account the dependency problem between task objectives, resulting in poor learning effect and inaccurate model output results. Therefore, how to provide a multi-task learning model that can be used to solve the target dependency problem is a problem that needs to be solved at present. SUMMARY
[0003] Therefore, the embodiments of the present specification provide a data processing method based on a multi-task model. One or more embodiments of the present specification also relate to a data processing apparatus based on a multi-task model, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects in the prior art.
[0004] According to a first aspect of the embodiments of the present specification, a data processing method based on a multi-task model is provided, comprising:
[0005] obtaining user data of a recommendation task and inputting the user data to a multi-task model, wherein the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions;
[0006] obtaining shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively;
[0007] obtaining initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and performing fusion processing on the initial task features corresponding to the at least two recommendation dimensions respectively and the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively;
[0008] The recommendation data is generated according to the target task features corresponding to the at least two recommendation dimensions respectively, and is used as a task execution result corresponding to the recommendation task.
[0009] According to a second aspect of the embodiments of the present specification, a data processing method based on a multi-task model is provided, including:
[0010] Task data of a prediction task is obtained and input to the multi-task model, wherein the multi-task model is used to determine prediction results of the prediction task in at least two prediction dimensions;
[0011] Shared features corresponding to the task data are obtained through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two prediction dimensions respectively;
[0012] Initial task features corresponding to the at least two prediction dimensions are obtained through a feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two prediction dimensions and the shared features are fused to obtain target task features corresponding to the at least two prediction dimensions respectively;
[0013] Prediction data is generated according to the target task features corresponding to the at least two prediction dimensions respectively, and is used as a task execution result corresponding to the prediction task, wherein the prediction data includes prediction sub-data corresponding to the at least two prediction dimensions respectively.
[0014] According to a third aspect of the embodiments of the present specification, a data processing method based on a multi-task model is provided, applied to a cloud-side device, including:
[0015] User data associated with a recommendation task submitted by an end-side device is obtained and input to the multi-task model, wherein the multi-task model is used to determine recommendation results of the recommendation task in at least two recommendation dimensions;
[0016] Shared features corresponding to the user data are obtained through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively;
[0017] Initial task features corresponding to the at least two recommendation dimensions are obtained through a feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two recommendation dimensions and the shared features are fused to obtain target task features corresponding to the at least two recommendation dimensions respectively;
[0018] generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions, and return the recommendation data to the terminal device as a task execution result corresponding to the recommendation task, where the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions.
[0019] According to a fourth aspect of the embodiments of the present specification, a data processing apparatus based on a multi-task model is provided, comprising:
[0020] an input module configured to obtain user data of a recommendation task and input the user data to a multi-task model, where the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions;
[0021] a first obtaining module configured to obtain shared features corresponding to the user data through a feature extraction layer of the multi-task model, where the shared features include dimension attention information corresponding to the at least two recommendation dimensions;
[0022] a second obtaining module configured to obtain initial task features corresponding to the at least two recommendation dimensions through a feature fusion layer of the multi-task model, and perform fusion processing on the initial task features corresponding to the at least two recommendation dimensions and the shared features to obtain target task features corresponding to the at least two recommendation dimensions;
[0023] a generation module configured to generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions, and return the recommendation data to the terminal device as a task execution result corresponding to the recommendation task, where the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions.
[0024] According to a fifth aspect of the embodiments of the present specification, a data processing apparatus based on a multi-task model is provided, comprising:
[0025] an input module configured to obtain task data of a prediction task and input the task data to a multi-task model, where the multi-task model is used to determine a prediction result of the prediction task in at least two prediction dimensions;
[0026] a first obtaining module configured to obtain shared features corresponding to the task data through a feature extraction layer of the multi-task model, where the shared features include dimension attention information corresponding to the at least two prediction dimensions;
[0027] a second obtaining module configured to obtain initial task features corresponding to the at least two prediction dimensions through a feature fusion layer of the multi-task model, and perform fusion processing on the initial task features corresponding to the at least two prediction dimensions and the shared features to obtain target task features corresponding to the at least two prediction dimensions;
[0028] The generating module is configured to generate prediction data according to target task features corresponding to the at least two prediction dimensions respectively, and the prediction data is taken as a task execution result corresponding to the prediction task.
[0029] According to a sixth aspect of an embodiment of the present specification, a data processing apparatus based on a multi-task model is provided, comprising:
[0030] The input module is configured to obtain user data associated with a recommendation task submitted by an end-side device, and input the user data to the multi-task model, wherein the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions;
[0031] The first obtaining module is configured to obtain shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively;
[0032] The second obtaining module is configured to obtain initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and fuse the initial task features corresponding to the at least two recommendation dimensions respectively with the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively;
[0033] The generating module is configured to generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and return the recommendation data to the end-side device as a task execution result corresponding to the recommendation task, wherein the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively.
[0034] According to a seventh aspect of an embodiment of the present specification, a computing device is provided, comprising:
[0035] a memory and a processor;
[0036] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions, and the computer executable instructions, when executed by the processor, implement the steps of the above-mentioned data processing method based on a multi-task model.
[0037] According to an eighth aspect of an embodiment of the present specification, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions, when executed by a processor, implement the steps of the above-mentioned data processing method based on a multi-task model.
[0038] According to a ninth aspect of an embodiment of the present specification, a computer program is provided, which, when executed in a computer, causes the computer to perform the steps of the above-mentioned data processing method based on a multi-task model.
[0039] One embodiment of the present specification realizes obtaining shared features corresponding to user data through a feature extraction layer, realizing extracting different amounts of shared information for different samples, improving the prediction accuracy of the multi-task model based on sample-level shared information extraction, and subsequently fusing the shared information with the initial task features corresponding to each recommendation dimension respectively through a feature fusion layer to obtain target task features corresponding to each recommendation dimension respectively, realizing extracting unique task features for different tasks, and further improving the prediction accuracy of the multi-task model. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 is a scenario diagram of a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0041] Figure 2 is a flowchart of a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0042] Figure 3 is a structural diagram of a feature extraction layer in a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0043] Figure 4 is a structural diagram of a feature fusion layer in a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0044] Figure 5 is a process flowchart of a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0045] Figure 6 is a flowchart of a data processing method based on a multi-task model provided by one embodiment of the present specification;
[0046] Figure 7 is a structural diagram of a data processing apparatus based on a multi-task model provided by one embodiment of the present specification;
[0047] Figure 8 is a structural diagram of a data processing apparatus based on a multi-task model provided by one embodiment of the present specification;
[0048] Figure 9 is a structural diagram of a data processing apparatus based on a multi-task model provided by one embodiment of the present specification;
[0049] Figure 10 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0050] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples, and it can be apparent that the present specification can be practiced with less than the specific details set forth in the present specification. Therefore, the present specification is not limited to the details in the following description.
[0051] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0052] It will be understood that, although the terms first, second, etc. can be employed in describing various information, such information should not be limited to these terms. These terms are only used to differentiate one piece of information from another. For example, a first can be termed a second, and, similarly, a second can be termed a first, without departing from the scope of one or more embodiments of the present specification. The word "if' as used herein can be interpreted to mean "when" or "upon" or "in response to determining" depending on the context.
[0053] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present specification are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0054] First, the nomenclature involved in one or more embodiments of the present specification is explained.
[0055] Multi-task learning: Multi-task learning is a subfield of machine learning in which multiple learning tasks can be solved simultaneously, taking advantage of both commonalities and differences between tasks. This can improve the learning efficiency and prediction accuracy of task-specific models compared to training models individually.
[0056] Target dependency: In the field of multi-task learning, multiple targets exist in a dependent relationship, such as the two target tasks of click rate and conversion rate, and click and conversion are a progressive relationship.
[0057] Self-attention mechanism: The self-attention mechanism is a variant of the attention mechanism, which reduces the dependence on external information and is better at capturing the internal correlation of data or features. The application of the self-attention mechanism in text mainly solves the long-distance dependency problem by calculating the mutual influence between words.
[0058] More and more practical application scenarios currently use multi-task learning for project implementation, such as recommendation systems, advertising systems, etc. The main idea of multi-task learning is to combine shared parameters for learning different tasks and independent parameters related to the task to help one or more tasks that are not easy to learn to achieve better results, thereby solving the data sparsity problem, which is essentially a kind of transfer learning. The most commonly used scenario of multi-task learning is search, advertising, and recommendation scenarios. In these scenarios, different targets usually have a dependency relationship, such as click rate, conversion rate, and click conversion rate prediction (conversion can only occur after clicking). However, the current multi-target prediction method does not take into account the dependency between targets, resulting in poor learning effect of multi-task learning.
[0059] Based on this, in the present specification, a data processing method based on a multi-task model is provided to solve the dependency problem between targets and improve the learning effect of multi-task learning. The present specification also relates to a data processing apparatus based on a multi-task model, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0060] Reference Figure 1 , Figure 1A scene diagram of a data processing method based on a multi-task model is shown, which is provided according to one embodiment of the present specification, and is illustrated by taking a target user in an online shopping scenario as an example. In the online shopping scenario, the user can be understood as a consumer. When the consumer uses a shopping application through a user client, the application platform party will make product recommendations according to the user's preferences. Therefore, user data can be obtained through the user client. The user data can be behavior data generated in the shopping application, such as the user's historical purchase records, historical browsing records, etc. After obtaining this data, the application platform party can use a recommendation system to recommend products to the user. The specific recommendation system includes a multi-task model, which is used to perform prediction tasks of product click rate and product click conversion rate according to user behavior data, so as to determine the final recommended products for the user according to the prediction results. In the recommendation process, the user behavior data is input into the multi-task model. The shared features corresponding to the user data are extracted through the feature extraction layer in the multi-task model, and the shared features are input into the feature fusion layer. The feature fusion layer extracts initial task features corresponding to each recommendation dimension according to the user behavior data, and fuses each initial task feature with the shared features to generate target task features corresponding to each recommendation dimension, i.e., target task features corresponding to two prediction tasks. At this time, the target task features take into account both the shared features and the task features unique to each task, so that the model prediction results of the multi-task model are more accurate. Subsequently, the target task features are decoded to obtain recommendation data. The recommendation data can be a product that meets the preset conditions for both product click rate and product click conversion rate. Then, the product is fed back to the user as the recommendation data.
[0061] Referring to Figure 2 , Figure 2 A flowchart of a data processing method based on a multi-task model is shown, which is provided according to one embodiment of the present specification, and specifically includes the following steps.
[0062] Step 202: Obtain user data of a recommendation task and input it into a multi-task model, wherein the multi-task model is used to determine the recommendation results of the recommendation task in at least two recommendation dimensions.
[0063] The recommendation task can be understood as a task of providing a direction to a user for recommendation, such as recommending a product to a user in a shopping scenario, recommending a video to a user in a short video scenario, and the like. The user data can be understood as behavior data generated by a user in different projects, such as historical purchase records, historical browsing records, shopping consumption amounts, and the like in a shopping scenario, historical browsing records, historical interaction records, video publishing records, and the like in a short video scenario. The multi-task model can be understood as a model for performing a recommendation task. The multi-task model predicts a recommendation result based on multi-task learning, such as predicting a click rate of a user on a product, a purchase rate of a user on a product, and the like in a shopping scenario. The correlation between tasks is used to predict a more accurate recommendation result. Since the multi-task model predicts multiple task targets at the same time, the multi-task model determines a recommendation result of a recommendation task in at least two recommendation dimensions, such as recommending according to a product click rate and recommending according to a product purchase rate. After synthesizing the recommendation results of the two recommendation dimensions, the multi-task model can output a more accurate recommendation result, thereby providing a better user experience.
[0064] In actual applications, the user data can be collected by the project provider under the premise of user authorization, and subsequent applications are based on the user data. The multi-task model can include multiple task prediction targets, such as predicting a click rate of a user on a product, predicting a purchase rate of a user on a product, predicting a satisfaction rate of a user on a product, and the like based on user data. In specific implementation, there is a dependency between multiple task prediction targets, such as a user purchasing a product only after the user clicks on the product. Therefore, the multi-task model provided in the specification needs to consider the dependency problem between different task targets. Subsequently, shared features containing dimension attention information corresponding to different recommendation dimensions are extracted from the user data, thereby solving the dependency problem between different task targets and improving the prediction accuracy of the model.
[0065] In an embodiment of the specification, the recommendation task is a product recommendation task performed by a shopping platform for a consumer. The shopping platform uses behavior data generated by the consumer on the shopping platform as user data and uses a recommendation system to recommend products. In specific implementation, the user data is input into the multi-task model. The multi-task model is used to determine a recommendation result of a product recommendation task in two recommendation dimensions, i.e., recommending according to a click rate of a user on a product and recommending according to a purchase rate of a user on a product. The product set in the prediction process can be a set predicted in advance based on the user data. Subsequently, a recommended product that meets the user can be selected from the product set based on the prediction of the multi-task model. The product set can also be a set of all products provided by the shopping platform.
[0066] Further, in order to avoid the input of large amount of user data, resulting in slow processing efficiency of multi-task model or model unable to normally perform the execution of recommendation task, the user data needs to be embedded for processing, thereby reducing the model input data amount. Specifically, the user data of the recommendation task is obtained and input into the multi-task model, including: obtaining the user data of the recommendation task and embedding the user data to obtain the user data vector sequence corresponding to the user data; inputting the user data vector sequence into the multi-task model.
[0067] Among them, the embedding processing can be understood as dimensionality reduction processing of user data, using a low-dimensional vector to represent an object, thereby avoiding the increase of computational complexity due to large amount of data, which is not conducive to the model to output accurate prediction results.
[0068] In actual application, for shopping scene, the product set can be filtered according to user data, and the product set is embedded, that is, a word vector is generated for each product, and a user data vector sequence corresponding to the user data is formed, which can be input into the multi-task model.
[0069] In an embodiment of the present application, the user data of the product recommendation task is obtained, the user data is the behavior data generated by the user on the shopping platform, the candidate product set is filtered according to the user data, the candidate product set is embedded to obtain the user data vector sequence corresponding to the user data, and the user data vector sequence is input into the multi-task model.
[0070] Based on this, by embedding the user data, the model input data amount can be reduced, and the model processing efficiency and processing accuracy can be improved.
[0071] Step 204: obtaining the shared feature corresponding to the user data through the feature extraction layer of the multi-task model, wherein the shared feature includes the dimension attention information corresponding to each recommendation dimension.
[0072] Among them, after inputting the user data into the multi-task model, the shared feature corresponding to the user data can be extracted through the feature extraction layer in the multi-task model, and the shared feature includes the dimension attention information corresponding to each recommendation dimension, that is, the shared feature includes the shared information of each recommendation task, and the shared feature is used to assist the multi-task prediction.
[0073] In practical applications, different samples can extract different amounts of shared information, for example, there are two prediction tasks, one is to predict the click rate of users on goods and the other is to predict the conversion rate of users on goods, sample A may not need to extract shared features, and only needs to predict two tasks respectively, while sample B needs to fully extract shared features of two tasks for auxiliary prediction. The feature extraction layer is an adaptive shared extractor (ASRG), and the role of the feature extraction layer is to extract different amounts of shared information for different samples. The specific implementation idea is to learn a sample-level dynamic selector. See Figure 3 , Figure 3 The structure of the feature extraction layer in a data processing method based on a multi-task model according to an embodiment of the present specification is shown, wherein the overall structure of the feature extraction layer is based on the transformation of the self-attention network, the lowest layer is the feature input (Feature Embedding), the calculation of the key vector (Key) and the value vector (Value) is the same as the self-attention mechanism, which is obtained by the input feature through the multi-layer perception, the query vector (Query) is obtained by a randomly initialized matrix through sample-level personalized screening, the unselected Query is represented by an inducing point (Inducing Points) in the figure, and the structure used to screen different Query is represented by a dynamic activation layer (Dynamic Activation Layer) in Figure 3 The main principle is to input the sample features into a transformation layer (Transformation Layer) such as a multi-layer perception, and then pass through a dynamic activation function to obtain a binary vector with the same number of columns as the Inducing Points. Finally, the binary vector is multiplied by the Inducing Points, that is, the personalized screened Query is obtained. Then, based on the obtained Q, K, and V vectors, the shared features, that is, the shared information of multiple tasks, are obtained through the calculation method of the self-attention mechanism. Specifically, in Figure 3 Q, K, and V are input into the multi-head attention layer (Multi-Head Attention), and then the output of the multi-head attention layer is calculated through the addition normalization layer (Add&Norm) to obtain the shared information. The addition normalization layer is used to smoothly integrate the input and the output of other layers.
[0074] Further, in order to accurately obtain the shared information corresponding to multiple tasks and improve the prediction efficiency of the model, Q, K and V corresponding to the user data need to be calculated first. Specifically, the shared features corresponding to the user data are obtained through the feature extraction layer of the multi-task model, including: calculating the first query vector, the first key vector and the first value vector corresponding to the user data through the feature extraction layer of the multi-task model; and calculating the shared features corresponding to the user data according to the first query vector, the first key vector and the first value vector.
[0075] The first query vector can be understood as a Query vector obtained by processing in the feature extraction layer, the first key vector can be understood as a Key vector obtained by processing in the feature extraction layer, and the first value vector can be understood as a Value vector obtained by processing in the feature extraction layer. By calculating Q, K and V corresponding to the user data, the shared features corresponding to the user data are calculated through the self-attention mechanism, so that the shared features can include dimension attention information corresponding to multiple tasks respectively, such as that the product click rate prediction task pays more attention to product types and the product conversion rate prediction task pays more attention to product prices.
[0076] In an embodiment of the present disclosure, the first query vector Q1, the first key vector K1 and the first value vector V1 corresponding to the user data are calculated through the adaptive shared extractor, i.e., the feature extraction layer, of the multi-task model, and the shared features corresponding to the user data are calculated according to the first query vector Q1 and the first key vector K1 and the first value vector V1.
[0077] Based on this, the shared features are extracted through the feature extraction layer, and the shared features can be input to the feature fusion layer for fusion with task features, so as to obtain target task features of the fused shared features, so that the model output result is more accurate.
[0078] Further, in order to correctly calculate the first query vector, the first key vector and the first value vector, the weight matrix needs to be used for calculation. Specifically, the first query vector, the first key vector and the first value vector corresponding to the user data are calculated through the feature extraction layer of the multi-task model, including: calculating the first query weight matrix, the first key weight matrix and the first value weight matrix based on the feature extraction layer of the multi-task model; calculating the first query vector according to the first query weight matrix and the user data, calculating the first key vector according to the first key weight matrix and the user data, and calculating the first value vector according to the first value weight matrix and the user data.
[0079] The first query weight matrix can be understood as a weight parameter used for calculating the query vector, the first key weight matrix can be understood as a weight parameter used for calculating the key vector, and the first value weight matrix can be understood as a weight parameter used for calculating the value vector.
[0080] In practical applications, the weight matrix can be calculated according to the self-attention mechanism to obtain the first query weight matrix W Q1 , the first key weight matrix W K1 , and the first value weight matrix W V1 , and then the first query vector, the first key vector, and the first value vector are calculated through the weight matrix.
[0081] In an embodiment of the present disclosure, the first query weight matrix, the first key weight matrix, and the first value weight matrix are calculated by the adaptive shared extractor, i.e., the feature extraction layer, of the multi-task model, the first query vector is calculated according to the first query weight matrix and the user data, the first key vector is calculated according to the first key weight matrix and the user data, and the first value vector is calculated according to the first value weight matrix and the user data.
[0082] Further, the first query vector calculated in the feature extraction layer needs to be personalized screened according to a randomly initialized matrix, and specifically, the first query vector is calculated according to the first query weight matrix and the user data, including: calculating an initial first query vector according to the first query weight matrix and the user data; performing binary processing on the initial first query vector based on a preset activation function in the feature extraction layer to obtain a binary vector; and calculating the first query vector based on a query random matrix in the feature extraction layer and the binary vector.
[0083] The initial first query vector can be understood as a query vector calculated according to the first query weight matrix and the user data, the preset activation function can be understood as a preset dynamic activation function, the preset activation function is used for binary processing on the initial first query vector, and finally the obtained binary vector is multiplied by the query random matrix to obtain the first query vector.
[0084] In practical applications, the query random matrix can be data generated by a random distribution, for example, a normal distribution, and the query random matrix is Figure 3In the Inducing Points, after the initial first query vector is calculated according to the first query weight matrix and the user data, a binary vector with the same number of columns as the Inducing Points is obtained through a dynamic activation function, and then the binary vector is multiplied by the Inducing Points, so as to obtain the first query vector. In the specific implementation, since a binary vector needs to be learned in the feature extraction layer, if the sign function is directly used, it will not be able to be trained through the back propagation, therefore, the dynamic activation function is adopted, see formula 1, wherein the dynamic activation function can be set as a "cubic activation function" first, r is initially set as 1, and then r is updated according to the expression r = max (1e-3, r-2e-4*step) with the change of the model training iteration step, until after a certain iteration step is learned, r will converge to 1e-3, which is a very small value, and the form of the dynamic activation function is close to the sign function.
[0085]
[0086] Step 206: obtaining initial task features corresponding to the at least two recommendation dimensions respectively through the feature fusion layer of the multi-task model, and fusing the initial task features corresponding to the at least two recommendation dimensions respectively with the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively.
[0087] The feature fusion layer can be understood as a processing layer in the multi-task model for extracting task features corresponding to each recommendation task respectively and fusing the task features with the shared features, the initial task features are the task features corresponding to each recommendation task respectively, and the initial task features have not been fused with the shared features. After the initial task features are fused with the shared features, target task features corresponding to each task respectively can be obtained, and the shared features are fused in each target task feature.
[0088] In actual application, the feature fusion layer can be understood as a task adapter (Task Specific Adapter, TSA) in the multi-task model, see Figure 4 , Figure 4A structural diagram of a feature fusion layer in a data processing method based on a multi-task model is shown, which is also generated based on a self-attention mechanism. In order to output target task features considering shared information and task-specific information, initial features corresponding to each task need to be extracted first. Specifically, initial task features corresponding to at least two recommendation dimensions are obtained through the feature fusion layer of the multi-task model, including: calculating a second query vector, a second key vector and a second value vector corresponding to the user data through the feature fusion layer of the multi-task model; calculating a reference task feature according to the second query vector, the second key vector and the second value vector; determining task weights corresponding to the at least two recommendation dimensions respectively, and calculating initial task features corresponding to the at least two recommendation dimensions respectively according to the at least two task weights and the reference task feature.
[0089] Among them, the second query vector can be understood as the Query vector processed and obtained in the feature fusion layer, the second key vector can be understood as the Key vector processed and obtained in the feature fusion layer, and the second value vector can be understood as the Value vector processed and obtained in the feature fusion layer. The second key vector K2 and the second value vector V2 in the feature fusion layer are obtained by self-attention mechanism calculation of input features, and the second query vector Q2 is obtained according to a randomly initialized column vector.
[0090] In actual application, the second query vector in the feature fusion layer is a column vector, that is, Figure 4 Task Indicator, after obtaining Q2, K2 and V2, attention calculation can be performed to obtain the reference task feature. At this time, the task weight corresponding to each recommendation task needs to be considered. The task weight can be understood as the attention focus weight in each recommendation task, that is, the task weight corresponding to each recommendation dimension. Subsequently, the initial task feature corresponding to each recommendation subtask can be calculated according to the task weight corresponding to each recommendation dimension and the reference task feature.
[0091] Based on this, after calculating the initial task feature corresponding to the recommendation dimension of each recommendation subtask, the shared feature can be fused and superimposed subsequently to output the target task feature considering shared information and task-specific information.
[0092] Further, the second key vector K2 and the second value vector V2 in the feature fusion layer are obtained by self-attention mechanism calculation of the input features, and the second query vector Q2 is obtained according to a randomly initialized column vector. Specifically, the second query vector, the second key vector and the second value vector corresponding to the user data are calculated by the feature fusion layer of the multi-task model, including: calculating a second key weight matrix and a second value weight matrix based on the feature fusion layer of the multi-task model; obtaining a preset random vector as the second query vector, calculating the second key vector according to the second key weight matrix and the user data, and calculating the second value vector according to the second value weight matrix and the user data.
[0093] The second key weight matrix can be understood as a weight parameter required for calculating the key vector, and the second value weight matrix can be understood as a weight parameter required for calculating the value vector.
[0094] In actual application, the weight matrix can be calculated according to the self-attention mechanism to obtain the second key weight matrix W K2 and the second value weight matrix W V2 , and then the first key vector and the first value vector are calculated by the weight matrix respectively, and the second query vector is determined by the preset random vector.
[0095] In an embodiment of the present specification, the second query vector is determined by a preset random vector, the second query vector is a column vector, the second key vector is calculated according to the second key weight matrix and the user data, and the second value vector is calculated according to the second value weight matrix and the user data. After obtaining the second query vector Q2, the second key vector K2 and the second value vector V2, the initial task feature can be obtained by self-attention calculation, and the initial task feature and the shared feature are fused to obtain the target task feature.
[0096] Therefore, by fusing the initial task feature and the shared feature, the output result of the feature fusion layer takes into account the shared information and the task unique information, which is beneficial for the multi-task model to predict more accurate recommendation results.
[0097] Step 208: generating recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and taking the recommendation data as the task execution result corresponding to the recommendation task, wherein the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively.
[0098] After obtaining the target task features corresponding to each recommendation subtask respectively, the target task features can be processed to generate recommendation data, and all recommendation data can be used as the task execution result of the multi-task model in performing the recommendation task. Since the recommendation task includes multiple recommendation subtasks, the target task features corresponding to each recommendation dimension can generate corresponding recommendation sub-data. In actual application, the recommendation sub-data can be obtained by decoding the target task features output by the feature fusion layer.
[0099] In an embodiment of the present disclosure, the recommendation sub-data corresponding to each recommendation subtask is generated according to the target task features corresponding to each recommendation dimension respectively, which are the product click rate data and the product purchase rate data. Subsequently, the product click rate data and the product purchase rate data can be sorted and processed to filter out the data recommended to the user.
[0100] Therefore, the feature extraction layer and the feature fusion layer in the multi-task model can make the final output take into account the shared information and the task unique information, solve the dependency problem between multiple task targets, and improve the prediction efficiency of the multi-task model.
[0101] Further, in order to enable the user to perceive the recommendation result, the corresponding display page can also be generated according to the recommendation data. Specifically, the method further includes: generating a recommendation display page corresponding to the recommendation task according to the recommendation data; and displaying the recommendation data to a target user associated with the user data through the recommendation display page.
[0102] The recommendation display page can be understood as a page for displaying the recommendation result to the user. For example, if the user accesses a shopping application through a mobile phone, a page containing recommended products can be generated in the shopping application.
[0103] Further, the multi-task model provided in the embodiments of the present specification can be obtained by training in the following manner. Specifically, the training method of the multi-task model comprises: obtaining sample data of a prediction task and a sample label corresponding to the sample data, and inputting the sample data into a multi-task model, wherein the multi-task model is used to determine a prediction result of the prediction task in at least two prediction dimensions; obtaining shared features corresponding to the sample data through a feature extraction layer of the multi-task model, wherein the shared features comprise dimension attention information corresponding to the at least two prediction dimensions respectively; obtaining initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and performing fusion processing on the initial task features corresponding to the at least two prediction dimensions respectively and the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively; calculating a model loss value corresponding to the multi-task model according to the target task features corresponding to the at least two recommendation dimensions respectively and the sample label; and adjusting the multi-task model based on the model loss value until a model training stop condition is met.
[0104] The prediction task can be understood as a task to be performed by the multi-task model. The prediction task can include multiple prediction subtasks, and each prediction subtask corresponds to a respective prediction dimension. Therefore, the multi-task model is used to determine a prediction result of the prediction task in each prediction dimension. After processing user data through the feature extraction layer and the feature fusion layer in the multi-task model, target task features can be obtained. Subsequently, a final task target can be determined according to the target task features, and the task target and the sample label are used to calculate a model loss value, thereby adjusting the multi-task model until the model training is completed.
[0105] In actual application, the dependency problem between task targets of each prediction subtask is decoupled, and the multi-task problem of task target dependency is converted into a constrained ordinary multi-task for solving. In the embodiments of the present specification, a penalty function term is introduced into a loss function, and a constrained optimization problem is further converted into an unconstrained optimization problem. The multi-task learning loss function for target dependency is shown in Formula 2.
[0106]
[0107] wherein N is the number of subtasks, M is the number of samples, the function L is a loss function, w i is a weight calculated statically or dynamically for each task, θ s is a shared parameter between tasks, θ i is a specific parameter of task i, f i (x j ; θ s , θ i) is a model in the sample x j For the prediction output of task i, σ i-1 is a penalty coefficient, L M-Task is the loss function of the director Wu, L D-Task is the penalty function item of the target dependency.
[0108] Based on this, through the auxiliary loss function calculation of the target dependency, the final loss function can be the addition of the main task loss function and the auxiliary loss function, and the final loss function is obtained, so that the multi-task model solving the target dependency problem is trained according to the final loss function L.
[0109] The data processing method based on the multi-task model provided in the specification includes obtaining user data of a recommendation task and inputting the user data to a multi-task model, wherein the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions; obtaining shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively; obtaining initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and fusing the initial task features corresponding to the at least two recommendation dimensions respectively with the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively; and generating recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and taking the recommendation data as a task execution result corresponding to the recommendation task, wherein the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively. Through the feature extraction layer, the shared features corresponding to the user data are obtained, the shared information of different information amounts is extracted for different samples, the prediction accuracy of the multi-task model is improved based on the sample-level shared information extraction, and the shared information and the initial task features corresponding to each recommendation dimension respectively are fused through the feature fusion layer, the dependency problem between task targets is solved, the target task features corresponding to each recommendation dimension respectively are obtained, and the prediction accuracy of the multi-task model is further improved.
[0110] The following describes the data processing method based on the multi-task model provided in the specification in combination with the accompanying Figure 5 The data processing method based on the multi-task model is further described by taking the application of the data processing method based on the multi-task model provided in the specification to user image prediction as an example. Among them, Figure 5 A processing process flow diagram of a data processing method based on a multi-task model provided in an embodiment of the specification is shown, which specifically includes the following steps.
[0111] Step 502: Obtain task data of a prediction task and input the task data to a multi-task model, wherein the multi-task model is used to determine a prediction result of the prediction task in at least two prediction dimensions.
[0112] In an implementable manner, the task data can be portrait data of a user, such as a face picture, a full-body photo, or the like, and the prediction task can be predicting data related to the user according to the portrait data of the user, such as predicting the income and expenditure of the user according to the portrait of the user, predicting the occupation of the user, or the like. The task data of the prediction task is input into the multi-task model, and the multi-task model is used to determine the prediction results of the prediction task in the income and expenditure prediction dimension and the occupation prediction dimension.
[0113] Step 504: obtaining shared features corresponding to the task data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two prediction dimensions respectively.
[0114] In an implementable manner, the shared features corresponding to the user portrait are obtained through the feature extraction layer of the multi-task model, and the shared features include the dimension attention information in the income and expenditure prediction dimension and the dimension attention information in the occupation prediction dimension.
[0115] Step 506: obtaining initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and performing fusion processing on the initial task features corresponding to the at least two prediction dimensions respectively and the shared features to obtain target task features corresponding to the at least two prediction dimensions respectively.
[0116] In an implementable manner, the initial task features corresponding to the income and expenditure prediction dimension and the occupation prediction dimension respectively are obtained through the feature fusion layer of the multi-task model, and the initial task features corresponding to the two prediction dimensions respectively and the shared features are fused to obtain target task feature 1 corresponding to the income and expenditure prediction dimension and target task feature 2 corresponding to the occupation prediction dimension.
[0117] Step 508: generating prediction data according to the target task features corresponding to the at least two prediction dimensions respectively, and taking the prediction data as a task execution result corresponding to the prediction task, wherein the prediction data includes prediction sub-data corresponding to the at least two prediction dimensions respectively.
[0118] In an implementable manner, the user predicted income and expenditure is determined according to the target task feature 1 corresponding to the income and expenditure prediction dimension, the user predicted occupation is determined according to the target task feature 2 corresponding to the occupation prediction dimension, and the user predicted income and expenditure and the user predicted occupation are taken as the task execution result of the prediction task.
[0119] A data processing method based on a multi-task model is provided in the specification. The method includes obtaining task data of a prediction task and inputting the task data to a multi-task model, wherein the multi-task model is used to determine prediction results of the prediction task in at least two prediction dimensions; obtaining shared features corresponding to the task data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two prediction dimensions respectively; obtaining initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and performing fusion processing on the initial task features corresponding to the at least two prediction dimensions respectively and the shared features to obtain target task features corresponding to the at least two prediction dimensions respectively; and generating prediction data according to the target task features corresponding to the at least two prediction dimensions respectively, and taking the prediction data as a task execution result corresponding to the prediction task, wherein the prediction data includes prediction sub-data corresponding to the at least two prediction dimensions respectively. The method can solve the dependency problem between multi-task objectives and improve the prediction accuracy of the multi-task model.
[0120] Referring to Figure 6 , Figure 6 A flowchart of a data processing method based on a multi-task model according to an embodiment of the specification is shown. The method is applied to a cloud-side device and specifically includes the following steps.
[0121] In step 602, user data associated with a recommended task submitted by an end-side device is obtained and input to a multi-task model, wherein the multi-task model is used to determine recommendation results of the recommended task in at least two recommendation dimensions.
[0122] In an implementable manner, the cloud-side device can be understood as a cloud computing device of a recommendation service provider, and the end-side device can be understood as a client device of a recommendation service user. The recommendation service user can send user data to the cloud-side device of the recommendation service provider for model processing, thereby ensuring the data security of the recommendation service user and avoiding the leakage of data of the recommendation service provider.
[0123] In step 604, shared features corresponding to the user data are obtained through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively.
[0124] In step 606, initial task features corresponding to the at least two recommendation dimensions respectively are obtained through a feature fusion layer of the multi-task model, and fusion processing is performed on the initial task features corresponding to the at least two recommendation dimensions respectively and the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively.
[0125] Step 608: generating recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and returning the recommendation data to the terminal device as a task execution result corresponding to the recommendation task, wherein the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively.
[0126] In an implementable manner, the service provider can return the recommendation data to the service user after generating the recommendation data, so that the service user obtains data meeting the expected demand, for subsequent project application.
[0127] Corresponding to the method embodiments described above, the present specification also provides a data device based on a multi-task model, Figure 7 A structure diagram of a data device based on a multi-task model is shown, which is provided by one embodiment of the present specification. As shown in the figure, Figure 7 The device includes:
[0128] The input module 702 is configured to obtain user data of a recommendation task and input the user data to a multi-task model, wherein the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions.
[0129] The first obtaining module 704 is configured to obtain shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively.
[0130] The second obtaining module 706 is configured to obtain initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and perform fusion processing on the initial task features corresponding to the at least two recommendation dimensions respectively and the shared features, to obtain target task features corresponding to the at least two recommendation dimensions respectively.
[0131] The generation module 708 is configured to generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and return the recommendation data as a task execution result corresponding to the recommendation task, wherein the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively.
[0132] Optionally, the first obtaining module 704 is further configured to calculate a first query vector, a first key vector and a first value vector corresponding to the user data through the feature extraction layer of the multi-task model, and calculate the shared features corresponding to the user data according to the first query vector, the first key vector and the first value vector.
[0133] Optionally, the first obtaining module 704 is further configured to calculate a first query weight matrix, a first key weight matrix and a first value weight matrix based on a feature extraction layer of the multi-task model; calculate a first query vector according to the first query weight matrix and the user data, calculate a first key vector according to the first key weight matrix and the user data, and calculate a first value vector according to the first value weight matrix and the user data.
[0134] Optionally, the first obtaining module 704 is further configured to calculate an initial first query vector according to the first query weight matrix and the user data; perform binaryzation processing on the initial first query vector based on a preset activation function in the feature extraction layer to obtain a binaryzation vector; and calculate a first query vector based on a query random matrix in the feature extraction layer and the binaryzation vector.
[0135] Optionally, the second obtaining module 706 is further configured to calculate a second query vector, a second key vector and a second value vector corresponding to the user data through a feature fusion layer of the multi-task model; calculate a reference task feature according to the second query vector, the second key vector and the second value vector; determine task weights corresponding to the at least two recommendation dimensions respectively, and calculate initial task features corresponding to the at least two recommendation dimensions respectively according to the at least two task weights and the reference task feature.
[0136] Optionally, the second obtaining module 706 is further configured to calculate a second key weight matrix and a second value weight matrix based on a feature fusion layer of the multi-task model; obtain a preset random vector as a second query vector, calculate a second key vector according to the second key weight matrix and the user data, and calculate a second value vector according to the second value weight matrix and the user data.
[0137] Optionally, the apparatus further comprises a display module configured to generate a recommendation display page corresponding to the recommendation task according to the recommendation data; and display the recommendation data to a target user associated with the user data through the recommendation display page.
[0138] Optionally, the input module 702 is further configured to obtain user data of a recommendation task and perform embedding processing on the user data to obtain a user data vector sequence corresponding to the user data; and input the user data vector sequence to a multi-task model.
[0139] Optionally, the apparatus further comprises a training module configured to obtain sample data of a prediction task and a sample label corresponding to the sample data, and input the sample data into a multi-task model, wherein the multi-task model is used to determine a prediction result of the prediction task in at least two prediction dimensions; obtain shared features corresponding to the sample data through a feature extraction layer of the multi-task model, wherein the shared features comprise dimension attention information corresponding to the at least two prediction dimensions respectively; obtain initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and perform fusion processing on the initial task features corresponding to the at least two prediction dimensions respectively and the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively; calculate a model loss value corresponding to the multi-task model according to the target task features corresponding to the at least two recommendation dimensions respectively and the sample label; and perform parameter adjustment on the multi-task model based on the model loss value until a model training stop condition is met.
[0140] The present specification provides a data processing apparatus based on a multi-task model, comprising: an input module configured to obtain user data of a recommendation task and input into a multi-task model, wherein the multi-task model is used to determine a recommendation result of the recommendation task in at least two recommendation dimensions; a first obtaining module configured to obtain shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features comprise dimension attention information corresponding to the at least two recommendation dimensions respectively; a second obtaining module configured to obtain initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and perform fusion processing on the initial task features corresponding to the at least two recommendation dimensions respectively and the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively; and a generation module configured to generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and take the recommendation data as a task execution result corresponding to the recommendation task, wherein the recommendation data comprises recommendation sub-data corresponding to the at least two recommendation dimensions respectively. Through the feature extraction layer, shared features corresponding to the user data are obtained, shared information of different information amounts is extracted for different samples, the prediction accuracy of the multi-task model is improved based on sample-level shared information extraction, and the shared information and the initial task features corresponding to each recommendation dimension respectively are fused through the feature fusion layer, the dependency problem between task targets is solved, the target task features corresponding to each recommendation dimension respectively are obtained, and the prediction accuracy of the multi-task model is further improved.
[0141] The above is a schematic scheme of the data processing apparatus based on the multi-task model according to an embodiment of the present specification. It should be noted that the technical scheme of the data processing apparatus based on the multi-task model and the technical scheme of the data processing method based on the multi-task model described above belong to the same concept. The technical scheme of the data processing apparatus based on the multi-task model is not described in detail, and the description of the technical scheme of the data processing method based on the multi-task model can be referred to.
[0142] Corresponding to the method embodiments described above, the present specification also provides data device embodiments based on a multi-task model, Figure 8 A structural schematic diagram of a data device based on a multi-task model provided by an embodiment of the present specification is shown. As shown in the figure, Figure 8 The device comprises:
[0143] The input module 802 is configured to obtain task data of a prediction task and input the task data to a multi-task model, wherein the multi-task model is used to determine a prediction result of the prediction task in at least two prediction dimensions;
[0144] The first obtaining module 804 is configured to obtain shared features corresponding to the task data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two prediction dimensions respectively;
[0145] The second obtaining module 806 is configured to obtain initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and fuse the initial task features corresponding to the at least two prediction dimensions respectively with the shared features to obtain target task features corresponding to the at least two prediction dimensions respectively;
[0146] The generation module 808 is configured to generate prediction data according to the target task features corresponding to the at least two prediction dimensions respectively, and the prediction data is used as a task execution result corresponding to the prediction task, wherein the prediction data includes prediction sub-data corresponding to the at least two prediction dimensions respectively.
[0147] The specification provides a data processing device based on a multi-task model, comprising: an input module configured to obtain task data of a prediction task and input to a multi-task model, wherein the multi-task model is used to determine the prediction result of the prediction task in at least two prediction dimensions; a first acquisition module configured to acquire shared features corresponding to the task data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two prediction dimensions respectively; a second acquisition module configured to acquire initial task features corresponding to the at least two prediction dimensions respectively through a feature fusion layer of the multi-task model, and fuse the initial task features corresponding to the at least two prediction dimensions respectively with the shared features to obtain target task features corresponding to the at least two prediction dimensions respectively; a generation module configured to generate prediction data according to the target task features corresponding to the at least two prediction dimensions respectively, and take the prediction data as a task execution result corresponding to the prediction task, wherein the prediction data includes prediction sub-data corresponding to the at least two prediction dimensions respectively. The dependency problem between multi-task objectives can be solved, and the prediction accuracy of the multi-task model can be improved.
[0148] The above is a schematic scheme of the data processing device based on the multi-task model of the embodiment. It should be noted that the technical scheme of the data processing device based on the multi-task model belongs to the same concept as the technical scheme of the data processing method based on the multi-task model described above, and the details of the technical scheme of the data processing device based on the multi-task model which are not described in detail can be referred to the description of the technical scheme of the data processing method based on the multi-task model.
[0149] Corresponding to the method embodiments described above, the specification also provides data device embodiments based on a multi-task model, Figure 9 A structure schematic diagram of a data device based on a multi-task model provided by one embodiment of the specification is shown. As shown in the figure, Figure 9 The device is applied to a cloud-side equipment, which comprises:
[0150] The input module 902 is configured to obtain user data of an associated recommendation task submitted by an end-side equipment and input to a multi-task model, wherein the multi-task model is used to determine the recommendation result of the recommendation task in at least two recommendation dimensions;
[0151] The first acquisition module 904 is configured to acquire shared features corresponding to the user data through a feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively;
[0152] The second obtaining module 906 is configured to obtain initial task features corresponding to the at least two recommendation dimensions respectively through a feature fusion layer of the multi-task model, and fuse the initial task features corresponding to the at least two recommendation dimensions respectively with the shared features to obtain target task features corresponding to the at least two recommendation dimensions respectively.
[0153] The generating module 908 is configured to generate recommendation data according to the target task features corresponding to the at least two recommendation dimensions respectively, and return the recommendation data as a task execution result corresponding to the recommendation task to the terminal device, where the recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions respectively.
[0154] The above is a schematic scheme of the data processing apparatus based on the multi-task model according to the embodiment. It should be noted that the technical scheme of the data processing apparatus based on the multi-task model belongs to the same concept as the technical scheme of the data processing method based on the multi-task model described above, and the details of the technical scheme of the data processing apparatus based on the multi-task model which are not described in detail can be referred to the description of the technical scheme of the data processing method based on the multi-task model.
[0155] Figure 10 A structural block diagram of a computing device 1000 according to one embodiment of the present specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected with the memory 1010 through a bus 1030, and a database 1050 is used to save data.
[0156] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of networks such as the Internet. The access device 1040 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, Near Field Communication (NFC).
[0157] In one embodiment of the present specification, the above-mentioned components of the computing device 1000 and other components not shown in the Figure 10 may be connected to each other, for example, through a bus. It should be understood that Figure 10 The computing device structure diagram shown is merely for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.
[0158] The computing device 1000 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, and the like), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smart watch, smart glasses, and the like), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1000 can also be a mobile or stationary server.
[0159] The processor 1020 is configured to execute computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned data processing method based on the multi-task model.
[0160] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the data processing method based on the multi-task model belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the data processing method based on the multi-task model.
[0161] An embodiment of the present specification further provides a computer readable storage medium storing computer executable instructions, and the computer executable instructions implement the steps of the data processing method based on the multi-task model when executed by a processor.
[0162] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the data processing method based on the multi-task model belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the data processing method based on the multi-task model.
[0163] An embodiment of the present specification further provides a computer program, and the computer program causes a computer to execute the steps of the data processing method based on the multi-task model when the computer program is executed in the computer.
[0164] The above is a schematic scheme of the computer program of the embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the data processing method based on the multi-task model belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be referred to the description of the technical scheme of the data processing method based on the multi-task model.
[0165] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still accomplish desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0166] The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate additions or deletions according to the requirements of patent practice, for example, according to the patent practice in some regions, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0167] It should be noted that for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the embodiments of the present specification are not limited by the order of the described actions, because according to the embodiments of the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present specification.
[0168] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0169] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. The present specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and use the present specification. The present specification is limited by the claims and their entire scope and equivalents.
Claims
1. A data processing method based on a multi-task model, comprising: User data for a recommendation task is acquired and input into a multi-task model, wherein the multi-task model is used to determine the recommendation results of the recommendation task in at least two recommendation dimensions; The shared features corresponding to the user data are obtained through the feature extraction layer of the multi-task model, wherein the shared features include the dimension attention information corresponding to the at least two recommendation dimensions respectively; The initial task features corresponding to the at least two recommendation dimensions are obtained through the feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two recommendation dimensions are fused with the shared features. The multi-task problem on which the task target depends is transformed into a constrained ordinary multi-task for solution, thereby obtaining the target task features corresponding to the at least two recommendation dimensions. Recommendation data is generated based on the target task features corresponding to the at least two recommendation dimensions, and serves as the task execution result corresponding to the recommendation task. The recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions.
2. The method as described in claim 1, wherein the shared features corresponding to the user data are obtained through the feature extraction layer of the multi-task model, comprising: The first query vector, first key vector, and first value vector corresponding to the user data are calculated through the feature extraction layer of the multi-task model. The shared features corresponding to the user data are calculated based on the first query vector, the first key vector, and the first value vector.
3. The method as described in claim 2, wherein calculating the first query vector, the first key vector, and the first value vector corresponding to the user data through the feature extraction layer of the multi-task model includes: The first query weight matrix, the first key weight matrix, and the first value weight matrix are calculated based on the feature extraction layer of the multi-task model. A first query vector is calculated based on the first query weight matrix and the user data; a first key vector is calculated based on the first key weight matrix and the user data; and a first value vector is calculated based on the first value weight matrix and the user data.
4. The method as described in claim 3, wherein calculating the first query vector based on the first query weight matrix and the user data includes: Calculate the initial first query vector based on the first query weight matrix and the user data; The initial first query vector is binarized based on the preset activation function in the feature extraction layer to obtain a binarized vector; The first query vector is calculated based on the query random matrix in the feature extraction layer and the binarized vector.
5. The method as described in claim 1, wherein the initial task features corresponding to the at least two recommendation dimensions are obtained through the feature fusion layer of the multi-task model, comprising: The second query vector, second key vector, and second value vector corresponding to the user data are calculated through the feature fusion layer of the multi-task model. The baseline task features are calculated based on the second query vector, the second key vector, and the second value vector. Determine the task weights corresponding to the at least two recommendation dimensions, and calculate the initial task features corresponding to the at least two recommendation dimensions based on the at least two task weights and the baseline task features.
6. The method as described in claim 5, wherein calculating the second query vector, the second key vector, and the second value vector corresponding to the user data through the feature fusion layer of the multi-task model includes: The second key weight matrix and the second value weight matrix are calculated based on the feature fusion layer of the multi-task model. Obtain a preset random vector and use it as the second query vector. Calculate the second key vector based on the second key weight matrix and the user data. Calculate the second value vector based on the second value weight matrix and the user data.
7. The method according to any one of claims 1-6, further comprising: Generate a recommendation display page corresponding to the recommendation task based on the recommendation data; The recommended data is displayed to target users associated with the user data through the recommended display page.
8. The method according to any one of claims 1-6, wherein obtaining user data for recommendation tasks and inputting it into a multi-task model, comprises: Obtain user data for recommendation tasks and perform embedding processing on the user data to obtain a user data vector sequence corresponding to the user data; The user data vector sequence is input into the multi-task model.
9. The method of claim 1, wherein the training method of the multi-task model comprises: Obtain sample data for the prediction task and the corresponding sample labels, and input the sample data into a multi-task model, wherein the multi-task model is used to determine the prediction results of the prediction task in at least two prediction dimensions; The shared features corresponding to the sample data are obtained through the feature extraction layer of the multi-task model, wherein the shared features include dimensional attention information corresponding to at least two prediction dimensions. The initial task features corresponding to the at least two prediction dimensions are obtained through the feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two prediction dimensions are fused with the shared features. The multi-task problem on which the task target depends is transformed into a constrained ordinary multi-task for solution, thereby obtaining the target task features corresponding to the at least two recommendation dimensions. Calculate the model loss value corresponding to the multi-task model based on the target task features corresponding to the at least two recommendation dimensions and the sample labels; The multi-task model is tuned based on the model loss value until the model training stops.
10. A data processing method based on a multi-task model, comprising: The task data of the prediction task is obtained and input into a multi-task model, wherein the multi-task model is used to determine the prediction result of the prediction task in at least two prediction dimensions. The shared features corresponding to the task data are obtained through the feature extraction layer of the multi-task model, wherein the shared features include the dimension attention information corresponding to the at least two prediction dimensions respectively; The initial task features corresponding to the at least two prediction dimensions are obtained through the feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two prediction dimensions are fused with the shared features. The multi-task problem on which the task target depends is transformed into a constrained ordinary multi-task for solution, thereby obtaining the target task features corresponding to the at least two prediction dimensions. Predictive data is generated based on the target task features corresponding to the at least two prediction dimensions, and is used as the task execution result corresponding to the predicted task. The predicted data includes the predicted sub-data corresponding to the at least two prediction dimensions.
11. A data processing method based on a multi-task model, applied to cloud-side devices, comprising: The user data of the associated recommendation task submitted by the terminal device is obtained and input into the multi-task model, wherein the multi-task model is used to determine the recommendation result of the recommendation task in at least two recommendation dimensions; The shared features corresponding to the user data are obtained through the feature extraction layer of the multi-task model, wherein the shared features include the dimension attention information corresponding to the at least two recommendation dimensions respectively; The initial task features corresponding to the at least two recommendation dimensions are obtained through the feature fusion layer of the multi-task model, and the initial task features corresponding to the at least two recommendation dimensions are fused with the shared features. The multi-task problem on which the task target depends is transformed into a constrained ordinary multi-task for solution, thereby obtaining the target task features corresponding to the at least two recommendation dimensions. Recommendation data is generated based on the target task features corresponding to the at least two recommendation dimensions, and returned to the edge device as the task execution result corresponding to the recommended task. The recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions.
12. A data processing device based on a multi-task model, comprising: An input module is configured to acquire user data for a recommendation task and input it into a multi-task model, wherein the multi-task model is used to determine the recommendation results of the recommendation task in at least two recommendation dimensions; The first acquisition module is configured to acquire shared features corresponding to the user data through the feature extraction layer of the multi-task model, wherein the shared features include dimension attention information corresponding to the at least two recommendation dimensions respectively; The second acquisition module is configured to acquire the initial task features corresponding to the at least two recommendation dimensions through the feature fusion layer of the multi-task model, and to fuse the initial task features corresponding to the at least two recommendation dimensions with the shared features. The target task features corresponding to the at least two recommendation dimensions are obtained by transforming the multi-task problem on which the task target depends into a constrained ordinary multi-task for solution. The generation module is configured to generate recommendation data based on the target task features corresponding to the at least two recommendation dimensions, and use the generated data as the task execution result corresponding to the recommendation task. The recommendation data includes recommendation sub-data corresponding to the at least two recommendation dimensions.
13. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Information recommendation method and device, electronic equipment and storage medium
CN113901328A
Information recommendation method and device based on artificial intelligence and electronic equipment
CN114741583A