Model training methods and devices, content recommendation methods and devices
By adding a dropout layer to the dual-tower model of the recommender system to randomly hide neurons, the robustness of the model is improved, the problem of poor recommendation accuracy caused by the sparsity of long-tail object data is solved, and more accurate content recommendation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-12-28
- Publication Date
- 2026-05-26
AI Technical Summary
In existing recommendation systems, content recommendation models are not accurate enough in recommending objects, especially when long-tail object data is sparse. The models have difficulty converging, resulting in insufficient generalization ability and affecting recommendation accuracy.
In the dual-tower model of the recommender system, the robustness of the model is improved by adding a dropout layer to randomly hide neurons in the neural network. The dual-tower deep structural semantic model is used to process the features of objects and content, and the model parameters are updated through feature matching and loss function until the model converges.
This improves the robustness of the dual-tower model in the recommendation system, thereby enhancing the accuracy of content recommendation and solving the problem of insufficient model generalization ability caused by the sparsity of long-tail object data.
Smart Images

Figure CN116415624B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a model training method and apparatus, and a content recommendation method and apparatus. Background Technology
[0002] With the continuous development of internet technology, people's lives have become inseparable from the internet. In the internet age, with the rapid expansion of content, people face increasing pressure in choosing content, which reduces the efficiency of content use and leads to information overload.
[0003] A recommendation system is a personalized recommendation system that recommends information and products that an individual might be interested in based on their content needs and interests. A good recommendation system not only provides personalized content and services but also establishes a close relationship with the individual.
[0004] However, in some cases, the content recommendation model in a recommender system does not recommend content that is accurate enough for the target object. Summary of the Invention
[0005] This application provides a model training method and apparatus, and a content recommendation method and apparatus, which can effectively improve the accuracy of content recommendation.
[0006] The first aspect of this application provides a model training method, the method comprising:
[0007] Obtain training sample information, which includes multiple training samples, including a first object feature corresponding to object information, a first content feature corresponding to multiple content information items, and label information corresponding to each content information item.
[0008] The first object features are processed using a first neural network to obtain the second object features. During the process of processing the first object features using the first neural network, the neurons in the first neural network are randomly hidden.
[0009] The first content features are processed using a second neural network to obtain the second content features;
[0010] The second object feature and the second content feature are matched to obtain a first matching result;
[0011] The model parameters of the preset neural network model are updated based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes the first neural network and the second neural network.
[0012] Accordingly, a second aspect of this application provides a model training apparatus, the apparatus comprising:
[0013] The first acquisition unit is used to acquire training sample information, which includes multiple training samples. The training samples include a first object feature corresponding to object information, a first content feature corresponding to multiple content information, and label information corresponding to each content information.
[0014] The first processing unit is configured to perform feature processing on the first object features using a first neural network to obtain second object features, wherein, during the feature processing of the first object features using the first neural network, the neurons in the first neural network are randomly hidden.
[0015] The second processing unit is used to perform feature processing on the first content feature using a second neural network to obtain the second content feature;
[0016] The first matching unit is used to perform feature matching between the second object feature and the second content feature to obtain a first matching result;
[0017] An update unit is used to update the model parameters of a preset neural network model based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes the first neural network and the second neural network.
[0018] In some embodiments, the model training apparatus further includes:
[0019] The third processing unit is used to perform feature processing on the first object features again using the first neural network to obtain third object features, wherein, during the process of performing feature processing on the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0020] The first calculation unit is used to calculate the first difference information between the second object feature and the third object feature;
[0021] The update unit is further configured to:
[0022] The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the first difference information.
[0023] In some embodiments, the model training apparatus further includes:
[0024] The second matching unit is used to perform feature matching between the third object feature and the second content feature to obtain a second matching result;
[0025] The second calculation unit is used to calculate the second difference information between the first matching result and the second matching result;
[0026] The update unit is further configured to:
[0027] The model parameters of the preset neural network model are updated based on the first matching result, the label information, the first difference information, and the second difference information.
[0028] In some embodiments, the updating unit includes:
[0029] The first determining subunit is configured to determine a first sub-loss function based on the first matching result and the label information;
[0030] The second determining subunit is used to determine the second sub-loss function based on the first difference information;
[0031] The third determining subunit is used to determine the third sub-loss function based on the second difference information;
[0032] Construct sub-units to build loss functions for a preset neural network model based on the first sub-loss function, the second sub-loss function, and the third sub-loss function;
[0033] The training subunit is used to iteratively train the preset neural network model based on the loss function.
[0034] In some embodiments, the second computing unit includes:
[0035] The fourth determining subunit is used to determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result;
[0036] The calculation subunit is used to calculate the relative entropy between the first result sequence and the second result sequence to obtain the second difference information between the first matching result and the second matching result.
[0037] In some embodiments, the model training apparatus provided in this application further includes:
[0038] The fourth processing unit is used to perform feature processing on the first object features again using the first neural network to obtain the fourth object features, wherein, during the process of performing feature processing on the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0039] The third matching unit is used to perform feature matching between the second content feature and the fourth object feature to obtain a third matching result;
[0040] The third calculation unit is used to calculate the third difference information between the first matching result and the third matching result;
[0041] The update unit is further configured to:
[0042] The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the third difference information.
[0043] In some embodiments, the first matching unit includes:
[0044] The operation subunit is used to perform a dot product operation between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the operation result;
[0045] The processing subunit is used to normalize the calculation result to obtain the first matching result.
[0046] A third aspect of this application provides a content recommendation method, the method including;
[0047] Retrieve object information and candidate content information;
[0048] Feature extraction is performed on the object information to obtain object features;
[0049] Feature extraction is performed on the candidate content information to obtain content features;
[0050] The object features and the content features are input into a preset neural network model, and the score corresponding to each content feature is output. The preset neural network model is the preset neural network model trained in the model training method provided in the first aspect.
[0051] Target candidate content is determined based on the score corresponding to each content feature, and the candidate content is recommended to the target.
[0052] Accordingly, a fourth aspect of this application provides a content recommendation device, the device comprising:
[0053] The second acquisition unit is used to acquire object information and candidate content information;
[0054] The first extraction unit is used to extract features from the object information to obtain object features;
[0055] The second extraction unit is used to extract features from the candidate content information to obtain content features;
[0056] An input unit is used to input the object features and the content features into a preset neural network model and output a score corresponding to each content feature. The preset neural network model is the preset neural network model trained in the model training method described in the first aspect.
[0057] The determining unit is used to determine target candidate content based on the score corresponding to each content feature, and recommend the candidate content to the object.
[0058] In some embodiments, the first extraction unit includes:
[0059] The word segmentation subunit is used to segment the object information to obtain multiple words corresponding to the object information.
[0060] The embedding subunit is used to perform word embedding processing on the multiple word segments to obtain the object features corresponding to the object information.
[0061] The fifth aspect of this application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in the model training method provided in the first aspect of this application or the content recommendation method provided in the third aspect.
[0062] The sixth aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the content recommendation method provided in the first aspect of this application.
[0063] The seventh aspect of this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in the model training method provided in the first aspect or the content recommendation method provided in the third aspect.
[0064] The model training method provided in this application involves acquiring training sample information, which includes multiple training samples. Each training sample includes a first object feature corresponding to object information, first content features corresponding to multiple pieces of content information, and label information corresponding to each piece of content information. A first neural network is used to process the first object features to obtain second object features. During the feature processing of the first object features using the first neural network, neurons in the first neural network are randomly hidden. A second neural network is used to process the first content features to obtain second content features. Feature matching is performed between the second object features and the second content features to obtain a first matching result. The model parameters of a preset neural network model are updated based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes both a first neural network and a second neural network.
[0065] Therefore, the model training method provided in this application can add hidden layers to the sub-model that processes object features in the dual-tower model of the recommender system, thereby randomly hiding the neurons of the sub-model. This avoids the long tail of object features that could cause the model to fail to converge, improves the robustness of the dual-tower model of the recommender system, and thus improves the accuracy of content recommendation. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a schematic diagram of a model training scenario in this application;
[0068] Figure 2 This is a flowchart illustrating the model training method provided in this application;
[0069] Figure 3 This is another flowchart illustrating the model training method provided in this application;
[0070] Figure 4 This is a flowchart illustrating the content recommendation method provided in this application;
[0071] Figure 5 This is a schematic diagram of the model training device provided in this application;
[0072] Figure 6 This is a schematic diagram of the content recommendation device provided in this application;
[0073] Figure 7This is a schematic diagram of the structure of the computer device provided in this application. Detailed Implementation
[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0075] This invention provides a model training method and apparatus, and a content recommendation method and apparatus. The model training method can be used in a model training apparatus. This model training apparatus can be integrated into a computer device, which can be a terminal or a server. The terminal can be a mobile phone, tablet computer, laptop computer, smart TV, wearable smart device, personal computer (PC), or in-vehicle terminal, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. The server can also be a node in a blockchain.
[0076] Please see Figure 1 This is a schematic diagram of a scenario for the model training method provided in this application. As shown in the figure, server A receives training sample information sent by terminal B. The training sample information includes multiple training samples, each including a first object feature corresponding to object information, a first content feature corresponding to multiple pieces of content information, and label information corresponding to each piece of content information. Then, server A uses a first neural network to process the first object feature to obtain a second object feature. During the feature processing of the first object feature using the first neural network, neurons in the first neural network are randomly hidden. A second neural network is used to process the first content feature to obtain a second content feature. Feature matching is performed between the second object feature and the second content feature to obtain a first matching result. The model parameters of the preset neural network model are updated according to the first matching result and the label information until the preset neural network model converges. The preset neural network model includes the first neural network and the second neural network.
[0077] It should be noted that, Figure 1The illustrated model training scenario diagram is merely an example. The model training scenario described in this application is intended to more clearly illustrate the technical solution of this application and does not constitute a limitation on the technical solution provided in this application. Those skilled in the art will understand that, with the evolution of model training scenarios and the emergence of new business scenarios, the technical solution provided in this application is equally applicable to similar technical problems.
[0078] The implementation scenarios described above will be explained in detail below.
[0079] In related technologies, the Dual-Tower Deep Structured Semantic Models (DSSM) used in recommender systems employ deep neural networks (DNNs) to model object features and content features separately. The model then outputs a similarity score between the two, and content recommendations are made based on this similarity. However, due to the significant differences between objects, a long-tail phenomenon is pronounced. When long-tail object data is sparse, the model corresponding to the object features struggles to converge, resulting in insufficient generalization ability of the trained model and consequently, low recommendation accuracy. To address the problem of insufficient generalization ability and poor recommendation accuracy caused by sparse long-tail object data, this application provides a model training method that specifically improves the robustness of the model in the recommender system, thereby enhancing the accuracy of content recommendations.
[0080] This application will describe the embodiments from the perspective of a model training device, which can be integrated into a computer device. The computer device can be a terminal or a server. The terminal can be a mobile phone, tablet computer, laptop computer, smart TV, wearable smart device, personal computer (PC), or in-vehicle terminal, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. Figure 2 The diagram shown is a flowchart of the model training method provided in this application. The method includes:
[0081] Step 101: Obtain training sample information.
[0082] The training sample information can be used to train the dual-tower DSSM model in the recommender system. The training sample information can be a training sample set, which may include multiple training samples. The training samples contain the first object feature corresponding to the object information, the first content feature corresponding to the content information, and the label information corresponding to the content features. In this application, the object can be a specific user, or it can be an object simulated or controlled by artificial intelligence, such as an intelligent robot.
[0083] The first object feature is a feature obtained by extracting features from the object information; this feature can be a feature vector. Specifically, feature extraction from the object information can be achieved by mapping the text information corresponding to the object information into a vector space to obtain the first object feature. When the text information corresponding to the object information is in English, word hashing can be used to obtain the first object feature; when the text information corresponding to the object information is in Chinese, word embedding can be used to obtain the first object feature. Similarly, the above methods can be used to obtain the first content feature corresponding to the content information.
[0084] In this training sample, there may be one object feature corresponding to one object information and multiple content features corresponding to multiple content information. Additionally, the training sample includes label information corresponding to each content information, which can be 1 or 0. When the label information is 1, it indicates that the object corresponding to the object information in the training sample has clicked on the content corresponding to the label information, thus the sample is determined to be a positive sample. When the label information is 0, it indicates that the object corresponding to the object information in the training sample did not click on the content corresponding to the label information during sampling, thus the sample is determined to be a negative sample. That is, in this application, a pre-defined neural network model can be trained using the object features corresponding to the object information and the content features corresponding to the content information as input, and the label information corresponding to the content information as input. Here, the pre-defined neural network model can be the aforementioned dual-tower DSSM model.
[0085] Step 102: Use the first neural network to process the features of the first object to obtain the features of the second object.
[0086] In this application, the preset neural network model for training can be the aforementioned dual-tower DSSM model. Since the dual-tower DSSM model includes a DNN for processing object features and a DNN for processing content features, the DNN for processing object features is defined as the first neural network, and the DNN for processing content features is defined as the second neural network.
[0087] In this application, when using a first neural network to process the features of a first object, random hiding processing, i.e., dropout processing, can be performed on the neurons in the first neural network. Specifically, the DNN corresponding to the first neural network in this application can be a multi-layer perceptron (MLP). Random hiding processing of the neurons in this DNN can be achieved by adding a dropout layer between every two layers in the MLP, thereby randomly hiding the neurons in the MLP. In this application, because a dropout layer is added to the DNN, some neurons in the model can be randomly hidden (masked) during model training, thereby obtaining different feature representations of the same object, which can improve the robustness of the model.
[0088] Step 103: Use a second neural network to process the first content features to obtain the second content features.
[0089] In the dual-tower DSSM model, another DNN is used to process the content features. Since the first content feature contains features corresponding to multiple content items, it can also be referred to as the first content feature sequence. The second content feature obtained by processing the first content feature using the second neural network can also be referred to as the second content feature sequence.
[0090] In some embodiments, when the second neural network processes the first content feature, random dropout processing can also be performed on the neurons in the second neural network to avoid the problem that the long tail of the content feature causes the content feature processing model to fail to converge, thereby further enhancing the robustness of the trained preset neural network model.
[0091] Step 104: Perform feature matching between the second object features and the second content features to obtain the first matching result.
[0092] In the dual-tower DSSM model, once the features corresponding to the object and the features corresponding to the content are determined—that is, the second object features and the second content features mentioned above—the object features and content features can be further matched to determine the semantic similarity between object information and content information. For example, the cosine similarity between the vectors corresponding to the object features and the vectors corresponding to the content features can be used to characterize the semantic similarity between object information and content information.
[0093] In some embodiments, feature matching is performed between the second object features and the second content features to obtain a first matching result, including:
[0094] 1. Perform a dot product operation between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the operation result;
[0095] 2. Normalize the calculation results to obtain the first matching result.
[0096] In this application, a dot product operation can be performed between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the result. The result of the vector dot product operation is a scalar, such as a numerical value. As mentioned earlier, the second content feature can be a sequence of second object features. Therefore, performing a dot product operation between the feature vector corresponding to the second object feature and the vector corresponding to the second content feature can be performing a dot product operation between the feature vector corresponding to the second object feature and the vector corresponding to each feature in the second content feature sequence. The resulting result can be a numerical sequence, meaning the result contains multiple numerical values.
[0097] Then, the result of the operation can be normalized. This can be done by using the softmax function to process the numerical sequence corresponding to the result, thus obtaining the matching result. It can be understood that the matching result is also a numerical sequence, where each value represents the semantic similarity between content information and object information.
[0098] Step 105: Update the model parameters of the preset neural network model according to the first matching result and label information until the preset neural network model converges.
[0099] In this application, the preset neural network can be the aforementioned dual-tower DSSM model, which includes a DNN for processing object features and a DNN for processing content features. That is, the preset neural network model can include the aforementioned first neural network and second neural network. When processing the preset neural network model, the input to the model is the aforementioned first object feature and first content feature, and the output of the model is the aforementioned first matching result.
[0100] As mentioned earlier, the first matching result is a numerical sequence. On the other hand, the training samples also include label information corresponding to each piece of content information; that is, the label information also constitutes a label sequence. Therefore, according to the preset loss function calculation formula, and using the aforementioned numerical and label sequences, the loss value corresponding to each piece of content information can be calculated. Based on these loss values, gradient backpropagation is performed on the preset neural network model to adjust the model parameters of the preset neural network model, that is, to adjust the model parameters of the first and second neural networks, until the parameters of the preset neural network model converge, thus completing the training of the preset neural network model.
[0101] In some embodiments, the model training method provided in this application further includes:
[0102] 1. The first object features are processed again using the first neural network to obtain the third object features. During the process of processing the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0103] 2. Calculate the first difference information between the features of the second object and the features of the third object;
[0104] 3. Update the model parameters of the preset neural network model based on the first matching result, label information, and first difference information.
[0105] In this embodiment, a first neural network can be used to further process the features of the first object to obtain the features of the third object. When processing the features of the first object using the first neural network, random masking of the neurons in the first neural network is still required. That is, a dropout layer still needs to be added to the first neural network (DNN) to randomly mask the neurons in the DNN. During the two feature processing steps using the dropout method based on the first neural network for the first object features, the proportion of neurons in the two dropout steps can be the same.
[0106] Since the method of hiding neurons in the first neural network is randomized, the second and third object features obtained by processing the first object feature twice using the first neural network will also differ. However, since the first object feature processed by the first neural network is the same in both cases, the second and third object features obtained after multiple processing of the first object feature by the ideal model should also tend to be similar, that is, the difference between the second and third object features should be as small as possible. To address this, contrastive learning can be used to adjust the network parameters of the first neural network. Specifically, the first difference information between the second and third object features can be calculated, and then this first difference information can be added to the loss function of the preset neural network model to constrain the model parameters.
[0107] In this application, after calculating the first difference information, the model parameters of the preset neural network model can be further updated based on the first matching result, label information, and the first difference information. Specifically, the new loss function of the preset neural network model includes two parts: one part is the difference between the probability value and label value corresponding to each content output by the model, and the other part is the first difference information between the second object feature and the third object feature. Then, the preset neural network model is iteratively trained based on this new loss function to obtain the trained preset neural network model.
[0108] In some embodiments, the model training method provided in this application further includes:
[0109] 4. Perform feature matching between the features of the third object and the features of the second content to obtain the second matching result;
[0110] 5. Calculate the second difference information between the first matching result and the second matching result;
[0111] 6. Update the model parameters of the preset neural network model based on the first matching result, label information, first difference information, and second difference information.
[0112] In this application, after obtaining different sub-models for processing object features using the dropout method, and then using these different sub-models to process the first object features to obtain the second and third object features, the output results of the different sub-models can be further constrained. That is, it is necessary not only to minimize the difference between the second and third object features, but also to minimize the difference in semantic similarity between the object features and content features output by the different sub-models.
[0113] Therefore, in this application, after further feature processing of the first object features using the first neural network to obtain the third object features, the third object features can be further matched with the second content features to obtain a second matching result. As mentioned earlier, the matching result is a numerical sequence composed of a series of similarity values. That is, both the first matching result and the second matching result here are numerical sequences.
[0114] Furthermore, the model parameters of the preset neural network model can be updated based on the first matching result, label information, first difference information, and second difference information.
[0115] In some embodiments, updating the model parameters of a preset neural network model based on a first matching result, label information, first difference information, and second difference information includes:
[0116] 6.1 Determine the first sub-loss function based on the first matching result and label information;
[0117] 6.2 Determine the second sub-loss function based on the first difference information;
[0118] 6.3 Determine the third sub-loss function based on the second difference information;
[0119] 6.4 Constructing the loss function of the preset neural network model based on the first sub-loss function, the second sub-loss function, and the third sub-loss function;
[0120] 6.5. Iteratively train the preset neural network model based on the loss function.
[0121] In this embodiment, the loss function of the preset neural network model can include three parts: the first part is the difference between the second object feature and the third object feature, i.e., the first difference information, which can be called the first sub-loss function; the second part is the difference between the matching result of the second object feature and the second content feature and the matching result of the third object feature and the second content feature, i.e., the difference between the first matching result and the second matching result, i.e., the second difference information, which can be called the second sub-loss function; the third part is the difference between the matching result and the label information, where the matching result can be either the first matching result or the second matching result, which can be called the third sub-loss function.
[0122] Then, based on the first, second, and third sub-loss functions mentioned above, the total loss function of the preset neural network model is determined. Specifically, the three sub-loss functions can be summed to obtain the total loss function of the preset neural network model.
[0123] Thus, after determining the total loss function of the preset neural network model, the preset neural network model can be iteratively trained based on the loss function and training samples until the model parameters converge, resulting in the trained preset neural network model.
[0124] In some embodiments, calculating second difference information between the first matching result and the second matching result includes:
[0125] 5.1 Determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result;
[0126] 5.2 Calculate the relative entropy between the first result sequence and the second result sequence to obtain the second difference information between the first matching result and the second matching result.
[0127] In this application, the difference information between the first and second matching results can be determined by calculating the Kullback-Leibler divergence between the sequences corresponding to the first and second matching results. The Kullback-Leibler divergence, also known as relative entropy (RE) or information divergence (ID), is an asymmetric measure of the difference between two probability distributions.
[0128] Specifically, we can first determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result, where the values in the result sequences can be the dot product between the second content feature and the second object feature or the third object feature. Then, by calculating the relative entropy between the first result sequence and the second result sequence, we obtain the second difference information between the first matching result and the second matching result.
[0129] In some embodiments, the model training method provided in this application further includes:
[0130] A. The first object features are processed again using the first neural network to obtain the fourth object features. During the process of processing the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0131] B. Perform feature matching between the second content feature and the fourth object feature to obtain the third matching result;
[0132] C. Calculate the third difference information between the first matching result and the third matching result;
[0133] D. Update the model parameters of the preset neural network model based on the first matching result, label information, and third difference information.
[0134] In this embodiment, the first object features are also processed twice using the dropout method based on the first neural network to obtain the second object features and the fourth object features. However, in this embodiment, it is not necessary to perform comparative learning on the second object features and the fourth object features. It is only necessary to constrain the outputs of the two sub-models obtained by the dropout method, so that the matching results of the second content features and the second object features are as consistent as possible with the matching results of the second content features and the fourth object features.
[0135] Therefore, in this embodiment, after determining the second object feature and the fourth object feature, feature matching is performed on the second content feature and the fourth object feature to obtain a third matching result. Then, the third difference information between the first matching result and the third matching result is calculated. Furthermore, the model parameters of the preset neural network model are updated based on the first matching result, the label information, and the third difference information.
[0136] In this embodiment of the application, the loss function of the preset neural network model includes two parts: the first part is the difference between the first matching result and the label information, and the second part is the difference between the first matching result and the third matching result. The loss function of the preset neural network model can be obtained by adding these two parts together.
[0137] Then, based on the above loss function and training sample information, the preset neural network model is iteratively trained until the model parameters converge, and the trained preset neural network model is obtained.
[0138] As described above, the model training method provided in this application involves acquiring training sample information, which includes multiple training samples. Each training sample includes a first object feature corresponding to object information, a first content feature corresponding to multiple pieces of content information, and label information corresponding to each piece of content information. A first neural network is used to process the first object feature to obtain a second object feature. During the feature processing of the first object feature using the first neural network, neurons in the first neural network are randomly hidden. A second neural network is used to process the first content feature to obtain a second content feature. Feature matching is performed between the second object feature and the second content feature to obtain a first matching result. The model parameters of a preset neural network model are updated based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes a first neural network and a second neural network.
[0139] Therefore, the model training method provided in this application can add hidden layers to the sub-model that processes object features in the dual-tower model of the recommender system, thereby randomly hiding the neurons of the sub-model. This avoids the long tail of object features that could cause the model to fail to converge, improves the robustness of the dual-tower model of the recommender system, and thus improves the accuracy of content recommendation.
[0140] This application also provides a model training method that can be used in a computer device, which can be a terminal or a server. Figure 3 The diagram shown is another flowchart illustrating the content recommendation method provided in this application. The method specifically includes:
[0141] Step 201: The computer device acquires training sample information.
[0142] The training sample information can include multiple training samples. Each training sample can include object information, multiple pieces of content information corresponding to the object information, and label information for each piece of content information. The label information can be 0 or 1, representing the click status of the object corresponding to the content information. A label of 0 is called a negative sample, and a label of 1 is called a positive sample.
[0143] Content information can include the title, body, and tags of the content.
[0144] Step 202: The computer device performs word embedding processing on the object information and content information to obtain the first object feature and the first content feature.
[0145] In this process, after acquiring the training sample information, the computing device performs word segmentation on the object information and content information in the training sample information, and then performs word embedding on the segmented information to obtain the first object feature corresponding to the object information and the first content feature corresponding to the content information.
[0146] Both the first object feature and the first content feature can be feature vectors. The first content feature can include feature vectors corresponding to multiple content information, that is, the first content feature can specifically be a feature sequence.
[0147] Step 203: The computer device uses the first neural network in the preset neural network model to perform feature processing on the first content feature to obtain the second content feature.
[0148] In this application, the network model used for training is a preset neural network model, which can be a dual-tower DSSM model, which includes a first neural network for processing content features and a second neural network for processing object features.
[0149] The first neural network is used to perform feature processing on the first content feature to obtain the second content feature.
[0150] Step 204: The computer device uses the second neural network in the preset neural network model to perform feature processing on the first object feature twice to obtain the second object feature and the third object feature.
[0151] In this application, the dropout method can be used to obtain more sub-models. Specifically, the dropout method can be used to process the features of the first object based on the second neural network. When processing the features of the first object using the dropout method based on the second neural network, neurons in the second neural network can be randomly hidden using a preset dropout probability. The dropout method only hides neurons in the second neural network at the current processing time and does not cause the neurons to be lost. Each neuron in the trained second neural network has its corresponding model parameters, and the neurons in the second neural network still exist when using the trained preset neural network model.
[0152] The computer device uses a second neural network in a pre-defined neural network model to perform feature processing on the first object's features twice, resulting in second and third object features. Because the dropout method randomly hides neurons in the second neural network, the resulting second and third object features are different.
[0153] Step 205: The computer device calculates the first difference information between the second object feature and the third object feature.
[0154] In this application, a method based on Simple Constructive Learning (SimCSE) sentence embeddings is adopted. A sub-model is obtained using dropout, and the randomness of dropout is used to obtain different object features of an object, namely the aforementioned second and third object features. These two features are then compared and learned, i.e., the first difference information between the second and third object features is calculated. It is understandable that, since these two features are different object features corresponding to the same object, they should be as similar as possible. That is, the difference information between them should be as small as possible. Therefore, during model training, the second and third object features should tend to be similar.
[0155] Step 206: The computer device performs feature matching between the second content feature and the second object feature to obtain the first matching result.
[0156] In the dual-tower DSSM model, after determining the second content feature corresponding to the content information and the second object feature corresponding to the object information, feature matching is further performed on the second content feature and the second object feature to obtain the semantic similarity between the object information and the content information. Therefore, the computer device can perform feature matching on the second content feature and the second object feature to obtain the first matching result. Specifically, matching the second content feature and the second object feature involves first determining the content feature vector corresponding to the second content feature and the object feature vector corresponding to the second object feature, and then calculating the cosine similarity between the content feature vector and the object feature vector to obtain the semantic similarity between the content information and the object information. Since the second content feature contains features corresponding to multiple content information, the cosine similarity between multiple content feature vectors and object feature vectors can be calculated to obtain multiple semantic similarities, or semantic similarity sequences. Then, the semantic similarity sequences are further input into a softmax layer for normalization processing to obtain the first matching result. That is, the first matching result is a numerical sequence.
[0157] Step 207: The computer device performs feature matching between the second content feature and the third object feature to obtain the second matching result.
[0158] In this application, the dropout method is used to obtain two features of the object: the aforementioned second object feature and the third object feature. After performing feature matching between the second content feature and the second object feature to obtain the first matching result, further feature matching between the second content feature and the third object feature is required to obtain the second matching result. The matching method here is the same as the aforementioned matching method between the second content feature and the second object feature, and will not be described again here.
[0159] Step 208: The computer device calculates the second difference information between the first matching result and the second matching result.
[0160] As mentioned earlier, the first matching result is a numerical sequence, where the values represent the semantic similarity between object information and different content information. Similarly, the second matching result is also the semantic similarity between the same object and the aforementioned different content information. Since the semantic similarity of the same object to the same content information should be similar, a second difference information can be calculated between the first and second matching results. During model training, this difference information should be continuously reduced so that the first and second matching results tend to be the same.
[0161] Step 209: The computer device calculates the third difference information between the first matching result and the tag information.
[0162] Furthermore, the method used in this application to train the preset neural network model is supervised training, which means that the model output results are constrained by certain labels. That is, in this application, the first matching result should have label information that is close to the model's.
[0163] Therefore, the computer device can calculate the third difference information between the first matching result and the label information. During the training of the model, the third difference information should gradually approach 0.
[0164] Step 210: The computer device constructs a loss function for a preset neural network model based on the first difference information, the second difference information, and the third difference information.
[0165] Based on the above analysis, there are three constraints in the process of training the preset neural network model, namely the first difference information, the second difference information, and the third difference information. Therefore, a loss function for training the preset neural network model can be constructed based on the first difference information, the second difference information, and the third difference information, and then the preset neural network model can be trained based on the loss function.
[0166] Step 211: The computer device iteratively trains the preset neural network model based on the loss function to obtain the trained preset neural network model.
[0167] In this process, after determining the loss function used to train the preset neural network model, the preset neural network model is iteratively trained based on the loss function and training sample information until the preset neural network model converges, thus obtaining the trained preset neural network model.
[0168] As described above, the content recommendation method provided in this application involves obtaining training sample information, which includes multiple training samples. Each training sample includes a first object feature corresponding to object information, first content features corresponding to multiple pieces of content information, and tag information corresponding to each piece of content information. A first neural network is used to process the first object features to obtain second object features. During the feature processing of the first object features using the first neural network, neurons in the first neural network are randomly hidden. A second neural network is used to process the first content features to obtain second content features. Feature matching is performed between the second object features and the second content features to obtain a first matching result. The model parameters of a preset neural network model are updated based on the first matching result and the tag information until the preset neural network model converges. The preset neural network model includes both the first neural network and the second neural network.
[0169] Therefore, the model training method provided in this application can add hidden layers to the sub-model that processes object features in the dual-tower model of the recommender system, thereby randomly hiding the neurons of the sub-model. This avoids the long tail of object features that could cause the model to fail to converge, improves the robustness of the dual-tower model of the recommender system, and thus improves the accuracy of content recommendation.
[0170] This application also provides a content recommendation method, which can be applied to a content recommendation device that can be integrated into a computer device. For example... Figure 4 The diagram shown is a flowchart illustrating the content recommendation method provided in this application. The method includes:
[0171] Step 301: Obtain object information and candidate content information.
[0172] The candidate content information may include the title, body, and tags of the content.
[0173] Step 302: Extract features from the object information to obtain object features.
[0174] After obtaining the object information, feature extraction can be performed on the object information to obtain object features.
[0175] In some embodiments, feature extraction is performed on object information to obtain object features, including:
[0176] 1. Perform word segmentation on the object information to obtain multiple words corresponding to the object information;
[0177] 2. Perform word embedding processing on multiple word segments to obtain object features corresponding to object information.
[0178] In this embodiment, word embedding can be used to extract features from object information. Specifically, the object information can be segmented first to obtain multiple segments corresponding to the object information, and then each segment can be embedded to obtain the object features corresponding to the object information.
[0179] Step 303: Extract features from candidate content information to obtain content features.
[0180] Further feature extraction can be performed on the candidate content information to obtain content features. These content features include features corresponding to multiple candidate content information. Feature extraction of candidate content information can also be achieved by using word embedding methods to process the candidate content information and obtain the corresponding content features.
[0181] Step 304: Input the object features and content features into the trained preset neural network model to obtain the score corresponding to each content feature.
[0182] The pre-trained neural network can be a pre-trained neural network model obtained by training using the model training method provided in this application.
[0183] Step 305: Determine target candidate content based on the score corresponding to each content feature, and recommend candidate content to the target.
[0184] In this process, after obtaining the score corresponding to each content feature, the score corresponding to each candidate content can be determined. Then, a preset number of candidate contents with the highest scores can be selected as target candidate contents, and these target candidate contents can be recommended to the target.
[0185] As described above, the content recommendation method provided in this application involves: acquiring object information and candidate content information; extracting features from the object information to obtain object features; extracting features from the candidate content information to obtain content features; inputting the object features and content features into a preset neural network model, outputting a score corresponding to each content feature, where the preset neural network model is a preset neural network model trained according to the model training method provided in this application; determining target candidate content based on the score corresponding to each content feature, and recommending candidate content to the object. The content recommendation method provided in this application uses a more accurate candidate content evaluation model to score candidate content, and then recommends target candidate content to the object based on the candidate content's score. This method can effectively improve the accuracy of content recommendation.
[0186] To better implement the above model training methods, this application also provides a model training device that can be integrated into a terminal or server.
[0187] For example, such as Figure 5 The diagram shown is a schematic representation of the structure of a model training device provided in an embodiment of this application. The model training device may include a first acquisition unit 401, a first processing unit 402, a second processing unit 403, a first matching unit 404, and an update unit 405, as follows:
[0188] The first acquisition unit 401 is used to acquire training sample information, which includes multiple training samples. The training samples include the first object feature corresponding to the object information, the first content feature corresponding to multiple content information, and the label information corresponding to each content information.
[0189] The first processing unit 402 is used to perform feature processing on the first object features using a first neural network to obtain the second object features, wherein, during the feature processing of the first object features using the first neural network, the neurons in the first neural network are randomly hidden.
[0190] The second processing unit 403 is used to perform feature processing on the first content feature using a second neural network to obtain the second content feature;
[0191] The first matching unit 404 is used to perform feature matching between the second object features and the second content features to obtain the first matching result;
[0192] The update unit 405 is used to update the model parameters of the preset neural network model according to the first matching result and the label information until the preset neural network model converges. The preset neural network model includes a first neural network and a second neural network.
[0193] In some embodiments, the model training apparatus further includes:
[0194] The third processing unit is used to process the first object features again using the first neural network to obtain the third object features. In the process of processing the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0195] The first calculation unit is used to calculate the first difference information between the features of the second object and the features of the third object;
[0196] The update unit is also used for:
[0197] The model parameters of the preset neural network model are updated based on the first matching result, label information, and first difference information.
[0198] In some embodiments, the model training apparatus further includes:
[0199] The second matching unit is used to perform feature matching between the third object features and the second content features to obtain the second matching result;
[0200] The second calculation unit is used to calculate the second difference information between the first matching result and the second matching result;
[0201] The update unit is also used for:
[0202] The model parameters of the preset neural network model are updated based on the first matching result, label information, first difference information, and second difference information.
[0203] In some embodiments, the updating unit includes:
[0204] The first determining subunit is used to determine the first sub-loss function based on the first matching result and the label information;
[0205] The second determining sub-unit is used to determine the second sub-loss function based on the first difference information;
[0206] The third determining sub-unit is used to determine the third sub-loss function based on the second difference information;
[0207] Construct sub-units to build the loss function of the preset neural network model based on the first sub-loss function, the second sub-loss function, and the third sub-loss function;
[0208] The training subunit is used to iteratively train a pre-defined neural network model based on a loss function.
[0209] In some embodiments, the second computing unit includes:
[0210] The fourth determining subunit is used to determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result;
[0211] The calculation subunit is used to calculate the relative entropy between the first result sequence and the second result sequence to obtain the second difference information between the first matching result and the second matching result.
[0212] In some embodiments, the model training apparatus provided in this application further includes:
[0213] The fourth processing unit is used to perform feature processing on the first object features again using the first neural network to obtain the fourth object features, wherein, during the process of performing feature processing on the first object features again using the first neural network, the neurons in the first neural network are randomly hidden.
[0214] The third matching unit is used to perform feature matching between the second content feature and the fourth object feature to obtain the third matching result;
[0215] The third calculation unit is used to calculate the third difference information between the first matching result and the third matching result;
[0216] The update unit is also used for:
[0217] The model parameters of the preset neural network model are updated based on the first matching result, label information, and third difference information.
[0218] In some embodiments, the first matching unit includes:
[0219] The operation subunit is used to perform a dot product operation between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the operation result;
[0220] The processing subunit is used to normalize the calculation results to obtain the first matching result.
[0221] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0222] As described above, the model training apparatus provided in this application embodiment acquires training sample information through a first acquisition unit 401. The training sample information includes multiple training samples, each including a first object feature corresponding to object information, a first content feature corresponding to multiple pieces of content information, and label information corresponding to each piece of content information. A first processing unit 402 performs feature processing on the first object feature using a first neural network to obtain a second object feature. During the feature processing of the first object feature using the first neural network, neurons in the first neural network are randomly hidden. A second processing unit 403 performs feature processing on the first content feature using a second neural network to obtain a second content feature. A first matching unit 404 performs feature matching on the second object feature and the second content feature to obtain a first matching result. An update unit 405 updates the model parameters of a preset neural network model based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes a first neural network and a second neural network.
[0223] Therefore, the model training method provided in this application can add hidden layers to the sub-model that processes object features in the dual-tower model of the recommender system, thereby randomly hiding the neurons of the sub-model. This avoids the long tail of object features that could cause the model to fail to converge, improves the robustness of the dual-tower model of the recommender system, and thus improves the accuracy of content recommendation.
[0224] To better implement the above recommendation method, this application also provides a content recommendation device, which can be integrated into a terminal or server.
[0225] For example, such as Figure 6 The diagram shown is a structural schematic of a content recommendation device provided in an embodiment of this application. The content recommendation device may include a second acquisition unit 501, a first extraction unit 502, a second extraction unit 503, an input unit 504, and a determination unit 505, as follows:
[0226] The second acquisition unit 501 is used to acquire object information and candidate content information;
[0227] The first extraction unit 502 is used to extract features from object information to obtain object features;
[0228] The second extraction unit 503 is used to extract features from candidate content information to obtain content features;
[0229] The input unit 504 is used to input object features and content features into a preset neural network model and output a score corresponding to each content feature. The preset neural network model is the preset neural network model trained in the model training method of the first aspect.
[0230] The determination unit 505 is used to determine the target candidate content based on the score corresponding to each content feature, and recommend the candidate content to the object.
[0231] In some embodiments, the first extraction unit includes:
[0232] The word segmentation subunit is used to segment object information into words to obtain multiple words corresponding to the object information;
[0233] The embedding subunit is used to perform word embedding processing on multiple word segments to obtain object features corresponding to object information.
[0234] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0235] As described above, the content recommendation device provided in this application embodiment acquires object information and candidate content information through a second acquisition unit 501; a first extraction unit 502 extracts features from the object information to obtain object features; a second extraction unit 503 extracts features from the candidate content information to obtain content features; an input unit 504 inputs the object features and content features into a preset neural network model and outputs a score corresponding to each content feature. The preset neural network model is a preset neural network model trained according to the model training method provided in this application; and a determination unit 505 determines target candidate content based on the score corresponding to each content feature and recommends the candidate content to the object. The content recommendation method provided in this application uses a more accurate candidate content evaluation model to score the candidate content and then recommends target candidate content to the object based on the score of the candidate content. This method can effectively improve the accuracy of content recommendation.
[0236] This application also provides a computer device, which can be a terminal or a server, such as... Figure 7 The diagram shown is a structural schematic of the computer device provided in this application. Specifically:
[0237] The computer device may include components such as a processing unit 601 with one or more processing cores, a storage unit 602 with one or more storage media, a power module 603, and an input module 604. Those skilled in the art will understand that... Figure 7 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0238] The processing unit 601 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the storage unit 602, and by calling data stored in the storage unit 602. Optionally, the processing unit 601 may include one or more processing cores; preferably, the processing unit 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processing unit 601.
[0239] Storage unit 602 can be used to store software programs and modules. Processing unit 601 executes various functional applications and data processing by running the software programs and modules stored in storage unit 602. Storage unit 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, and web page access), etc.; the data storage area may store data created based on the use of the computer device. In addition, storage unit 602 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, storage unit 602 may also include a memory controller to provide processing unit 601 with access to storage unit 602.
[0240] The computer equipment also includes a power supply module 603 that supplies power to various components. Preferably, the power supply module 603 can be logically connected to the processing unit 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply module 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0241] The computer device may also include an input module 604, which can be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to object settings and function control.
[0242] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processing unit 601 in the computer device loads the executable files corresponding to the processes of one or more applications into the storage unit 602 according to the following instructions, and the processing unit 601 runs the applications stored in the storage unit 602 to realize various functions, as follows:
[0243] The process involves: acquiring training sample information, which includes multiple training samples, each containing a first object feature corresponding to an object, first content features corresponding to multiple pieces of content information, and label information corresponding to each piece of content information; processing the first object features using a first neural network to obtain second object features, wherein neurons in the first neural network are randomly hidden during the feature processing process; processing the first content features using a second neural network to obtain second content features; performing feature matching between the second object features and the second content features to obtain a first matching result; and updating the model parameters of a preset neural network model based on the first matching result and label information until the preset neural network model converges. The preset neural network model includes both the first and second neural networks.
[0244] Alternatively, obtain object information and candidate content information; extract features from the object information to obtain object features; extract features from the candidate content information to obtain content features; input the object features and content features into a preset neural network model, and output a score corresponding to each content feature. The preset neural network model is a preset neural network model trained according to the model training method provided in this application; determine the target candidate content based on the score corresponding to each content feature, and recommend candidate content to the object.
[0245] It should be noted that the computer device provided in this application embodiment and the method in the above embodiment belong to the same concept. The specific implementation of each of the above operations can be found in the previous embodiments, and will not be repeated here.
[0246] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0247] Therefore, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:
[0248] The process involves: acquiring training sample information, which includes multiple training samples, each containing a first object feature corresponding to an object, first content features corresponding to multiple pieces of content information, and label information corresponding to each piece of content information; processing the first object features using a first neural network to obtain second object features, wherein neurons in the first neural network are randomly hidden during the feature processing process; processing the first content features using a second neural network to obtain second content features; performing feature matching between the second object features and the second content features to obtain a first matching result; and updating the model parameters of a preset neural network model based on the first matching result and label information until the preset neural network model converges. The preset neural network model includes both the first and second neural networks.
[0249] Alternatively, obtain object information and candidate content information; extract features from the object information to obtain object features; extract features from the candidate content information to obtain content features; input the object features and content features into a preset neural network model, and output a score corresponding to each content feature. The preset neural network model is a preset neural network model trained according to the model training method provided in this application; determine the target candidate content based on the score corresponding to each content feature, and recommend candidate content to the object.
[0250] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0251] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0252] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the methods provided in the embodiments of the present invention, the beneficial effects that any of the methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0253] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the aforementioned model training method or content recommendation method.
[0254] The model training method and apparatus, and content recommendation method and apparatus provided in the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A content recommendation method, characterized in that, The method includes: Retrieve object information and candidate content information; Feature extraction is performed on the object information to obtain object features; Feature extraction is performed on the candidate content information to obtain content features; The object features and the content features are input into a preset neural network model, and the score corresponding to each content feature is output. Based on the score corresponding to each content feature, target candidate content is determined, and the candidate content is recommended to the object. The preset neural network model is obtained in the following way: Obtain training sample information, which includes multiple training samples, including a first object feature corresponding to object information, a first content feature corresponding to multiple content information items, and label information corresponding to each content information item. The first object features are processed using a first neural network to obtain the second object features. During the process of processing the first object features using the first neural network, the neurons in the first neural network are randomly hidden. The first content features are processed using a second neural network to obtain the second content features; The second object feature and the second content feature are matched to obtain a first matching result; The model parameters of the preset neural network model are updated based on the first matching result and the label information until the preset neural network model converges. The preset neural network model includes the first neural network and the second neural network.
2. The method according to claim 1, characterized in that, The method further includes: The first object features are processed again using the first neural network to obtain the third object features. During the process of processing the first object features again using the first neural network, the neurons in the first neural network are randomly hidden. Calculate the first difference information between the second object feature and the third object feature; The step of updating the model parameters of the preset neural network model based on the first matching result and the label information includes: The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the first difference information.
3. The method according to claim 2, characterized in that, The method further includes: The third object features are matched with the second content features to obtain a second matching result; Calculate the second difference information between the first matching result and the second matching result; The step of updating the model parameters of the preset neural network model based on the first matching result, the label information, and the first difference information includes: The model parameters of the preset neural network model are updated based on the first matching result, the label information, the first difference information, and the second difference information.
4. The method according to claim 3, characterized in that, The step of updating the model parameters of the preset neural network model based on the first matching result, the label information, the first difference information, and the second difference information includes: A first sub-loss function is determined based on the first matching result and the label information; The second sub-loss function is determined based on the first difference information; The third sub-loss function is determined based on the second difference information; The loss function of the preset neural network model is constructed based on the first sub-loss function, the second sub-loss function, and the third sub-loss function. The preset neural network model is iteratively trained based on the loss function.
5. The method according to claim 3, characterized in that, The calculation of the second difference information between the first matching result and the second matching result includes: Determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result; Calculate the relative entropy between the first result sequence and the second result sequence to obtain the second difference information between the first matching result and the second matching result.
6. The method according to claim 1, characterized in that, The method further includes: The first object features are processed again using the first neural network to obtain the fourth object features. During the process of processing the first object features again using the first neural network, the neurons in the first neural network are randomly hidden. The second content feature is matched with the fourth object feature to obtain a third matching result; Calculate the third difference information between the first matching result and the third matching result; The step of updating the model parameters of the preset neural network model based on the first matching result and the label information includes: The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the third difference information.
7. The method according to claim 1, characterized in that, The step of performing feature matching between the second object features and the second content features to obtain a first matching result includes: Perform a dot product operation between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the operation result; The calculation result is normalized to obtain the first matching result.
8. The method according to claim 1, characterized in that, The step of extracting features from the object information to obtain object features includes: The object information is segmented into words to obtain multiple words corresponding to the object information; Word embedding processing is performed on the multiple word segments to obtain the object features corresponding to the object information.
9. A content recommendation device, characterized in that, The device includes: The first acquisition unit is used to acquire training sample information, which includes multiple training samples. The training samples include a first object feature corresponding to object information, a first content feature corresponding to multiple content information, and label information corresponding to each content information. The first processing unit is configured to perform feature processing on the first object features using a first neural network to obtain second object features, wherein, during the feature processing of the first object features using the first neural network, the neurons in the first neural network are randomly hidden. The second processing unit is used to perform feature processing on the first content feature using a second neural network to obtain the second content feature; The first matching unit is used to perform feature matching between the second object feature and the second content feature to obtain a first matching result; An update unit is used to update the model parameters of a preset neural network model according to the first matching result and the label information until the preset neural network model converges. The preset neural network model includes the first neural network and the second neural network. The second acquisition unit is used to acquire object information and candidate content information; The first extraction unit is used to extract features from the object information to obtain object features; The second extraction unit is used to extract features from the candidate content information to obtain content features; An input unit is used to input the object features and the content features into the preset neural network model and output a score corresponding to each content feature. The determining unit is used to determine target candidate content based on the score corresponding to each content feature, and recommend the candidate content to the object.
10. The apparatus according to claim 9, characterized in that, The device further includes: The third processing unit is used to perform feature processing on the first object features again using the first neural network to obtain third object features, wherein, during the process of performing feature processing on the first object features again using the first neural network, the neurons in the first neural network are randomly hidden. The first calculation unit is used to calculate the first difference information between the second object feature and the third object feature; The update unit is further configured to: The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the first difference information.
11. The apparatus according to claim 10, characterized in that, The device further includes: The second matching unit is used to perform feature matching between the third object feature and the second content feature to obtain a second matching result; The second calculation unit is used to calculate the second difference information between the first matching result and the second matching result; The update unit is further configured to: The model parameters of the preset neural network model are updated based on the first matching result, the label information, the first difference information, and the second difference information.
12. The apparatus according to claim 11, characterized in that, The update unit includes: The first determining subunit is configured to determine a first sub-loss function based on the first matching result and the label information; The second determining subunit is used to determine the second sub-loss function based on the first difference information; The third determining subunit is used to determine the third sub-loss function based on the second difference information; Construct sub-units to build loss functions for a preset neural network model based on the first sub-loss function, the second sub-loss function, and the third sub-loss function; The training subunit is used to iteratively train the preset neural network model based on the loss function.
13. The apparatus according to claim 11, characterized in that, The second computing unit includes: The fourth determining subunit is used to determine the first result sequence corresponding to the first matching result and the second result sequence corresponding to the second matching result; The calculation subunit is used to calculate the relative entropy between the first result sequence and the second result sequence to obtain the second difference information between the first matching result and the second matching result.
14. The apparatus according to claim 9, characterized in that, The device further includes: The fourth processing unit is used to perform feature processing on the first object features again using the first neural network to obtain the fourth object features, wherein, during the process of performing feature processing on the first object features again using the first neural network, the neurons in the first neural network are randomly hidden. The third matching unit is used to perform feature matching between the second content feature and the fourth object feature to obtain a third matching result; The third calculation unit is used to calculate the third difference information between the first matching result and the third matching result; The update unit is further configured to: The model parameters of the preset neural network model are updated based on the first matching result, the label information, and the third difference information.
15. The apparatus according to claim 9, characterized in that, The first matching unit includes: The operation subunit is used to perform a dot product operation between the feature vector corresponding to the second object feature and the feature vector corresponding to the second content feature to obtain the operation result; The processing subunit is used to normalize the calculation result to obtain the first matching result.
16. The apparatus according to claim 9, characterized in that, The first extraction unit includes: The word segmentation subunit is used to segment the object information to obtain multiple words corresponding to the object information. The embedding subunit is used to perform word embedding processing on the multiple word segments to obtain the object features corresponding to the object information.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the content recommendation method of claims 1 to 8.
18. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the content recommendation method according to claims 1 to 8.
19. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps in the content recommendation method described in claims 1 to 8.