CN-117349527-B - Training method and device of object recommendation model, and object recommendation method and device
Abstract
The embodiment of the specification provides a training method and device of an object recommendation model, and an object recommendation method and device. 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 liveness data are acquired, then an object recommendation model is trained until training end conditions are met, wherein the object feature data and the user feature data are provided for a feature interaction layer to obtain cross features, the cross features and the user liveness data are provided for an attention network layer to obtain user attention features, vector features and the user attention features output by a feature extraction layer are provided for a prediction network layer to obtain predicted recommended objects for all users, and the object recommendation model is adjusted based on first losses obtained by the predicted recommended objects.
Inventors
- ZHOU YUJIE
- Sang Jianshun
- WEI XUEYONG
- GU LIHONG
- PENG CUNYIN
Assignees
- 支付宝(杭州)信息技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20231008
Claims (13)
- 1. A method for training an object recommendation model, wherein the object recommendation model comprises a feature extraction layer, a feature interaction layer, an attention network layer and a prediction network layer, The method comprises the following steps: Acquiring object feature data, user feature data and user liveness data from data comprising a user and an object; Training the object recommendation model until a training ending condition is met in the following manner: Providing the object feature data and the user feature data to the feature interaction layer to obtain cross features; providing the cross feature and the user liveness data to the attention network layer to obtain user attention features, wherein the user attention features are used for representing attention degrees of various users with different liveness aiming at different cross features; Providing the vector features and the user attention features output by the feature extraction layer according to the input object feature data and the user feature data to the prediction network layer to obtain predicted recommended objects for the users, and The object recommendation model is adjusted based on a first penalty incurred by the predicted recommended object.
- 2. The method of claim 1, wherein adjusting the object recommendation model based on the first penalty incurred by the predicted recommended object comprises: obtaining a first penalty from the predicted recommended object and the tag object; obtaining a second loss according to the user activity characteristics corresponding to the user activity data, wherein the second loss is inversely proportional to the user activity, and And adjusting the object recommendation model according to the first loss and the second loss.
- 3. The method of claim 2, wherein deriving the second penalty from the user activity characteristic corresponding to the user activity data comprises: And determining a second loss according to the user activity characteristic corresponding to the user activity data and the variance obtained by the cross characteristic, wherein the second loss is inversely proportional to the variance.
- 4. The method of claim 2, wherein deriving the second penalty from the user activity characteristic corresponding to the user activity data comprises: Obtaining a second individual loss corresponding to each user according to the user activity characteristics of each user input into the object recommendation model, and And carrying out fusion treatment on each obtained second individual loss to obtain second loss.
- 5. The method of claim 1, further comprising: acquiring associated information characteristic data associated with the user and/or the object from the data; Providing the vector features and the user attention features output by the feature extraction layer according to the input object feature data and the user feature data to the prediction network layer so as to obtain predicted recommended objects for the users, wherein the predicted recommended objects for the users comprise: Providing the object feature data, the user feature data and the associated information feature data to the feature extraction layer to obtain corresponding object vector features, user vector features and associated information vector features, and And providing the object vector features, the user vector features, the associated information vector features and the user attention features to the prediction network layer to obtain predicted recommended objects for the respective users.
- 6. The method of claim 1, wherein the attention network layer comprises a feature extraction sub-layer, an attention network sub-layer, and a weighting network sub-layer, Providing the intersection feature and the user liveness data to the attention network layer, and obtaining the user attention feature comprises: The feature extraction sub-layer performs feature extraction on the user liveness data input into the attention network layer so as to output user liveness features; The attention network sub-layer multiplies the input cross feature and the user liveness feature to output attention scores of each user to each cross feature, and The weighted network sub-layer weights the intersection feature with the input attention score to output a user attention feature.
- 7. The method of claim 1, wherein the user liveness data includes at least one of login data for indicating a system in which a user is logged in to the object, click data for indicating that the user clicks on the object, and operation data for indicating that the user operates on the object.
- 8. A method for recommending an object using an object recommendation model, wherein the object recommendation model comprises 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 one of the methods of claims 1 to 7, The method comprises the following steps: acquiring object feature data of an object, user feature data and user activity data of a user to be recommended, and Providing the object feature data, the user feature data and the user activity data to the object recommendation model to obtain an object recommended by the user to be recommended, The feature extraction layer in the object recommendation model processes the input object feature data and the user feature data to output vector features, the feature interaction layer processes the input user feature data and the input object feature data to output cross features, the attention network layer processes the input cross features and the input user activity data to output user attention features, and the prediction network layer predicts the vector features and the user attention features to output recommended objects.
- 9. An apparatus for training an object recommendation model, wherein the object recommendation model comprises a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer, The device comprises: A data acquisition unit that acquires object feature data, user feature data, and user liveness data from data including a user and an object; An object recommendation unit providing the object feature data, the user feature data and the user activity data to the object recommendation model to output a predicted recommended object, wherein 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 representing the attention degree of each user of different activities to different cross features, the feature extraction layer is provided to the prediction network layer according to the vector features output by the input object feature data and the user attention features to obtain the predicted recommended object for each user, and A model adjustment unit that adjusts the object recommendation model based on a first loss obtained by the predicted recommendation object, Wherein, when the training end condition is not satisfied, the model adjustment unit triggers the data providing unit to perform an 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: obtaining a first penalty from the predicted recommended object and the tag object; obtaining a second loss according to the user activity characteristics corresponding to the user activity data, wherein the second loss is inversely proportional to the user activity, and And adjusting the object recommendation model according to the first loss and the second loss.
- 11. The apparatus of claim 9, wherein the data acquisition unit is further configured to: acquiring associated information characteristic data associated with the user and/or the object from the data, and The object recommendation unit is further configured to: Providing the object feature data, the user feature data and the associated information feature data to the feature extraction layer to obtain corresponding object vector features, user vector features and associated information vector features, and And providing the object vector features, the user vector features, the associated information vector features and the user attention features to the prediction network layer to obtain predicted recommended objects for the respective users.
- 12. An apparatus for object recommendation using an object recommendation model, wherein the object recommendation model comprises a feature extraction layer, a feature interaction layer, an attention network layer and a prediction network layer, the object recommendation model being obtained according to any one of the methods of claims 1 to 7, The device comprises: a data acquisition unit for acquiring object feature data of the object, 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 an object recommended by the user to be recommended, wherein the feature extraction layer in the object recommendation model processes the input object feature data and the user feature data to output vector features, the feature interaction layer processes the input user feature data and the object feature data to output cross features, the attention network layer processes the input cross features and the 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 object.
- 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, the at least one processor executing the computer program to implement the method of any one of claims 1-8.
Description
Training method and device of object recommendation model, and object recommendation method and device Technical Field The embodiment of the specification relates to the technical field of artificial intelligence, in particular to a training method and device of an object recommendation model and an object recommendation method and device. Background In recommendation scenes, such as commodity recommendation, image recommendation, and the like, in order to achieve more accurate recommendation for users, a recommendation model is widely used. In the current training mode of the recommendation model, user data and commodity data are used as samples to train the recommendation model, in the training process, the recommendation model respectively performs feature extraction on the user data and the commodity data, and then the matching degree between the user features and the commodity features is calculated and used for representing the recommendation degree of commodities to users. And finally, calculating the loss based on the matching degree, and adjusting the recommendation model according to the loss. Disclosure of Invention In view of the foregoing, the embodiments of the present disclosure provide a training method and apparatus for an object recommendation model, and an object recommendation method and apparatus. According to the technical scheme of the embodiment of the specification, the users are layered according to the liveness, and the correlation between the liveness of the users and the characteristics is mined, so that the characteristics concerned by the users with low liveness can be captured, and the learning effect of the users with different liveness on the characteristics is improved. According to one aspect of the embodiments of the present specification, there is provided 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 acquiring object feature data, user feature data and user liveness data from data including a user and an object, training the object recommendation model until a training end condition is satisfied, providing the object feature data and the user feature data to the feature interaction layer to obtain cross features, providing the cross features and the user liveness data to the attention network layer to obtain user attention features, wherein the user attention features are used for representing attention degrees of respective users of different liveness for different cross features, providing the feature extraction layer to the prediction network layer according to vector features output by the input object feature data and the user attention features to obtain predicted recommended objects for the respective users, and adjusting the object recommendation model based on first losses obtained by the predicted recommended objects. According to another aspect of the embodiments of the present disclosure, there is further provided a method for recommending an object by using an object recommendation model, where the object recommendation model includes a feature extraction layer, a feature interaction layer, an attention network layer, and a prediction network layer, and the object recommendation model is obtained according to any one of the training methods described above, and the method includes obtaining 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, the user feature data, and the user activity data to the object recommendation model, to obtain an object recommended for the user to be recommended, and wherein the feature extraction layer in the object recommendation model processes the input object feature data and the user feature data to output vector features, the feature interaction layer processes the input user feature data and the input object feature data to output cross features, and the attention network layer processes the input cross features and the user activity data to output user attention features, and the prediction network layer predicts the input cross features and the user attention features to output the recommended object. According to another aspect of embodiments of the present specification, there is also provided 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 apparatus including a data acquisition unit that acquires object feature data, user feature data, and user liveness data from data including a user and an object, an object recommendation unit that supplies the object feature data, the user feature data, and the user liveness data to the object recommendation model to output