Commodity recommendation method and device, equipment and storage medium
By using the dynamic feature screening network in the product recommendation model to transform and fuse user and product features, the problem of insufficient feature interaction caused by the separation of the user tower and the product tower is solved, and the accuracy and usability of the recommendation model are improved.
Patent Information
- Application Number
- CN202311585921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2024-10-22
AI Technical Summary
In existing product recommendation models, the separation of user towers and product towers leads to insufficient feature interaction, resulting in a decrease in model accuracy; existing feature selection methods such as filtering, packaging and embedding methods have large calculation loads and weak generalization capabilities. question.
A preset-based dynamic feature screening network is used to perform feature transformation and fusion processing on the user feature matrix and product feature matrix to generate user word embedding vectors and product word embedding vectors. Model training is performed through a deep neural network to improve the accuracy of the recommendation model.
It improves the accuracy and usability of product recommendation, avoids the problem of misalignment between feature importance calculation and model goals, reduces the interference of unimportant features on the model, and improves the generalization ability of the model.
Smart Images

Figure CN118822657A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a product recommendation method, device, equipment and storage medium. Background Art
[0002] At present, the mainstream recommendation model is the dual-tower model, including the user tower and the product tower. The user tower is composed of user features + DNN structure, and the product tower is composed of product features + corresponding DNN structure. Before training to obtain the corresponding embedding vectors of users and products, the left and right towers do not perform any feature combination or nonlinear crossover. The separation of the product tower and the user tower facilitates online deployment.
[0003] There are three main types of feature selection methods at present, namely filtering, packaging and embedding, which calculate the importance of features through tree models. The filtering method scores each feature by divergence or correlation, and sets a threshold or the number of features to be selected for screening; the packaging method uses machine learning algorithms to evaluate the effect of feature subsets, which can detect the interaction between two or more features, and the selected feature subsets make the model achieve the best effect, including full search, heuristic search, random search, recursive feature elimination, etc.; the embedding method embeds feature selection into the model construction process, such as feature selection methods based on tree models. Commonly used feature fusion technologies in the model are mainly feature splicing, feature summation, feature averaging, etc.
[0004] However, the existing filtering method feature selection scheme mainly determines the importance of features by calculating correlation coefficients, KL divergence, etc. This calculation method mainly selects features by evaluating the correlation between independent variables and dependent variables, and is not aligned with the model objectives. The packaging method mainly selects different feature subsets to find the best feature subset. The main disadvantage of this method is that the calculation is large and takes a long time. The tree model method in the embedding method is a commonly used method. The main disadvantage of this scheme is that the generalization ability of the tree model is weak.
[0005] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of the present invention is to provide a product recommendation method, device, equipment and storage medium, aiming to make product recommendations more accurate and usable by improving the accuracy of the recommendation model.
[0007] To achieve the above-mentioned purpose, the present invention provides a product recommendation method, device, equipment and storage medium, including:
[0008] Obtain the recommended user characteristics of the recommended user;
[0009] Input the features of the user to be recommended into the pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results of feature transformation and feature fusion of the pre-acquired target user feature matrix and target product feature matrix;
[0010] A target product word embedding vector that matches the to-be-recommended user word embedding vector is selected from a pre-configured product word embedding vector retrieval library for product recommendation.
[0011] Optionally, the training process of the dual-tower recommendation model includes:
[0012] Obtaining an original user feature set and an original product feature set;
[0013] Filter out user features that meet a first preset condition in the original user feature set and product features that meet a second preset condition in the original product feature set to obtain a corresponding target user feature set and target product feature set;
[0014] Performing feature conversion on the target user feature set and the target product feature set to obtain a corresponding target user feature matrix and a target product feature matrix;
[0015] Performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain a feature processing result;
[0016] The feature processing results are transmitted to a preset deep neural network for model training by the deep neural network to obtain a dual-tower recommendation model.
[0017] Optionally, the step of filtering out user features that meet a first preset condition in the original user feature set and product features that meet a second preset condition in the original product feature set to obtain a corresponding target user feature set and target product feature set includes:
[0018] Calculate the importance weights of user features and product features in the original user feature set and the original product feature set based on the pre-trained feature selection model;
[0019] Filter out user features whose importance weights are greater than a first preset threshold in the original user feature set to obtain a target user feature set;
[0020] The product features whose importance weights are greater than a second preset threshold value in the original product feature set are screened out to obtain a target product feature set.
[0021] Optionally, the step of constructing the feature selection model includes:
[0022] Setting weight parameter values for model building features in the pre-acquired model building feature set;
[0023] Based on the weight parameter value, sampling the model building features in the model building feature set;
[0024] The weight parameter values corresponding to the sampled model construction features are added to the preset loss function to construct the feature selection model.
[0025] Optionally, the feature processing result includes a user feature fusion result and a product word embedding vector, and the step of performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain the feature processing result includes:
[0026] Performing feature transformation processing and feature fusion processing on the target user feature matrix through the dynamic feature screening network to generate a user feature fusion result;
[0027] The target product feature matrix is subjected to feature transformation processing and feature fusion processing through the dynamic feature screening network to generate a product word embedding vector.
[0028] Optionally, the step of performing feature transformation processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network includes:
[0029] Performing word embedding mapping on the target user feature matrix to obtain a user feature embedding matrix, and performing word embedding mapping on the target product feature matrix to obtain a product feature embedding matrix;
[0030] The user feature embedding matrix is linearly mapped through a predefined first linear mapping matrix to obtain a user feature transformation matrix, and the product feature embedding matrix is linearly mapped through a predefined second linear mapping matrix to obtain a product feature transformation matrix.
[0031] Optionally, the step of performing feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network includes:
[0032] Calculating weight values corresponding to user features based on the user feature transformation matrix, and calculating weight values corresponding to product features based on the product feature transformation matrix;
[0033] A user feature fusion matrix is generated based on the user feature transformation matrix and the weight values of the corresponding user features, and a product feature fusion matrix is generated based on the product feature transformation matrix and the weight values of the corresponding product features.
[0034] In addition, to achieve the above-mentioned purpose, the present invention further provides a commodity recommendation device, the commodity recommendation device comprising:
[0035] An acquisition module, used to acquire the recommended user characteristics of the recommended user;
[0036] An input module is used to input the features of the user to be recommended into a pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network to perform feature transformation and feature fusion on a pre-acquired target user feature matrix and a target product feature matrix;
[0037] The recommendation module is used to select a target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation.
[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a product recommendation device, which includes: a memory, a processor, and a product recommendation program stored in the memory and executable on the processor, wherein the product recommendation program is configured to implement the steps of the product recommendation method described above.
[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a product recommendation program is stored, and when the product recommendation program is executed by a processor, the steps of the product recommendation method described above are implemented.
[0040] The product recommendation method, device, equipment and storage medium proposed in the present invention obtain the user features to be recommended of the user to be recommended and input the user features to be recommended into a pre-trained dual-tower recommendation model to generate a word embedding vector for the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results after feature transformation and feature fusion of a pre-acquired target user feature matrix and a target product feature matrix, and selects a target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation, thereby making product recommendations more accurate and usable by improving the accuracy of the dual-tower recommendation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a structural diagram of a commodity recommendation device in a hardware operating environment involved in an embodiment of the present invention;
[0042] Figure 2 This is a flow chart of a first embodiment of the commodity recommendation method of the present invention;
[0043] Figure 3A schematic diagram of the process of recommending products by the product recommendation method of the present invention;
[0044] Figure 4 This is a flow chart of a second embodiment of the product recommendation method of the present invention;
[0045] Figure 5 A schematic diagram of a flow chart of a third embodiment of the commodity recommendation method of the present invention;
[0046] Figure 6 This is a flow chart of a fourth embodiment of the product recommendation method of the present invention;
[0047] Figure 7 This is a schematic diagram of the process flow of the dynamic feature screening network of the present invention for processing features;
[0048] Figure 8 This is a schematic diagram of the processing flow of features by the dynamic feature screening network of the user tower and the product tower of the product recommendation method of the present invention;
[0049] Fig. 9 Schematic diagram of the functional modules of the commodity recommendation device of the present invention.
[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] The embodiment of the present application takes into account that due to the separation of the user tower and the product tower in the dual-tower recommendation model, the user vector and the product vector only interact when the inner product is performed at the top layer, and the user vector and the vector at this time are the result of multiple nonlinear transformations of the original features, and there has been a large loss of precision relative to the original features, resulting in a decrease in the accuracy of the model. The existing filtering method feature selection scheme mainly determines the importance of features by calculating correlation coefficients, KL divergence, etc. This calculation method mainly selects features by evaluating the correlation between independent variables and dependent variables, and is not aligned with the model target. The packaging method mainly selects different feature subsets to find the best feature subset. The main disadvantage of this method is that the calculation amount is large and the time spent is long. The tree model method in the embedding method is a commonly used method. The main disadvantage of this scheme is that the generalization ability of the tree model is weak.
[0053] Therefore, the present application proposes to screen and cross-fuse features before the features enter the multi-layer neural network, so as to avoid the loss of important features due to multiple nonlinear changes, thereby improving the accuracy of the model. On the one hand, the present application proposes a neural network pre-training model that can be aligned with the model target, requires only one calculation, and has strong generalization ability to calculate the importance of features, which can achieve feature screening and reduce the interference of unimportant features on the model. On the other hand, the present application proposes a dynamic feature screening network model based on feature transformation and feature fusion, which can realize feature multi-space mapping and multi-space feature adaptive cross-fusion, and realize dynamic screening of features. Compared with the prior art, when fusing features, only simple operations such as splicing, summing, and averaging are performed, and no multi-space mapping of features is performed. This solution can further improve the accuracy of the model and make product recommendations more accurate.
[0054] Based on this, an embodiment of the present application proposes a solution, by obtaining the user features to be recommended of the user to be recommended and inputting the user features to be recommended into a pre-trained dual-tower recommendation model to generate a word embedding vector for the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results after feature transformation and feature fusion of the pre-acquired target user feature matrix and the target product feature matrix, and selects the target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation, thereby making the product recommendation more accurate and usable by improving the accuracy of the recommendation model.
[0055] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the commodity recommendation device of this application belongs. The commodity recommendation device can be a device independent of the terminal device and capable of data processing, which can be carried on the terminal device in the form of hardware or software.
[0056] In this embodiment, the terminal device to which the commodity recommendation apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .
[0057] The memory 130 stores an operating system and a product recommendation program. The product recommendation device can store information such as the characteristics of the user to be recommended and the product recommendation program in the memory 130. The output module 110 can be a display screen, a speaker, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with an external device or server through the communication module 140.
[0058] When the product recommendation program in the memory 130 is executed by the processor, the following steps are implemented:
[0059] Obtain the recommended user characteristics of the recommended user;
[0060] Input the features of the user to be recommended into the pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results of feature transformation and feature fusion of the pre-acquired target user feature matrix and target product feature matrix;
[0061] A target product word embedding vector that matches the to-be-recommended user word embedding vector is selected from a pre-configured product word embedding vector retrieval library for product recommendation.
[0062] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0063] Obtaining an original user feature set and an original product feature set;
[0064] Filter out user features that meet a first preset condition in the original user feature set and product features that meet a second preset condition in the original product feature set to obtain a corresponding target user feature set and target product feature set;
[0065] Performing feature conversion on the target user feature set and the target product feature set to obtain a corresponding target user feature matrix and a target product feature matrix;
[0066] Performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain a feature processing result;
[0067] The feature processing results are transmitted to a preset deep neural network for model training by the deep neural network to obtain a dual-tower recommendation model.
[0068] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0069] Calculate the importance weights of user features and product features in the original user feature set and the original product feature set based on the pre-trained feature selection model;
[0070] Filter out user features whose importance weights are greater than a first preset threshold in the original user feature set to obtain a target user feature set;
[0071] The product features whose importance weights are greater than a second preset threshold value in the original product feature set are screened out to obtain a target product feature set.
[0072] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0073] Setting weight parameter values for model building features in the pre-acquired model building feature set;
[0074] Based on the weight parameter value, sampling the model building features in the model building feature set;
[0075] The weight parameter values corresponding to the sampled model construction features are added to the preset loss function to construct the feature selection model.
[0076] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0077] Performing feature transformation processing and feature fusion processing on the target user feature matrix through the dynamic feature screening network to generate a user feature fusion result;
[0078] The target product feature matrix is subjected to feature transformation processing and feature fusion processing through the dynamic feature screening network to generate a product word embedding vector.
[0079] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0080] Performing word embedding mapping on the target user feature matrix to obtain a user feature embedding matrix, and performing word embedding mapping on the target product feature matrix to obtain a product feature embedding matrix;
[0081] The user feature embedding matrix is linearly mapped through a predefined first linear mapping matrix to obtain a user feature transformation matrix, and the product feature embedding matrix is linearly mapped through a predefined second linear mapping matrix to obtain a product feature transformation matrix.
[0082] Furthermore, when the product recommendation program in the memory 130 is executed by the processor, the following steps are also implemented:
[0083] Calculating weight values corresponding to user features based on the user feature transformation matrix, and calculating weight values corresponding to product features based on the product feature transformation matrix;
[0084] A user feature fusion matrix is generated based on the user feature transformation matrix and the weight values of the corresponding user features, and a product feature fusion matrix is generated based on the product feature transformation matrix and the weight values of the corresponding product features.
[0085] This embodiment adopts the above scheme, specifically by obtaining the user features of the user to be recommended and inputting the user features into the pre-trained dual-tower recommendation model to generate a word embedding vector for the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results after feature transformation and feature fusion of the pre-acquired target user feature matrix and the target product feature matrix, and selects the target product word embedding vector that matches the user word embedding vector to be recommended from the pre-configured product word embedding vector retrieval library for product recommendation, thereby improving the accuracy of the recommendation model and making the product recommendation more accurate and usable.
[0086] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present application is proposed.
[0087] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a product recommendation method of the present invention. In this embodiment, the product recommendation method includes:
[0088] Step S1000: Obtaining the recommended user characteristics of the recommended user;
[0089] Specifically, refer to Figure 3 In the process shown, when it is necessary to recommend products to a target user, the characteristics of the target user can be obtained online in real time as the characteristics of the user to be recommended.
[0090] Step S2000: inputting the features of the user to be recommended into the pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network to perform feature transformation and feature fusion on a pre-acquired target user feature matrix and a target product feature matrix;
[0091] In recommendation systems, the two-tower model is often used to learn the relationship between users and products in order to better perform personalized recommendations. The two towers of the two-tower model represent users and products respectively. By learning the representations of the two, the model can quantify the relationship between them, thereby improving the accuracy of recommendations.
[0092] The dual-tower model includes a user tower and a product tower, which process user and product information respectively. The two towers usually have the same structure, but the parameters can be learned independently.
[0093] Similar to the dual-tower model in other fields, the dual-tower model in the recommendation system also usually adopts a shared weight approach, which means that the parameters of the user tower and the product tower are the same in order to learn a common feature representation.
[0094] User and product information is usually mapped to a low-dimensional embedding space, mainly through the Embedding layer. The parameters of this layer are an important part of the model that needs to be learned. They map user and product information to the representation space.
[0095] The dual-tower model usually uses a contrastive loss function, such as cosine similarity loss or cross entropy loss, to measure the similarity between users and items. During the training process, the model learns better recommendation representations by minimizing the representation distance of the same user-item pair and maximizing the representation distance of different user-item pairs.
[0096] The twin-tower model in the recommendation system can be applied to a variety of tasks, including user behavior prediction, click-through rate prediction, etc. By learning the embedded representation of users and products, the twin-tower model can better capture the relationship between them and improve the recommendation effect.
[0097] In this embodiment, after obtaining the features to be recommended of the target user, the user features of the user to be recommended are input into the trained dual-tower recommendation model, and the user tower in the dual-tower recommendation model performs real-time inference on the features of the user to be recommended to obtain a user word embedding vector, wherein the inference process may include performing feature embedding processing on the features of the user to be recommended, and then sending the embedded features to the dynamic feature screening network of the user tower for further processing, and then transmitting the processing results to the trained deep neural network DNN, thereby obtaining a user word embedding vector.
[0098] Then, according to the obtained user word embedding vector, vector retrieval is performed in the configured full-quantity product word embedding vector retrieval library. Specifically, the product word embedding vector whose similarity with the user word embedding vector reaches a certain value is retrieved as the target product word embedding vector through the similarity calculation rule. After obtaining the target product word embedding vector, the corresponding product can be selected according to the vector to recommend the product to the user to be recommended. Among them, the product word embedding vector in the full-quantity product word embedding vector retrieval library can be obtained by the dynamic feature screening network during model training after feature transformation and feature fusion of the target product feature matrix used for training, and stored in the retrieval library.
[0099] In the dual-tower recommendation model of this embodiment, a dynamic feature screening network module is added to perform feature transformation and feature fusion processing on the input features when training the dual-tower recommendation model before transmitting them to the deep neural network, thereby avoiding the loss of accuracy of important features after multiple nonlinear changes to the features under normal circumstances.
[0100] Step S3000: Select a target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation.
[0101] After obtaining the user word embedding vector corresponding to the user feature to be recommended through the above steps, calculate the similarity between the user word embedding vector and each product word embedding vector in the full product word embedding retrieval library, and select the product corresponding to the product word embedding vector with the highest similarity as the most similar top product for recommendation.
[0102] In this embodiment, the user features to be recommended of the user to be recommended are obtained and input into the pre-trained dual-tower recommendation model to generate a word embedding vector for the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results after feature transformation and feature fusion of the pre-acquired target user feature matrix and the target product feature matrix, and a target product word embedding vector matching the user word embedding vector to be recommended is selected from a pre-configured product word embedding vector retrieval library for product recommendation, thereby making the product recommendation more accurate and usable by improving the accuracy of the recommendation model.
[0103] Further, refer to Figure 4 , Figure 4 This is a flow chart of the second embodiment of the product recommendation method of the present invention, based on the above Figure 2 In the illustrated embodiment, the training process of the dual-tower recommendation model includes:
[0104] Step S0100: obtaining an original user feature set and an original product feature set;
[0105] Step S0200: Filter out user features that meet the first preset condition in the original user feature set and product features that meet the second preset condition in the original product feature set to obtain corresponding target user feature sets and target product feature sets;
[0106] Specifically, the dual-tower recommendation model in this embodiment proposes a method for selecting features for feature training that is different from the mainstream filtering method, packaging method, and embedding method. It proposes to build a feature selection neural network model based on feature weights, and screen features by learning the importance weights of each feature. This technology has the advantages of only requiring one training and having strong model generalization ability.
[0107] First, obtain the original user feature set and original product feature set for model training.
[0108] Then, the obtained original user feature set and original product feature set are respectively input into the pre-trained feature selection model, and the importance weight of each original user feature in the original user feature set and the importance weight of each original product feature in the original product feature set are calculated through the feature selection model. The features whose original user feature importance weights are greater than a preset user feature weight threshold are taken as target user features, and the features whose original product feature importance weights are greater than a preset product feature weight threshold are taken as target product features, thereby obtaining the target user feature set and the target product feature set.
[0109] Step S0300: performing feature conversion on the target user feature set and the target product feature set to obtain a corresponding target user feature matrix and a target product feature matrix;
[0110] Specifically, in this embodiment, the target user feature set and the target product feature set are respectively subjected to feature conversion processing to obtain a target user feature matrix and a target product feature matrix for feature transformation and feature fusion. Specifically, the features in the feature set are converted according to certain rules to generate a feature matrix of predetermined specifications. For example, a feature set containing 100 features is converted into a 10*10 feature matrix, and a feature set containing 120 features is converted into a matrix of 30*40, 20*60, etc. The specific conversion rules are selected according to the needs.
[0111] Step S0400: performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain a feature processing result;
[0112] Step S0500: Transmit the feature processing result to a preset deep neural network for the deep neural network to perform model training to obtain a dual-tower recommendation model.
[0113] After the target user feature set is converted into a target user feature matrix and the target product feature set is converted into a target product feature matrix through the above-mentioned feature conversion processing, the obtained target user feature matrix and target product feature matrix can be sent to the dynamic feature screening network for further processing, including feature transformation and feature fusion. The dynamic feature screening network realizes dynamic screening of features by performing feature multi-space mapping (feature transformation) and multi-space feature adaptive cross-fusion (feature fusion) on the input target user feature matrix and target product feature matrix. Compared with the prior art which only performs simple operations such as splicing, summing, and averaging during feature fusion, the accuracy of the features dynamically screened in this embodiment and the degree of matching with the source data are higher.
[0114] After processing the target user feature matrix and the target product feature matrix through the dynamic feature screening network, the corresponding feature fusion results are obtained. Then the dynamic feature screening network sends the obtained feature fusion results to the preset deep neural network for the final model training to obtain the dual-tower recommendation model.
[0115] Specifically, the deep neural network DNN in this embodiment can be composed of multiple hidden layers, each hidden layer contains multiple neurons, and these hidden layers are responsible for learning representations of different abstract levels of data, where the hidden layers closer to the input layer learn lower-level features, and the hidden layers closer to the output layer learn higher-level features. Information is transmitted and learned through the connection weights between layers. For example, the input layer (Input Layer) receives the original input data, each neuron corresponds to a feature of the input, and the output layer (Output Layer) provides the final output. The number of neurons in the output layer depends on the task type. For example, the number of output neurons for a classification task is usually equal to the number of categories.
[0116] In addition, each connection in DNN has a weight to adjust the transmission strength of information in the network. These weights are learned during the training process to minimize the loss function of the model on the task. It also includes an activation function after each hidden layer neuron to introduce nonlinear transformations. Nonlinear activation functions enable DNN to capture more complex patterns and relationships.
[0117] Specifically, in this embodiment, by obtaining the original user feature set and the original product feature set, the user features in the original user feature set that meet the first preset condition and the product features in the original product feature set that meet the second preset condition are screened out to obtain the corresponding target user feature set and target product feature set, and feature conversion is performed on the target user feature set and the target product feature set to obtain the corresponding target user feature matrix and the target product feature matrix, and feature transformation processing and feature fusion processing are performed on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain feature processing results, and the feature processing results are transmitted to a preset deep neural network for the deep neural network to perform model training to obtain a dual-tower recommendation model, thereby obtaining features with higher accuracy for the DNN module to perform model training, thereby improving the accuracy of the ultimately trained dual-tower recommendation model and making product recommendations more accurate and usable.
[0118] Further, refer to Figure 5 , Figure 5 This is a flow chart of the third embodiment of the product recommendation method of the present invention, based on the above Figure 4In the embodiment shown, the step S0200: filtering out user features in the original user feature set that meet the first preset condition and product features in the original product feature set that meet the second preset condition, and obtaining the corresponding target user feature set and target product feature set may include:
[0119] Step S0201: calculating the importance weights of user features and product features in the original user feature set and the original product feature set based on the pre-trained feature selection model;
[0120] Step S0202: Filter out user features whose importance weights are greater than a first preset threshold in the original user feature set to obtain a target user feature set;
[0121] Step S0203: Filter out the product features whose importance weights are greater than a second preset threshold value in the original product feature set to obtain a target product feature set.
[0122] Specifically, in this embodiment, in order to streamline the total amount of input features, feature importance selection processing is required. Specifically, the importance weights of the features are calculated through a pre-trained feature selection model, and then the features with lower importance weights are removed based on the calculated importance weights, thereby achieving the purpose of reducing the number of features and reducing the dimensionality disaster that occurs during subsequent feature transformation and feature fusion.
[0123] The extracted original user feature set and original product feature set are respectively input into the trained feature selection model. Each feature in the feature set is analyzed and calculated through the feature selection model to obtain the importance weight value of the corresponding feature, and the features in the feature set whose importance weight value is greater than the preset threshold are selected as target features. Features whose importance weight value is less than the preset threshold are generally irrelevant features or distorted features. Such features often have a negative impact on the accuracy of the recommendation model, so they are not adopted.
[0124] It should be understood that different preset conditions should be used for different data sources, that is, different importance weight preset thresholds should be used for the selection of target user feature sets and target product feature sets, that is, for the generation of target user feature sets, the first preset threshold (user feature importance weight value) is used to screen the features in the original user feature set, and for the generation of target product feature sets, the second preset threshold (product feature importance weight value) is used to screen the features in the original product feature set, and the specific weight threshold should be set according to the actual situation. It should be understood that the preset user feature importance weight value and product feature importance weight value are not limited to different values, and in specific circumstances, they can also be two identical values.
[0125] Furthermore, the steps of constructing the feature selection model in this embodiment include:
[0126] Step S0010: setting weight parameter values for the model building features in the pre-acquired model building feature set;
[0127] Step S0020: based on the weight parameter value, sampling the model building features in the model building feature set;
[0128] Step S0030: adding the model weight parameter values corresponding to the sampled model construction features to the preset loss function to construct a feature selection model.
[0129] Specifically, in this embodiment, when calculating the feature importance weight, it can be achieved by constructing a pre-trained multi-layer neural network model for feature importance selection, that is, a feature selection model. Specifically, the feature selection model can be constructed through the following steps. First, a set of model construction feature sets for training is constructed. The model construction feature set contains model construction features. Before sending these model construction features into the multi-layer neural network, a weight parameter Pi that needs to be trained is set for each dimensional feature i.
[0130] Pi is initialized with a random value, and the range of Pi value is between 0 and 1. The Pi value of a specific feature represents the probability value of the feature being used for training, that is, feature i is sampled with a probability of Pi in a training batch, and the feature values of other unsampled features i are set to 0.
[0131] Then, the feature weight parameter pi is used as the feature importance weight value, and the feature importance weight value is added to the loss function in the form of a regular term for training, thereby obtaining a pre-trained multi-layer neural network model for feature importance selection.
[0132] Among them, the goal of the loss function is to make samples of the same category closer in the representation space, and samples of different categories farther away in the representation space, which helps the model better distinguish samples of different categories in the representation space, thereby improving the performance of contrastive learning tasks. For example, the triplet loss function is a contrastive learning loss function. For each training sample, this loss needs to provide three samples: anchor, positive sample, and negative sample. The goal of the triplet loss is to make the distance between the anchor and the positive sample smaller than the distance between the anchor and the negative sample, while introducing a smaller margin to ensure sufficient differentiation. Another example is the cosine similarity loss function, which is trained by maximizing the cosine similarity between samples of the same category and minimizing the cosine similarity between samples of different categories. The cosine similarity loss is usually used to measure the directional differences of samples in high-dimensional representation space.
[0133] After the feature selection model is trained, all features can be input into the pre-trained multi-layer neural network model for feature importance selection when feature selection is needed to obtain the importance weights of each feature in the full set of features.
[0134] After the importance weight of each feature is obtained, the features whose importance weight exceeds the set threshold can be selected as subsequent training samples according to the preset importance weight threshold.
[0135] In this embodiment, by setting weight parameter values for model building features in a pre-acquired model building feature set, the model building features in the model building feature set are sampled based on the weight parameter values, and the model weight parameter values corresponding to the sampled model building features are added to a preset loss function to construct a feature selection model. A neural network pre-training model is constructed that can be aligned with the model target, requires only one calculation, and has strong generalization ability to calculate the importance of features. This can achieve feature screening, reduce the interference of unimportant features on the model, improve the accuracy of the recommendation model, and thereby improve the accuracy of product recommendations.
[0136] Further, refer to Figure 6 , Figure 6 This is a flow chart of the fourth embodiment of the product recommendation method of the present invention, based on the above Figure 4 In the embodiment shown, the step S0400: performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain feature processing results may include:
[0137] Step S0410: performing feature transformation processing and feature fusion processing on the target user feature matrix through the dynamic feature screening network to generate a user feature fusion result;
[0138] Step S0420: performing feature transformation processing and feature fusion processing on the target product feature matrix through the dynamic feature screening network to generate a product word embedding vector;
[0139] Specifically, refer to Figure 7 , Figure 7 This is a flow chart of the dynamic feature screening network in this embodiment performing feature transformation and feature fusion processing on the input feature set (target user feature set and target product feature set).
[0140] Specifically, in this embodiment, referring to Figure 8 The dual-tower recommendation model includes a user tower and a product tower. Dynamic feature screening networks are added to the user tower and the product tower of the dual-tower model respectively, so as to perform feature transformation on the target user feature set and the target product feature set after feature selection to generate the corresponding target user feature matrix and the target product feature matrix. Then, after further processing through the dynamic feature screening network, the product word embedding vector and the user feature fusion result are obtained, and the product word embedding vector and the user feature fusion result are respectively transmitted to the corresponding deep neural network DNN for model training, wherein the processing of the target user feature matrix and the target product feature matrix by the dynamic feature screening neural network includes two parts: feature transformation and feature fusion.
[0141] Specifically, the user feature matrix is input into the corresponding user dynamic feature screening network for feature transformation and feature fusion, thereby obtaining the user feature fusion result.
[0142] The product feature matrix is input into the corresponding product dynamic feature screening network for feature transformation and feature fusion, so as to obtain the product word embedding vector. After obtaining the product word embedding vector, the product word embedding vector can be further stored in the vector retrieval library for query when making product recommendations.
[0143] Furthermore, in this embodiment, the step of performing feature transformation processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network may include:
[0144] Step S0431: performing word embedding mapping on the target user feature matrix to obtain a user feature embedding matrix, and performing word embedding mapping on the target product feature matrix to obtain a product feature embedding matrix;
[0145] Step S0432: linearly mapping the user feature embedding matrix through a predefined first linear mapping matrix to obtain a user feature transformation matrix, and linearly mapping the product feature embedding matrix through a predefined second linear mapping matrix to obtain a product feature transformation matrix.
[0146] Specifically, refer to Figure 7 In this embodiment, the feature transformation of the feature matrix is first performed by performing word embedding mapping on each feature to obtain an embedding vector with a uniform dimension of m, that is, a feature embedding vector, where m is a preset hyperparameter. It should be understood that the feature matrix here can be a user feature matrix or a product feature matrix.
[0147] After each feature in the feature matrix is subjected to word embedding mapping to generate the corresponding feature embedding vector, these generated feature vectors can form an n*m feature embedding matrix. For example, the user feature matrix is subjected to word embedding mapping to obtain an n1*m1 user feature embedding matrix, and the product feature matrix is subjected to word embedding mapping to obtain an n2*m2 product feature embedding matrix, where n1 and n2 represent the number of user features and the number of product features, respectively, and m1 and m2 represent the dimensions of the user feature embedding vector and the product feature embedding vector, respectively.
[0148] Finally, z m*k linear mapping matrices are defined, and the above n*m feature matrix is linearly mapped z times to obtain the feature transformation matrix W after z feature transformations. The size of the feature transformation matrix W is n*k, where z and k are preset model training hyperparameters, and the specific values are pre-set according to the specific situation.
[0149] Furthermore, in this embodiment, the step of performing feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network includes:
[0150] Step S0433: Calculating the weight value of the corresponding user feature based on the user feature transformation matrix, and calculating the weight value of the corresponding commodity feature based on the commodity feature transformation matrix;
[0151] Step S0434: generating a user feature fusion matrix based on the user feature transformation matrix and the weight values of the corresponding user features, and generating a product feature fusion matrix based on the product feature transformation matrix and the weight values of the corresponding product features.
[0152] Specifically, refer to Figure 7 In this embodiment, the step of fusing the feature results after different linear space transformations are performed by the linear mapping matrix in the above steps specifically includes:
[0153] First, for each feature transformation result, that is, the feature transformation matrix W after the feature transformation, the average is calculated according to the feature number dimension (average is calculated according to the feature number n) to obtain z 1*k vectors.
[0154] Then, each dimension value of the vector of size 1*k (i.e., the hyperparameter k) is averaged to obtain the value m, and then processed through the output layer of the deep neural network DNN - the softmax layer to obtain the weight value α.
[0155] According to each feature transformation matrix obtained after the feature transformation in the above steps and the respective feature weight value α, the feature fusion result matrix R is calculated.
[0156] Specifically, each feature matrix W can be multiplied by its own feature weight α according to the following calculation formula, and finally added together to obtain the feature fusion result:
[0157] R=W1*α1+W2*α2+...+Wn*αn
[0158] Among them, W1, W2...Wn and α1, α2...αn refer to the feature transformation matrix after feature transformation and the feature weight value of the corresponding feature respectively.
[0159] It should be noted that the feature fusion method in this embodiment is different from the traditional direct splicing feature fusion method. It learns a weight α for each feature through a weighted method, and then obtains the feature fusion result based on each feature matrix and their respective feature weights α. In this way, compared with the prior art, when fusion of features only performs simple operations such as splicing, and does not perform multi-space mapping of features, this solution can realize multi-space mapping of features and adaptive cross-fusion of multi-space features, realize dynamic screening of features, and thus improve the accuracy of the model.
[0160] In this embodiment, the target user feature set and the target product feature set are subjected to feature conversion to obtain corresponding user feature matrices and product feature matrices, and the user feature matrix is subjected to feature transformation processing and feature fusion processing through the dynamic feature screening network to generate a user feature fusion result, and the product feature matrix is subjected to feature transformation processing and feature fusion processing through the dynamic feature screening network to generate a product word embedding vector, and the neural network model based on feature transformation and feature fusion is used to realize feature multi-space mapping and multi-space feature adaptive cross-fusion, realize dynamic feature screening, improve the accuracy of the model, and thus improve the accuracy of product recommendations.
[0161] In addition, refer to Fig. 9 The embodiment of the present invention further provides a product recommendation device 90, the device comprising:
[0162] An acquisition module 91 is used to acquire the recommended user characteristics of the recommended user;
[0163] An input module 92 is used to input the features of the user to be recommended into a pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network to perform feature transformation and feature fusion on a pre-acquired target user feature matrix and a target product feature matrix.
[0164] The recommendation module 93 is used to select a target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation.
[0165] In addition, an embodiment of the present invention also provides a product recommendation device, which includes: a memory, a processor, and a product recommendation program stored in the memory and executable on the processor, wherein the product recommendation processing program is configured to implement the steps of each embodiment of the product recommendation method described above.
[0166] In addition, the present invention also provides a computer-readable storage medium, on which a product recommendation program is stored. When the product recommendation program is executed by a processor, the steps of each embodiment of the product recommendation method described above are implemented.
[0167] In the embodiments of the apparatus, terminal device and computer-readable storage medium of the present invention, all technical features of the above-mentioned embodiments of the commodity recommendation method are included, and the expansion and explanation content of the specification are basically the same as those of the above-mentioned embodiments of the commodity recommendation method, and will not be repeated here.
[0168] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0169] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0171] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A product recommendation method, It is characterized in that The method comprises the following steps: Obtain the recommended user characteristics of the recommended user; Input the features of the user to be recommended into the pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network on the feature processing results of feature transformation and feature fusion of the pre-acquired target user feature matrix and target product feature matrix; A target product word embedding vector that matches the to-be-recommended user word embedding vector is selected from a pre-configured product word embedding vector retrieval library for product recommendation.
2. The product recommendation method according to claim 1, It is characterized in that The training process of the dual-tower recommendation model includes: Obtaining an original user feature set and an original product feature set; Filter out user features that meet a first preset condition in the original user feature set and product features that meet a second preset condition in the original product feature set to obtain a corresponding target user feature set and target product feature set; Performing feature conversion on the target user feature set and the target product feature set to obtain a corresponding target user feature matrix and a target product feature matrix; Performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain a feature processing result; The feature processing results are transmitted to a preset deep neural network for model training by the deep neural network to obtain a dual-tower recommendation model.
3. The commodity recommendation method according to claim 2, It is characterized in that The step of filtering out user features that meet the first preset condition in the original user feature set and product features that meet the second preset condition in the original product feature set to obtain the corresponding target user feature set and target product feature set comprises: Calculate the importance weights of user features and product features in the original user feature set and the original product feature set based on the pre-trained feature selection model; Filter out user features whose importance weights are greater than a first preset threshold in the original user feature set to obtain a target user feature set; The product features whose importance weights are greater than a second preset threshold value in the original product feature set are screened out to obtain a target product feature set.
4. The commodity recommendation method according to claim 3, It is characterized in that The steps of constructing the feature selection model include: Setting weight parameter values for model building features in the pre-acquired model building feature set; Based on the weight parameter value, sampling the model building features in the model building feature set; The weight parameter values corresponding to the sampled model construction features are added to the preset loss function to construct the feature selection model.
5. The commodity recommendation method according to claim 2, It is characterized in that The feature processing result includes a user feature fusion result and a product word embedding vector, and the step of performing feature transformation processing and feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network to obtain the feature processing result includes: Performing feature transformation processing and feature fusion processing on the target user feature matrix through the dynamic feature screening network to generate a user feature fusion result; The target product feature matrix is subjected to feature transformation processing and feature fusion processing through the dynamic feature screening network to generate a product word embedding vector.
6. The commodity recommendation method according to claim 2, It is characterized in that The step of performing feature transformation processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network includes: Performing word embedding mapping on the target user feature matrix to obtain a user feature embedding matrix, and performing word embedding mapping on the target product feature matrix to obtain a product feature embedding matrix; The user feature embedding matrix is linearly mapped through a predefined first linear mapping matrix to obtain a user feature transformation matrix, and the product feature embedding matrix is linearly mapped through a predefined second linear mapping matrix to obtain a product feature transformation matrix.
7. The commodity recommendation method according to claim 6, It is characterized in that The step of performing feature fusion processing on the target user feature matrix and the target product feature matrix through the dynamic feature screening network includes: Calculating weight values corresponding to user features based on the user feature transformation matrix, and calculating weight values corresponding to product features based on the product feature transformation matrix; A user feature fusion matrix is generated based on the user feature transformation matrix and the weight values of the corresponding user features, and a product feature fusion matrix is generated based on the product feature transformation matrix and the weight values of the corresponding product features.
8. A product recommendation device, It is characterized in that The device comprises: An acquisition module, used to acquire the recommended user characteristics of the recommended user; An input module is used to input the features of the user to be recommended into a pre-trained dual-tower recommendation model to generate a word embedding vector of the user to be recommended, wherein the dual-tower recommendation model is trained based on a preset dynamic feature screening network to perform feature transformation and feature fusion on a pre-acquired target user feature matrix and a target product feature matrix; The recommendation module is used to select a target product word embedding vector that matches the user word embedding vector to be recommended from a pre-configured product word embedding vector retrieval library for product recommendation.
9. A product recommendation device, It is characterized in that The device comprises: a memory, a processor, and a commodity recommendation program stored in the memory and executable on the processor, wherein the commodity recommendation program is configured to implement the steps of the commodity recommendation method according to any one of claims 1 to 7.
10. A storage medium, It is characterized in that The storage medium stores a product recommendation program, which, when executed by a processor, implements the steps of the product recommendation method according to any one of claims 1 to 7.
Citation Information
Cited By
Commodity recommendation method and system based on double-tower model
CN119444372A
