Training method and device of object recommendation model, object recommendation method and device
By introducing feature extraction, interaction, attention network, and prediction network layers into the recommendation model and using user activity data for hierarchical processing, the problem of difficulty in capturing the characteristics of low-activity users is solved, thereby improving the accuracy of the recommendation model and the effect of personalized recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2023-10-08
- Publication Date
- 2026-05-05
AI Technical Summary
Existing recommendation models struggle to effectively capture the characteristics of inactive users during training, resulting in poor recommendation performance.
By introducing a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer, user activity data is used to stratify users, uncover the characteristics of low-activity users, and improve the learning effect for users with different activity levels.
This improved the recommendation model's ability to learn features from inactive users, enhancing the accuracy and personalization of recommendations.
Smart Images

Figure CN117349527B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of artificial intelligence technology, specifically to a training method and apparatus for an object recommendation model, and an object recommendation method and apparatus. Background Technology
[0002] In recommendation scenarios, such as product and image recommendations, recommendation models are widely used to make more accurate recommendations to users. Current recommendation model training methods use user and product data as samples to train the model. During training, the model extracts features from both user and product data, then calculates the matching degree between user and product features. This matching degree represents the degree to which a product is recommended to the user. Finally, a loss is calculated based on the matching degree, and the recommendation model is adjusted accordingly. Summary of the Invention
[0003] In view of the above, embodiments of this specification provide a training method and apparatus for an object recommendation model, and an object recommendation method and apparatus. Through the technical solutions of these embodiments, users are segmented according to activity level, and the correlation between user activity and features is mined. This allows for the capture of features that low-activity users are interested in, thereby improving the feature learning effect for users with different activity levels.
[0004] According to one aspect of an embodiment of this specification, a method for training an object recommendation model is provided, wherein the object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The method includes: obtaining object feature data, user feature data, and user activity data from data including users and objects; training the object recommendation model in the following manner until a training termination condition is met: providing the object feature data and user feature data to the feature interaction layer to obtain cross features; providing the cross features and user activity data to the attention network layer to obtain user attention features, wherein the user attention features are used to represent the degree of attention paid by each user with different activity levels to different cross features; providing the vector features output by the feature extraction layer based on the input object feature data and user feature data, and the user attention features to the prediction network layer to obtain predicted recommended objects for each user; and adjusting the object recommendation model based on a first loss obtained from the predicted recommended objects.
[0005] According to another aspect of the embodiments of this specification, a method for object recommendation using an object recommendation model is also provided. The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The object recommendation model is obtained according to any of the training methods described above. The method includes: acquiring object feature data of an object and user feature data and user activity data of a user to be recommended; and providing the object feature data, user feature data, and user activity data to the object recommendation model to obtain objects recommended for the user to be recommended. Specifically, the feature extraction layer in the object recommendation model processes the input object feature data and user feature data to output vector features; the feature interaction layer processes the input user feature data and object feature data to output cross features; the attention network layer processes the input cross features and user activity data to output user attention features; and the prediction network layer predicts the vector features and the user attention features to output the recommended objects.
[0006] According to another aspect of the embodiments of this specification, an apparatus for training an object recommendation model is also provided, wherein the object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The apparatus includes: a data acquisition unit for acquiring object feature data, user feature data, and user activity data from data including users and objects; and an object recommendation unit for providing the object feature data, user feature data, and user activity data to the object recommendation model to output predicted recommended objects, wherein the object feature data and user feature data are provided to the feature interaction layer to obtain cross features; and the cross features and user activity data are provided to the attention network layer. The system obtains user attention features, which represent the degree of attention paid by users with different activity levels to different cross-features. The feature extraction layer outputs vector features and user attention features based on the input object feature data and user feature data, which are provided to the prediction network layer to obtain the predicted recommended objects for each user. The system also includes a model adjustment unit, which adjusts the object recommendation model based on the first loss obtained from the predicted recommended objects. When the training termination condition is not met, the model adjustment unit triggers the data providing unit to perform the operation of providing object feature data, user feature data, and user activity data to the object recommendation model.
[0007] According to another aspect of the embodiments of this specification, an apparatus for object recommendation using an object recommendation model is also provided. The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The object recommendation model is obtained according to any of the training methods described above. The apparatus includes: a data acquisition unit for acquiring object feature data of an object and user feature data and user activity data of a user to be recommended; and an object recommendation unit for providing the object feature data, user feature data, and user activity data to the object recommendation model to obtain objects recommended for the user to be recommended. The feature extraction layer in the object recommendation model processes the input object feature data and user feature data to output vector features; the feature interaction layer processes the input user feature data and object feature data to output cross features; the attention network layer processes the input cross features and user activity data to output user attention features; and the prediction network layer performs prediction processing on the vector features and user attention features to output the recommended objects.
[0008] According to another aspect of the embodiments of this specification, an electronic device is also provided, comprising: at least one processor, a memory coupled to the at least one processor, and a computer program stored on the memory, wherein the at least one processor executes the computer program to implement the object recommendation model training method or object recommendation method as described above. Attached Figure Description
[0009] A further understanding of the nature and advantages of the embodiments described in this specification can be achieved by referring to the following accompanying drawings. In the drawings, similar components or features may have the same reference numerals.
[0010] Figure 1 A schematic diagram of an example of an object recommendation model according to an embodiment of this specification is shown.
[0011] Figure 2 A flowchart illustrating an example of a method for training an object recommendation model according to embodiments of this specification is shown.
[0012] Figure 3 A schematic diagram illustrating an example of an object recommendation model processing procedure according to an embodiment of this specification is shown.
[0013] Figure 4 A structural diagram of an example attention network layer according to an embodiment of this specification is shown.
[0014] Figure 5 A flowchart illustrating an example of a method for object recommendation using an object recommendation model according to an embodiment of this specification is shown.
[0015] Figure 6 A block diagram illustrating an example of an apparatus for training an object recommendation model according to an embodiment of this specification is shown.
[0016] Figure 7 A block diagram illustrating an example of an apparatus for object recommendation using an object recommendation model according to an embodiment of this specification is shown.
[0017] Figure 8 A block diagram of an electronic device for implementing an object recommendation model training method according to an embodiment of this specification is shown.
[0018] Figure 9 A block diagram of an electronic device for implementing an object recommendation method according to an embodiment of this specification is shown. Detailed Implementation
[0019] The subject matter described herein will be discussed below with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of the embodiments described herein. Various processes or components may be omitted, substituted, or added as needed in the various examples. Furthermore, features described in some examples may be combined in other examples.
[0020] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.
[0021] In recommendation scenarios, such as product and image recommendations, recommendation models are widely used to make more accurate recommendations to users. Current training methods for recommendation models use user and product data as samples. During training, the model extracts features from both user and product data separately, then calculates the matching degree between user and product features. This matching degree represents the degree to which a product is recommended to the user. Finally, a loss is calculated based on the matching degree, and the recommendation model is adjusted accordingly. A more effective training method is urgently needed.
[0022] In view of the above, embodiments of this specification provide a training method and apparatus for an object recommendation model, and an object recommendation method and apparatus. The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. In the training method, object feature data, user feature data, and user activity data are obtained from data including users and objects. The object recommendation model is trained in the following manner until the training termination condition is met: the object feature data and user feature data are provided to the feature interaction layer to obtain cross features; the cross features and user activity data are provided to the attention network layer to obtain user attention features; the vector features output by the feature extraction layer based on the input object feature data and user feature data, as well as the user attention features, are provided to the prediction network layer to obtain the predicted recommended objects for each user; and the object recommendation model is adjusted based on a first loss obtained from the predicted recommended objects. Through the technical solution of the embodiments of this specification, users are segmented according to activity level, and the correlation between user activity and features is mined, thereby capturing the features that low-activity users are interested in, and thus improving the learning effect of features for users with different activity levels.
[0023] The following description, in conjunction with the accompanying drawings, details the training method and apparatus for an object recommendation model, as well as the object recommendation method and apparatus provided in the embodiments of this specification.
[0024] Figure 1 A schematic diagram of an example of an object recommendation model according to an embodiment of this specification is shown.
[0025] The object recommendation model in the embodiments of this specification is used to recommend objects to users, and the recommended objects may include products and coupons. The trained object recommendation model can be applied to a system or platform for presenting objects, such as a shopping website for recommending products to users, or a coupon channel for recommending coupons to users. The coupon channel may be a functional module in an app.
[0026] like Figure 1 As shown, the object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The feature extraction layer extracts features from the input data to output corresponding vector features. For example, a neural network can be used for the feature extraction layer. In one example, the feature extraction layer may include an embedding layer and a feature extraction network layer. The embedding layer converts the input data into an embedding vector representation, and then provides the output embedding vector to the feature extraction network layer. The feature extraction network layer extracts features from the input embedding vector to output the corresponding vector features.
[0027] The feature interaction layer is used to interact with at least two input features to obtain corresponding cross features. In one example, the feature interaction layer may include an embedding layer to convert the input data into an embedding vector representation. Cross features can be used to represent situations where two different features exist simultaneously. For example, the cross features of a user and an object can represent situations that may occur between the user and the object, such as the object being presented to the user or the user clicking on the object.
[0028] Attention network layers can employ attention models to determine the level of attention a user pays to different features. Different users can focus on different features, and furthermore, different users can pay different levels of attention to the same feature.
[0029] The prediction network layer is used to make recommendation predictions based on the input features and output the predicted recommended objects for each user. In one example, the prediction network layer can be composed of neural networks, such as multiple MLPs (Multi-Layer Perceptrons).
[0030] Figure 2 A flowchart of an example 200 of a method for training an object recommendation model according to an embodiment of this specification is shown.
[0031] like Figure 2 As shown in Figure 210, object feature data, user feature data, and user activity data can be obtained from the data.
[0032] In the embodiments of this specification, the data used to train the object recommendation model may include historical data from the system or platform on which the object recommendation model is applied. The object recommendation model is used to recommend objects to users; therefore, the object recommendation model involves users and objects to be recommended, and the data used for training includes user- and object-related data. For example, when the object recommendation model is applied to a consumer voucher channel, the data used to train the object recommendation model may include historical data from the consumer voucher channel, which includes user- and consumer voucher-related data.
[0033] Object feature data related to objects can be obtained from the data used to train the object recommendation model. Different objects can have different features, and the corresponding object feature data can also be different. The object feature data of each object can be used to represent the object's attributes and other characteristics. Object feature data can include at least one of the following: object name, type, price, object identifier, usage scenario, attribute information, and object exposure information. The attribute information of different objects can be different. For example, the attribute information of a product can include batch number, place of origin, production date, and ingredients. The attribute information of a voucher can include the voucher's face value, validity period, and usage restrictions. Usage restrictions can include the stores where the voucher can be used and the time period during which it can be used. Object exposure information can include the frequency, duration, and time period of object exposure, as well as relevant information about the object being presented to each user. The relevant information about the object being presented to each user can include the user information corresponding to the user to whom the object is presented, the frequency, duration, and time period during which the object is presented to each user.
[0034] User characteristic data can be used to characterize users, and different users may have different user characteristic data. User characteristic data may include at least one of the following: user identifier, account name corresponding to the user's account, user activity records on the system or platform, and user interaction data with objects. User activity records may include records of user login, browsing, clicking, and other operations. For example, activity record data may include the duration a user spends browsing an object. User interaction data with objects may include user click and view records, purchase records, and usage records for various objects.
[0035] User activity data can be used to represent a user's activity level on a system or platform used to present an object. This can include user activity logs on the system or platform, and interaction data between the user and the object. In one example, activity logs might include login data indicating that the user logged into the system containing the object. Interaction data might include click data indicating that the user clicked on an object, and action data indicating that the user performed actions on the object. Clicking on an object could indicate that the user clicked to view it; therefore, click data could include viewing duration, click frequency, etc., while action data related to the object could include product purchase data, coupon usage data, etc.
[0036] The more frequently a user's activity is recorded, the higher their activity level; the more frequently a user interacts with objects, the higher their activity level. Higher user activity yields richer user characteristic data, resulting in a more accurate user profile. Conversely, lower user activity results in less user characteristic data, leading to a less accurate user profile.
[0037] In 220, object feature data and user feature data can be provided to the feature interaction layer to obtain cross features.
[0038] In the embodiments of this specification, the feature interaction layer can convert the input object feature data and user feature data into object features and user features represented by embedding vectors, and then interact the object features and user features in the user space and object space to obtain corresponding cross features. For example... Figure 3 As shown, Figure 3 A schematic diagram illustrating an example of an object recommendation model processing procedure according to an embodiment of this specification is shown.
[0039] In the feature interaction layer, object features and user features, represented as vectors, have the same dimension. Object and user features can be multiplied element-wise; that is, the product of corresponding elements in the object and user features can be used as the value of the corresponding element in the cross feature. For example, if the first element in the object feature is e1 and the first element in the user feature is k1, then the product of these two elements can be used as the value of the first element in the cross feature. The resulting cross feature has the same dimension as the object and user features. For example, the object feature can be represented as a vector {e1, e2, ..., e...}. i User features can be represented as vectors {k1, k2, ..., k}. i Then the output cross features can be represented as {e1×k1,e2×k2,…,e i ×k i}
[0040] The cross features output by the feature interaction layer can include multiple features. Each cross feature can represent the feature interaction between a user feature and an object feature, and can represent the situation between the user and the object. This situation includes the interaction between the user and the object, such as no interaction or interaction. When there is interaction, the interaction situation can include the object being exposed to the user, the user clicking on the object, and other operations performed by the user on the object. The interaction situation can also include the co-occurrence of user features and object features. For example, when the user feature is gender and the object feature is a specific product category, the probability of male and video games co-occurring is higher than that of female and video games, while the probability of female and beauty products co-occurring is higher than that of male and beauty products. By perceiving the signal of the co-occurrence of user features and object features, the model can more accurately predict what behavior the user will take towards the object, such as exposure without clicking or exposure and clicking.
[0041] In layer 230, cross-features and user activity data can be provided to the attention network layer to obtain user attention features. Figure 3 The object recommendation model processing procedure is shown.
[0042] In the embodiments of this specification, user attention features can be used to represent the degree of attention paid by users with different activity levels to different cross-features. Different users may have different levels of attention to different features, thus allowing users to be stratified using an attention network. Users can then be processed according to their activity levels, facilitating subsequent training for each level. This enhances the training effect for inactive users. In one example, each user can be considered a level, allowing for separate processing and training for each user.
[0043] In the attention network layer, after segmenting users based on their activity level, the attention level of each user to various cross-features can be calculated, and this attention level can be represented by a score. The higher the score of a user for a cross-feature, the higher the user's attention to that cross-feature. Based on the user's attention to each cross-feature, a weight distribution for each cross-feature can be assigned to that user, and different users can be assigned different weight distributions. Each user's weight distribution can be used to represent that user's attention to each cross-feature.
[0044] In one example, the attention network layer may include a feature extraction sublayer, an attention network sublayer, and a weighted network sublayer. Figure 4 A structural diagram of an example attention network layer according to an embodiment of this specification is shown. The input to the attention network layer includes cross features and user activity data. In the attention network layer, the user activity features corresponding to the user activity data can be used as queries, and the cross features can be used as keys and values.
[0045] During the processing of the attention network layer, user activity data is provided to the feature extraction sublayer. This sublayer extracts features from the input user activity data to output corresponding user activity features. The dimensionality of the user activity features is the same as that of the cross features. Then, the user activity features and cross features are provided to the attention network sublayer. In this sublayer, for each user, the user activity features are multiplied by each cross feature to obtain a corresponding attention score, which represents the user's attention to each cross feature. Different users show different levels of attention to different cross features, resulting in different attention scores.
[0046] The processing procedure of the attention network sublayer can be represented by the following formula:
[0047] α=K T Q = v T g(WE a +b)
[0048] Where α represents the attention score, K T Let Q represent the transpose of the cross feature used as the Key, Q represent the user activity feature used as the Query, v represent one of the cross features, W represent the weight matrix in the attention network sublayer, and E represent the cross feature. a denoted by b, representing user activity characteristics, and g() representing the activation function, which can be similar to the ReLU function.
[0049] For each user, a corresponding attention score can be calculated for each cross-feature. The attention scores for each cross-feature can form a weight distribution assigned to that user. The weight distribution for each user can be used to scale the cross-features used as values. The scaled cross-features can reflect the degree of attention that users pay to each cross-feature.
[0050] Attention scores and cross-features are provided to a weighted network sublayer. This sublayer uses the input attention scores to weight the cross-features, scaling them using the weight distribution of each user to obtain scaled cross-features. These scaled cross-features serve as the user attention features output by the weighted network sublayer. The output user attention features represent the attention given to different cross-features by users with varying activity levels. Based on this, user attention features can guide subsequent prediction network layers to extract more effective information for different users. For example, by using the user attention features to represent the attention given to different cross-features by each user, the prediction network layer can extract features that the user is more interested in—features that are more effective for that user.
[0051] Back Figure 2 In step 240, the vector features output by the feature extraction layer and the user attention features can be provided to the prediction network layer to obtain the predicted recommendation objects for each user. Figure 3 The object recommendation model processing procedure is shown.
[0052] In the embodiments of this specification, the vector features output by the feature extraction layer can be obtained based on the object feature data and user feature data input to the feature extraction layer. The recommended objects output by the prediction network layer in the object recommendation model can include only the recommended objects, or they can include the recommended objects and their corresponding recommendation index, which can be expressed as a percentage. A higher recommendation index indicates a higher recommendation degree. Furthermore, the object recommendation model can output a set of predicted values for each user. Each set of predicted values includes the predicted recommended objects, and the set of predicted values for each user can include each object and its corresponding predicted recommendation index.
[0053] In another example, for each user, after predicting the recommendation index for each object, the prediction network layer can sort the objects according to the recommendation index and output the top N objects and their corresponding recommendation indices as a set of predicted values. N can be a user-defined integer.
[0054] In one example, in addition to acquiring object feature data, user feature data, and user activity data, it's also possible to extract association information feature data related to users and / or objects. Association information feature data can influence the interaction between users and objects; for example, it can have a positive impact, promoting interaction. In one example, association information feature data might include time and location information related to user-object interactions, such as the time or time period when the object was presented to the user, or the time or time period when the user clicked on the object. For example, if a user frequently clicks to view objects during midday, then the user is more active during midday.
[0055] In addition, associated information feature data can also include environmental information during user interaction with objects, such as weather information and the Wi-Fi network information connected to the user's device. For example, on rainy days, users tend to click to view rain gear products.
[0056] In this example, object feature data, user feature data, and association information feature data can be provided to the feature extraction layer to obtain corresponding object vector features, user vector features, and association information vector features. Then, the object vector features, user vector features, association information vector features, and user attention features can be provided to the prediction network layer to obtain the predicted recommended objects for each user.
[0057] In this example, the object recommendation model is trained by adding associated information feature data related to users and / or objects as one of the factors influencing the interaction between users and objects. This allows the object recommendation model to consider the influence of associated information when making recommendations, thereby improving the recommendation accuracy of the object recommendation model.
[0058] At 250, the object recommendation model can be adjusted based on the first loss.
[0059] In one example, the object recommendation model can be adjusted based solely on the first loss, which is derived from the predicted recommended objects. In another example, the first loss can be calculated based on both the predicted recommended objects and the labeled objects. Different predicted recommended objects can be output for different users, and each user can have a corresponding labeled object; the labeled objects can be different for different users.
[0060] In one method of calculating the first loss, for each user, a first sub-loss can be calculated based on the predicted recommended object and label object corresponding to that user. Then, the first sub-losses for each user can be fused to obtain the first loss for that round of training. The fusion process can include averaging, weighted summation, etc.
[0061] In the weighted summation calculation method, weights are assigned to each user based on their activity level; higher activity levels result in lower weights, and lower activity levels in higher weights. The first sub-loss for each user is multiplied by its weight to obtain the weighted first sub-loss. Then, the weighted first sub-losses for all users are averaged to obtain the final first loss. In this calculation method, users with higher weights receive more attention during training, effectively weighting the feature learning of less active users and thus improving the overall recommendation performance across different activity levels.
[0062] In another example, the object recommendation model can be adjusted based on a first loss and other losses. In this example, the first loss is obtained based on the predicted recommended objects and labeled objects. Then, a second loss is obtained based on the user activity features corresponding to the user activity data. The second loss is inversely proportional to user activity; that is, the higher the user activity, the smaller the second loss; the lower the user activity, the larger the second loss.
[0063] In the calculation of the second loss, it can be calculated separately for different users, and the second loss can be different for different users. The second loss can affect the importance of the corresponding user during the training process. The larger the second loss, the more attention the corresponding user and the user's related data (such as user feature data and user activity data) will receive during the training process, thereby strengthening the feature learning of the user corresponding to the larger second loss.
[0064] In one method of calculating the second loss, the second loss can be obtained based on the user activity features corresponding to the user activity data and the variance obtained from the cross features.
[0065] The second loss is inversely proportional to the variance; that is, the larger the variance, the smaller the second loss, and vice versa. The variance obtained from the cross features can represent the degree of data dispersion. Higher user activity corresponds to more dispersed data, and lower user activity corresponds to less dispersed data. Therefore, the higher the degree of data dispersion, the more dispersed and rich the data, and the better the training effect for the corresponding users during model training.
[0066] In this calculation method, the second loss is obtained from the user activity feature and variance, which are inversely proportional to it. For low-activity users, the lower the user activity and the smaller the variance used to represent the dispersion of the data, the larger the second loss is obtained. As a result, low-activity users can be given more attention during the training process, thereby strengthening the learning of features by low-activity users and improving the training effect for low-activity users.
[0067] In one example, the second loss can be obtained according to the following formula:
[0068] loss aux =δ -t / (h(A)+ε)
[0069] Where, loss aux Let δ represent the second loss, t represent the user activity level, ε represent a positive number, A represent the cross features output by the feature interaction layer, and h() represent the variance calculation operation.
[0070] In another method for calculating the second loss, when a batch of data in the input object recommendation model includes multiple users, the second volume loss for each user can be obtained based on their user activity characteristics. That is, each user receives a corresponding second volume loss. Then, these second volume losses can be fused to obtain the overall second loss for the batch of data in the input object recommendation model.
[0071] In one fusion method, the losses of each second entity can be averaged and summed to obtain the average value as the second loss. In another fusion method, the sum of the losses of each second entity can be used as the second loss.
[0072] After obtaining the first and second losses, the object recommendation model can be adjusted based on them. In one example, the sum of the first and second losses can be used as the total loss, and the object recommendation model can then be adjusted based on the total loss. In another example, the sum of the second loss multiplied by a specified coefficient and the first loss can be used as the total loss, and the object recommendation model can then be adjusted based on the total loss.
[0073] Through the above example, a second loss is introduced that is inversely proportional to user activity and the variance obtained from cross features. The second loss can affect the importance of the corresponding user during the training process. The larger the second loss, the more attention the corresponding user and the user's related data can receive during the training process, thereby strengthening the learning of features by users with larger second losses, so as to achieve stratified training for stratified users, thereby improving the overall training effect of the object recommendation model.
[0074] At step 260, a check can be performed to determine if the training termination condition is met. If yes, training of the object recommendation model ends. If no, return to step 220 and execute the operation.
[0075] In the embodiments of this specification, the training termination condition may include at least one of the following conditions: the number of training rounds reaches a specified number of rounds threshold, the training duration reaches a specified duration threshold, and the loss is less than a specified loss threshold.
[0076] Figure 5 A flowchart of an example 500 of a method for object recommendation using an object recommendation model according to an embodiment of this specification is shown.
[0077] The object recommendation model used may include a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. Figure 5 The object recommendation model in the illustrated embodiment can be obtained by the object recommendation model training method provided in the embodiments of this specification.
[0078] like Figure 5 As shown in Figure 510, the object feature data of the object, as well as the user feature data and user activity data of the user to be recommended, are obtained.
[0079] In 520, object feature data, user feature data, and user activity data can be provided to the object recommendation model.
[0080] In the 530 object recommendation model, the feature extraction layer can process the input object feature data and user feature data to output vector features.
[0081] In 540, the feature interaction layer can process the input user feature data and object feature data to output cross features.
[0082] In 550, the attention network layer can process the input cross features and user activity data to output user attention features.
[0083] In the 560, the prediction network layer can predict vector features and user attention features to output the objects recommended to the user to be recommended.
[0084] Figure 6 A block diagram of an example of an apparatus (hereinafter referred to as model training apparatus 600) for training an object recommendation model according to an embodiment of this specification is shown.
[0085] The object recommendation model used by the model training device 600 includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. For example... Figure 6 As shown, the model training device 600 includes a data acquisition unit 610, an object recommendation unit 620, and a model adjustment unit 630.
[0086] The data acquisition unit 610 can be configured to acquire object feature data, user feature data, and user activity data from data including users and objects.
[0087] The object recommendation unit 620 can be configured to provide object feature data, user feature data, and user activity data to the object recommendation model to output predicted recommended objects. Specifically, the object feature data and user feature data are provided to a feature interaction layer to obtain cross features; the cross features and user activity data are provided to an attention network layer to obtain user attention features, which represent the degree of attention paid by users with different activity levels to different cross features; the vector features output by the feature extraction layer based on the input object feature data and user feature data, along with the user attention features, are provided to a prediction network layer to obtain predicted recommended objects for each user; and
[0088] The model tuning unit 630 can be configured to tune the object recommendation model based on a first loss obtained from the predicted recommended objects. Specifically, when the training termination condition is not met, the model tuning unit triggers the data providing unit to provide object feature data, user feature data, and user activity data to the object recommendation model.
[0089] In one example, the model adjustment unit 630 can also be configured to: obtain a first loss based on the predicted recommended objects and labeled objects; obtain a second loss based on the user activity features corresponding to the user activity data, wherein the second loss is inversely proportional to the user activity; and adjust the object recommendation model based on the first loss and the second loss.
[0090] In one example, the data acquisition unit 610 can also be configured to: acquire association information feature data related to users and / or objects from the data. The object recommendation unit can also be configured to: provide object feature data, user feature data, and association information feature data to the feature extraction layer to obtain corresponding object vector features, user vector features, and association information vector features; and provide object vector features, user vector features, association information vector features, and user attention features to the prediction network layer to obtain the predicted recommended objects for each user.
[0091] Figure 7 A block diagram of an example of an apparatus (hereinafter referred to as object recommendation apparatus 700) for recommending objects using an object recommendation model according to an embodiment of this specification is shown.
[0092] The object recommendation model used by the object recommendation device 700 includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. This object recommendation model can be obtained according to the training method provided in the embodiments of this specification.
[0093] like Figure 7 As shown, the object recommendation device 700 may include a data acquisition unit 710 and an object recommendation unit 720.
[0094] The data acquisition unit 710 can be configured to acquire object feature data of the object, as well as user feature data and user activity data of the user to be recommended.
[0095] The object recommendation unit 720 can be configured to provide object feature data, user feature data, and user activity data to the object recommendation model to output objects recommended to the user. The object recommendation model includes a feature extraction layer that processes the input object feature data and user feature data to output vector features; a feature interaction layer that processes the input user feature data and object feature data to output cross features; an attention network layer that processes the input cross features and user activity data to output user attention features; and a prediction network layer that performs prediction processing on the vector features and user attention features to output the recommended objects.
[0096] Reference above Figures 1 to 7 The present specification describes a training method and apparatus for an object recommendation model, and embodiments thereof.
[0097] The training device and object recommendation device of the object recommendation model in the embodiments of this specification can be implemented in hardware, software, or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by the processor of the device loading the corresponding computer program instructions from the memory into memory and running them. In the embodiments of this specification, the training device and object recommendation device of the object recommendation model can be implemented, for example, using electronic devices.
[0098] Figure 8 A block diagram of an electronic device 800 for implementing an object recommendation model training method according to an embodiment of this specification is shown.
[0099] like Figure 8 As shown, the electronic device 800 may include at least one processor 810, a memory (e.g., non-volatile memory) 820, a RAM 830, and a communication interface 840, and the at least one processor 810, memory 820, RAM 830, and communication interface 840 are connected together via a bus 850. The at least one processor 810 executes at least one computer-readable instruction (i.e., the elements implemented in software above) stored or encoded in the memory.
[0100] In one embodiment, computer-executable instructions are stored in memory, which, when executed, cause at least one processor 810 to: acquire object feature data, user feature data, and user activity data from data including users and objects; train an object recommendation model until a training termination condition is met by: providing the object feature data and user feature data to a feature interaction layer to obtain cross features; providing the cross features and user activity data to an attention network layer to obtain user attention features; providing the vector features output by a feature extraction layer based on the input object feature data and user feature data, as well as the user attention features, to a prediction network layer to obtain predicted recommended objects for each user; and adjusting the object recommendation model based on a first loss obtained from the predicted recommended objects.
[0101] Figure 9 A block diagram of an electronic device 900 for implementing an object recommendation method according to an embodiment of this specification is shown.
[0102] like Figure 9 As shown, the electronic device 900 may include at least one processor 910, a memory (e.g., non-volatile memory) 920, a RAM 930, and a communication interface 940, and the at least one processor 910, memory 920, RAM 930, and communication interface 940 are connected together via a bus 950. The at least one processor 910 executes at least one computer-readable instruction (i.e., the elements implemented in software above) stored or encoded in the memory.
[0103] In one embodiment, computer-executable instructions are stored in memory, which, when executed, cause at least one processor 910 to: acquire object feature data of an object and user feature data and user activity data of a user to be recommended; provide the object feature data, user feature data, and user activity data to an object recommendation model to obtain an object recommended for the user to be recommended; a feature extraction layer in the object recommendation model processes the input object feature data and user feature data to output vector features; a feature interaction layer processes the input user feature data and object feature data to output cross features; an attention network layer processes the input cross features and user activity data to output user attention features; and a prediction network layer predicts the vector features and user attention features to output an object recommended for the user to be recommended.
[0104] It should be understood that the computer-executable instructions stored in memory, when executed, cause at least one processor 810 and processor 910 to perform the above combinations as described in the various embodiments of this specification. Figure 1-7 The description includes various operations and functions.
[0105] According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figure 1-7 The description includes various operations and functions.
[0106] Specifically, a system or apparatus equipped with a readable storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer or processor of the system or apparatus can read and execute the instructions stored in the readable storage medium.
[0107] In this case, the program code itself, which can be read from a readable medium, can perform the functions of any of the above embodiments. Therefore, the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.
[0108] The computer program code required for the operation of each part of this manual can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB, .NET, and Python; conventional procedural programming languages such as C, Visual Basic 2003, Perl, COBOL 2002, PHP, and ABAP; dynamic programming languages such as Python, Ruby, and Groovy; or other programming languages. This program code can run on the user's computer, or as a standalone software package on the user's computer, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service, such as Software as a Service (SaaS).
[0109] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.
[0110] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0111] Not all steps and units in the above process and system structure diagrams are mandatory; some steps or units can be omitted as needed. The execution order of each step is not fixed and can be determined as required. The device structure described in the above embodiments can be a physical structure or a logical structure. That is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.
[0112] The term "exemplary" as used throughout this specification means "serving as an example, instance, or illustration" and does not imply that it is "preferred" or "advantageous" over other embodiments. Detailed descriptions are included for the purpose of providing an understanding of the described techniques. However, these techniques may be practiced without these detailed descriptions. In some instances, well-known structures and apparatuses are shown in block diagram form to avoid obscuring the concepts of the described embodiments.
[0113] The optional embodiments of the present specification have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present specification are not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present specification, various simple modifications can be made to the technical solutions of the embodiments of the present specification, and these simple modifications all fall within the protection scope of the embodiments of the present specification.
[0114] The foregoing description of this specification is provided to enable any person skilled in the art to implement or use the content of this specification. Various modifications to the content of this specification will be apparent to those skilled in the art, and the general principles defined herein can be applied to other variations without departing from the scope of protection of this specification. Therefore, this specification is not limited to the examples and designs described herein, but is consistent with the widest scope of the principles and novel features disclosed herein.
Claims
1. A method for training an object recommendation model, wherein, The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The method includes: Extract object feature data, user feature data, and user activity data from data including users and objects; The object recommendation model shall be trained in the following manner until the training termination condition is met: The object feature data and the user feature data are provided to the feature interaction layer to obtain cross features; The cross features and the user activity data are provided to the attention network layer to obtain user attention features, wherein the user attention features are used to represent the degree of attention that each user with different activity levels pays to different cross features; The vector features output by the feature extraction layer based on the input object feature data and user feature data, along with the user attention features, are provided to the prediction network layer to obtain the predicted recommended objects for each user; and The object recommendation model is adjusted based on the first loss obtained from the predicted recommended objects.
2. The method as described in claim 1, wherein, The adjustment of the object recommendation model based on the first loss obtained from the predicted recommended objects includes: The first loss is obtained based on the predicted recommended objects and labeled objects; A second loss is obtained based on the user activity characteristics corresponding to the user activity data, wherein the second loss is inversely proportional to the user activity; and The object recommendation model is adjusted based on the first loss and the second loss.
3. The method as described in claim 2, wherein, The second loss is derived from the user activity characteristics corresponding to the user activity data, including: A second loss is determined based on the user activity features corresponding to the user activity data and the variance obtained from the cross features, wherein the second loss is inversely proportional to the variance.
4. The method of claim 2, wherein, The second loss is derived from the user activity characteristics corresponding to the user activity data, including: The second volume loss for each user is obtained based on the user activity features of each user input into the object recommendation model; and The obtained second volume losses are fused together to obtain the second loss.
5. The method of claim 1, further comprising: Extract association information feature data related to the user and / or the object from the data; The vector features output by the feature extraction layer based on the input object feature data and user feature data, along with the user attention features, are provided to the prediction network layer to obtain the predicted recommended objects for each user, including: The object feature data, the user feature data, and the associated information feature data are provided to the feature extraction layer to obtain corresponding object vector features, user vector features, and associated information vector features; and The object vector features, user vector features, association information vector features, and user attention features are provided to the prediction network layer to obtain the predicted recommended objects for each user.
6. The method of claim 1, wherein, The attention network layer includes a feature extraction sublayer, an attention network sublayer, and a weighted network sublayer. The cross-features and the user activity data are provided to the attention network layer to obtain user attention features, including: The feature extraction sublayer extracts features from the user activity data input to the attention network layer to output user activity features; The attention network sublayer multiplies the input cross features and user activity features to calculate the attention score for each user to each cross feature; and The weighted network sublayer uses the input attention score to weight the cross features to output user attention features.
7. The method of claim 1, wherein, The user activity data includes at least one of the following: login data indicating that a user has logged into the system where the object is located, click data indicating that a user has clicked on the object, and operation data indicating that a user has performed an operation on the object.
8. A method for object recommendation using an object recommendation model, wherein, The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer, and is obtained according to any one of the methods described in claims 1 to 7. The method includes: Obtain object feature data of the target object, as well as user feature data and user activity data of the user to be recommended; and The object feature data, the user feature data, and the user activity data are provided to the object recommendation model to obtain objects recommended for the user to be recommended. In the object recommendation model, the feature extraction layer processes the input object feature data and user feature data to output vector features; the feature interaction layer processes the input user feature data and object feature data to output cross features; the attention network layer processes the input cross features and user activity data to output user attention features; and the prediction network layer predicts the vector features and user attention features to output the recommended object.
9. An apparatus for training an object recommendation model, wherein, The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer. The device includes: The data acquisition unit acquires object feature data, user feature data, and user activity data from data including users and objects; An object recommendation unit provides the object feature data, user feature data, and user activity data to the object recommendation model to output predicted recommended objects. The object feature data and user feature data are provided to the feature interaction layer to obtain cross features; the cross features and user activity data are provided to the attention network layer to obtain user attention features, which represent the degree of attention paid by users with different activity levels to different cross features. The vector features output by the feature extraction layer based on the input object feature data and user feature data, along with the user attention features, are provided to the prediction network layer to obtain predicted recommended objects for each user. The model adjustment unit adjusts the object recommendation model based on the first loss obtained from the predicted recommended objects. When the training termination condition is not met, the model adjustment unit triggers the data providing unit to perform the operation of providing the object feature data, the user feature data, and the user activity data to the object recommendation model.
10. The apparatus of claim 9, wherein, The model adjustment unit is further configured to: The first loss is obtained based on the predicted recommended objects and labeled objects; A second loss is obtained based on the user activity characteristics corresponding to the user activity data, wherein the second loss is inversely proportional to the user activity; and The object recommendation model is adjusted based on the first loss and the second loss.
11. The apparatus of claim 9, wherein, The data acquisition unit is further configured to: Extract association information feature data related to the user and / or the object from the data; and The object recommendation unit is further configured to: The object feature data, the user feature data, and the associated information feature data are provided to the feature extraction layer to obtain corresponding object vector features, user vector features, and associated information vector features; and The object vector features, user vector features, association information vector features, and user attention features are provided to the prediction network layer to obtain the predicted recommended objects for each user.
12. An apparatus for object recommendation using an object recommendation model, wherein, The object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer, and is obtained according to any one of the methods described in claims 1 to 7. The device includes: The data acquisition unit acquires object feature data of the target, user feature data and user activity data of the user to be recommended; and The object recommendation unit provides the object feature data, the user feature data, and the user activity data to the object recommendation model to obtain objects recommended for the user to be recommended. Specifically, the feature extraction layer in the object recommendation model processes the input object feature data and user feature data to output vector features; the feature interaction layer processes the input user feature data and object feature data to output cross features; the attention network layer processes the input cross features and user activity data to output user attention features; and the prediction network layer performs prediction processing on the vector features and user attention features to output the recommended objects.
13. An electronic device, comprising: At least one processor, a memory coupled to the at least one processor, and a computer program stored on the memory, wherein the at least one processor executes the computer program to implement the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Model training and recommendation method and device, electronic equipment and storage medium
CN114840757A
Object recommendation method and device, server and storage medium
CN116701765A