Product recommendation method, device, non-volatile storage medium and electronic device
By using multiple sub-networks and gating networks in the neural network model, combined with scene labels and historical behavior data, the problem of low accuracy in multi-scene recommendations is solved, and more accurate product recommendations are achieved.
Patent Information
- Application Number
- CN202411972200.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Existing technologies find it difficult to balance the commonalities and differences of scenarios in multi-scenario recommendations, resulting in low recommendation accuracy.
A neural network model is used, which includes multiple sub-networks and gating networks. The sub-network weights are determined by the recommendation scenario labels, and the click-through rate is predicted by combining candidate products and historical behavior data.
It improves the accuracy of product recommendations for users, balances the commonalities and differences between scenarios, and enhances the personalized service capabilities of the recommendation system.
Smart Images

Figure CN119831706B_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, non-volatile storage medium, and electronic device. Background Art
[0002] Multi-scenario recommendation refers to a recommendation system that considers the behavior and interests of users with different characteristics in different scenarios, providing users with accurate and comprehensive product and service recommendations in a more personalized manner. Users with different characteristics can be categorized across multiple dimensions: for example, user activity can be categorized into frequently active users, moderately active users, and inactive users; and geographical location can be categorized into users in different provinces, prefectures, and cities. The term "different scenarios" also encompasses a broad range of scenarios, including whether it is a holiday, whether it is the beginning or end of the month, and the product's business sector. Multi-scenario recommendation methods consider the segmentation of different users in different scenarios to provide precise and personalized recommendations. Currently, mobile applications provide personalized recommendation services to a large number of users. Better services help applications increase user stickiness and gain ecosystem advantages. The industry has proposed and implemented various deep learning-based recommendation methods, which have significantly improved click-through rates. However, with the continuous expansion and segmentation of application scenarios and user groups, the industry has yet to explore the problem of multi-scenario recommendation. The complexity of multi-scenario recommendation lies in the simultaneous similarities and differences between different scenarios and the varying data distribution. If each scene is modeled, the commonalities between scenes may be ignored and multiple models will be difficult to maintain; if the data of all scenes are mixed, it will be difficult to model the differences between scenes, which may result in overfitting in large scenes and underfitting in small scenes.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] Embodiments of the present invention provide a product recommendation method, device, non-volatile storage medium, and electronic device to at least solve the technical problem in the prior art of low accuracy in recommending products to users by considering scenario factors.
[0005] According to one aspect of an embodiment of the present invention, a product recommendation method is provided, comprising: obtaining candidate product data to be recommended to a target account, and historical behavior data of the target account; determining a recommendation scenario label based on the category to which the candidate product in the candidate product data belongs; inputting the candidate product data, the historical behavior data, and the recommendation scenario features into a pre-trained neural network model, and having the neural network model predict a click-through rate corresponding to the candidate product data, wherein the neural network model comprises a plurality of subnetworks and a gating network, the plurality of subnetworks respectively outputting an initial click-through rate based on the candidate product data and the historical behavior data, the gating network being used to determine the respective weights of the plurality of subnetworks based on the recommendation scenario label, and the click-through rate corresponding to the candidate product data being jointly determined by the initial click-through rates outputted by the plurality of subnetworks and the respective weights of the plurality of subnetworks.
[0006] Optionally, the candidate product data, historical behavior data and recommendation scenario labels are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data, including: inputting the candidate product data and historical behavior data into a feature extraction module included in the neural network model, and the feature extraction model outputs common features; inputting the common features into multiple sub-networks respectively, and the multiple sub-networks respectively output initial click-through rates; inputting the recommendation scenario labels into a gating network, and the gating network outputs the weights of each of the multiple sub-networks; and determining the click-through rate corresponding to the candidate product data based on the initial click-through rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
[0007] Optionally, the recommended scenario label is input into the gating network, and the gating network outputs the weights of each of the multiple sub-networks, including: obtaining the account portrait features of the target account; generating scenario features based on the account portrait features and the recommended scenario label; inputting the scenario features into the gating network, and the gating network outputs the weights of each of the multiple sub-networks.
[0008] Optionally, the scene features are input into the gating network, and the gating network outputs the weights of the respective sub-networks, including: matching the scene features with a plurality of pre-set pre-stored scene features; determining the similarity between the plurality of pre-stored scene features and the scene features; determining the weights of the respective pre-stored scenes based on the similarity between the plurality of pre-stored scene features and the scene features; inputting the weights of the respective pre-stored scenes into the gating network, and the gating network outputs the weights of the respective sub-networks.
[0009] Optionally, the candidate product data and historical behavior data are input into a feature extraction module included in a neural network model, and the feature extraction model outputs common features, including: inputting the historical behavior data into a long short-term memory network included in the feature extraction module, and the long short-term memory network outputs behavior features; performing feature extraction on the candidate product sequence to obtain product features; inputting the behavior features and product features into an attention network included in the feature extraction module, and the attention network outputs common features.
[0010] According to another aspect of an embodiment of the present invention, a product recommendation device is provided, including: an acquisition module for acquiring candidate product data recommended to a target account, and historical behavior data of the target account; a determination module for determining a recommendation scenario label based on the category to which the candidate product in the candidate product data belongs; a prediction module for inputting the candidate product data, historical behavior data, and recommendation scenario features into a pre-trained neural network model, and the neural network model predicts a click-through rate corresponding to the candidate product data, wherein the neural network model includes multiple sub-networks and a gating network, and the multiple sub-networks respectively output initial click-through rates based on the candidate product data and the historical behavior data, and the gating network is used to determine the respective weights of the multiple sub-networks based on the recommendation scenario label, and the click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by each of the multiple sub-networks and the respective weights of the multiple sub-networks.
[0011] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executed by any one of the product recommendation methods.
[0012] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the product recommendation methods.
[0013] According to yet another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, which implements any one of the above-mentioned product recommendation methods when executed by a processor.
[0014] In an embodiment of the present invention, candidate product data recommended to a target account and the target account's historical behavior data are obtained; a recommendation scenario label is determined based on the category to which the candidate product belongs in the candidate product data; the candidate product data, historical behavior data, and recommendation scenario features are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data. The neural network model includes multiple subnetworks and a gating network, and the multiple subnetworks each output an initial click-through rate based on the candidate product data and historical behavior data. The gating network is used to determine the weights of the multiple subnetworks based on the recommendation scenario label. The click-through rate corresponding to the candidate product data is determined by the initial click-through rates output by the multiple subnetworks and the weights of the multiple subnetworks. This solves the technical problem of low accuracy in recommending products to users based on scenario factors in the prior art, thereby achieving the technical effect of improving the accuracy of product recommendations for users. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 This is a flowchart of a product recommendation method provided by an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of a product recommendation device provided according to an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] According to an embodiment of the present invention, an embodiment of a method for recommending products is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0022] Figure 1 is a flow chart of a product recommendation method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0023] Step S102: Acquire candidate product data recommended to the target account and historical behavior data of the target account.
[0024] In this step, based on information such as the products that the user has clicked or browsed in the target application at a certain moment, a candidate list of products to be recommended to the user is determined, and the user's historical browsing, purchasing, searching and other behavioral data are determined.
[0025] Step S104: determining a recommendation scenario label according to the category to which the candidate commodity in the candidate commodity data belongs.
[0026] In this step, the categories of the products in the candidate list of products recommended to the user are determined, and the recommendation scenarios to be used are determined based on the categories.
[0027] In step S106, the candidate product data, historical behavior data, and recommendation scenario features are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data. The neural network model includes multiple sub-networks and a gating network. The multiple sub-networks respectively output initial click-through rates based on the candidate product data and historical behavior data. The gating network is used to determine the weights of the multiple sub-networks based on the recommendation scenario labels. The click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by the multiple sub-networks and the weights of the multiple sub-networks.
[0028] In this step, the candidate product list, the user's historical purchase or browsing behavior data, and the characteristics of the recommendation scenario are input into the trained neural network model. The neural network model can then predict the user's click-through rate for the products in the candidate list. The neural network model consists of two parts: one is a multiple sub-network for preliminarily predicting the initial click-through rate of the candidate products, and the other is a gating network that assigns weights to these initial click-through rates. Based on the initial click-through rates of the candidate products and the corresponding weights, the final click-through rate of the candidate products can be obtained.
[0029] In an optional embodiment, candidate product data, historical behavior data, and recommendation scenario labels are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data, including: inputting the candidate product data and historical behavior data into a feature extraction module included in the neural network model, and the feature extraction model outputs common features; inputting the common features into multiple sub-networks respectively, and the multiple sub-networks respectively output initial click-through rates; inputting the recommendation scenario labels into a gating network, and the gating network outputs the weights of each of the multiple sub-networks; and determining the click-through rate corresponding to the candidate product data based on the initial click-through rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
[0030] Optionally, common features are input into multiple sub-networks, and each sub-network will output an initial click-through rate. After obtaining the initial click-through rate output by each sub-network, a weight is assigned to each initial click-through rate through the gating network, and the final click-through rate can be obtained by multiplying the initial click-through rate and the corresponding weight. The click-through rate is defined by the following steps: combing and constructing the details of the user's behavior link within the terminal. Assume that a user behavior includes: the user is exposed to a certain content on a certain page or point of the application at a certain moment, and interacts or does not interact. Record each user's behavior and sort it by time to construct the user's behavior link details. Mark the location set as I, the product set as J, assign an index to each location and product, and represent them with a vector of dimension k. Therefore, a parameter matrix of dimension (|I|+|J|)×k can be initialized Where R represents a set of real numbers, and the parameter matrix is initialized using a standard normal distribution.
[0031] Based on the detailed data of user behavior links, extract the user's history of nearly T history The user behavior vector sequence for each day is composed of exposure position + exposure product + click + conversion. For example, if a user is exposed at position i and clicks on product j, but no transaction conversion occurs, a behavior vector b is represented as follows. Embedding(i) and Embedding(j) are corresponding vectors extracted from the parameter matrix, with 1 representing a click and 0 representing no conversion.
[0032] b=[Embedding(i),Embedding(j),1,0] T ∈R (2k+2)×1 .
[0033] The behavior link details of a user, totaling m behaviors, are expressed as above to obtain the user behavior sequence:
[0034] B=[b1,b2,…b m ]∈R d×m , let d = 2k + 2.
[0035] Among them, b1, b2, ... b m They represent different behavior vectors respectively.
[0036] Based on the future T future Positive and negative samples are constructed based on visit and transaction behaviors at various locations during the day. A positive click sample is an exposure that resulted in a click, recorded as 1, while a negative click sample is an exposure that resulted in no click, recorded as 0. Conversion positive and negative samples are derived from the click sample. A positive conversion sample is a click that resulted in a conversion, recorded as 1, while a negative conversion sample is a click that resulted in no conversion, recorded as 0.
[0037] In an optional embodiment, the recommended scenario label is input into the gating network, and the gating network outputs the weights of each of the multiple sub-networks, including: obtaining the account portrait features of the target account; generating scenario features based on the account portrait features and the recommended scenario label; inputting the scenario features into the gating network, and the gating network outputs the weights of each of the multiple sub-networks.
[0038] Optionally, user-specific portrait features and scenario labels are combined to jointly determine the weights of multiple sub-networks. In addition to the basic information of users that are usually predicted, user portrait features can also include discrete label features that are strongly related to business scenarios, such as user value, activity level, membership level, etc. Scenario labels include the business category to which the product belongs. User portrait labels contain features of users of different qualities, and scenario labels reflect the contextual semantics and situations when users interact with recommended products. The two types of labels are used as scenario features S in addition to the user behavior sequence B for subsequent scenario information injection. Let n user portrait labels and scenario labels be [s1, s2,…, s n ], and then mapped to a k-dimensional vector sequence and linearly mapped and straightened to obtain the scene feature S:
[0039] S=Flatten(W s Embedding([s1,s2,…,s n ]))∈R kn×1
[0040] Among them, W s ∈Rk×k It is a trainable parameter matrix, and the Flatten function flattens the original k×n matrix into a kn×1 vector.
[0041] While preparing features, perform pruning operations simultaneously, discarding some user behavior details and labels. For example, locations with too few clicks, such as those with fewer than a set threshold for all users in the past 30 days, can be excluded. Furthermore, based on prior domain knowledge, some meaningless access behaviors can be excluded, such as pages where users enter passwords or refresh pages. This pruning operation can further reduce noise data and memory usage. The scenario features are then fed into the gating network, which outputs the weights corresponding to each subnetwork.
[0042] In an optional embodiment, scene features are input into a gating network, and the gating network outputs the weights of each of the multiple sub-networks, including: matching the scene features with a plurality of pre-set pre-stored scene features; determining the similarity between the plurality of pre-stored scene features and the scene features; determining the weights of each of the plurality of pre-stored scenes based on the similarity between the plurality of pre-stored scene features and the scene features; inputting the weights of each of the plurality of pre-stored scenes into the gating network, and the gating network outputs the weights of each of the multiple sub-networks.
[0043] Optionally, the obtained scene features contain the qualitative differences of users and scene difference knowledge, which are used to model user interaction habits in different situations. Therefore, by calculating the cosine similarity between different scene features, we can find the knowledge that the scene has in common with similar scenes but is different from other scenes. Specifically, let the set of all scene features be {S1, S2, ..., S N}, then for the i-th scene S i , calculate the cosine similarity of other scenes (including the i-th scene itself) in turn: After adding standard normal distribution noise, we extract the K most similar scenes and perform a Softmax operation. These weights are used as weights for each scene, with values between [0, 1] and a sum of 1. These weights are then used for subsequent expert network gating (i.e., the gated network). The Softmax operation normalizes the weights to ensure that they are between [0, 1] and that the sum of all weights is 1. For any i-th scene, the weight of the j-th scene is calculated as follows:
[0044] w i =Softmax(TopK(H(Sim(S i )),K))∈R 1×N
[0045] Sim(S i )=[Sim(S i ,S1),Sim(S i,S2),…,Sim(S i ,S N )]∈R 1×N
[0046] H(x)=x+StandardNormal()∈R 1×N
[0047]
[0048] Among them, w i Represents weight, TopK function represents the selection of K values with the highest similarity, H(x) represents a function, which adds a vector randomly drawn from the standard normal distribution to the input vector x. It is often used to introduce noise to increase the generalization ability of the model or avoid overfitting. Sim represents the similarity function, and StandardNormal represents standard normal noise.
[0049] Set up a total of N+1 expert networks (multiple sub-networks), denoted as Among them, E0 is shared by all scenes to learn the common knowledge between scenes, E1 to E N Each expert network, corresponding to 1 to N scenarios, has exclusive access to knowledge about the corresponding and similar scenarios, as compared to other scenarios. The smaller K, the more diverse the knowledge learned by each expert network. The larger K, the more common the knowledge learned by each expert network. When K = N, all expert networks share knowledge from all scenarios.
[0050] Structurally, each expert network is a three-layer feedforward network that takes as input a shared user feature representation and outputs a user feature representation influenced by specific scenario knowledge. The computational process is as follows:
[0051]
[0052] Among them, f MLP represents an independent expert network for each parameter, F is the shared user feature representation, and E iThe corresponding expert network outputs the user feature representation under the specific scenario knowledge. The mapping matrix of the expert network in terms of parameters is initialized by Kaiming, and batch normalization is performed before ReLU activation. The batch normalization parameter γ conforms to the standard normal distribution initialization, and β is initialized to 0. Kaiming initialization is a method used for weight initialization in deep learning. Kaiming initialization is mainly aimed at neural network layers that use the ReLU (Rectified Linear Unit) activation function. The characteristic of the ReLU activation function is that it sets all input values less than 0 to 0, which may cause the gradient of some weights in the forward propagation of the network to be 0, so that these weights will not be updated during the back propagation process. Kaiming initialization reduces the occurrence of this problem by matching the distribution of network weights with the ReLU activation function.
[0053] Since multiple experts simultaneously estimate the click-through rate and conversion rate of each product, it is necessary to consider how to reasonably balance the weights of the various expert predictions, ultimately outputting the estimated scores for click-through rate and conversion rate from all expert networks in the form of a weighted sum. The scene similarity obtained in the previous steps is used to activate the corresponding expert network and serves as the weight for the expert network's output results. The calculation formula is as follows:
[0054] E=E0+[E1,…,E N ]w T =[E0,E1,…,E N ][1,w] T ∈R d×1
[0055] Only similar scenarios have non-zero weights that sum to 1. Expert networks with weights of 0 are not activated and do not participate in forward computation or backward propagation. E represents the user feature representation infused with differentiated and shared scenario knowledge, and w represents the N unique expert weights.
[0056] In an optional embodiment, the candidate product data and historical behavior data are input into a feature extraction module included in a neural network model, and the feature extraction model outputs common features, including: inputting the historical behavior data into a long short-term memory network included in the feature extraction module, and the long short-term memory network outputs behavior features; performing feature extraction on the candidate product sequence to obtain product features; inputting the behavior features and product features into an attention network included in the feature extraction module, and the attention network outputs common features.
[0057] Optionally, a bidirectional long short-term memory network structure is used to encode the user's behavior sequence. Input the vector sequence B corresponding to the user's behavior, and use the long short-term memory network to capture the contextual semantic association of the user's behavior and the user's interest point offset. The user's behavior vector sequence is recorded as B = [b1, b2, ... b m ]∈R d×m , m is the number of user behaviors, and d is the dimension of the behavior vector. The calculation formula is as follows:
[0058] B ′ =f Bi-LSTM (B)=0b1 ′ ,b2 ′ ,…b m ′ 1∈R d×m
[0059] As a serial time series model, the bidirectional LSTM network structure suffers from long-distance dependency issues. If the user behavior sequence is too long, the LSTM network will have difficulty capturing the relationship between two behaviors that are far apart. Self-attention can avoid this problem. The self-attention calculation formula is as follows:
[0060]
[0061] Where R represents the set of real numbers, W q 、W k 、W v represents the weight matrix in the linear transformation, used to convert the input matrix B' into the query matrix Q, key matrix K, and value matrix V. These weight matrices are updated during training via the backpropagation algorithm to adapt to the needs of different tasks. A represents the attention weight matrix, and B' represents the final output matrix, which represents the feature representation matrix obtained by reweighting each element in the sequence based on its relevance to other elements in the sequence. The dimension is d × m.
[0062] The vector of each candidate target product j is linearly mapped to Q. The user behavior feature sequence is linearly mapped to obtain K and V. Then, attention calculation is performed to fully capture the correlation information between historical behavior and the current target product to be recommended, completing the deep encoding of user behavior features. The calculation method is as follows to obtain the final user feature representation F:
[0063]
[0064] Among them, W k' and W v' These two weight matrices are used to convert the feature representation matrix B' of the user behavior sequence into the key matrix K B” Sum matrix V B”, where K B” and V B” They are used to store contextual information and actual information associated with user behavior and recommended products respectively. Denotes the bond matrix K B” dimensional size. F represents the final attention output, which is a matrix that integrates the user behavior sequence and the recommended product association information, with a dimension of d×1. In an optional embodiment, the neural network model is trained in the following manner: obtaining training samples, wherein the training samples include sample candidate product data recommended for the sample account, sample historical behavior data of the sample account, sample recommendation scenario features, and the click-through rate of the sample account for the sample candidate product; using the training samples, the neural network model is trained with the goal of minimizing a pre-set loss function, wherein the loss function is determined according to the difference between the click-through rate of the sample candidate product output by the neural network model and the click-through rate of the sample account for the sample candidate product.
[0065] Optionally, after obtaining the user feature representation injected with scene knowledge, it will be input into small feedforward networks of different tasks to complete different downstream tasks such as click-through rate estimation and conversion rate estimation. That is, the small network for binary click estimation is MLP ctr , the small network for binary conversion estimation is MLP cvr , the final output numerical results are as follows:
[0066]
[0067]
[0068] pCTCVR=pCTR*pCVR
[0069] in, Indicates the use of MLP ctr The network's function for estimating click rate for input E. f(MLP ctr ) is an MLP ctr The forward propagation function of the network takes the user feature representation E as input and outputs the predicted click-through rate value pCTR. Indicates the use of MLP cvr The network estimates the conversion rate of input E. f(MLP cvr ) is an MLP cvr The forward propagation function of the network takes the user feature representation E as input and outputs the predicted conversion rate value pCVR.
[0070] For the user's click-through rate and conversion rate estimates for each product output by the model, binary cross entropy is used to calculate the loss between the actual situation of whether the user clicked / converted and the estimated value:
[0071] lctr =-CTRlog(pCTR)-(1-CTR)log(1-pCTR)
[0072] l ctcvr =-CTCVRlog(pCTCVR)-(1-CTCVR)log(1-pCTCVR)
[0073] where l ctr and l ctcvr The CTR and CVR are the losses in click-through rate and conversion rate, respectively. CTR∈{0,1} represents the actual status of whether a user clicked, with 0 indicating no click and 1 indicating a click. Similarly, CTCVR=CTR*CVR∈{0,1} represents whether a user clicked and converted a transaction.
[0074] Sparse expert networks can cause load imbalance, meaning only a few experts are consistently selected. A common approach is to add an auxiliary loss to balance expert utilization. This method directly selects experts based on scene similarity, so it goes a step further than existing methods by adding a boundary loss based on similar and dissimilar scenes to capture the differences between scenes. This allows each target scene to correspond to different similar scenes, avoiding the problem of some experts always being activated. The boundary loss is calculated as follows:
[0075]
[0076] For the i-th scenario, min j∈topk(i) (Sim(S i ,S j )) is the minimum similarity value of similar scenes. is the maximum similarity of scenes that are not similar to it. In other words, the loss function is sensitive to the prior K value and requires that the boundary between similar scenes and dissimilar scenes is close to the preset hyperparameter m. m takes values [0,1], and when it is 0, l margin Also 0.
[0077] In summary, the overall loss function of this scheme is as follows:
[0078] Loss = αl ctr +βl ctcvr +λl margin
[0079] α and β are task-related hyperparameters that control the task emphasis during model optimization. λ is used to adjust the utilization of sparse experts.
[0080] Specifically, the example process is as follows:
[0081] The user's historical behavior data range is empirically taken as the historical behavior of the past 32 days, that is, T history =32.
[0082] The positive sample data range of user behavior is empirically taken as the behavior in the next 7 days, that is, T future =7.
[0083] The usage characteristics are shown in Table 1.
[0084] Table 1: Usage characteristics table
[0085]
[0086] The dimension of the initialization vector is empirically set to 32. The dimension d of the user and scene feature representations is empirically set to 256. The number of expert networks, K, is empirically set to 3. The maximum scene margin, m, is empirically set to 0.4. The loss hyperparameters, α, β, and λ, are empirically set to α = β = 0.5 and λ = 0.1. The sample loss is empirically defined as binary cross entropy. Adam is empirically used as the optimizer, with a learning rate of 1e-4 and an l2 regularization coefficient of 4e-5.
[0087] Adam is a gradient-based optimization algorithm that combines momentum optimization with adaptive learning rate features. It is suitable for training neural networks and deep learning models, effectively adjusting the learning rate and adaptively adjusting the step size of parameter updates during training.
[0088] In an embodiment of the present invention, candidate product data recommended to a target account and the target account's historical behavior data are obtained; a recommendation scenario label is determined based on the category to which the candidate product belongs in the candidate product data; the candidate product data, historical behavior data, and recommendation scenario features are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data. The neural network model includes multiple subnetworks and a gating network, and the multiple subnetworks each output an initial click-through rate based on the candidate product data and historical behavior data. The gating network is used to determine the weights of the multiple subnetworks based on the recommendation scenario label. The click-through rate corresponding to the candidate product data is determined by the initial click-through rates output by the multiple subnetworks and the weights of the multiple subnetworks. This solves the technical problem of low accuracy in recommending products to users based on scenario factors in the prior art, thereby achieving the technical effect of improving the accuracy of product recommendations for users.
[0089] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation manner.
[0090] Step S1: Obtain candidate product data recommended to a target account and historical behavior data of the target account.
[0091] Optionally, based on information such as products clicked or browsed by the user in the target application at a certain moment, a candidate list of a series of products recommended to the user is determined, and the user's historical browsing, purchasing, searching and other behavioral data is determined.
[0092] Step S2: Determine a recommendation scenario label based on the category to which the candidate product in the candidate product data belongs.
[0093] Optionally, the categories to which the commodities in the candidate list of a series of commodities recommended to the user belong are determined, and the recommendation scenario to be used is determined based on the categories.
[0094] In step S3, the candidate product data, historical behavior data, and recommendation scenario features are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data. The neural network model includes multiple sub-networks and a gating network. The multiple sub-networks respectively output initial click-through rates based on the candidate product data and historical behavior data. The gating network is used to determine the weights of the multiple sub-networks based on the recommendation scenario labels. The click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by the multiple sub-networks and the weights of the multiple sub-networks.
[0095] Optionally, the candidate product list, user behavior data such as past purchases or browsing history, and recommendation scenario characteristics are fed into a trained neural network model. The neural network model can then predict the user's click-through rate for the products on the candidate product list. The neural network model consists of two parts: one is a multiple sub-network for preliminarily predicting the initial click-through rate of the candidate products, and the other is a gating network that assigns weights to these initial click-through rates. Based on the initial click-through rates of the candidate products and the corresponding weights, the final click-through rate of the candidate products can be determined.
[0096] Step S31, inputting the candidate product data, historical behavior data and recommendation scenario labels into a pre-trained neural network model, and having the neural network model predict the click-through rate corresponding to the candidate product data, including: inputting the candidate product data and historical behavior data into a feature extraction module included in the neural network model, and having the feature extraction model output common features; inputting the common features into multiple sub-networks respectively, and having the multiple sub-networks output initial click-through rates respectively; inputting the recommendation scenario labels into a gating network, and having the gating network output the weights of each of the multiple sub-networks; and determining the click-through rate corresponding to the candidate product data based on the initial click-through rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
[0097] Optionally, common features are input into multiple sub-networks, and each sub-network will output an initial click-through rate. After obtaining the initial click-through rate output by each sub-network, a weight is assigned to each initial click-through rate through the gating network, and the final click-through rate can be obtained by multiplying the initial click-through rate and the corresponding weight. The click-through rate is defined by the following steps: combing and constructing the details of the user's behavior link within the terminal. Assume that a user behavior includes: the user is exposed to a certain content on a certain page or point of the application at a certain moment, and interacts or does not interact. Record each user's behavior and sort it by time to construct the user's behavior link details. Mark the location set as I, the product set as J, assign an index to each location and product, and represent them with a vector of dimension k. Therefore, a parameter matrix of dimension (|I|+|J|)×k can be initialized Where R represents a set of real numbers, and the parameter matrix is initialized using a standard normal distribution.
[0098] Based on the detailed data of user behavior links, extract the user's history of nearly T history The user behavior vector sequence for each day is composed of exposure position + exposure product + click + conversion. For example, if a user is exposed at position i and clicks on product j, but no transaction conversion occurs, a behavior vector b is represented as follows. Embedding(i) and Embedding(j) are corresponding vectors extracted from the parameter matrix, with 1 representing a click and 0 representing no conversion.
[0099] b=[Embedding(i),Embedding(j),1,0] T ∈R (2k+2)×1 .
[0100] The behavior link details of a user, totaling m behaviors, are expressed as above to obtain the user behavior sequence:
[0101] B=[b1,b2,…b m ]∈R d×m , let d = 2k + 2.
[0102] Among them, b1, b2, ... b m They represent different behavior vectors respectively.
[0103] Based on the future T future Positive and negative samples are constructed based on visit and transaction behaviors at various locations during the day. A positive click sample is an exposure that resulted in a click, recorded as 1, while a negative click sample is an exposure that resulted in no click, recorded as 0. Conversion positive and negative samples are derived from the click sample. A positive conversion sample is a click that resulted in a conversion, recorded as 1, while a negative conversion sample is a click that resulted in no conversion, recorded as 0.
[0104] Step S32: Input the recommended scenario label into the gating network, and the gating network outputs the weights of the respective sub-networks, including: obtaining the account portrait features of the target account; generating scenario features based on the account portrait features and the recommended scenario label; inputting the scenario features into the gating network, and the gating network outputs the weights of the respective sub-networks.
[0105] Optionally, user-specific portrait features and scenario labels are combined to jointly determine the weights of multiple sub-networks. In addition to the basic information of users that are usually predicted, user portrait features can also include discrete label features that are strongly related to business scenarios, such as user value, activity level, membership level, etc. Scenario labels include the business category to which the product belongs. User portrait labels contain features of users of different qualities, and scenario labels reflect the contextual semantics and situations when users interact with recommended products. The two types of labels are used as scenario features S in addition to the user behavior sequence B for subsequent scenario information injection. Let n user portrait labels and scenario labels be [s1, s2,…, s n ], and then mapped to a k-dimensional vector sequence and linearly mapped and straightened to obtain the scene feature S:
[0106] S=Flatten(W s Embedding([s1,s2,…,s n ]))∈R kn×1
[0107] Among them, W s ∈R k×k It is a trainable parameter matrix, and the Flatten function flattens the original k×n matrix into a kn×1 vector.
[0108] While preparing features, perform pruning operations simultaneously, discarding some user behavior details and labels. For example, locations with too few clicks, such as those with fewer than a set threshold for all users in the past 30 days, can be excluded. Furthermore, based on prior domain knowledge, some meaningless access behaviors can be excluded, such as pages where users enter passwords or refresh pages. This pruning operation can further reduce noise data and memory usage. The scenario features are then fed into the gating network, which outputs the weights corresponding to each subnetwork.
[0109] Step S33, inputting the scene features into the gating network, and the gating network outputting the weights of the respective sub-networks, including: matching the scene features with a plurality of pre-set pre-stored scene features; determining the similarity between the plurality of pre-stored scene features and the scene features; determining the weights of the respective pre-stored scenes based on the similarity between the plurality of pre-stored scene features and the scene features; inputting the weights of the respective pre-stored scenes into the gating network, and the gating network outputting the weights of the respective sub-networks.
[0110] Optionally, the obtained scene features contain the qualitative differences of users and scene difference knowledge, which are used to model user interaction habits in different situations. Therefore, by calculating the cosine similarity between different scene features, we can find the knowledge that the scene has in common with similar scenes but is different from other scenes. Specifically, let the set of all scene features be {S1, S2, ..., S N}, then for the i-th scene S i , calculate the cosine similarity of other scenes (including the i-th scene itself) in turn: After adding standard normal distribution noise, we extract the K most similar scenes and perform a Softmax operation. These weights are used as weights for each scene, with values between [0, 1] and a sum of 1. These weights are then used for subsequent expert network gating (i.e., the gated network). The Softmax operation normalizes the weights to ensure that they are between [0, 1] and that the sum of all weights is 1. For any i-th scene, the weight of the j-th scene is calculated as follows:
[0111] w i =Softmax(TopK(H(Sim(S i )),K))∈R 1×N
[0112] Sim(S i )=[Sim(S i ,S1),Sim(S i ,S2),…,Sim(S i ,S N )]∈R 1×N
[0113] H(x)=x+StandardNormal()∈R 1×N
[0114]
[0115] Among them, w i Represents weight, TopK function represents the selection of K values with the highest similarity, H(x) represents a function, which adds a vector randomly drawn from the standard normal distribution to the input vector x. It is often used to introduce noise to increase the generalization ability of the model or avoid overfitting. Sim represents the similarity function, and StandardNormal represents standard normal noise.
[0116] Set up a total of N+1 expert networks (multiple sub-networks), denoted as Among them, E0 is shared by all scenes to learn the common knowledge between scenes, E1 to E NEach expert network, corresponding to 1 to N scenarios, has exclusive access to knowledge about the corresponding and similar scenarios, as compared to other scenarios. The smaller K, the more diverse the knowledge learned by each expert network. The larger K, the more common the knowledge learned by each expert network. When K = N, all expert networks share knowledge from all scenarios.
[0117] Structurally, each expert network is a three-layer feedforward network that takes as input a shared user feature representation and outputs a user feature representation influenced by specific scenario knowledge. The computational process is as follows:
[0118]
[0119] Among them, f MLP represents an independent expert network for each parameter, F is the shared user feature representation, and E i The corresponding expert network outputs the user feature representation under the specific scenario knowledge. The mapping matrix of the expert network in terms of parameters is initialized by Kaiming, and batch normalization is performed before ReLU activation. The batch normalization parameter γ conforms to the standard normal distribution initialization, and β is initialized to 0. Kaiming initialization is a method used for weight initialization in deep learning. Kaiming initialization is mainly aimed at neural network layers that use the ReLU (Rectified Linear Unit) activation function. The characteristic of the ReLU activation function is that it sets all input values less than 0 to 0, which may cause the gradient of some weights in the forward propagation of the network to be 0, so that these weights will not be updated during the back propagation process. Kaiming initialization reduces the occurrence of this problem by matching the distribution of network weights with the ReLU activation function.
[0120] Since multiple experts simultaneously estimate the click-through rate and conversion rate of each product, it is necessary to consider how to reasonably balance the weights of the various expert predictions, ultimately outputting the estimated scores for click-through rate and conversion rate from all expert networks in the form of a weighted sum. The scene similarity obtained in the previous steps is used to activate the corresponding expert network and serves as the weight for the expert network's output results. The calculation formula is as follows:
[0121] E=E0+[E1,…,E N ]w T =[E0,E1,…,E N ][1,w] T ∈R d×1
[0122] Only similar scenarios have non-zero weights that sum to 1. Expert networks with weights of 0 are not activated and do not participate in forward computation or backward propagation. E represents the user feature representation infused with differentiated and shared scenario knowledge, and w represents the N unique expert weights.
[0123] Step S34, inputting the candidate product data and historical behavior data into the feature extraction module included in the neural network model, and having the feature extraction model output common features, including: inputting the historical behavior data into the long short-term memory network included in the feature extraction module, and having the long short-term memory network output behavior features; performing feature extraction on the candidate product sequence to obtain product features; inputting the behavior features and product features into the attention network included in the feature extraction module, and having the attention network output common features.
[0124] Optionally, a bidirectional long short-term memory network structure is used to encode the user's behavior sequence. Input the vector sequence B corresponding to the user's behavior, and use LSTM to capture the contextual semantic association of the user's behavior and the user's interest point offset. The user's behavior vector sequence is recorded as B = [b1, b2, ... b m ]∈R d×m , m is the number of user behaviors, and d is the dimension of the behavior vector. The calculation formula is as follows:
[0125] B ′ =f Bi-LSTM (B)=0b1 ′ ,b2 ′ ,…b m ′ 1∈R d×m
[0126] As a serial time series model, the bidirectional LSTM network structure suffers from long-distance dependency issues. If the user behavior sequence is too long, the LSTM network will have difficulty capturing the relationship between two behaviors that are far apart. Self-attention can avoid this problem. The self-attention calculation formula is as follows:
[0127]
[0128] Where R represents the set of real numbers, W q 、W k 、W v represents the weight matrix in the linear transformation, used to convert the input matrix B' into the query matrix Q, key matrix K, and value matrix V. These weight matrices are updated during training via the backpropagation algorithm to adapt to the needs of different tasks. A represents the attention weight matrix, and B' represents the final output matrix, which represents the feature representation matrix obtained by reweighting each element in the sequence based on its relevance to other elements in the sequence. The dimension is d × m.
[0129] The vector of each candidate target product j is linearly mapped to Q. The user behavior feature sequence is linearly mapped to obtain K and V. Then, attention calculation is performed to fully capture the correlation information between historical behavior and the current target product to be recommended, completing the deep encoding of user behavior features. The calculation method is as follows to obtain the final user feature representation F:
[0130]
[0131] Among them, W k' and W v' These two weight matrices are used to convert the feature representation matrix B' of the user behavior sequence into the key matrix K B” Sum matrix V B” , where K B” and V B” They are used to store contextual information and actual information associated with user behavior and recommended products respectively. Denotes the bond matrix K B” dimensional size. F represents the final attention output, which is a matrix that integrates the user behavior sequence and the recommended product association information, with a dimension of d×1. Step S35, the neural network model is trained in the following manner: obtaining training samples, wherein the training samples include sample candidate product data recommended for the sample account, sample historical behavior data of the sample account, sample recommendation scenario features, and the click-through rate of the sample account for the sample candidate product; using the training samples, the neural network model is trained with the goal of minimizing a pre-set loss function, wherein the loss function is determined according to the difference between the click-through rate of the sample candidate product output by the neural network model and the click-through rate of the sample account for the sample candidate product.
[0132] Optionally, after obtaining the user feature representation injected with scene knowledge, it will be input into small feedforward networks of different tasks to complete different downstream tasks such as click-through rate estimation and conversion rate estimation. That is, the small network for binary click estimation is MLP ctr , the small network for binary conversion estimation is MLP cvr , the final output numerical results are as follows:
[0133]
[0134]
[0135] pCTCVR=pCTR*pCVR
[0136] in, Indicates the use of MLP ctr The network's function for estimating click rate for input E. f(MLP ctr) is an MLP ctr The forward propagation function of the network takes the user feature representation E as input and outputs the predicted click-through rate value pCTR. Indicates the use of MLP cvr The network estimates the conversion rate of input E. f(MLP cvr ) is an MLP cvr The forward propagation function of the network takes the user feature representation E as input and outputs the predicted conversion rate value pCVR.
[0137] For the user's click-through rate and conversion rate estimates for each product output by the model, binary cross entropy is used to calculate the loss between the actual situation of whether the user clicked / converted and the estimated value:
[0138] l ctr =-CTRlog(pCTR)-(1-CTR)log(1-pCTR)
[0139] l ctcvr =-CTCVRlog(pCTCVR)-(1-CTCVR)log(1-pCTCVR)
[0140] where l ctr and l ctcvr The CTR and CVR are the losses in click-through rate and conversion rate, respectively. CTR∈{0,1} represents the actual status of whether a user clicked, with 0 indicating no click and 1 indicating a click. Similarly, CTCVR=CTR*CVR∈{0,1} represents whether a user clicked and converted a transaction.
[0141] Sparse expert networks can cause load imbalance, meaning only a few experts are consistently selected. A common approach is to add an auxiliary loss to balance expert utilization. This method directly selects experts based on scene similarity, so it goes a step further than existing methods by adding a boundary loss based on similar and dissimilar scenes to capture the differences between scenes. This allows each target scene to correspond to different similar scenes, avoiding the problem of some experts always being activated. The boundary loss is calculated as follows:
[0142]
[0143] For the i-th scenario, min j∈topk(i) (Sim(S i ,S j )) is the minimum similarity value of similar scenes. is the maximum similarity of scenes that are not similar to it. In other words, the loss function is sensitive to the prior K value and requires that the boundary between similar scenes and dissimilar scenes is close to the preset hyperparameter m. m takes values [0,1], and when it is 0, l margin Also 0.
[0144] In summary, the overall loss function of this scheme is as follows:
[0145] Loss = αl ctr +βl ctcvr +λl margin
[0146] α and β are task-related hyperparameters that control the task emphasis during model optimization. λ is used to adjust the utilization of sparse experts.
[0147] Specifically, the example process is as follows:
[0148] The user's historical behavior data range is empirically taken as the historical behavior of the past 32 days, that is, T history =32.
[0149] The positive sample data range of user behavior is empirically taken as the behavior in the next 7 days, that is, T future =7.
[0150] The usage characteristics are shown in Table 1.
[0151] Table 1: Usage characteristics table
[0152]
[0153] The dimension of the initialization vector is empirically set to 32. The dimension d of the user and scene feature representations is empirically set to 256. The number of expert networks, K, is empirically set to 3. The maximum scene margin, m, is empirically set to 0.4. The loss hyperparameters, α, β, and λ, are empirically set to α = β = 0.5 and λ = 0.1. The sample loss is empirically defined as binary cross entropy. Adam is empirically used as the optimizer, with a learning rate of 1e-4 and an l2 regularization coefficient of 4e-5.
[0154] Adam is a gradient-based optimization algorithm that combines momentum optimization with adaptive learning rate features. It is suitable for training neural networks and deep learning models, effectively adjusting the learning rate and adaptively adjusting the step size of parameter updates during training.
[0155] The above optional implementation achieves at least the following effects: solving the technical problem of low accuracy in recommending products to users considering scenario factors in the prior art, thereby achieving the technical effect of improving the accuracy of recommending products to users.
[0156] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0157] In this embodiment, a product recommendation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation methods, and will not be repeated here. As used below, the terms "module" and "device" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation by hardware, or a combination of software and hardware, is also possible and conceivable.
[0158] According to an embodiment of the present invention, there is also provided an embodiment of a device for implementing a product recommendation method. Figure 2 is a schematic diagram of a product recommendation device according to an embodiment of the present invention. Figure 2 As shown, the above-mentioned product recommendation device includes an acquisition module 21, a determination module 22, and a prediction module 23. The device is described below.
[0159] An acquisition module 21 is configured to receive a detection instruction for performing risk detection on a target business, wherein the detection instruction includes a business type of the target business;
[0160] The determination module 22 is connected to the acquisition module 21 and is used to respond to the detection instruction and display the risk detection characteristics corresponding to the target business according to the predetermined correspondence between the business type and the risk detection characteristics;
[0161] The prediction module 23 is connected to the determination module 22 and is used to receive the selection instruction and determine the selected risk detection feature.
[0162] In a product recommendation device provided by an embodiment of the present invention, an acquisition module is set up to obtain candidate product data recommended to a target account, as well as historical behavior data of the target account; a determination module is used to determine a recommendation scenario label based on the category to which the candidate product belongs in the candidate product data; a prediction module inputs the candidate product data, historical behavior data, and recommendation scenario features into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data, wherein the neural network model includes multiple sub-networks and a gating network, and the multiple sub-networks respectively output initial click-through rates based on the candidate product data and the historical behavior data, and the gating network is used to determine the respective weights of the multiple sub-networks based on the recommendation scenario label, and the click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by the multiple sub-networks and the respective weights of the multiple sub-networks, thereby solving the technical problem in the prior art of low accuracy in recommending products to users considering scenario factors, thereby achieving the technical effect of improving the accuracy of recommending products to users.
[0163] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0164] It should be noted that the acquisition module 21, determination module 22, and prediction module 23 described above correspond to steps S102 to S10 in the embodiment. The examples and application scenarios implemented by these modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that these modules, as part of the device, can be run on a computer terminal.
[0165] It should be noted that the optional or preferred implementation of this embodiment can be found in the relevant description in the embodiment, which will not be repeated here.
[0166] The above-mentioned product recommendation device may also include a processor and a memory. The acquisition module 21, the determination module 22, the prediction module 23, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0167] The processor includes a kernel, which retrieves the corresponding program unit from memory. There can be one or more kernels. Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip.
[0168] An embodiment of the present invention provides a non-volatile storage medium on which a program is stored. When the program is executed by a processor, a product recommendation method is implemented.
[0169] like Figure 3 As shown, an embodiment of the present invention provides an electronic device, the electronic device 10 includes a processor, a memory, and a program stored in the memory and runnable on the processor. When the processor executes the program, the following steps are implemented: the memory is used to store a computer program, wherein, when the computer program is executed by the processor, the processor implements the above-mentioned product recommendation method. The device in this article can be a server, PC, etc.
[0170] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: computer instructions are executed by a processor to perform the above-mentioned product recommendation method.
[0171] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0175] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0176] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0177] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0178] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0179] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0180] The above are merely embodiments of the present invention and are not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.
Claims
1. A product recommendation method, characterized in that: include: Obtaining candidate product data recommended to a target account, as well as historical behavior data of the target account; Determining a recommendation scenario label based on the category to which the candidate product in the candidate product data belongs; The candidate product data, the historical behavior data and the recommendation scenario features are input into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data, wherein the neural network model includes multiple sub-networks and a gating network, and the multiple sub-networks respectively output initial click-through rates based on the candidate product data and the historical behavior data. The gating network is used to determine the weights of each of the multiple sub-networks based on the recommendation scenario label, and the click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
2. The method according to claim 1, characterized in that The step of inputting the candidate product data, the historical behavior data, and the recommendation scenario label into a pre-trained neural network model, and predicting the click-through rate corresponding to the candidate product data by the neural network model, includes: Inputting the candidate product data and the historical behavior data into a feature extraction module included in the neural network model, and having the feature extraction model output common features; Inputting the common features into the multiple sub-networks respectively, and having the multiple sub-networks output initial click-through rates respectively; Inputting the recommended scene label into the gating network, and having the gating network output the weights of each of the multiple sub-networks; The click rate corresponding to the candidate product data is determined according to the initial click rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
3. The method according to claim 2, characterized in that Inputting the recommended scene label into the gating network, and having the gating network output the weights of the multiple sub-networks, includes: Obtaining account profile features of the target account; Generate scenario features based on the account portrait features and the recommended scenario labels; The scene features are input into the gating network, and the gating network outputs the weights of each of the multiple sub-networks.
4. The method according to claim 2, characterized in that Inputting the scene features into the gating network, and having the gating network output the weights of the plurality of sub-networks, comprises: Matching the scene feature with a plurality of pre-set pre-stored scene features; Determining similarities between the plurality of pre-stored scene features and the scene feature; determining weights of the plurality of pre-stored scenes according to similarities between the plurality of pre-stored scene features and the scene feature; The weights of the plurality of pre-stored scenarios are input into the gating network, and the gating network outputs the weights of the plurality of sub-networks.
5. The method according to claim 2, characterized in that The step of inputting the candidate product data and the historical behavior data into a feature extraction module included in the neural network model, and having the feature extraction model output common features, includes: Inputting the historical behavior data into the long short-term memory network included in the feature extraction module, and having the long short-term memory network output behavior features; Extracting features from the candidate product sequence to obtain product features; The behavior features and the product features are input into the attention network included in the feature extraction module, and the attention network outputs the common features.
6. The method according to claim 1, characterized in that The neural network model is trained in the following way: Acquire training samples, wherein the training samples include sample candidate product data recommended for a sample account, sample historical behavior data of the sample account, sample recommendation scenario features, and click-through rates of the sample account for the sample candidate products; The neural network model is trained using the training samples with the goal of minimizing a pre-set loss function, wherein the loss function is determined based on the difference between the click-through rate of the sample candidate products output by the neural network model and the click-through rate of the sample candidate products by the sample accounts.
7. A product recommendation device, characterized in that: include: An acquisition module, configured to acquire candidate product data recommended to a target account and historical behavior data of the target account; a determination module, configured to determine a recommendation scenario label based on the category to which the candidate product in the candidate product data belongs; The prediction module inputs the candidate product data, the historical behavior data and the recommendation scenario features into a pre-trained neural network model, and the neural network model predicts the click-through rate corresponding to the candidate product data, wherein the neural network model includes multiple sub-networks and a gating network, and the multiple sub-networks respectively output initial click-through rates based on the candidate product data and the historical behavior data. The gating network is used to determine the weights of each of the multiple sub-networks based on the recommendation scenario label, and the click-through rate corresponding to the candidate product data is jointly determined by the initial click-through rates output by each of the multiple sub-networks and the weights of each of the multiple sub-networks.
8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the product recommendation method according to any one of claims 1 to 6.
9. A computer device, characterized in that: include: memory and processor, The memory stores a computer program; The processor is configured to execute a computer program stored in the memory, and when the computer program is executed, the processor executes the product recommendation method according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that The computer instructions are executed by a processor to execute the product recommendation method according to any one of claims 1 to 6.