Content Recommendation Method, Apparatus, Electronic Device, and Computer-Readable Storage Medium
By mapping the conversion weight coefficients in the content recommendation model, combining the training samples for feature dimension transformation and fusion, adjusting the weight coefficients to improve the accuracy of the model, the problem of low accuracy caused by separate adjustment of network parameters in the prior art is solved, and higher recommendation accuracy and lower model size are achieved.
Patent Information
- Application Number
- CN202210735277.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-06-27
AI Technical Summary
The separation of network parameter adjustments of existing recommended models leads to lower accuracy of recommended models after training.
By obtaining the conversion weight coefficients used for feature dimension transformation in the content recommendation model, performing mapping processing to obtain the fusion weight coefficient, and combining the training samples for feature dimension transformation and feature fusion, adjusting the conversion weight coefficient and fusion weight coefficient to improve the accuracy of the model.
Improves the accuracy of the recommended model when content recommendation is recommended after training, reduces the model size and improves the prediction speed.
Smart Images

Figure CN115130669B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular, to a content recommendation method, apparatus, electronic device, and computer-readable storage medium. Background Art
[0002] With the rapid development of the Internet, the amount of data transmitted through the Internet is increasing. In order to screen out the content that users are interested in from the vast amount of data and recommend it to users, recommendation models have emerged.
[0003] Currently, during the training of the recommendation model, the adjustment of the network parameters of the recommendation model is separate, resulting in a low accuracy when using the trained recommendation model for recommendation. Summary of the Invention
[0004] Embodiments of this application provide a content recommendation method, apparatus, electronic device, and computer-readable storage medium, which can solve the technical problem that the separate adjustment of the network parameters of the recommendation model leads to a low accuracy when using the trained recommendation model for recommendation.
[0005] A model training method includes:
[0006] Obtain the transformation weight coefficient for feature dimension transformation in the content recommendation model;
[0007] Perform a mapping process on the above transformation weight coefficient to obtain the fusion weight coefficient for feature fusion of the above content recommendation model;
[0008] Obtain the training sample set of the above content recommendation model, where each training sample in the training sample set includes the object feature of the sample object and the sample content corresponding to the sample object;
[0009] Perform dimension transformation processing on the above training sample according to the above transformation weight coefficient to obtain at least one transformed feature vector corresponding to the above training sample;
[0010] Perform feature fusion processing on at least one of the above transformed feature vectors according to the above fusion weight coefficient to obtain the first fusion feature vector corresponding to the above training sample;
[0011] According to the above first fusion feature vector, predict the response rate of the above sample object to the above sample content, and train the above content recommendation model according to the predicted response rate to adjust the above transformation weight coefficient and the above fusion weight coefficient, so as to obtain a trained recommendation model for content recommendation.
[0012] Correspondingly, a content recommendation method according to an embodiment of this application includes:
[0013] Obtain the target object feature of the target object and each content to be recommended;
[0014] Input the above-mentioned target object features and the above-mentioned content to be recommended into the above-mentioned trained recommendation model for prediction, and obtain the target response rate of the above-mentioned target object for each of the above-mentioned content to be recommended;
[0015] Recommend the content to be recommended whose target response rate meets the preset response rate to the above-mentioned target object.
[0016] Correspondingly, an embodiment of the present application provides a model training device, including:
[0017] A first acquisition module, configured to acquire a conversion weight coefficient for feature dimension conversion in a content recommendation model;
[0018] A coefficient mapping module, configured to perform a mapping process on the above-mentioned conversion weight coefficient to obtain a fusion weight coefficient for feature fusion of the above-mentioned content recommendation model;
[0019] A second acquisition module, configured to acquire a training sample set of the above-mentioned content recommendation model, where each training sample in the training sample set includes object features of a sample object and sample content responded by the above-mentioned sample object;
[0020] A dimension conversion module, configured to perform a dimension conversion process on the above-mentioned training sample according to the above-mentioned conversion weight coefficient to obtain at least one converted feature vector corresponding to the above-mentioned training sample;
[0021] A feature fusion module, configured to perform a feature fusion process on at least one of the above-mentioned converted feature vectors according to the above-mentioned fusion weight coefficient to obtain a first fusion feature vector corresponding to the above-mentioned training sample;
[0022] A prediction training module, configured to predict the response rate of the above-mentioned sample object for the above-mentioned sample content according to the above-mentioned first fusion feature vector, and train the above-mentioned content recommendation model according to the predicted response rate to adjust the above-mentioned conversion weight coefficient and the above-mentioned fusion weight coefficient, so as to obtain a trained recommendation model for content recommendation.
[0023] Optionally, the coefficient mapping module is specifically configured to execute:
[0024] Perform a first fully connected mapping process on the above-mentioned conversion weight coefficient to obtain a candidate fusion weight coefficient for feature fusion of the above-mentioned content recommendation model;
[0025] Perform an activation mapping process on the above-mentioned candidate fusion weight coefficient to obtain the fusion weight coefficient of the above-mentioned content recommendation model.
[0026] Optionally, the coefficient mapping module is specifically configured to execute:
[0027] Perform activation mapping processing on the above candidate fusion weight coefficients to obtain the initial fusion weight coefficients of the above content recommendation model;
[0028] Perform discrete differentiable processing on the above initial fusion weight coefficients to obtain the fusion weight coefficients of the above content recommendation model.
[0029] Optionally, the model training device further includes:
[0030] A feature mapping module, configured to perform a second fully connected mapping process on the transformed feature vector to obtain a second fusion feature vector corresponding to the training sample.
[0031] Correspondingly, the prediction training module is specifically configured to execute:
[0032] Concatenate the first fusion feature vector and the second fusion feature vector to obtain a fusion feature vector;
[0033] Predict the response rate of the sample object to the above sample content according to the fusion feature vector.
[0034] Optionally, the above content recommendation model includes multiple preset mapping dimensions corresponding to the above transformation weight coefficients.
[0035] Correspondingly, the dimension transformation module is specifically configured to execute:
[0036] Extract features from the above training sample to obtain at least one feature domain corresponding to the above training sample;
[0037] Perform dimension mapping processing on the above feature domain according to multiple above preset mapping dimensions to obtain candidate transformation feature vectors of the above feature domain for each of the above preset mapping dimensions;
[0038] Perform dimension fusion processing on the candidate transformation feature vectors of each of the above feature domains according to the above transformation weight coefficients to obtain transformation feature vectors corresponding to the above feature domains.
[0039] Optionally, the feature fusion module is specifically configured to execute:
[0040] Perform cross operation on the above transformed feature vectors to obtain at least one candidate fusion feature vector;
[0041] Perform feature fusion processing on the above candidate fusion feature vectors according to the fusion weight coefficients in the above that match the above candidate fusion feature vectors to obtain a first fusion feature vector corresponding to the above training sample.
[0042] Optionally, the above content recommendation model includes gating parameters for mapping.
[0043] Correspondingly, the coefficient mapping module is specifically configured to execute:
[0044] Perform a mapping process on the above conversion weight coefficients according to the above gating parameters to obtain the fusion weight coefficients of the above content recommendation model.
[0045] The prediction training module is specifically used to execute:
[0046] Determine the first target loss value according to the predicted response rate and the true response rate corresponding to the above training sample set;
[0047] If the above first target loss value does not meet the first preset condition, update the above gating parameters according to the above first target loss value to obtain updated gating parameters;
[0048] Based on the above updated gating parameters and the above conversion weight coefficients, update the above fusion weight coefficients to obtain updated fusion weight coefficients;
[0049] Update the above conversion weight coefficients according to the above first target loss value to obtain updated conversion weight parameters;
[0050] Use the above updated conversion weight parameters as the above conversion weight parameters, use the above updated fusion weight coefficients as the above fusion weight coefficients, and return to execute the step of extracting features from the above training samples to obtain at least one feature domain corresponding to the above training samples;
[0051] If the above first target loss value meets the above first preset condition, obtain the trained recommendation model for content recommendation.
[0052] Optionally, there are multiple above conversion weight coefficients, and each above conversion weight coefficient corresponds to one above preset mapping dimension.
[0053] Correspondingly, the prediction training module is specifically used to execute:
[0054] If the above first target loss value meets the above first preset condition, use the largest conversion weight coefficient among the multiple above conversion weight coefficients as the target conversion weight coefficient corresponding to the above feature domain, and use the preset mapping dimension corresponding to the above target conversion weight coefficient as the target mapping dimension corresponding to the above feature domain;
[0055] Obtain the trained recommendation model for content recommendation according to the above target conversion weight coefficient, target mapping dimension and the above fusion weight coefficients.
[0056] Optionally, the prediction training module is specifically used to execute:
[0057] Use the fusion weight coefficients greater than the preset threshold among the above fusion weight coefficients as the target fusion weight coefficients;
[0058] According to the above-mentioned target transformation weight coefficient, target mapping dimension, and the above-mentioned target fusion weight coefficient, a trained recommendation model for content recommendation is obtained.
[0059] Optionally, the above-mentioned content recommendation model further includes a model weight coefficient.
[0060] Correspondingly, the prediction training module is specifically configured to execute:
[0061] Determine a second target loss value according to the predicted response rate and the true response rate corresponding to the above-mentioned training sample set;
[0062] If the above-mentioned second target loss value does not meet the second preset condition, update the above-mentioned model weight coefficient according to the above-mentioned second target loss value, and return to execute the step of extracting features from the above-mentioned training samples to obtain at least one feature domain corresponding to the above-mentioned training samples;
[0063] If the above-mentioned second target loss value meets the second preset condition, obtain a candidate recommendation model;
[0064] Input the verification samples in the verification set into the above-mentioned candidate recommendation model for prediction to obtain a first target loss value;
[0065] The above-mentioned step of returning to execute the step of extracting features from the above-mentioned training samples to obtain at least one feature domain corresponding to the above-mentioned training samples includes:
[0066] Return to execute the step of inputting the verification samples in the verification set into the above-mentioned candidate recommendation model for prediction to obtain a first target loss value.
[0067] Correspondingly, an embodiment of the present application provides a content recommendation device, including:
[0068] An acquisition module, configured to acquire the target object features of the target object and each content to be recommended;
[0069] A prediction module, configured to input the above-mentioned target object features and the above-mentioned content to be recommended into the above-mentioned trained recommendation model for prediction to obtain the target response rate of the above-mentioned target object for each of the above-mentioned content to be recommended;
[0070] A recommendation module, configured to recommend the content to be recommended whose target response rate meets the preset response rate to the above-mentioned target object.
[0071] In addition, an embodiment of the present application further provides an electronic device, including a processor and a memory, the above-mentioned memory stores a computer program, and the above-mentioned processor is used to run the computer program in the above-mentioned memory to implement the model training method or content recommendation method provided by the embodiment of the present application.
[0072] In addition, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute any one of the model training methods or content recommendation methods provided by the embodiments of the present application.
[0073] In addition, an embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements any one of the model training methods or content recommendation methods provided by the embodiments of the present application.
[0074] In the embodiment of the present application, first, obtain the transformation weight coefficient for feature dimension transformation in the content recommendation model, and then perform a mapping process on the transformation weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model. Next, obtain the training sample set of the content recommendation model. Each training sample in the training sample set includes the object feature of the sample object and the sample content corresponding to the sample object response. Secondly, perform dimension transformation processing on the training samples according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training samples, and perform feature fusion processing on the at least one fused feature vector according to the fusion weight coefficient to obtain the first fused feature vector corresponding to the training samples. Finally, according to the first fused feature vector, predict the response rate of the sample object to the sample content, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, so as to obtain a trained recommendation model for content recommendation.
[0075] That is, in the embodiment of the present application, since after obtaining the transformation weight coefficient, a mapping process is performed on the transformation weight coefficient to obtain the fusion weight coefficient, and a connection is established between the transformation weight coefficient and the fusion weight coefficient. Therefore, after performing dimension transformation processing on the training samples according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training samples, and performing feature fusion processing on the at least one fused feature vector according to the fusion weight coefficient to obtain the first fused feature vector corresponding to the training samples, according to the first fused feature vector, predict the response rate of the sample object to the sample content, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, the obtained trained recommendation model has higher accuracy in content recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0077] Figure 1It is a schematic diagram of the scenario of the model training process provided by an embodiment of the present application;
[0078] Figure 2 It is a schematic flowchart of the model training method provided by an embodiment of the present application;
[0079] Figure 3 It is a schematic flowchart of the content recommendation method provided by an embodiment of the present application;
[0080] Figure 4 It is a schematic flowchart of another model training method provided by an embodiment of the present application;
[0081] Figure 5 It is a schematic diagram of the structure of the content recommendation model provided by an embodiment of the present application;
[0082] Figure 6 It is a schematic flowchart of the application method of the model provided by an embodiment of the present application;
[0083] Figure 7 It is a schematic diagram of the structure of the model training device provided by an embodiment of the present application;
[0084] Figure 8 It is a schematic diagram of the structure of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0085] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present application.
[0086] An embodiment of the present application provides a model training method, device, electronic device, and computer-readable storage medium. Among them, the model training device can be integrated in the electronic device, and the electronic device can be a server or a terminal device, etc.
[0087] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0088] Moreover, multiple servers can form a blockchain, and the server is a node on the blockchain.
[0089] The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication means, and this application does not make any restrictions here.
[0090] For example, as Figure 1 shown, the server can obtain the conversion weight coefficient for feature dimension conversion in the content recommendation model; perform a mapping process on the conversion weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model. The terminal obtains the training sample set of the content recommendation model. Each training sample in the training sample set includes the object features of the sample object and the sample content corresponding to the sample object, and sends the training sample set to the server.
[0091] The server performs dimension conversion processing on the training samples according to the conversion weight coefficient to obtain at least one converted feature vector corresponding to the training samples; performs feature fusion processing on the at least one fused feature vector according to the fusion weight coefficient to obtain the first fused feature vector corresponding to the training samples; predicts the response rate of the sample object to the sample content according to the first fused feature vector, and trains the content recommendation model according to the predicted response rate to adjust the conversion weight coefficient and the fusion weight coefficient, so as to obtain the trained recommendation model for content recommendation.
[0092] In the specific implementation manner of this application, data related to user information and the like are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0093] In addition, "a plurality of" in the embodiments of this application means two or more. "First" and "second" in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.
[0094] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0095] In this embodiment, the description will be made from the perspective of the model training device. For the convenience of explaining the model training method of this application, the following will be described in detail with the model training device integrated in the terminal, that is, the terminal is used as the execution subject for detailed description.
[0096] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the model training method provided by an embodiment of this application. The model training method may include:
[0097] S201. Obtain the transformation weight coefficient for feature dimension transformation in the content recommendation model.
[0098] The content recommendation model refers to a neural network model used to establish the connection between users and content and recommend content to users. For example, the content recommendation model can be used in the scenario of recommended subscription account graphics and texts. After a user browses the tweets of the public accounts they follow, through the content recommendation model, new articles or videos can be recommended to the user. That is, on the interface of the terminal, the recommended new articles or videos can be seen.
[0099] The content recommendation model can be a Factor Machine (FM) or a Factorization-Machine based Neural Network for CTR Prediction (DeepFM). For the type of the content recommendation model, it can be selected according to the actual situation, and this embodiment does not make a limitation here.
[0100] Content can refer to information on the Internet. For example, content can be multimedia resources, information about goods, and information about articles, etc.
[0101] The transformation weight coefficient can refer to the weight coefficient of the preset mapping dimension in the content recommendation model. The preset mapping dimension refers to the dimension of the feature vector obtained after the feature dimension transformation of the original feature vector. For example, after the feature dimension transformation of a 256-dimensional feature vector according to the preset mapping dimension, a 16-dimensional feature vector is obtained. Then the preset mapping dimension is 16 dimensions, and the 16-dimensional feature vector is the feature vector of the preset mapping dimension. Then, according to the feature vector of the preset mapping dimension and the transformation weight coefficient, the transformed feature vector is obtained.
[0102] Optionally, the preset mapping dimension can be implemented through the embeddings in the content recommendation model, that is, the dimension of an embedding layer can be used to represent a preset mapping dimension. The embedding layer refers to the network layer used for feature dimension transformation. That is, the embedding layer can be used to map the discrete feature vector into a continuous low-dimensional feature vector.
[0103] It should be understood that the content recommendation model can include one preset mapping dimension or multiple preset mapping dimensions. Each preset mapping dimension corresponds to a transformation weight coefficient, that is, multiple embedding layers can be included, and each embedding layer corresponds to a transformation weight coefficient. Among them, each preset mapping dimension can be different.
[0104] Alternatively, the transformation weight coefficient can also refer to the weight coefficient used to change the dimension of the original feature vector, that is, according to the transformation weight coefficient, the feature dimension transformation of the original feature vector is performed to obtain the transformed feature vector.
[0105] When the terminal obtains the initialization instruction, it can obtain the conversion weight coefficient for feature dimension conversion in the content recommendation model. Alternatively, when the terminal obtains the training sample set of the content recommendation model, it can obtain the conversion weight coefficient. This embodiment does not make a limitation here.
[0106] S202. Perform a mapping process on the conversion weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model.
[0107] In the related art, since the fusion weight coefficient is directly affected by the conversion weight coefficient, generally, the adjustment of the fusion weight coefficient and the conversion weight coefficient is done separately. That is, when training the content recommendation model, only the conversion weight coefficient is adjusted, or only the fusion weight coefficient is adjusted. This makes the accuracy of the content recommended to the user not very high when using the trained recommendation model for content recommendation.
[0108] In order to be more accurate when using the trained recommendation model for content recommendation, in this embodiment, a connection between the conversion weight coefficient and the fusion weight coefficient is first established. That is, after obtaining the conversion weight coefficient, a mapping process is performed on the conversion weight coefficient to obtain the fusion weight coefficient, so that when training the content recommendation model, the conversion weight coefficient and the fusion weight coefficient can be adjusted simultaneously, thereby improving the content recommendation effect of the trained recommendation model.
[0109] In some embodiments, performing a mapping process on the conversion weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model includes:
[0110] Perform a first fully connected mapping process on the conversion weight coefficient to obtain the candidate fusion weight coefficient for feature fusion of the content recommendation model;
[0111] Perform an activation mapping process on the candidate fusion weight coefficient to obtain the fusion weight coefficient of the content recommendation model.
[0112] Among them, the content recommendation model may include a gating layer. The gating layer includes a first fully connected layer and an activation function layer. Then, perform a first fully connected mapping process on the conversion weight coefficient through the first fully connected layer to obtain the candidate fusion weight coefficient, and perform an activation mapping process on the candidate fusion weight coefficient through the activation function layer, so as to map the fusion weight coefficient to a number within the range of [0, 1].
[0113] In order to ensure the discrete characteristics of the fusion weight coefficient while making the fusion weight coefficient differentiable during the process of updating the fusion weight coefficient, in other embodiments, performing an activation mapping process on the candidate fusion weight coefficient to obtain the fusion weight coefficient of the content recommendation model includes:
[0114] Perform activation mapping processing on the candidate fusion weight coefficients to obtain the initial fusion weight coefficients of the content recommendation model;
[0115] Perform discrete differentiable processing on the initial fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model.
[0116] The discrete differentiable processing may include discrete processing and differentiable processing. After performing discrete processing on the initial fusion weight coefficients, discrete fusion weight coefficients can be obtained. At this time, the discrete fusion weight coefficients are also the fusion weight coefficients. However, in order to solve the gradient of the first target loss value with respect to the fusion weight coefficients during the process of updating the fusion weight coefficients according to the first target loss value, differentiable processing can be performed on the discrete fusion weight coefficients to obtain the fusion weight coefficients.
[0117] In this embodiment, after performing activation mapping processing on the candidate fusion weight coefficients, the fusion weight coefficients are not directly obtained. Instead, discrete differentiable processing is performed on the initial fusion weight coefficients obtained after performing activation mapping processing on the candidate fusion weight coefficients, and then the fusion weight coefficients are obtained, so that the fusion weight coefficients are discrete and differentiable at the same time.
[0118] S203. Obtain the training sample set of the content recommendation model. Each training sample in the training sample set includes the object features of the sample object and the sample content corresponding to the sample object response.
[0119] After the terminal obtains the transformation weight coefficients and fusion weight coefficients of the content recommendation model, it can immediately obtain the training sample set of the content recommendation model. Alternatively, after the terminal obtains the transformation weight coefficients and fusion weight coefficients of the content recommendation model, it can also obtain the training sample set of the content recommendation model after a preset time interval. Or, the terminal can also obtain the transformation weight coefficients and fusion weight coefficients when it obtains the training sample set. This embodiment does not make a limitation here.
[0120] The sample object may refer to the user on the training sample, the object features may refer to the attribute features of the user and / or the real-time click behavior features, and the sample content may be the information on the Internet corresponding to the user response. For example, it may be the price of a commodity, the price of a commodity, etc. Optionally, the sample content may also be the context information of the information on the Internet corresponding to the user response. For example, the context information may be the time of the information on the Internet corresponding to the user response, or the position where the information on the Internet corresponding to the user response is displayed on the terminal, etc.
[0121] S204. Perform dimension transformation processing on the training samples according to the transformation weight coefficients to obtain at least one transformed feature vector corresponding to the training samples.
[0122] Among them, the training samples can be first subjected to feature extraction to obtain the feature vectors of the training samples, and then the transformation weight coefficients are multiplied by the feature vectors to achieve the dimensionality transformation of the feature vectors, so as to obtain at least one transformed feature vector corresponding to the training samples.
[0123] Alternatively, when the content recommendation model includes multiple preset mapping dimensions corresponding to the transformation weight coefficients, the training samples are subjected to dimensionality transformation processing according to the transformation weight coefficients to obtain at least one transformed feature vector corresponding to the training samples, including:
[0124] Feature extraction is performed on the training samples to obtain at least one feature domain corresponding to the training samples;
[0125] According to the multiple preset mapping dimensions, dimensionality mapping processing is performed on the feature domain to obtain candidate transformed feature vectors of the feature domain for each preset mapping dimension;
[0126] According to the transformation weight coefficients, dimensionality fusion processing is performed on the candidate transformed feature vectors of each feature domain to obtain the transformed feature vector corresponding to the feature domain.
[0127] A feature domain refers to a feature set composed of feature vectors of the same type. For example, each training sample includes the user's age, gender, and the articles clicked by the user. Then, the feature vectors corresponding to the ages of multiple users can form the first feature domain, the feature vectors corresponding to the genders of multiple users can form the second feature domain, and the feature vectors corresponding to the articles clicked by multiple users can form the third feature domain.
[0128] The preset mapping dimensions and the number of preset mapping dimensions can be selected according to the actual situation. For example, the number of preset mapping dimensions is set to 4, and the preset mapping dimensions can be set to 16, 32, 64, and 128. This embodiment does not make any limitations here.
[0129] Optionally, one feature domain can correspond to multiple preset mapping dimensions, and the preset mapping dimensions and the number of preset mapping dimensions corresponding to each feature domain can be the same. For example, the feature domain includes the first feature domain and the second feature domain, and the preset mapping dimensions corresponding to the first feature domain and the second feature domain can both be 16, 32, 64, and 128.
[0130] Optionally, after obtaining the feature vectors corresponding to the training samples, the feature vectors can be encoded into 01 vectors, and then the 01 feature vectors of the same type are concatenated to obtain the respective feature domains corresponding to the 01 feature vectors. The method of encoding the feature vectors into 01 vectors can be selected according to the actual situation. For example, the one-hot algorithm or the binary encoding algorithm can be used to encode the feature vectors into 01 vectors. This embodiment does not make any limitations here.
[0131] After obtaining the feature domain, dimension mapping processing can be performed on the feature domain according to multiple preset mapping dimensions to obtain candidate transformed feature vectors of the feature domain for each preset mapping dimension. For example, if the length of the feature domain is m, and the preset mapping dimensions are n and l, then the candidate transformed feature vector of the feature domain for the preset mapping dimension m can be an m*n feature vector, and the candidate transformed feature vector for the preset mapping dimension l can be an m*l feature vector.
[0132] Since the dimensions of the candidate transformed feature vectors obtained according to different preset mapping dimensions are different, therefore, before performing dimension fusion processing on the candidate transformed feature vectors of each feature domain according to the transformation weight coefficient to obtain the transformed feature vector corresponding to the feature domain, the candidate transformed feature vectors can be subjected to a third fully connected processing, so as to project the candidate transformed feature vectors to the same dimension to obtain the fully connected candidate transformed feature vectors. Finally, according to the transformation weight coefficient, dimension fusion processing is performed on the fully connected candidate transformed feature vectors of each feature domain to obtain the transformed feature vector corresponding to the feature domain.
[0133] Optionally, there can be multiple transformation weight coefficients, and each transformation weight coefficient corresponds to a preset mapping dimension. After obtaining the candidate transformed feature vectors of the feature domain for the preset mapping dimension, multiply the candidate transformed feature vectors for the preset mapping dimension by the transformation weight coefficient corresponding to the preset mapping dimension to obtain the multiplication results of the feature domain for each preset mapping dimension. Finally, add up the respective multiplication results to achieve dimension fusion processing of the candidate transformed feature vectors of each feature domain to obtain the transformed feature vector corresponding to the feature domain.
[0134] In this embodiment, when training the content recommendation model, different preset mapping dimensions are set, and each transformation weight coefficient has a corresponding preset mapping dimension, and then the preset mapping dimensions are selected according to the transformation weight coefficient.
[0135] S205. Perform feature fusion processing on at least one transformed feature vector according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample.
[0136] Among them, the fusion weight coefficient can be directly multiplied by the transformed feature vector respectively to achieve feature fusion processing of the transformed feature vector and obtain the first fusion feature vector.
[0137] Or, performing feature fusion processing on at least one transformed feature vector according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample can also be:
[0138] Perform cross operation on the transformed feature vectors to obtain at least one candidate fusion feature vector;
[0139] Perform feature fusion processing on the candidate fusion feature vector according to the fusion weight coefficient that matches the candidate fusion feature vector in the fusion weight coefficients, to obtain the first fusion feature vector corresponding to the training sample.
[0140] Cross operation refers to performing inner product processing or Hadamard product processing on two feature vectors, so as to obtain a candidate fusion feature vector corresponding to the two feature vectors.
[0141] The fusion weight coefficient that matches the candidate fusion feature vector can refer to the fusion weight coefficient corresponding to the transformed feature vector for obtaining the candidate fusion feature vector. For example, perform a cross operation on the transformed feature vector 1 and the transformed feature vector 2 to obtain the candidate fusion feature vector 12, then the fusion weight coefficient that matches the candidate fusion feature vector can be the fusion weight coefficients corresponding to the transformed feature vector 1 and the transformed feature vector 2.
[0142] Optionally, the fusion weight coefficient that matches the candidate fusion feature vector can be multiplied by the candidate fusion feature vector to obtain the result of multiplying the fusion vectors, and then the results of multiplying the fusion vectors are added together, so as to obtain the first fusion feature vector.
[0143] Optionally, the fusion weight coefficient corresponding to the transformed feature vector can be determined according to the feature domain, where one fusion weight coefficient can correspond to every two feature domains. For example, the feature domain includes the first feature domain and the second feature domain, the fusion weight coefficient corresponding to the first feature domain and the second feature domain is the fusion weight coefficient a, the transformed feature vector corresponding to the first feature domain is the transformed feature vector 1, the transformed feature vector corresponding to the second feature domain is the transformed feature vector 2, perform a cross operation on the transformed feature vector 1 and the transformed feature vector 2 to obtain the candidate fusion feature vector 12, then the fusion weight coefficient that matches the candidate fusion feature vector 12 is the fusion weight coefficient a.
[0144] It should be noted that the cross operation can be performed on the transformed feature vectors through the feature cross layer in the content recommendation model to obtain at least one candidate fusion feature vector; perform feature fusion processing on the candidate fusion feature vector according to the fusion weight coefficient that matches the candidate fusion feature vector in the fusion weight coefficients, to obtain the first fusion feature vector corresponding to the training sample.
[0145] S206. Predict the response rate of the sample object to the sample content according to the first fusion feature vector, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, so as to obtain the trained recommendation model for content recommendation.
[0146] Since the fusion weight coefficient is obtained by mapping the transformation weight coefficient, therefore, when predicting the response rate of the sample object to the sample content according to the first fusion feature vector and training the content recommendation model according to the predicted response rate, the transformation weight coefficient and the fusion weight coefficient can be adjusted simultaneously, so that the obtained trained recommendation model has higher accuracy when performing content recommendation.
[0147] The response rate can refer to the click-through rate (CTR) or the browsing rate of the user to the sample content, etc.
[0148] However, since the first fusion feature vector is mainly a vector obtained by combining low-dimensional features, therefore, in order to improve the accuracy of the trained recommendation model when performing content recommendation, before predicting the response rate of the sample object to the sample content according to the first fusion feature vector, it further includes:
[0149] Performing a second fully connected mapping process on the transformation feature vector to obtain a second fusion feature vector corresponding to the training sample;
[0150] Predicting the response rate of the sample object to the sample content according to the first fusion feature vector includes:
[0151] Concatenating the first fusion feature vector and the second fusion feature vector to obtain a fusion feature vector;
[0152] Predicting the response rate of the sample object to the sample content according to the fusion feature vector.
[0153] In this embodiment, while obtaining the first fusion feature vector, performing a second fully connected mapping process on the transformation feature vector to obtain a second fusion feature vector corresponding to the training sample. At this time, the second fusion feature vector includes the high-dimensional features of the training sample, and then concatenating the first fusion feature vector and the second fusion feature vector to obtain a fusion feature vector, and finally predicting the response rate of the sample object to the sample content according to the fusion feature vector, so as to improve the accuracy of the trained recommendation model when performing content recommendation.
[0154] Among them, the second fully connected mapping process can be performed on the transformation feature vector through the deep learning layer in the content recommendation model to obtain a second fusion feature vector corresponding to the training sample. The first fusion feature vector and the second fusion feature vector can be concatenated through the prediction layer in the content recommendation model to obtain a fusion feature vector, and the response rate of the sample object to the sample content is predicted according to the fusion feature vector.
[0155] Optionally, the process of training the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient to obtain a trained recommendation model for content recommendation can be:
[0156] Determine a first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set;
[0157] If the first target loss value does not meet the first preset condition, update the conversion weight coefficient according to the first target loss value to obtain an updated conversion weight coefficient, and perform a mapping process on the updated conversion weight coefficient to update the fusion weight coefficient to obtain an updated fusion weight coefficient;
[0158] Take the updated conversion weight parameter as the conversion weight parameter, take the updated fusion weight coefficient as the fusion weight coefficient, and return to execute the step of extracting features from the training sample to obtain at least one feature domain corresponding to the training sample;
[0159] If the first target loss value meets the first preset condition, obtain a trained recommendation model for content recommendation.
[0160] However, if the fusion weight coefficient is updated according to the updated conversion weight coefficient, it will cause unstable training. To solve this technical problem, in some embodiments, the content recommendation model includes gating parameters for mapping. Performing a mapping process on the conversion weight coefficient to obtain the fusion weight coefficient of the content recommendation model includes:
[0161] Perform a mapping process on the conversion weight coefficient according to the gating parameters to obtain the fusion weight coefficient of the content recommendation model;
[0162] Train the content recommendation model according to the predicted response rate to adjust the conversion weight coefficient and the fusion weight coefficient to obtain a trained recommendation model for content recommendation, including:
[0163] Determine a first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set;
[0164] If the first target loss value does not meet the first preset condition, update the gating parameter according to the first target loss value to obtain an updated gating parameter;
[0165] Based on the updated gating parameter and the conversion weight coefficient, update the fusion weight coefficient to obtain an updated fusion weight coefficient;
[0166] Update the conversion weight coefficient according to the first target loss value to obtain an updated conversion weight parameter;
[0167] Take the updated conversion weight parameter as the conversion weight parameter, take the updated fusion weight coefficient as the fusion weight coefficient, and return to execute the step of extracting features from the training sample to obtain at least one feature domain corresponding to the training sample;
[0168] If the first target loss value meets the first preset condition, a trained recommendation model for content recommendation is obtained.
[0169] In this embodiment, instead of updating the fusion weight coefficient according to the updated transformation weight coefficient, the fusion weight coefficient is updated according to the updated gating parameter and the transformation weight coefficient, so that when updating the fusion weight coefficient, the transformation weight coefficient is not updated, thereby improving the stability of the content recommendation model during training.
[0170] The gating parameter can be the parameter of the first fully connected layer. According to the gating parameter, the process of mapping the transformation weight coefficient to obtain the fusion weight coefficient of the content recommendation model can be as follows:
[0171] According to the gating parameter, perform a first fully connected mapping process on the transformation weight coefficient to obtain the candidate fusion weight coefficient of the content recommendation model;
[0172] Perform an activation mapping process on the candidate fusion weight coefficient to obtain the fusion weight coefficient of the content recommendation model.
[0173] The predicted response rate and the true response rate corresponding to the training sample set can be substituted into a preset formula for calculation, so as to obtain the first target loss value. The preset formula can be selected according to the actual situation. For example, a cross-entropy function or a mean square error function can be selected. This embodiment does not make a limitation here.
[0174] When the first target loss value is greater than the first preset threshold, it can be determined that the first target loss value does not meet the first preset condition. When the first target loss value is less than or equal to the second preset threshold, it can be determined that the first target loss value meets the first preset condition.
[0175] When each feature domain corresponds to multiple preset mapping dimensions and there is a corresponding transformation weight coefficient for each preset mapping dimension, that is, when each feature domain has multiple transformation weight coefficients and each transformation weight coefficient corresponds to a preset mapping dimension, if the trained recommendation model is used for content recommendation, then each feature domain can only correspond to one preset mapping dimension, that is, each feature domain can only correspond to one transformation weight coefficient.
[0176] Therefore, when using the trained recommendation model for content recommendation, after obtaining the target object feature and the target feature domains of each content to be recommended, the maximum transformation weight coefficient can be selected from the multiple transformation weight coefficients of the feature domain, and then according to the preset mapping dimension corresponding to the maximum transformation weight coefficient and the maximum transformation weight coefficient, the dimension transformation process is performed on the target feature domain to obtain the target transformation feature vector corresponding to the target feature domain.
[0177] Alternatively, if the first target loss value meets the first preset condition, a trained recommendation model for content recommendation is obtained, including:
[0178] If the first target loss value meets the first preset condition, the largest transformation weight coefficient among the multiple transformation weight coefficients is used as the target transformation weight coefficient corresponding to the feature domain, and the preset mapping dimension corresponding to the target transformation weight coefficient is used as the target mapping dimension corresponding to the feature domain;
[0179] A trained recommendation model for content recommendation is obtained according to the target transformation weight coefficient, the target mapping dimension, and the fusion weight coefficient.
[0180] In this embodiment, when the first target loss value meets the first preset condition, the largest transformation weight coefficient among the multiple transformation weight coefficients is used as the target transformation weight coefficient corresponding to the feature domain, and the preset mapping dimension corresponding to the target transformation weight coefficient is used as the target mapping dimension corresponding to the feature domain. A trained recommendation model for content recommendation is obtained according to the target transformation weight coefficient, the target mapping dimension, and the fusion weight coefficient. Then, when using the trained recommendation model for content recommendation, after obtaining the target object feature and the target feature domains of each content to be recommended, the dimension transformation processing of the target feature domain can be directly performed according to the target mapping dimension and the target transformation weight coefficient, without having to select the largest transformation weight coefficient from the multiple transformation weight coefficients of the feature domain.
[0181] There are multiple fusion weight coefficients. When using the trained recommendation model for content recommendation, the fusion weight coefficients can be screened, so that not only the calculation amount can be reduced, but also the invalid cross terms (the cross terms refer to the results obtained after cross operation) can be eliminated. Therefore, after obtaining the target transformed feature vector, the fusion weight coefficients greater than the preset threshold among the fusion weight coefficients can be used as the target fusion weight coefficients, and then the feature fusion processing of the target transformed feature vector can be performed according to the target fusion weight coefficients.
[0182] Alternatively, a trained recommendation model for content recommendation is obtained according to the target transformation weight coefficient, the target mapping dimension, and the fusion weight coefficient, including:
[0183] The fusion weight coefficients greater than the preset threshold among the fusion weight coefficients are used as the target fusion weight coefficients;
[0184] A trained recommendation model for content recommendation is obtained according to the target transformation weight coefficient, the target mapping dimension, and the target fusion weight coefficient.
[0185] In this embodiment, when the first target loss value meets the first preset condition, the fusion weight coefficients greater than the preset threshold in the fusion weight coefficients are used as the target fusion weight coefficients. According to the target conversion weight coefficients, the target mapping dimension, and the target fusion weight coefficients, a trained recommendation model for content recommendation is obtained, so that when using the trained recommendation model for content recommendation, there is no need to screen out the target fusion weight coefficients from multiple fusion weight coefficients again.
[0186] Since there are other network layers in the content recommendation model. For example, when the feature extraction layer in the content recommendation model is used to extract features from the training samples to obtain at least one feature domain corresponding to the training samples, or when the second fully connected layer in the content recommendation model performs a second fully connected mapping process on the transformed feature vectors to obtain the second fusion feature vectors corresponding to the training samples, the content recommendation model further includes a feature extraction layer and / or a second fully connected layer. That is, at this time, the network parameters of the content recommendation model further include model weight coefficients, and the model weight coefficients can be the network parameters of the feature extraction layer or the second fully connected layer, etc.
[0187] If the model weight coefficients, the conversion weight coefficients, and the fusion weight coefficients are adjusted simultaneously, it will lead to overfitting. Therefore, in some other embodiments, determining the first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set includes:
[0188] Determining a second target loss value according to the predicted response rate and the true response rate corresponding to the training sample set;
[0189] If the second target loss value does not meet the second preset condition, then updating the model weight coefficients according to the second target loss value, and returning to execute the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples;
[0190] If the second target loss value meets the second preset condition, then obtaining a candidate recommendation model;
[0191] Inputting the validation samples in the validation set into the candidate recommendation model for prediction to obtain the first target loss value;
[0192] Returning to execute the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples includes:
[0193] Returning to execute the step of inputting the validation samples in the validation set into the candidate recommendation model for prediction to obtain the first target loss value.
[0194] In this embodiment, the content recommendation model is trained according to the training sample set to adjust the model weight coefficients in the content recommendation model, obtaining a candidate recommendation model. Then, the candidate recommendation model is trained according to the validation set to adjust the conversion weight coefficients and fusion weight coefficients in the candidate recommendation model, thereby avoiding the phenomenon of overfitting.
[0195] When the second target loss value is less than or equal to the second preset threshold, it can be determined that the second target loss value meets the second preset condition. When the second target loss value is greater than the second preset threshold, it can be determined that the second target loss value does not meet the second preset condition.
[0196] It should be noted that the process of training the content recommendation model according to the training sample set to adjust the model weight coefficients in the content recommendation model to obtain a candidate recommendation model, and the process of training the candidate recommendation model according to the validation set to adjust the conversion weight coefficients and fusion weight coefficients in the candidate recommendation model can be executed alternately to achieve retraining of the model weight coefficients, fusion weight coefficients, and conversion weight coefficients.
[0197] For example, first execute the process of training the content recommendation model according to the training sample set to adjust the model weight coefficients in the content recommendation model to obtain a candidate recommendation model. Then, execute the process of training the candidate recommendation model according to the validation set to adjust the conversion weight coefficients and fusion weight coefficients in the candidate recommendation model. Then, execute the process of training the content recommendation model according to the training sample set to adjust the model weight coefficients in the content recommendation model to obtain a candidate recommendation model again, until the model converges, that is, until the first target loss value meets the third preset condition and the second target loss value meets the fourth preset condition, then stop training to obtain the trained recommendation model.
[0198] When the first target loss value is less than or equal to the third preset threshold, it can be determined that the first target loss value meets the third preset condition. When the second target loss value is less than or equal to the fourth preset threshold, it can be determined that the second target loss value meets the fourth preset condition. The third preset threshold can be less than the first preset threshold, and the fourth preset threshold can be less than the second preset threshold.
[0199] Alternatively, when executing the process of training the content recommendation model according to the training sample set to adjust the model weight coefficients in the content recommendation model, the number of training times can be judged. When the number of training times is equal to the first preset number of times, a candidate recommendation model is obtained. Then, the candidate recommendation model is trained according to the validation set, and the number of validations is judged. If the number of validations is equal to the second preset number of times, then return to execute the process of training the content recommendation model according to the training sample set until the first target loss value meets the first preset condition and the second target loss value meets the second preset condition, then stop training to obtain the trained recommendation model.
[0200] Alternatively, after inputting the training samples in the training sample set into the content recommendation model to obtain the second target loss value and updating the model weight coefficients according to the second target loss value, the validation samples in the validation set can be directly input into the content recommendation model to obtain the first target loss value, and the transformation weight coefficient and the fusion weight coefficient can be updated according to the first target loss value, without waiting until the second target loss value meets the second preset condition, then inputting the validation samples in the validation set into the candidate recommendation model to obtain the first target loss value, and then directly returning to execute the step of inputting the training samples in the training sample set into the content recommendation model to obtain the second target loss value. Finally, when the first target loss value meets the first preset condition and the second target loss value meets the second preset condition, the training is stopped to obtain the trained recommendation model.
[0201] As can be seen from the above, in the embodiment of the present application, the transformation weight coefficient for feature dimension transformation in the content recommendation model is first obtained, and then the transformation weight coefficient is mapped to obtain the fusion weight coefficient for feature fusion in the content recommendation model. Next, the training sample set of the content recommendation model is obtained, and each training sample in the training sample set includes the object feature of the sample object and the sample content corresponding to the sample object response. Secondly, the training samples are subjected to dimension transformation processing according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training samples, and the at least one fused feature vector is subjected to feature fusion processing according to the fusion weight coefficient to obtain the first fused feature vector corresponding to the training samples. Finally, according to the first fused feature vector, the response rate of the sample object to the sample content is predicted, and the content recommendation model is trained according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient to obtain the trained recommendation model for content recommendation.
[0202] That is, in the embodiment of the present application, after obtaining the transformation weight coefficient, the transformation weight coefficient is mapped to obtain the fusion weight coefficient, establishing a connection between the transformation weight coefficient and the fusion weight coefficient. Therefore, after the training samples are subjected to dimension transformation processing according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training samples, and the at least one fused feature vector is subjected to feature fusion processing according to the fusion weight coefficient to obtain the first fused feature vector corresponding to the training samples, according to the first fused feature vector, the response rate of the sample object to the sample content is predicted, and the content recommendation model is trained according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, and the obtained trained recommendation model has a higher accuracy in content recommendation.
[0203] The following refers to Figure 3 to illustrate the content recommendation method by the trained recommendation model in this embodiment.
[0204] S301. Obtain the target object features of the target object and each content to be recommended.
[0205] When the terminal receives an update instruction for each content to be recommended, it can obtain the target object features of the target object and each content to be recommended. Alternatively, the terminal can obtain the target object features of the target object and each content to be recommended in response to a triggering operation by the user on the display interface.
[0206] S302. Input the target object features and the content to be recommended into the trained recommendation model for prediction to obtain the target response rate of the target object for each content to be recommended.
[0207] Optionally, the target object features and the content to be recommended can be input into the trained recommendation model for feature extraction to obtain at least one target feature domain. Then, through the trained recommendation model, dimension mapping processing is performed on the target feature domain according to the target preset mapping dimension corresponding to the target feature domain to obtain a candidate target transformation feature vector. According to the target transformation weight coefficient corresponding to the target preset mapping dimension, dimension fusion processing is performed on the candidate target transformation feature vector to obtain the target transformation feature vector corresponding to the target feature domain.
[0208] Next, through the trained recommendation model, cross operations are performed on the target transformation feature vector to obtain at least one candidate target fusion feature vector. According to the target fusion weight coefficient corresponding to the target feature domain, feature fusion processing is performed on the candidate target fusion feature vector to obtain a third fusion feature vector.
[0209] Through the trained recommendation model, second fully connected mapping processing is performed on the target transformation feature vector to obtain a fourth fusion feature vector. The third fusion feature vector and the fourth fusion feature vector are spliced to obtain a target fusion feature vector. Through the trained recommendation model, according to the target fusion feature vector, the target response rate of the target object for each content to be recommended is predicted.
[0210] S303. Recommend the content to be recommended whose target response rate meets the preset response rate to the target object.
[0211] In this embodiment, since the trained recommendation model establishes the relationship between the fusion weight coefficient and the transformation weight coefficient and adjusts the fusion weight coefficient and the transformation weight coefficient simultaneously during training, the target response rate obtained through the trained recommendation model can be more accurate, improving the accuracy of the content to be recommended whose target response rate meets the preset response rate, so as to recommend the content to be recommended that is more in line with the target object to the target object.
[0212] According to the method described in the above embodiment, the following will give an example for further detailed description.
[0213] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of the model training method provided by the embodiment of the present application. The model training method process may include:
[0214] S401. The terminal obtains the conversion weight coefficient of the embedding layer in the content recommendation model.
[0215] The content recommendation model in this embodiment may be as Figure 5 shown. The content recommendation model includes a feature extraction layer, an embedding layer, a feature crossing layer, a deep learning layer, a prediction layer, and a gating layer. Field refers to the feature domain.
[0216] Each feature domain may correspond to multiple embedding layers. For example, as Figure 5 shown, one feature domain corresponds to 4 embedding layers, and the dimensions of each embedding layer may be 16, 32, 64, and 128 respectively. The conversion weight coefficients corresponding to each embedding layer of one feature domain are respectively and i represents the i-th feature domain.
[0217] S402. The terminal uses the gating layer in the content recommendation model to perform a first fully connected mapping process on the conversion weight coefficient to obtain the candidate fusion weight coefficient of the feature crossing layer in the content recommendation model, and performs an activation mapping process on the candidate fusion weight coefficient to obtain the initial fusion weight coefficient of the feature crossing layer.
[0218] The gating layer may include a first fully connected layer and an activation layer. As Figure 5 shown, the terminal may perform a first fully connected mapping process on the conversion weight coefficient through the first fully connected layer to obtain the candidate fusion weight coefficient of the feature crossing layer in the content recommendation model, and perform an activation mapping process on the candidate fusion weight coefficient through the activation layer to obtain the fusion weight coefficient of the content recommendation model.
[0219] Among them, the mapping process of the gating layer on the conversion weight coefficient may be as shown in relational expression (1):
[0220]
[0221] Gate represents the gating layer, h represents the h-th feature domain, j represents the j-th embedding layer, β ih represents the initial fusion weight coefficient corresponding to the i-th feature domain and the h-th feature domain, θ β represents the gating parameter, that is, represents the network parameter of the first fully connected layer.
[0222] S403. The terminal performs a discrete differentiable process on the initial fusion weight coefficient to obtain the fusion weight coefficient of the feature crossing layer.
[0223] The discrete differentiable processing includes discrete processing and differentiable processing. Among them, the terminal can substitute the initial fusion weight coefficient into the relational expression (2) to perform discrete processing on the initial fusion weight coefficient:
[0224] β ih '=sign(β ih -0.5) (2)
[0225] Substitute the result of the relational expression (2) into the relational expression (3) to achieve differentiable processing on the initial fusion weight coefficient:
[0226] β ih ”=β ih +stop_gradient(β ih '-β ih ) (3)
[0227] Among them, β ih ' represents the discrete fusion weight coefficient obtained after performing discrete processing on the initial fusion weight coefficient, β ih ” represents the fusion weight coefficient, sign() represents the sign function, and stop_gradient() means that when solving the gradient of the first target loss value with respect to the gating parameter, first solve the gradient of the first target loss value with respect to the fusion weight coefficient, then solve the gradient of the fusion weight coefficient with respect to the initial fusion weight coefficient, and then solve the gradient of the initial fusion weight coefficient with respect to the gating parameter, so as to obtain the gradient of the first target loss value with respect to the gating parameter.
[0228] Since the discrete fusion weight coefficient has discreteness, therefore, the discrete fusion weight coefficient does not have differentiability, that is, it is impossible to first solve the gradient of the fusion weight coefficient with respect to the discrete fusion weight coefficient, and then solve the gradient of the discrete fusion weight coefficient with respect to the initial fusion weight coefficient. Therefore, the result of the relational expression (3) is used to represent the fusion weight coefficient, so that the gradient of the fusion weight coefficient with respect to the initial fusion weight coefficient can be directly solved.
[0229] That is, the relational expression (3) means that in the forward propagation process of the content recommendation model, the fusion weight coefficient is equal to the discrete fusion weight coefficient, and in the backward propagation process of the content recommendation model, the gradient of the fusion weight coefficient with respect to the discrete fusion weight coefficient is not solved, and the gradient of the fusion weight coefficient with respect to the initial fusion weight coefficient is directly solved.
[0230] S404. The terminal obtains the training sample set of the content recommendation model, and uses the feature extraction layer in the content recommendation model to extract features from the training samples in the training sample set, obtaining at least one feature domain corresponding to the training samples. Each training sample includes the object feature of the sample object and the sample content corresponding to the sample object response.
[0231] S405. The terminal uses multiple embedding layers corresponding to the feature domain in the content recommendation model to perform dimensionality mapping processing on the feature domain, obtains candidate transformed feature vectors of the feature domain for each embedding layer, and multiplies and accumulates the transformation weight coefficients corresponding to the embedding layer with the candidate transformed feature vectors to obtain the transformed feature vector corresponding to the feature domain.
[0232] Among them, the feature domain can be substituted into formula (4) for dimensionality mapping processing to obtain candidate transformed feature vectors:
[0233]
[0234] represents the candidate transformed feature vector of the i-th feature domain for the j-th embedding layer, N i represents the number of feature vectors in the i-th feature domain, d j represents the dimension of the embedding layer, represents the j-th embedding layer of the i-th feature domain, x i represents the feature vector in the i-th feature domain, x i can be a one-hot vector, and its vector length is N i , and R represents the dimensional space.
[0235] Then, substitute the candidate transformed feature vectors of the feature domain for each embedding layer into formula (5) for dimensionality fusion processing to obtain the transformed feature vector corresponding to the feature domain:
[0236]
[0237] e i' represents the transformed feature vector corresponding to the i-th feature domain, y represents the number of embedding layers, Transform() represents the third fully connected processing. Since the dimensions of the candidate transformed feature vectors corresponding to different embedding layers are different, first project the candidate transformed feature vectors to the same dimension through Transform(), then multiply the fully connected candidate transformed feature vectors and the transformation weight coefficients to obtain the multiplication results of the feature domain for each embedding layer, and then add the multiplication results to obtain the transformed feature vector corresponding to the feature domain.
[0238] It should be noted that after obtaining the multiplication results of the feature domain for each embedding layer by using the embedding layer, the multiplication results can also be input into the first fusion layer for accumulation to obtain the transformed feature vector corresponding to the feature domain. For example, as Figure 5 shown.
[0239] S406. The terminal uses the feature crossing layer in the content recommendation model to perform a crossing operation on the transformed feature vectors, obtaining at least one candidate fusion feature vector, and performs feature fusion processing on the candidate fusion feature vector according to the fusion weight coefficients corresponding to the feature domains in the feature crossing layer, obtaining the first fusion feature vector corresponding to the training sample.
[0240] Among them, the transformed feature vectors corresponding to every two feature domains can be subjected to a crossing operation to obtain the candidate fusion feature vectors corresponding to these two feature domains, and then the candidate fusion feature vectors corresponding to these two feature domains are multiplied by the fusion weight coefficients corresponding to these two feature domains in the feature crossing layer, obtaining the multiplication result of the fusion vectors, and then the multiplication results of the respective fusion vectors are added together, thereby obtaining the first fusion feature vector to implement the feature fusion processing of the candidate fusion feature vectors.
[0241] Optionally, the candidate fusion feature vector can be input into the relation (6) for feature fusion processing:
[0242] r = ∑ i,h β ih × z ih where β ih ∈ {0, 1} (6)
[0243] r represents the first fusion feature vector, and z ih represents the candidate fusion feature vector corresponding to the transformed feature vector of the i-th feature domain and the transformed feature vector of the h-th feature domain.
[0244] It should be noted that after obtaining the multiplication results of the respective fusion feature vectors through the feature crossing layer, the multiplication results of the respective fusion feature vectors can also be added together through the second fusion layer, thereby obtaining the first fusion feature vector. For example, as Figure 5 shown.
[0245] S407. The terminal uses the deep learning layer in the content recommendation model to perform a second fully connected mapping process on the transformed feature vectors, obtaining the second fusion feature vector corresponding to the training sample.
[0246] The deep learning layer can be composed of at least one fully connected layer.
[0247] S408. The terminal uses the prediction layer in the content recommendation model to splice the first fusion feature vector and the second fusion feature vector, obtaining a fusion feature vector, and predicts the response rate of the sample object to the sample content according to the fusion feature vector.
[0248] S409. The terminal determines the second target loss value according to the predicted response rate and the true response rate corresponding to the training sample set.
[0249] S4010. If the second target loss value does not meet the second preset condition, the terminal updates the model weight coefficients in the content recommendation model according to the second target loss value and returns to execute S404. The model weight coefficients are the network parameters in the content recommendation model except for the conversion weight coefficients and the fusion weight coefficients.
[0250] Among them, the second target loss value can be substituted into the relational expression (7) for calculation to update the model weight coefficients:
[0251]
[0252] W‘(α, β) represents the updated model weight coefficients, W(α, β) represents the model weight coefficients. Since the model weight parameters are related to the conversion weight coefficient α and the fusion weight coefficient β, the model weight coefficients are denoted as W‘(α, β), and ξ represents the learning rate. represents the gradient operation, and Φtrain(W, α, β) represents the second target loss function. The second target loss value can be obtained through the second target loss function.
[0253] S4011. If the second target loss value meets the second preset condition, the terminal obtains the candidate recommendation model.
[0254] S4012. The terminal inputs the verification samples in the verification set into the candidate recommendation model for prediction to obtain the first target loss value.
[0255] S4013. If the first target loss value does not meet the first preset condition, the terminal updates the gating parameters of the gating layer according to the first target loss value to obtain the updated gating parameters. Based on the updated gating parameters and the conversion weight coefficients, the fusion weight coefficients are updated to obtain the updated fusion weight coefficients, and the updated fusion weight coefficients are used as the fusion weight coefficients.
[0256] It should be understood that after the terminal obtains the updated gating parameters, based on the updated gating parameters and the conversion weight coefficients, the initial fusion weight coefficients are updated using the relational expression (1) to obtain the updated initial fusion weight coefficients. Then, the updated initial fusion weight coefficients are discretely differentiable processed using the relational expressions (2) and (3) to obtain the updated fusion weight coefficients, and the updated fusion weight coefficients are used as the fusion weight coefficients.
[0257] Among them, the first target loss value can be substituted into the following relational expression (8) for calculation to update the gating parameters:
[0258]
[0259] θ β' represents the updated gating parameter, and Φval(W,α,β) is the first objective loss function. Through the first objective loss function, the first objective loss value can be obtained. represents solving the gradient of the first objective loss value with respect to the gating parameter. Optionally, the gradient of the first objective loss value with respect to the fusion weight coefficient can be solved first, then the gradient of the fusion weight coefficient with respect to the initial fusion weight coefficient can be solved, and then the gradient of the initial fusion weight coefficient with respect to the gating parameter can be solved, so as to obtain the gradient of the first objective loss value with respect to the gating parameter.
[0260] S4014: If the first objective loss value does not meet the first preset condition, the terminal updates the transformation weight coefficient according to the first objective loss value to obtain the updated transformation weight parameter, and uses the updated transformation weight parameter as the transformation weight parameter.
[0261] Among them, the first objective loss value can be substituted into formula (9) for calculation to realize the update of the transformation weight coefficient:
[0262]
[0263] α' represents the updated transformation weight coefficient. represents the transformation weight coefficient.
[0264] S4015: The terminal returns to execute S4012.
[0265] S4016: If the first objective loss value meets the first preset condition, the terminal takes the largest transformation weight coefficient among the multiple transformation weight coefficients as the target transformation weight coefficient corresponding to the feature domain, takes the embedding layer corresponding to the target transformation weight coefficient as the target embedding layer corresponding to the feature domain, takes the fusion weight coefficients greater than the preset threshold among the fusion weight coefficients as the target fusion weight coefficients, and obtains the trained recommendation model for content recommendation according to the target embedding layer, the target transformation weight coefficient, and the target fusion weight coefficients.
[0266] Please refer to Figure 6 , Figure 6 which is the flowchart of the model application method provided by the embodiment of the present application. The model application method process may include:
[0267] S601: The terminal obtains the target object feature of the target object and each content to be recommended, and uses the feature extraction layer in the trained recommendation model to extract features from the target object feature and each content to be recommended, so as to obtain multiple target feature domains corresponding to the target object feature and each content to be recommended.
[0268] S602. The terminal uses the target embedding layer corresponding to the target feature domain in the trained recommendation model to perform dimensionality mapping processing on the target feature domain, obtains a candidate target conversion feature vector corresponding to the target feature domain, and multiplies the candidate target conversion feature vector by the target conversion weight coefficient corresponding to the target embedding layer to obtain a target conversion feature vector corresponding to the target feature domain.
[0269] S603. The terminal uses the feature cross layer in the trained recommendation model to perform cross operations on the target conversion feature vector, obtains at least one candidate target fusion feature vector, and performs feature fusion processing on the candidate target fusion feature vector according to the target fusion weight coefficient corresponding to the target feature domain to obtain a third fusion feature vector.
[0270] S604. The terminal uses the deep learning layer in the trained recommendation model to perform a second fully connected mapping process on the target conversion feature vector to obtain a fourth fusion feature vector.
[0271] S605. The terminal uses the prediction layer in the trained recommendation model to splice the third fusion feature vector and the fourth fusion feature vector to obtain a target fusion feature vector, and predicts the target response rate of the target object for each content to be recommended according to the target fusion feature vector.
[0272] S606. The terminal recommends the content to be recommended whose target response rate meets the preset response rate to the target object.
[0273] Next, the effect of the trained recommendation model in this embodiment is described. The trained recommendation model and the baseline recommendation model in this embodiment are simultaneously applied to the subscription account graphic recommendation scenario. In the offline experiment, the click data between point B and point C of account A is used as the training sample and the validation sample, with a total of 50 million pieces. The content recommendation model and the baseline recommendation model are respectively trained according to the training sample and the validation sample to obtain the trained recommendation model, the trained baseline recommendation model, the area under the curve (AUC) corresponding to the trained recommendation model and the model size, and the AUC and the model size corresponding to the trained baseline recommendation model.
[0274] Among them, the model size refers to the size of the tensorflow checkpoint file (the checkpoint file is used to save the network parameters of the model saved after each training). The larger the AUC, the higher the accuracy. The larger the checkpoint file, the more redundant parameters there are.
[0275] Then, the click data at point D of product A, totaling 16 million records, with point D after point C, is used as test data. The trained recommendation model and the trained baseline recommendation model are used to predict the data at point D of product A, obtaining the prediction speed and prediction results of the trained recommendation model, as well as the prediction speed and prediction results of the trained baseline recommendation model. Among them, the total prediction time can be divided by the number of items predicted to obtain the prediction speed.
[0276] The evaluation metrics of the trained recommendation model and the trained baseline recommendation model can be as shown in the following table (the evaluation metrics refer to AUC, model size, and prediction speed):
[0277]
[0278] As can be seen from the above table, the AUC of this embodiment is higher than that of the baseline recommendation model, indicating that the accuracy of the trained recommendation model is higher than that of the trained baseline recommendation model. Moreover, this embodiment effectively reduces the model size and improves the prediction speed.
[0279] In the online experiment, the experimental group v.s. the control group has 2% traffic each, and the core experimental metric is the click-through rate (CTR) in the graphic and text recommendation scenario. The experiment proves that, compared with the baseline recommendation model, the accuracy of the trained recommendation model of this application embodiment has increased by 1.8% in terms of CTR.
[0280] For other implementation manners and corresponding beneficial effects in this embodiment, reference can be specifically made to the above model training method embodiment and content recommendation method embodiment, which will not be elaborated herein.
[0281] To facilitate better implementation of the model training method and content recommendation method provided by this application embodiment, this application embodiment also provides a device based on the above model training method or content recommendation method. The meanings of the nouns are the same as those in the above model training method and content recommendation method, and the specific implementation details can refer to the descriptions in the method embodiments.
[0282] For example, as Figure 7 shown, the model training device may include:
[0283] A first acquisition module 701, configured to acquire the transformation weight coefficients for feature dimension transformation in the content recommendation model.
[0284] A coefficient mapping module 702, configured to perform mapping processing on the transformation weight coefficients to obtain the fusion weight coefficients for feature fusion in the content recommendation model.
[0285] The second acquisition module 703 is configured to acquire a training sample set of the content recommendation model. Each training sample in the training sample set includes the object features of the sample object and the sample content responded by the sample object.
[0286] The dimension transformation module 704 is configured to perform dimension transformation processing on the training samples according to the transformation weight coefficients to obtain at least one transformed feature vector corresponding to the training samples.
[0287] The feature fusion module 705 is configured to perform feature fusion processing on at least one transformed feature vector according to the fusion weight coefficients to obtain a first fusion feature vector corresponding to the training samples.
[0288] The prediction training module 706 is configured to predict the response rate of the sample object to the sample content according to the first fusion feature vector, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficients and the fusion weight coefficients, so as to obtain a trained recommendation model for content recommendation.
[0289] Optionally, the coefficient mapping module 702 is specifically configured to perform:
[0290] Perform a first fully connected mapping process on the transformation weight coefficients to obtain candidate fusion weight coefficients for feature fusion of the content recommendation model;
[0291] Perform an activation mapping process on the candidate fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model.
[0292] Optionally, the coefficient mapping module 702 is specifically configured to perform:
[0293] Perform an activation mapping process on the candidate fusion weight coefficients to obtain the initial fusion weight coefficients of the content recommendation model;
[0294] Perform a discrete differentiable process on the initial fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model.
[0295] Optionally, the model training device further includes:
[0296] The feature mapping module is configured to perform a second fully connected mapping process on the transformed feature vectors to obtain a second fusion feature vector corresponding to the training samples.
[0297] Correspondingly, the prediction training module 706 is specifically configured to perform:
[0298] Concatenate the first fusion feature vector and the second fusion feature vector to obtain a fusion feature vector;
[0299] Predict the response rate of the sample object to the sample content according to the fusion feature vector.
[0300] Optionally, the content recommendation model includes multiple preset mapping dimensions corresponding to conversion weight coefficients.
[0301] Correspondingly, the dimension conversion module 704 is specifically configured to perform:
[0302] Extract features from the training samples to obtain at least one feature domain corresponding to the training samples;
[0303] Perform dimension mapping processing on the feature domain according to the multiple preset mapping dimensions to obtain candidate conversion feature vectors of the feature domain for each preset mapping dimension;
[0304] Perform dimension fusion processing on the candidate conversion feature vectors of each feature domain according to the conversion weight coefficients to obtain conversion feature vectors corresponding to the feature domain.
[0305] Optionally, the feature fusion module 705 is specifically configured to perform:
[0306] Perform cross operation on the conversion feature vectors to obtain at least one candidate fusion feature vector;
[0307] Perform feature fusion processing on the candidate fusion feature vectors according to the fusion weight coefficients matching the candidate fusion feature vectors in the fusion weight coefficients to obtain the first fusion feature vector corresponding to the training samples.
[0308] Optionally, the content recommendation model includes gating parameters for mapping.
[0309] Correspondingly, the coefficient mapping module 702 is specifically configured to perform:
[0310] Perform mapping processing on the conversion weight coefficients according to the gating parameters to obtain the fusion weight coefficients of the content recommendation model.
[0311] Correspondingly, the prediction training module 706 is specifically configured to perform:
[0312] Determine the first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set;
[0313] If the first target loss value does not meet the first preset condition, update the gating parameters according to the first target loss value to obtain the updated gating parameters;
[0314] Update the fusion weight coefficients based on the updated gating parameters and the conversion weight coefficients to obtain the updated fusion weight coefficients;
[0315] Update the conversion weight coefficients according to the first target loss value to obtain the updated conversion weight parameters;
[0316] Use the updated transformation weight parameter as the transformation weight parameter, use the updated fusion weight coefficient as the fusion weight coefficient, and return to perform the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples;
[0317] If the first target loss value meets the first preset condition, obtain the trained recommendation model for content recommendation.
[0318] Optionally, there are multiple transformation weight coefficients, and each transformation weight coefficient corresponds to a preset mapping dimension.
[0319] Correspondingly, the prediction training module 706 is specifically used to execute:
[0320] If the first target loss value meets the first preset condition, use the largest transformation weight coefficient among the multiple transformation weight coefficients as the target transformation weight coefficient corresponding to the feature domain, and use the preset mapping dimension corresponding to the target transformation weight coefficient as the target mapping dimension corresponding to the feature domain;
[0321] Obtain the trained recommendation model for content recommendation according to the target transformation weight coefficient, the target mapping dimension, and the fusion weight coefficient.
[0322] Optionally, the prediction training module 706 is specifically used to execute:
[0323] Use the fusion weight coefficients greater than the preset threshold in the fusion weight coefficients as the target fusion weight coefficients;
[0324] Obtain the trained recommendation model for content recommendation according to the target transformation weight coefficient, the target mapping dimension, and the target fusion weight coefficient.
[0325] Optionally, the prediction training module 706 is specifically used to execute:
[0326] Determine the second target loss value according to the predicted response rate and the true response rate corresponding to the training sample set;
[0327] If the second target loss value does not meet the second preset condition, update the model weight coefficient according to the second target loss value, and return to perform the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples;
[0328] If the second target loss value meets the second preset condition, obtain the candidate recommendation model;
[0329] Input the validation samples in the validation set into the candidate recommendation model for prediction to obtain the first target loss value;
[0330] Returning to perform the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples includes:
[0331] Return to the step of inputting the verification samples in the verification set into the candidate recommendation model for prediction to obtain the first target loss value.
[0332] In specific implementation, each of the above modules can be implemented as an independent entity, or can be arbitrarily combined and implemented as the same or several entities. For the specific implementation manners of the above modules and the corresponding beneficial effects, reference can be made to the foregoing method embodiments, which will not be elaborated herein.
[0333] The embodiment of the present application also provides an electronic device, which may be a server or a terminal, etc. As Figure 8 shown, it shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:
[0334] The electronic device may include a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, an input unit 804 and other components. Those skilled in the art can understand that Figure 8 the structure of the electronic device shown in
[0335] does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements. Among them:
[0336] The memory 802 can be used to store computer programs and modules. The processor 801 executes various functional applications and data processing by running the computer programs and modules stored in the memory 802. The memory 802 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, computer programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 802 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 can also include a memory controller to provide the processor 801 with access to the memory 802.
[0337] The electronic device further includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 803 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0338] The electronic device may further include an input unit 804, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0339] Although not shown, the electronic device may further include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 801 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 802 according to the following instructions, and the processor 801 will run the computer programs stored in the memory 802 to implement various functions, such as:
[0340] Obtain the transformation weight coefficient for feature dimension transformation in the content recommendation model;
[0341] Perform a mapping process on the transformation weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model;
[0342] Obtain the training sample set of the content recommendation model, and each training sample in the training sample set includes the object features of the sample object and the sample content corresponding to the sample object;
[0343] Perform dimension transformation processing on the training samples according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training samples;
[0344] Perform feature fusion processing on at least one transformed feature vector according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample;
[0345] According to the first fusion feature vector, predict the response rate of the sample object to the sample content, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, so as to obtain a trained recommendation model for content recommendation.
[0346] For the specific implementation manners of the above operations and the corresponding beneficial effects, reference can be made to the detailed description of the model training method above, and details are not described herein.
[0347] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or the relevant hardware can be controlled by a computer program. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0348] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any model training method or content recommendation method provided by the embodiment of the present application. For example, the computer program can execute the following steps:
[0349] Obtain the transformation weight coefficient for feature dimension transformation in the content recommendation model;
[0350] Perform a mapping process on the transformation weight coefficient to obtain a fusion weight coefficient for feature fusion of the content recommendation model;
[0351] Obtain a training sample set of the content recommendation model, and each training sample in the training sample set includes the object feature of the sample object and the sample content to which the sample object responds;
[0352] Perform dimension transformation processing on the training sample according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training sample;
[0353] Perform feature fusion processing on at least one transformed feature vector according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample;
[0354] According to the first fusion feature vector, predict the response rate of the sample object to the sample content, and train the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient, so as to obtain a trained recommendation model for content recommendation.
[0355] For the specific implementation manners of the above operations and the corresponding beneficial effects, reference can be made to the previous embodiments, and details are not described herein again.
[0356] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0357] Since the computer program stored in the computer-readable storage medium can execute the steps in any one of the model training methods or the content recommendation methods provided by the embodiments of the present application, the beneficial effects achievable by any one of the model training methods or the content recommendation methods provided by the embodiments of the present application can be realized. For details, refer to the previous embodiments and will not be elaborated here.
[0358] Among them, according to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned model training method or content recommendation method.
[0359] The above has introduced in detail a model training method, device, electronic device and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A content recommendation method, characterized in that, The content recommendation method includes: Obtaining the target object features of a target object and each content to be recommended; Inputting the target object features and the content to be recommended into a trained recommendation model for prediction to obtain the target response rate of the target object for each content to be recommended; Recommending the content to be recommended whose target response rate meets a preset response rate to the target object; Among them, the trained recommendation model is obtained through the following training method: Obtaining the transformation weight coefficients for feature dimension transformation in the content recommendation model; Performing a mapping process on the transformation weight coefficients to obtain the fusion weight coefficients for feature fusion in the content recommendation model; Obtaining the training sample set of the content recommendation model, where each training sample in the training sample set includes the object features of a sample object and the sample content responded by the sample object; Performing dimension transformation processing on the training samples according to the transformation weight coefficients to obtain at least one transformed feature vector corresponding to the training samples; Performing feature fusion processing on at least one of the transformed feature vectors according to the fusion weight coefficients to obtain a first fusion feature vector corresponding to the training samples; Predicting the response rate of the sample object for the sample content according to the first fusion feature vector, and training the content recommendation model according to the predicted response rate to adjust the transformation weight coefficients and the fusion weight coefficients to obtain a trained recommendation model for content recommendation.
2. The method according to claim 1, wherein Performing a mapping process on the transformation weight coefficients to obtain the fusion weight coefficients of the content recommendation model, including: Performing a first fully connected mapping process on the transformation weight coefficients to obtain candidate fusion weight coefficients for feature fusion in the content recommendation model; Performing an activation mapping process on the candidate fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model.
3. The method according to claim 2, characterized in that The performing an activation mapping process on the candidate fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model includes: Performing an activation mapping process on the candidate fusion weight coefficients to obtain the initial fusion weight coefficients of the content recommendation model; Performing a discrete differentiable process on the initial fusion weight coefficients to obtain the fusion weight coefficients of the content recommendation model.
4. The method according to claim 1, characterized in that, Before predicting the response rate of the sample object for the sample content according to the first fusion feature vector, it further includes: Performing a second fully connected mapping process on the transformed feature vector to obtain a second fusion feature vector corresponding to the training samples; The predicting the response rate of the sample object for the sample content according to the first fusion feature vector includes: Concatenating the first fusion feature vector and the second fusion feature vector to obtain a fusion feature vector; Predicting the response rate of the sample object for the sample content according to the fusion feature vector.
5. The method according to claim 1, wherein The content recommendation model includes multiple preset mapping dimensions corresponding to the transformation weight coefficients; Performing dimension transformation processing on the training samples according to the transformation weight coefficients to obtain at least one transformed feature vector corresponding to the training samples, including: Extract features from the training samples to obtain at least one feature domain corresponding to the training samples; Perform dimensional mapping processing on the feature domain according to multiple preset mapping dimensions to obtain candidate transformed feature vectors of the feature domain for each preset mapping dimension; Perform dimensional fusion processing on the candidate transformed feature vectors of each feature domain according to the transformation weight coefficient to obtain the transformed feature vector corresponding to the feature domain.
6. The method according to claim 1, characterized in that, The performing feature fusion processing on at least one transformed feature vector according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample includes: Perform cross operations on the transformed feature vectors to obtain at least one candidate fusion feature vector; Perform feature fusion processing on the candidate fusion feature vector according to the fusion weight coefficient matching the candidate fusion feature vector among the fusion weight coefficients to obtain a first fusion feature vector corresponding to the training sample.
7. The method according to claim 5, wherein The content recommendation model includes gating parameters for mapping, and performing mapping processing on the transformation weight coefficient to obtain the fusion weight coefficient of the content recommendation model includes: Perform mapping processing on the transformation weight coefficient according to the gating parameters to obtain the fusion weight coefficient of the content recommendation model; The training the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient to obtain a trained recommendation model for content recommendation includes: Determine a first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set; If the first target loss value does not meet the first preset condition, update the gating parameters according to the first target loss value to obtain updated gating parameters; Based on the updated gating parameters and the transformation weight coefficient, update the fusion weight coefficient to obtain an updated fusion weight coefficient; Update the transformation weight coefficient according to the first target loss value to obtain an updated transformation weight parameter; Use the updated transformation weight parameter as the transformation weight parameter, use the updated fusion weight coefficient as the fusion weight coefficient, and return to execute the step of extracting features from the training samples to obtain at least one feature domain corresponding to the training samples; If the first target loss value meets the first preset condition, obtain a trained recommendation model for content recommendation.
8. The method according to claim 7, wherein There are multiple transformation weight coefficients, and each transformation weight coefficient corresponds to one preset mapping dimension; The if the first target loss value meets the first preset condition, obtaining a trained recommendation model for content recommendation includes: If the first target loss value meets the first preset condition, use the largest transformation weight coefficient among the multiple transformation weight coefficients as the target transformation weight coefficient corresponding to the feature domain, and use the preset mapping dimension corresponding to the target transformation weight coefficient as the target mapping dimension corresponding to the feature domain; Obtain a trained recommendation model for content recommendation according to the target transformation weight coefficient, the target mapping dimension and the fusion weight coefficient.
9. The method according to claim 8, characterized in that, Obtaining a trained recommendation model for content recommendation according to the target transformation weight coefficient, the target mapping dimension, and the fusion weight coefficient, includes: Taking the fusion weight coefficients greater than a preset threshold in the fusion weight coefficients as target fusion weight coefficients; Obtaining a trained recommendation model for content recommendation according to the target transformation weight coefficient, the target mapping dimension, and the target fusion weight coefficient.
10. According to the method described in claim 7, the content recommendation model further includes a model weight coefficient. Determining a first target loss value according to the predicted response rate and the true response rate corresponding to the training sample set includes: Determining a second target loss value according to the predicted response rate and the true response rate corresponding to the training sample set; If the second target loss value does not meet the second preset condition, updating the model weight coefficient according to the second target loss value, and returning to execute the step of extracting features from the training sample to obtain at least one feature domain corresponding to the training sample; If the second target loss value meets the second preset condition, obtaining a candidate recommendation model; Inputting the validation samples in the validation set into the candidate recommendation model for prediction to obtain a first target loss value; The step of returning to execute the step of extracting features from the training sample to obtain at least one feature domain corresponding to the training sample includes: Returning to execute the step of inputting the validation samples in the validation set into the candidate recommendation model for prediction to obtain a first target loss value.
11. A content recommendation device, characterized in that, Includes: A first acquisition module for acquiring the transformation weight coefficient used for feature dimension transformation in the content recommendation model; A coefficient mapping module for performing mapping processing on the transformation weight coefficient to obtain the fusion weight coefficient for feature fusion of the content recommendation model; A second acquisition module for acquiring the training sample set of the content recommendation model, where each training sample in the training sample set includes the object features of the sample object and the sample content to which the sample object responds; A dimension transformation module for performing dimension transformation processing on the training sample according to the transformation weight coefficient to obtain at least one transformed feature vector corresponding to the training sample; A feature fusion module for performing feature fusion processing on at least one of the transformed feature vectors according to the fusion weight coefficient to obtain a first fusion feature vector corresponding to the training sample; A prediction training module for predicting the response rate of the sample object to the sample content according to the first fusion feature vector, and training the content recommendation model according to the predicted response rate to adjust the transformation weight coefficient and the fusion weight coefficient to obtain a trained recommendation model for content recommendation; An acquisition module for acquiring the target object features of the target object and each content to be recommended; A prediction module for inputting the target object features and the content to be recommended into the trained recommendation model for prediction to obtain the target response rate of the target object to each content to be recommended; A recommendation module for recommending the content to be recommended whose target response rate meets the preset response rate to the target object.
12. An electronic device, characterized in that, It includes a processor and a memory. The memory stores a computer program, and the processor is configured to run the computer program in the memory to execute the content recommendation method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the content recommendation method according to any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product stores a computer program, and the computer program is suitable for being loaded by a processor to execute the content recommendation method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Recommendation method and device based on artificial intelligence, and electronic equipment
CN113326440A
Media resource recommendation method, and multi-target fusion model training method and device
CN113516522A