Training Method of Object Recommendation Model, Object Recommendation Method and Device
By using initial graph data and comparison learning methods in the object recommendation model, the problems of data sparseness and interactive noisy data are solved, the recommendation accuracy and performance of the model are improved, and the waste of system resources is reduced.
Patent Information
- Application Number
- CN202310822409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2043-07-05
AI Technical Summary
In the prior art, the object recommendation model has problems with data sparsity and interactive noise data during training, resulting in poor prediction capabilities of the model's object recommendation and poor recommendation accuracy and effectiveness, which in turn leads to waste of system resources and reduced performance.
By obtaining the initial graph data, building graph data based on multiple interactive relationships, inputting the object recommendation model to be trained for prediction, and obtaining the prediction recommendation index data and node feature information. Then, comparison losses are generated based on the node feature information under different interaction operations, and comparison learning is performed to transfer the semantics of other interaction operations and alleviate data distribution bias and noise data.
Through joint comparison learning within and between operations, the accuracy of the model's representation of user accounts and objects is improved, the object recommendation prediction ability and the effect of the recommendation system is improved, invalid recommendation and waste of system resources are reduced, and system performance is improved.
Smart Images

Figure CN117009653B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular, to a method for training an object recommendation model, an object recommendation method, and a device therefor. Background Art
[0002] With the development of artificial intelligence technology, recommendation models constructed based on artificial intelligence technology are widely used in object recommendation systems such as commodities, applications, stores, and live broadcast rooms. During the training process of the object recommendation model, it is necessary to rely on the interaction operations between users and objects; in related technologies, due to the sparse nature of the interaction operation data itself between users and objects, model training is performed based on various interaction operations between users and objects. Although this can alleviate the problem of data sparsity to a certain extent, it will also bring interactive noise data, which has a negative impact on user and object representations, resulting in poor object recommendation prediction ability of the model, poor recommendation accuracy and effect in the recommendation system, and further bringing ineffective object recommendations, causing problems such as waste of system resources and decline in system performance of the recommendation system. Summary of the Invention
[0003] The present disclosure provides a method for training an object recommendation model, an object recommendation method, and a device therefor, so as to at least solve the technical problems of data sparsity and interactive noise data existing in model training in related technologies, the negative impact on user and object representations, and poor object recommendation prediction ability of the model, and poor recommendation accuracy and effect in the recommendation system. The technical solutions of the present disclosure are as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a method for training an object recommendation model, including:
[0005] Obtain initial graph data, where the initial graph data is constructed based on multiple interaction relationships, and the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects; the initial graph data includes multiple nodes; the multiple nodes include sample account nodes corresponding to the multiple sample accounts and sample object nodes corresponding to the multiple sample interaction objects;
[0006] Input the initial graph data into an object recommendation model to be trained for object recommendation prediction, and obtain prediction recommendation index data corresponding to each sample account and first node feature information of each node in each interaction operation among the multiple nodes;
[0007] Obtain the second node feature information of each node under the target interaction operation and the third node feature information of each node under the target interaction operation. The second node feature information is obtained based on the first perturbed graph data corresponding to the target subgraph data in the initial graph data, and the third node feature information is obtained based on the second perturbed graph data corresponding to the target subgraph data. The target subgraph data is the subgraph data corresponding to the target interaction operation among the multiple interaction operations.
[0008] Generate a first contrastive loss corresponding to each node based on the first node feature information. The first contrastive loss represents the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation. Each other interaction operation is each interaction operation other than the target interaction operation among the multiple interaction operations.
[0009] Generate a second contrastive loss corresponding to each node based on the second node feature information and the third node feature information. The second contrastive loss represents the difference between the node feature information of each node under the target interaction operation under different perturbations.
[0010] Train the object recommendation model to be trained based on the first contrastive loss, the second contrastive loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account to obtain a trained object recommendation model.
[0011] In an optional embodiment, the generating the first contrastive loss corresponding to each node based on the first node feature information includes:
[0012] Construct first positive sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation. The target account node is any sample account node among the multiple nodes.
[0013] Construct first negative sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation. Any other account node is any sample account node other than the target account node among the multiple nodes.
[0014] Construct second positive sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation. The target object node is any sample object node among the multiple nodes.
[0015] Construct second negative sample information based on the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes;
[0016] Determine the first contrastive loss based on the first positive sample information, the first negative sample information, the second positive sample information, and the second negative sample information.
[0017] In an alternative embodiment, the generating the second contrastive loss corresponding to each node based on the second node feature information and the third node feature information includes:
[0018] Construct third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation; the target account node is any sample account node among the multiple nodes;
[0019] Construct third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation; the any other account node is any sample account node other than the target account node among the multiple nodes;
[0020] Construct fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation; the target object node is any sample object node among the multiple nodes;
[0021] Construct fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes;
[0022] Determine the second contrastive loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information.
[0023] In an optional embodiment, the object recommendation model to be trained includes a graph feature extraction module to be trained, a self-attention learning module to be trained, a feature fusion module, and a classification module; the step of inputting the initial graph data into the object recommendation model to be trained for object recommendation prediction and obtaining the predicted recommendation metric data corresponding to each sample account and the first node feature information of each node in each interaction operation among the multiple nodes includes:
[0024] Input the initial graph data into the graph feature extraction module to be trained for graph feature extraction, and obtain the fourth node feature information of each node in each interaction operation;
[0025] Input the fourth node feature information into the self-attention learning module to be trained for self-attention learning, and obtain the first attention weight of each node in each interaction operation;
[0026] Input the fourth node feature information and the first attention weight into the feature fusion module for feature fusion, and obtain the first node feature information;
[0027] Input the first node feature information into the classification module for classification processing, and obtain the predicted recommendation metric data.
[0028] In an optional embodiment, the step of training the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account to obtain a trained object recommendation model includes:
[0029] Determine a recommendation loss according to the predicted recommendation metric data and the preset recommendation metric data;
[0030] Determine the first gradient information corresponding to the model parameters in the object recommendation model to be trained according to the recommendation loss;
[0031] Determine the second gradient information corresponding to the model parameters in the object recommendation model to be trained according to the first contrast loss;
[0032] Determine the third gradient information corresponding to the model parameters in the object recommendation model to be trained according to the second contrast loss;
[0033] Based on the first gradient information, correct the second gradient information and the third gradient information to obtain first corrected gradient information and second corrected gradient information respectively;
[0034] Train the object recommendation model to be trained according to the first gradient information, the first correction gradient information, and the second correction gradient information, to obtain the trained object recommendation model.
[0035] In an alternative embodiment, the correcting the second gradient information and the third gradient information based on the first gradient information to obtain the first correction gradient information and the second correction gradient information respectively includes:
[0036] According to the direction of the first gradient information, remove the gradient component in the target direction from the second gradient information to obtain the first initial gradient information corresponding to the second gradient information; the target direction is opposite to the direction of the first gradient information;
[0037] According to the direction of the first gradient information, remove the gradient component in the target direction from the third gradient information to obtain the second initial gradient information corresponding to the third gradient information;
[0038] According to the gradient magnitude of the first gradient information, adjust the gradient magnitudes of the first initial gradient information and the second initial gradient information to obtain the first correction gradient information and the second correction gradient information.
[0039] According to a second aspect of the embodiments of the present disclosure, there is provided an object recommendation method, including:
[0040] Obtain target graph data corresponding to a target account; the target graph data is graph data with the target account and at least one preset object as nodes, and at least one interaction relationship between the target account and the historical interaction objects of the target account among the at least one preset object as edges;
[0041] Input the target graph data into an object recommendation model obtained by the object recommendation model training method according to any one of the above first aspects for object recommendation prediction, to obtain target recommendation index data corresponding to the at least one preset object;
[0042] Based on the target recommendation index data, determine a target recommendation object from the at least one preset object;
[0043] Recommend the target recommendation object to the target account.
[0044] In an alternative embodiment, the object recommendation model includes a graph feature extraction module, a self-attention learning module, a feature fusion module, and a classification module; the inputting the target graph data into an object recommendation model obtained by the object recommendation model training method according to any one of the above first aspects for object recommendation prediction, to obtain target recommendation index data corresponding to the at least one preset object includes:
[0045] Input the target graph data into the graph feature extraction module for graph feature extraction to obtain the fifth node feature information of the account node corresponding to the target account under each interaction operation;
[0046] Input the fifth node feature information into the self-attention learning module for self-attention learning to obtain the second attention weight of the account node under each interaction operation;
[0047] Input the fifth node feature information and the second attention weight into the feature fusion module for feature fusion to obtain the sixth node feature information;
[0048] Input the sixth node feature information into the classification module for classification processing to obtain the target recommendation metric data.
[0049] According to the third aspect of the embodiments of the present disclosure, there is provided a training device for an object recommendation model, including:
[0050] A first graph data acquisition module configured to acquire initial graph data, where the initial graph data is constructed based on multiple interaction relationships, and the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects; the initial graph data includes multiple nodes; the multiple nodes include sample account nodes corresponding to the multiple sample accounts and sample object nodes corresponding to the multiple sample interaction objects;
[0051] A first object recommendation prediction module configured to input the initial graph data into an object recommendation model to be trained for object recommendation prediction, and obtain prediction recommendation metric data corresponding to each sample account and first node feature information of each node in each interaction operation among the multiple nodes;
[0052] A node feature information acquisition module configured to acquire second node feature information of each node under a target interaction operation and third node feature information of each node under the target interaction operation, where the second node feature information is obtained based on first perturbed graph data corresponding to target sub-graph data in the initial graph data, and the third node feature information is obtained based on second perturbed graph data corresponding to the target sub-graph data; the target sub-graph data is sub-graph data corresponding to the target interaction operation among the multiple interaction operations;
[0053] The first contrastive loss generation module is configured to generate, based on the first node feature information, a first contrastive loss corresponding to each node; the first contrastive loss characterizes the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation; each other interaction operation is each interaction operation other than the target interaction operation among the multiple interaction operations;
[0054] The second contrastive loss generation module is configured to generate, based on the second node feature information and the third node feature information, a second contrastive loss corresponding to each node; the second contrastive loss characterizes the difference between the node feature information of each node under the target interaction operation under different perturbations;
[0055] The model training module is configured to train the object recommendation model to be trained based on the first contrastive loss, the second contrastive loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account, to obtain a trained object recommendation model.
[0056] In an optional embodiment, the first contrastive loss generation module includes:
[0057] The first positive sample information construction unit is configured to construct first positive sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation; the target account node is any sample account node among the multiple nodes;
[0058] The first negative sample information construction unit is configured to construct first negative sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation; any other account node is any sample account node other than the target account node among the multiple nodes;
[0059] The second positive sample information construction unit is configured to construct second positive sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation; the target object node is any sample object node among the multiple nodes;
[0060] The second negative sample information construction unit is configured to construct second negative sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes;
[0061] The first contrast loss determination unit is configured to determine the first contrast loss based on the first positive sample information, the first negative sample information, the second positive sample information, and the second negative sample information.
[0062] In an optional embodiment, the second contrast loss generation module includes:
[0063] The third positive sample information construction unit is configured to construct third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation; the target account node is any sample account node among the multiple nodes;
[0064] The third negative sample information construction unit is configured to construct third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation; the any other account node is any sample account node other than the target account node among the multiple nodes;
[0065] The fourth positive sample information construction unit is configured to construct fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation; the target object node is any sample object node among the multiple nodes;
[0066] The fourth negative sample information construction unit is configured to construct fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes;
[0067] The second contrast loss determination unit is configured to determine the second contrast loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information.
[0068] In an optional embodiment, the object recommendation model to be trained includes a graph feature extraction module to be trained, a self-attention learning module to be trained, a feature fusion module, and a classification module; the first object recommendation prediction module includes:
[0069] A first graph feature extraction unit, configured to perform graph feature extraction by inputting the initial graph data into the graph feature extraction module to be trained, so as to obtain the fourth node feature information of each node under each interaction operation;
[0070] A first self-attention learning unit, configured to perform self-attention learning by inputting the fourth node feature information into the self-attention learning module to be trained, so as to obtain the first attention weight of each node under each interaction operation;
[0071] A first feature fusion unit, configured to perform feature fusion by inputting the fourth node feature information and the first attention weight into the feature fusion module, so as to obtain the first node feature information;
[0072] A first classification processing unit, configured to perform classification processing by inputting the first node feature information into the classification module, so as to obtain the predicted recommendation metric data.
[0073] In an optional embodiment, the model training module includes:
[0074] A recommendation loss determination unit, configured to determine a recommendation loss according to the predicted recommendation metric data and the preset recommendation metric data;
[0075] A first gradient information determination unit, configured to determine the first gradient information corresponding to the model parameters in the object recommendation model to be trained according to the recommendation loss;
[0076] A second gradient information determination unit, configured to determine the second gradient information corresponding to the model parameters in the object recommendation model to be trained according to the first contrast loss;
[0077] A third gradient information determination unit, configured to determine the third gradient information corresponding to the model parameters in the object recommendation model to be trained according to the second contrast loss;
[0078] A gradient information correction unit, configured to perform correction on the second gradient information and the third gradient information based on the first gradient information, and respectively obtain the first corrected gradient information and the second corrected gradient information;
[0079] A model training unit, configured to perform training on the object recommendation model to be trained according to the first gradient information, the first corrected gradient information, and the second corrected gradient information, to obtain the trained object recommendation model.
[0080] In an optional embodiment, the gradient information correction module includes:
[0081] A first gradient direction correction unit, configured to perform removing the gradient component in the target direction from the second gradient information according to the direction of the first gradient information, to obtain the first initial gradient information corresponding to the second gradient information; the target direction is opposite to the direction of the first gradient information;
[0082] A second gradient direction correction unit, configured to perform removing the gradient component in the target direction from the third gradient information according to the direction of the first gradient information, to obtain the second initial gradient information corresponding to the third gradient information;
[0083] A gradient magnitude correction unit, configured to perform adjusting the gradient magnitudes of the first initial gradient information and the second initial gradient information according to the gradient magnitude of the first gradient information, to obtain the first corrected gradient information and the second corrected gradient information.
[0084] According to a fourth aspect of the embodiments of the present disclosure, there is provided an object recommendation device, including:
[0085] A second graph data acquisition module, configured to perform acquiring target graph data corresponding to a target account; the target graph data is graph data with the target account and at least one preset object as nodes, and at least one interaction relationship between the target account and historical interaction objects of the target account among the at least one preset object as edges;
[0086] A second object recommendation prediction module, configured to perform inputting the target graph data into an object recommendation model obtained by the object recommendation model training method according to any one of the first aspects above for object recommendation prediction, to obtain target recommendation index data corresponding to the at least one preset object;
[0087] A target recommended object determination module, configured to perform determining a target recommended object from the at least one preset object based on the target recommendation index data;
[0088] An object recommendation module, configured to perform recommending the target recommended object to the target account.
[0089] In an optional embodiment, the object recommendation model includes a graph feature extraction module, a self-attention learning module, a feature fusion module, and a classification module; the second object recommendation prediction module includes:
[0090] A second graph feature extraction unit, configured to perform graph feature extraction by inputting the target graph data into the graph feature extraction module, so as to obtain fifth node feature information of the account node corresponding to the target account under each interaction operation;
[0091] A second self-attention learning unit, configured to perform self-attention learning by inputting the fifth node feature information into the self-attention learning module, so as to obtain a second attention weight of the account node under each interaction operation;
[0092] A second feature fusion unit, configured to perform feature fusion by inputting the fifth node feature information and the second attention weight into the feature fusion module, so as to obtain sixth node feature information;
[0093] A second classification processing unit, configured to perform classification processing by inputting the sixth node feature information into the classification module, so as to obtain the target recommendation metric data.
[0094] According to a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the instructions to implement the method according to any one of the first aspect or the second aspect as described above.
[0095] According to a sixth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the method according to any one of the first aspect or the second aspect as described above.
[0096] According to a seventh aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions, when it runs on a computer, enabling the computer to execute the method according to any one of the first aspect or the second aspect as described above.
[0097] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0098] During the training process of the object recommendation model, initial graph data is obtained. The initial graph data is constructed based on multiple interaction relationships, and the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects. Then, the initial graph data is input into the object recommendation model to be trained for object recommendation prediction, and the predicted recommendation index data corresponding to each sample account and the first node feature information of each node in each interaction operation in the initial graph data are obtained. Next, under different perturbations, the node feature information (the second node feature information and the third node feature information) of each node under the target interaction operation is obtained. Then, based on the first node feature information, a first contrast loss is generated to represent the difference between the node feature information of each node under the target interaction operation and other interaction operations, which can realize the contrast learning of the node feature information under the target interaction operation and other interaction operations, transfer the semantics of other interaction operations, improve the similarity between the node feature information under different interaction operations, and effectively alleviate the interaction noise data caused by the data distribution deviation in learning under different interaction operations. Then, based on the second node feature information and the third node feature information, a second contrast loss is generated to represent the difference between the node feature information of each node under the target interaction operation under different perturbations, which can effectively reduce the over-reliance on the edges corresponding to other interaction operations during the node feature learning process and effectively alleviate the interaction noise data brought by other interaction operations. Then, based on the first contrast loss, the second contrast loss, the predicted recommendation index data, and the preset recommendation index data corresponding to each sample account, the object recommendation model to be trained is trained to obtain a trained object recommendation model, which can realize the joint contrast learning within and between operations. On the basis of alleviating data sparsity based on the edge information corresponding to multiple interaction operations in the graph data, it can effectively alleviate the data distribution deviation in learning under different interaction operations and the interaction noise data brought by the over-reliance on the edges corresponding to other interaction operations, greatly improve the accuracy of the trained model in representing user accounts and objects, improve the object recommendation prediction ability of the model, and the recommendation effect in the recommendation system. Furthermore, it can also reduce the situation of ineffective object recommendations, reduce system resource waste, and improve system performance.
[0099] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation of the present disclosure.
[0101] Figure 1 is a schematic diagram of an application environment shown according to an exemplary embodiment;
[0102] Figure 2 It is a flowchart of a method for training an object recommendation model shown according to an exemplary embodiment;
[0103] Figure 3 It is a flowchart of inputting initial graph data into an object recommendation model to be trained for object recommendation prediction, and obtaining prediction recommendation index data corresponding to each sample account and first node feature information of each node under each interaction operation;
[0104] Figure 4 It is a flowchart of generating a first contrast loss corresponding to each node based on the first node feature information;
[0105] Figure 5 It is a flowchart of generating a second contrast loss corresponding to each node based on the second node feature information and the third node feature information;
[0106] Figure 6 It is a flowchart of training the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the prediction recommendation index data, and the preset recommendation index data corresponding to each sample account, and obtaining a trained object recommendation model;
[0107] Figure 7 It is a flowchart of an object recommendation method provided according to an exemplary embodiment;
[0108] Figure 8 It is a block diagram of a training device for an object recommendation model shown according to an exemplary embodiment;
[0109] Figure 9 It is a block diagram of an object recommendation device shown according to an exemplary embodiment;
[0110] Figure 10 It is a block diagram of an electronic device for object recommendation shown according to an exemplary embodiment;
[0111] Figure 11 It is a block diagram of an electronic device for training an object recommendation model shown according to an exemplary embodiment. Detailed implementation manners
[0112] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0113] It should be noted that the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings of the present disclosure are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0114] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties.
[0115] Artificial intelligence uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, a theory, method, technology and application system that perceives the environment, acquires knowledge and uses knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning and decision-making.
[0116] Artificial intelligence technology is an interdisciplinary subject, involving a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0117] The solution provided in the embodiments of the present application involves technologies such as deep learning in artificial intelligence. Specifically, it may involve the training of an object recommendation model based on deep learning and object recommendation and other processes, which will be specifically described through the following embodiments:
[0118] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an application environment shown according to an exemplary embodiment. The application environment may at least include a server 100 and a terminal 200.
[0119] In an alternative embodiment, the server 100 can be used to perform the training process of the object recommendation model. The server 100 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0120] In an alternative embodiment, the terminal 200 can be used to provide services such as object recommendation based on the object recommendation model. Specifically, the terminal 200 can include, but is not limited to, electronic devices such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, vehicle-mounted terminals, smart TVs, etc.; it can also be software running on the above-mentioned electronic devices, such as applications, applets, etc. The operating systems running on the electronic devices in the embodiments of the present application can include, but are not limited to, Android system, IOS system, Linux, Windows, etc.
[0121] In addition, it should be noted that Figure 1 The application environment shown is only one provided by the present disclosure. In actual applications, there may also be other application environments. For example, the training of the object recommendation model can also be implemented on the terminal.
[0122] In the embodiments of this specification, the above-mentioned server 100 and terminal 200 can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this.
[0123] Figure 2 is a flowchart of a method for training an object recommendation model shown according to an exemplary embodiment. This method can be applied to electronic devices such as servers and terminals, as Figure 2 shown, and this method can include the following steps:
[0124] In step S201, initial graph data is obtained.
[0125] In a specific embodiment, the above initial graph data is constructed based on multiple interaction relationships; the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects; one interaction relationship corresponds to one interaction operation. Specifically, multiple sample accounts and multiple sample interaction objects can be used as nodes, and at least one interaction relationship between each sample account and the sample interaction object corresponding to each sample account can be used as an edge to obtain the above initial graph data; the at least one interaction relationship can be the above multiple interaction relationships or a part of the above multiple interaction relationships; specifically, the sample interaction object corresponding to each sample account can be an object on which the sample account has performed an interaction operation among the multiple sample interaction objects. The initial graph data includes multiple nodes; the multiple nodes include sample account nodes corresponding to multiple sample accounts and sample object nodes corresponding to multiple sample interaction objects.
[0126] In a specific embodiment, the number of sample interaction objects corresponding to each sample account can be one or more. The sample interaction objects of different sample accounts can include the same object or different objects; the interaction operations of each sample account on the multiple sample interaction objects of the sample account can include the same interaction operation or different interaction operations; optionally, the sample account can be a user account in an object recommendation platform; specifically, the object can be multimedia content that needs to be recommended in the object recommendation platform. Optionally, the multimedia content can be a short video or a product detail page, etc. Specifically, the multiple interaction operations can include operations such as browsing, clicking, favoriting, liking, conversion (for example, purchasing a related product based on the sample interaction object, or downloading a related application based on the sample interaction object), etc.; the multiple interaction operations include a target interaction operation; optionally, the target interaction operation can be set according to actual application requirements. Optionally, the target interaction operation can be a conversion operation.
[0127] In step S203, the initial graph data is input into the object recommendation model to be trained for object recommendation prediction, and the predicted recommendation index data corresponding to each sample account and the first node feature information of each node in each interaction operation among the multiple nodes are obtained;
[0128] In a specific embodiment, the model structure of the object recommendation model to be trained can be set according to actual application requirements; optionally, the above object recommendation model to be trained includes a graph feature extraction module to be trained, a self-attention learning module to be trained, a feature fusion module, and a classification module; specifically, the graph feature extraction module to be trained can be a graph neural network to be trained. The self-attention learning module to be trained can be a self-attention learning network to be trained. The feature fusion module can be a network for fusing node feature information and corresponding self-attention weights. The classification module can be a network for performing classification processing based on node features (identifying whether an object performs a target interaction operation).
[0129] In an alternative embodiment, when the object recommendation model to be trained includes a graph feature extraction module to be trained, a self-attention learning module to be trained, a feature fusion module, and a classification module, as Figure 3 shown, the above process of inputting the initial graph data into the object recommendation model to be trained for object recommendation prediction, and obtaining the predicted recommendation metric data corresponding to each sample account and the first node feature information of each node among multiple nodes under each interaction operation may include the following steps:
[0130] In step S301, input the initial graph data into the graph feature extraction module to be trained for graph feature extraction, and obtain the fourth node feature information of each node under each interaction operation;
[0131] In step S303, input the fourth node feature information into the self-attention learning module to be trained for self-attention learning, and obtain the first attention weight of each node under each interaction operation;
[0132] In step S305, input the fourth node feature information and the first attention weight into the feature fusion module for feature fusion, and obtain the first node feature information;
[0133] In step S307, input the first node feature information into the classification module for classification processing, and obtain the predicted recommendation metric data.
[0134] In a specific embodiment, the initial graph data may include multiple sub-graph data, each sub-graph data corresponding to one interaction operation, each sub-graph data including the above-mentioned multiple nodes, and the multiple nodes are connected by an edge based on a corresponding interaction relationship; optionally, the graph feature extraction module to be trained can combine each sub-graph data in the initial graph data to extract the fourth node feature information of each node under each interaction operation. Specifically, the fourth node feature information can be the node feature information of each node learned based on the corresponding sub-graph data under the interaction operation corresponding to the sub-graph data.
[0135] In a specific embodiment, the following formula can be combined in the graph feature extraction module to be trained to extract the fourth node feature information of each node under each interaction operation:
[0136]
[0137] Wherein, represents the node feature information of node output by the th layer in the graph feature extraction module to be trained under the th interaction operation (correspondingly, the last output of the graph feature extraction module to be trained is the fourth node feature information of each node under each interaction operation); is the activation function; is the model parameter of the th layer in the graph feature extraction module to be trained; represents the node feature information of node output by the th layer in the graph feature extraction module to be trained under the th interaction operation; represents the feature information corresponding to the th interaction operation output by the th layer in the graph feature extraction module to be trained; represents the neighbor nodes of node on the subgraph data corresponding to the th interaction operation. is the average value function.
[0138] In a specific embodiment, the first attention weight table can learn the importance of node representations corresponding to each interaction operation on the basis of learning the correlation between multiple interaction operations. In a specific embodiment, the following formula can be combined in the self-attention learning module to be trained for self-attention learning to obtain the first attention weight of each node under each interaction operation:
[0139]
[0140] Wherein, represents the first attention weight of node under the th interaction operation; represents the fourth node feature information of node under multiple interaction operations, the concatenated node feature information; and are two model parameters associated with the interaction operation in the self-attention learning module to be trained.
[0141] In a specific embodiment, in the feature fusion module, the fourth node feature information of each node under each interaction operation and the first attention weight of each node under each interaction operation can be weighted and summed to obtain the first node feature information. Specifically, the first node feature information is the node feature information of each node under each interaction operation learned from the initial graph data in the object recommendation prediction by the object recommendation model to be trained.
[0142] In a specific embodiment, the predicted recommendation metric data represents the probability that the object recommendation model to be trained predicts that each sample account performs a target interaction operation on each sample interaction object based on the initial graph data. Specifically, the classification module can identify whether each sample account will perform a target interaction operation on each sample interaction object in combination with the first node feature information.
[0143] In the above embodiment, the initial graph data is first input into the graph feature extraction module to be trained to learn the fourth node feature information of each node under each interaction operation. Then, the fourth node feature information is input into the self-attention learning module to be trained for self-attention learning to obtain the first attention weight of each node under each interaction operation. Based on learning the correlation between multiple interaction operations, the importance degree of the node representation corresponding to each interaction operation can be learned. Then, in combination with the feature fusion module, the fourth node feature information and the first attention weight are fused to obtain the first node feature information, which can take into account the heterogeneity and correlation between interaction operations, greatly improving the accuracy of the node representation, and thus ensuring the accuracy of object recommendation prediction based on the first node feature information.
[0144] In addition, it should be noted that the object recommendation model to be trained may include a plurality of sequentially connected feature learning modules to be trained (the feature learning module to be trained includes a training graph feature extraction module, a self-attention learning module to be trained, and a feature fusion module connected in sequence) to better improve the accuracy of the node representation.
[0145] In step S205, the second node feature information of each node under the target interaction operation and the third node feature information of each node under the target interaction operation are obtained.
[0146] In a specific embodiment, the above-mentioned second node feature information is obtained based on the first perturbed graph data corresponding to the target sub-graph data in the initial graph data, and the third node feature information is obtained based on the second perturbed graph data corresponding to the target sub-graph data; the target sub-graph data is the sub-graph data corresponding to the target interaction operation among multiple interaction operations. Specifically, the target sub-graph data only includes the edges corresponding to the interaction relationships of the target interaction operation. Specifically, the first perturbed graph data and the second perturbed graph data are graph data obtained by performing different perturbations on the target sub-graph data. Specifically, edge perturbation or node perturbation can be performed on the target sub-graph data to obtain the perturbed graph data.
[0147] In a specific embodiment, taking the case of performing edge perturbation on the target sub-graph data to obtain the first perturbed graph data and the second perturbed graph data as an example, different edges in the target sub-graph data can be deleted respectively to obtain the first perturbed graph data and the second perturbed graph data with different perturbations. Optionally, taking the case of performing node perturbation on the target sub-graph data to obtain the first perturbed graph data and the second perturbed graph data as an example, different nodes in the target sub-graph data can be deleted respectively to obtain the first perturbed graph data and the second perturbed graph data with different perturbations.
[0148] In a specific embodiment, when the first perturbed graph data and the second perturbed graph data are obtained based on edge perturbation, the first perturbed graph data and the second perturbed graph data can be respectively input into a preset graph neural network for graph feature extraction processing to obtain the above-mentioned second node feature information and third node feature information. Optionally, the first perturbed graph data and the second perturbed graph data can also be respectively input into the above-mentioned object recommendation model to be trained, and in combination with the training graph feature extraction module, the self-attention learning module to be trained, and the feature fusion module in the object recommendation model to be trained, the second node feature information and the third node feature information are respectively extracted from the first perturbed graph data and the second perturbed graph data.
[0149] In an optional embodiment, when the first perturbation graph data and the second perturbation graph data are obtained based on node perturbations, the second node feature information corresponding to the nodes included in the first perturbation graph data among the above-mentioned multiple nodes can be obtained by combining the above-mentioned preset graph neural network or the training graph feature extraction module, the to-be-trained self-attention learning module, and the feature fusion module in the object recommendation model to be trained; correspondingly, the second node feature information corresponding to the nodes not included in the first perturbation graph data among the above-mentioned multiple nodes can be preset node feature information. Correspondingly, the third node feature information corresponding to the nodes included in the second perturbation graph data among the above-mentioned multiple nodes can be obtained by combining the above-mentioned preset graph neural network or the training graph feature extraction module, the to-be-trained self-attention learning module, and the feature fusion module in the object recommendation model to be trained; the third node feature information corresponding to the nodes not included in the second perturbation graph data among the above-mentioned multiple nodes can be preset node feature information.
[0150] In step S207, based on the first node feature information, a first contrast loss corresponding to each node is generated.
[0151] In a specific embodiment, the above-mentioned first contrast loss can represent the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation; each other interaction operation is each interaction operation other than the target interaction operation among the multiple interaction operations;
[0152] In practical applications, the number of interactions corresponding to different interaction operations shows a huge difference, resulting in a large difference in the node feature information learned by the object recommendation model to be trained under different interaction operations. Therefore, in order to alleviate the noise data brought by the data distribution deviation learned under different interaction operations, in the embodiments of the present application, the node feature information under the target interaction operation and other interaction operations (auxiliary operations) is subjected to contrastive learning to transfer the semantics of other interaction operations, and then the noise data brought by the data distribution deviation learned under different interaction operations is cached.
[0153] In an optional embodiment, as Figure 4 shown, the generation of the first contrast loss corresponding to each node based on the first node feature information may include the following steps:
[0154] In step S401, according to the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation, first positive sample information is constructed;
[0155] In step S403, first negative sample information is constructed according to the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation;
[0156] In step S405, second positive sample information is constructed according to the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation;
[0157] In step S407, second negative sample information is constructed according to the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation;
[0158] In step S409, a first contrast loss is determined based on the first positive sample information, the first negative sample information, the second positive sample information, and the second negative sample information.
[0159] In a specific embodiment, the above-mentioned target account node may be any sample account node among multiple nodes; the construction of the first positive sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation may include: combining the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under a certain other interaction operation into a first positive sample pair. Correspondingly, the first positive sample information includes multiple first positive sample pairs.
[0160] In a specific embodiment, any other account node is any sample account node other than the target account node among multiple nodes; the construction of the first negative sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation may include: combining the first node feature information of the target account node under the target interaction operation and the first node feature information of a certain other account node under a certain other interaction operation into a first negative sample pair. Correspondingly, the first negative sample information includes multiple first negative sample pairs.
[0161] In a specific embodiment, the above-mentioned target object node is any sample object node among multiple nodes. The construction of the second positive sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation may include: using the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under a certain other interaction operation as a second positive sample pair. Correspondingly, the second positive sample information may include multiple second positive sample pairs.
[0162] In a specific embodiment, any of the above-mentioned other object nodes is any sample object node among the multiple nodes except the target object node. The construction of the second negative sample information based on the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation may include: combining the first node feature information of the target object node under the target interaction operation and the first node feature information of a certain other object node under a certain other interaction operation to form a second negative sample pair. Correspondingly, the second negative sample information includes multiple second negative sample pairs.
[0163] In a specific embodiment, when determining the first contrast loss based on the first positive sample information, the first negative sample information, the second positive sample information, and the second negative sample information, a contrast learning loss function may be combined.
[0164] In the above embodiment, the first positive sample information constructed by combining the first node feature information of the target account node under the target interaction operation and other interaction operations (auxiliary operations), the first negative sample information constructed by combining the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under other interaction operations, the second positive sample information constructed by combining the first node feature information of the target object node under the target interaction operation and each other interaction operation, and the second negative sample information constructed by combining the first node feature information of the target object node under the target interaction operation and the first node feature information of other object nodes under other interaction operations are used to determine the first contrast loss, which can realize contrast learning of the node feature information under the target interaction operation and other interaction operations (auxiliary operations) to transfer the semantics of other interaction operations, improve the similarity between the node feature information under different interaction operations, and further, on the basis of alleviating data sparsity based on the edge information corresponding to multiple interaction operations, effectively alleviate the interaction noise data caused by the data distribution deviation in the learning under different interaction operations.
[0165] In step S209, based on the second node feature information and the third node feature information, a second contrast loss corresponding to each node is generated.
[0166] In a specific embodiment, the above-mentioned second contrast loss represents the difference between the node feature information of each node under the target interaction operation under different perturbations;
[0167] In practical applications, in order to reduce the dependence on the edges corresponding to other interaction operations during the node feature learning process, in the embodiments of this specification, self-supervised contrast learning within the target interaction operation may be combined with different perturbed graph data corresponding to the target subgraph data.
[0168] In an alternative embodiment, as Figure 5 shown, generating the second contrast loss corresponding to each node based on the second node feature information and the third node feature information may include the following steps:
[0169] In step S501, construct third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation;
[0170] In step S503, construct third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation;
[0171] In step S505, construct fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation;
[0172] In step S507, construct fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation;
[0173] In step S509, determine the second contrast loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information.
[0174] In a specific embodiment, the above target account node may be any sample account node among multiple nodes; constructing the third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation; the target account node being any sample account node among multiple nodes may include: combining the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation into a third positive sample pair. Correspondingly, the third positive sample information includes multiple third positive sample pairs.
[0175] In a specific embodiment, any other account node is any sample account node among multiple nodes other than the target account node; constructing the third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation may include: combining the second node feature information of the target account node under the target interaction operation and the third node feature information of a certain other account node under a certain target interaction operation into a third negative sample pair. Correspondingly, the third negative sample information includes multiple third negative sample pairs.
[0176] In a specific embodiment, the above-mentioned target object node is any sample object node among multiple nodes. The construction of the fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation may include: the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation are used as a fourth positive sample pair. Correspondingly, the fourth positive sample information may include multiple fourth positive sample pairs.
[0177] In a specific embodiment, any other object node mentioned above is any sample object node among multiple nodes except the target object node. The construction of the fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation may include: combining the second node feature information of the target object node under the target interaction operation and the third node feature information of a certain other object node under the target interaction operation to form a fourth negative sample pair. Correspondingly, the fourth negative sample information includes multiple fourth negative sample pairs.
[0178] In a specific embodiment, when determining the second contrast loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information, a contrast learning loss function can be combined.
[0179] Construct the third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation;
[0180] In step S503, construct the third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation;
[0181] In step S505, construct the fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation;
[0182] In step S507, construct the fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation
[0183] In the above embodiments, the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information constructed by combining the second node feature information and the third node feature information corresponding to multiple nodes under different perturbations are used to determine the second contrast loss, which can effectively reduce the over-reliance on the edges corresponding to other interaction operations during the node feature learning process. Furthermore, on the basis of alleviating data sparsity based on the edge information corresponding to multiple interaction operations, it can effectively alleviate the interactive noise data brought by other interaction operations.
[0184] In step S211, the object recommendation model to be trained is trained based on the first contrast loss, the second contrast loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account, to obtain a trained object recommendation model.
[0185] In a specific embodiment, the preset recommendation metric data corresponding to each sample account represents the probability that each sample account performs a target interaction operation on each sample interaction object. Specifically, the above preset recommendation metric data can be determined according to the interaction operation situation of each sample account on each sample interaction object. Optionally, if a certain sample account has performed a target interaction operation on each sample interaction object, correspondingly, the preset recommendation metric data can be 1; conversely, if a certain sample account has not performed a target interaction operation on each sample interaction object, the preset recommendation metric data can be 0.
[0186] In an optional embodiment, the above training of the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account to obtain a trained object recommendation model may include: determining a recommendation loss according to the predicted recommendation metric data and the preset recommendation metric data; performing a weighted sum of the recommendation loss, the first contrast loss, and the second contrast loss to determine a target loss; and training the object recommendation model to be trained based on the target loss to obtain a trained object recommendation model.
[0187] In a specific embodiment, the above recommendation loss may represent the difference between the predicted recommendation metric data and the preset recommendation metric data; specifically, the recommendation loss can be determined in combination with a preset loss function; optionally, the preset loss function may include a cross-entropy loss function, an exponential loss function, etc. The target loss may represent the object recommendation performance of the object recommendation model to be trained; optionally, the larger the target loss, the worse the object recommendation performance; conversely, the larger the target loss, the better the object recommendation performance.
[0188] In a specific embodiment, the weights corresponding to the recommendation loss, the first contrast loss, and the second contrast loss can be adjusted and obtained according to actual application requirements.
[0189] In a specific embodiment, the gradient descent method can be combined to determine the gradient information corresponding to the target loss, and the corresponding model parameters in the object recommendation model to be trained can be adjusted in combination with the gradient information. Then, based on the updated object recommendation model to be trained, the above steps S203 to S209 are repeated to determine the target loss, determine the gradient information corresponding to the target loss, and the training iteration steps of adjusting the corresponding model parameters in the object recommendation model to be trained until the preset convergence condition is met; and the object recommendation model to be trained corresponding to when the preset convergence condition is met is used as the object training model.
[0190] In a specific embodiment, the above-mentioned meeting the preset convergence condition can be that the target loss is less than or equal to the preset loss threshold, or the number of training iteration steps reaches the preset number, etc. Specifically, the preset loss threshold and the preset number can be set in combination with the model accuracy and training speed requirements in actual applications.
[0191] In the above embodiment of adjusting the model parameters of the object recommendation model to be trained by weighted summation of multiple losses, the possibility of unbalanced optimization in cross-tasks (cross-operations) is ignored, which will reduce the performance of the target task (the task of predicting the target interaction operation performed by the account); and adjusting the weights of multiple losses is often time-consuming and laborious. In an alternative embodiment, in order to solve the problems of reduced performance of the target task (object recommendation) and low efficiency caused by time-consuming and laborious loss weight adjustment process in the above-mentioned training of adjusting the model parameters of the object recommendation model to be trained by weighted summation of multiple losses; as Figure 6 shown, the above-mentioned training of the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the predicted recommendation index data, and the preset recommendation index data corresponding to each sample account to obtain the trained object recommendation model may include:
[0192] In step S601, according to the predicted recommendation index data and the preset recommendation index data, the recommendation loss is determined;
[0193] In step S603, according to the recommendation loss, the first gradient information corresponding to the model parameters in the object recommendation model to be trained is determined;
[0194] In step S605, according to the first contrast loss, the second gradient information corresponding to the model parameters in the object recommendation model to be trained is determined;
[0195] In step S607, according to the second contrast loss, the third gradient information corresponding to the model parameters in the object recommendation model to be trained is determined;
[0196] In step S609, based on the first gradient information, the second gradient information and the third gradient information are corrected to obtain first corrected gradient information and second corrected gradient information respectively;
[0197] In step S611, based on the first gradient information, the first corrected gradient information and the second corrected gradient information, the object recommendation model to be trained is trained to obtain a trained object recommendation model.
[0198] In a specific embodiment, the first gradient information for adjusting the model parameters can be calculated by combining the gradient descent method and the recommendation loss; the second gradient information for adjusting the model parameters can be calculated by combining the gradient descent method and the first contrast loss; and the third gradient information for adjusting the model parameters can be calculated by combining the gradient descent method and the second contrast loss.
[0199] In a specific embodiment, the above-mentioned correction of the second gradient information and the third gradient information based on the first gradient information to obtain the first corrected gradient information and the second corrected gradient information respectively may include: correcting the directions and / or magnitudes of the second gradient information and the third gradient information based on the direction and / or magnitude of the first gradient information to obtain the first corrected gradient information and the second corrected gradient information respectively.
[0200] In an alternative embodiment, taking the correction of the directions and magnitudes of the second gradient information and the third gradient information as an example, the above-mentioned correction of the second gradient information and the third gradient information based on the first gradient information to obtain the first corrected gradient information and the second corrected gradient information respectively may include:
[0201] According to the direction of the first gradient information, the gradient component in the target direction in the second gradient information is removed to obtain the first initial gradient information corresponding to the second gradient information;
[0202] According to the direction of the first gradient information, the gradient component in the target direction in the third gradient information is removed to obtain the second initial gradient information corresponding to the third gradient information;
[0203] According to the gradient magnitude of the first gradient information, the gradient magnitudes of the first initial gradient information and the second initial gradient information are adjusted to obtain the first corrected gradient information and the second corrected gradient information.
[0204] In a specific embodiment, the first corrected gradient information can be the result of correcting the second gradient information; the second corrected gradient information can be the result of correcting the third gradient information; the target direction is opposite to the direction of the first gradient information; specifically, the first initial gradient information can be the gradient information obtained by removing the gradient component in the target direction from the second gradient information. The second initial gradient information can be the gradient information obtained by removing the gradient component in the target direction from the third gradient information. Optionally, the following formula can be combined to remove the gradient component in the target direction from the second gradient information and the third gradient information:
[0205]
[0206] wherein, can be the gradient information to be corrected (the second gradient information or the third gradient information) can be the first gradient information, can be the gradient information obtained by removing the gradient component in the target direction (the first initial gradient information or the second initial gradient information).
[0207] In a specific embodiment, although the degree of interference with the gradient corresponding to the model target task (the task of predicting the target interaction operation executed by the account) is reduced through direction adjustment, the large gradient amplitude of the auxiliary task corresponding to the contrast loss still hinders the optimization of the model target task. Therefore, in the embodiments of this specification, the size of the large gradient is further adjusted to make it closer to the gradient of the target task (the first gradient information); optionally, the following formula can be combined to adjust the gradient size:
[0208]
[0209] wherein, can be the gradient information obtained by removing the gradient component in the target direction (the first initial gradient information or the second initial gradient information), can be the first gradient information; can be a preset relaxation factor; can be the first corrected gradient information or the second corrected gradient information.
[0210] In the above embodiments, first, according to the direction of the first gradient information, the gradient components in the target direction opposite to the direction of the first gradient information in the second gradient information and the third gradient information are removed, and the first initial gradient information corresponding to the second gradient information and the second initial gradient information corresponding to the third gradient information are obtained, which can effectively reduce the degree of interference with the gradient corresponding to the target task of the model; then, in combination with the gradient magnitude of the first gradient information, the gradient magnitudes of the first initial gradient information and the second initial gradient information are adjusted to obtain the first corrected gradient information and the second corrected gradient information, which can effectively improve the consistency between the gradient information corresponding to the auxiliary task and the first gradient information corresponding to the target task, and further improve the smoothness during model training, and solve the problem of optimization imbalance between the auxiliary task and the target task.
[0211] In addition, it should be noted that in the scenario of correcting the direction and magnitude of the second gradient information and the third gradient information, the magnitude can also be corrected first and then the direction can be calibrated, which can be set according to the actual application requirements.
[0212] In the above embodiments, in combination with the first gradient information determined based on the recommendation loss corresponding to the target task of the object recommendation model to be trained, the second gradient information and the third gradient information determined based on the first contrast loss and the second contrast loss during the training process of the object recommendation model to be trained are corrected to obtain the first corrected gradient information and the second corrected gradient information respectively, which can effectively ensure the consistency between the first corrected gradient information and the second corrected gradient information corresponding to the auxiliary task and the first gradient information corresponding to the target task. Then, according to the first gradient information, the first corrected gradient information and the second corrected gradient information, the object recommendation model to be trained is trained to obtain a trained object recommendation model, which can effectively improve the smoothness during model training and solve the problem of optimization imbalance between the auxiliary task and the target task.
[0213] As can be seen from the technical solutions provided in the embodiments of this specification above, in the training process of the object recommendation model in this specification, initial graph data is obtained. The initial graph data is constructed based on multiple interaction relationships, and the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects. Then, the initial graph data is input into the object recommendation model to be trained for object recommendation prediction, and the predicted recommendation index data corresponding to each sample account and the first node feature information of each node in each interaction operation in the initial graph data are obtained. Next, under different perturbations, the node feature information (the second node feature information and the third node feature information) of each node under the target interaction operation is obtained. Then, based on the first node feature information, a first contrast loss representing the difference between the node feature information of each node under the target interaction operation and other interaction operations is generated, which can realize the contrast learning of the node feature information under the target interaction operation and other interaction operations, so as to transfer the semantics of other interaction operations, improve the similarity between the node feature information under different interaction operations, and effectively alleviate the interaction noise data caused by the data distribution deviation in learning under different interaction operations. Then, based on the second node feature information and the third node feature information, a second contrast loss representing the difference between the node feature information of each node under the target interaction operation under different perturbations is generated, which can effectively reduce the over-dependence on the edges corresponding to other interaction operations in the process of node feature learning and effectively alleviate the interaction noise data brought by other interaction operations. Then, based on the first contrast loss, the second contrast loss, the predicted recommendation index data, and the preset recommendation index data corresponding to each sample account, the object recommendation model to be trained is trained to obtain a trained object recommendation model, which can realize the joint contrast learning within and between operations. On the basis of alleviating data sparsity based on the edge information corresponding to multiple interaction operations in the graph data, it can effectively alleviate the data distribution deviation in learning under different interaction operations and the interaction noise data caused by the over-dependence on the edges corresponding to other interaction operations, greatly improve the accuracy of the trained model in representing user accounts and objects, improve the object recommendation prediction ability of the model, and the recommendation effect in the recommendation system. Furthermore, it can also reduce the situation of invalid object recommendations, reduce system resource waste, and improve system performance.
[0214] The following introduces an object recommendation method of an object recommendation model obtained based on the above object recommendation model training method of the present application, as Figure 7 shown Figure 7 is a flowchart of an object recommendation method provided according to an exemplary embodiment, which may include the following steps:
[0215] In step S701, target graph data corresponding to a target account is obtained;
[0216] In a specific embodiment, the target account may be any user account that needs to recommend an object on the object recommendation platform. The above-mentioned target graph data is graph data with the target account and at least one preset object as nodes, and at least one interaction relationship between the target account and the historical interaction objects of the target account among the target account and at least one preset object as edges; the at least one preset object may be an object to be recommended on the object recommendation platform; optionally, the historical interaction objects of the target account may be the objects on which the target account has performed interaction operations among the at least one preset object. The historical interaction objects may include at least one object, and correspondingly, the target account may have performed at least one interaction operation on each object.
[0217] In step S703, the target graph data is input into the trained object recommendation model for object recommendation prediction, and target recommendation index data corresponding to at least one preset object is obtained.
[0218] In a specific embodiment, the target recommendation index data may represent the probability that the trained object recommendation model predicts that the target account will perform a target interaction operation on at least one preset object.
[0219] In an alternative embodiment, the trained object recommendation model includes a trained graph feature extraction module, a trained self-attention learning module, a feature fusion module, and a classification module; the above-mentioned inputting the target graph data into the trained object recommendation model for object recommendation prediction to obtain target recommendation index data corresponding to at least one preset object may include:
[0220] Input the target graph data into the trained graph feature extraction module for graph feature extraction to obtain the fifth node feature information of the account node corresponding to the target account under each interaction operation;
[0221] Input the fifth node feature information into the trained self-attention learning module for self-attention learning to obtain the second attention weight of the account node under each interaction operation;
[0222] Input the fifth node feature information and the second attention weight into the feature fusion module for feature fusion to obtain the sixth node feature information;
[0223] Input the sixth node feature information into the classification module for classification processing to obtain the target recommendation index data.
[0224] In a specific embodiment, the above-mentioned input of the target graph data into the trained object recommendation model for object recommendation prediction to obtain the target recommendation index data corresponding to at least one preset object can refer to the specific refinement of the corresponding specific refinement steps of the above-mentioned input of the initial graph data into the object recommendation model to be trained for object recommendation prediction, obtaining the predicted recommendation index data corresponding to each sample account and the first node feature information of each node under each interaction operation among multiple nodes, and the specific refinement will not be elaborated here.
[0225] In the above embodiment, first, the target graph data is input into the graph feature extraction module to learn the fifth node feature information of each node under each interaction operation. Then, the fifth node feature information is input into the self-attention learning module for self-attention learning to obtain the second attention weight of each node under each interaction operation. Based on learning the correlation among multiple interaction operations, the importance degree of the node representation corresponding to each interaction operation can be learned. Then, combined with the feature fusion module, the fifth node feature information and the second attention weight are fused to obtain the sixth node feature information, which can take into account the heterogeneity and correlation among interaction operations, greatly improving the accuracy of the node representation, and further ensuring the accuracy of object recommendation prediction based on the sixth node feature information.
[0226] In step S705, based on the target recommendation index data, a target recommendation object is determined from at least one preset object.
[0227] In a specific embodiment, the target recommendation object may include at least one object recommended to the target account; optionally, an object whose corresponding target recommendation index data in at least one preset object is greater than or equal to a preset threshold may be used as the target recommendation object; alternatively, the objects whose corresponding target recommendation index data in at least one preset object are sorted in descending order and ranked in the top preset number of positions may be used as the target recommendation objects.
[0228] In step S707, the target recommendation object is recommended to the target account.
[0229] In a specific embodiment, the above-mentioned recommendation of the target recommendation object to the target account may include: sending the target recommendation object to the terminal corresponding to the target account.
[0230] As can be seen from the technical solutions provided in the embodiments of this specification above, in the process of object recommendation in this specification, target graph data corresponding to a target account is obtained. The target graph data is graph data with the target account and at least one preset object as nodes and at least one interaction relationship between the historical interaction objects of the target account among the target account and at least one preset object as edges. Inputting the target graph data into an object recommendation model trained based on the joint contrast loss corresponding to between operations and within operations for object recommendation prediction can effectively ensure the accuracy of the feature information corresponding to the target account and at least one preset object learned by the model during the object recommendation prediction process. Furthermore, it can effectively ensure the accuracy and effectiveness of the target recommendation metric data. Then, based on the target recommendation metric data, a target recommendation object recommended to the target account is determined, which can greatly improve the recommendation effect in the recommendation system. Moreover, it can also reduce the situation of invalid object recommendations, reduce system resource waste, and improve system performance.
[0231] Figure 8 is a block diagram of a training device for an object recommendation model shown according to an exemplary embodiment. Referring to Figure 8 , the device includes:
[0232] A first graph data acquisition module 810, configured to execute acquiring initial graph data, which is constructed based on multiple interaction relationships. The multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects. The initial graph data includes multiple nodes. The multiple nodes include sample account nodes corresponding to multiple sample accounts and sample object nodes corresponding to multiple sample interaction objects.
[0233] A first object recommendation prediction module 820, configured to execute inputting the initial graph data into an object recommendation model to be trained for object recommendation prediction, and obtaining prediction recommendation metric data corresponding to each sample account and first node feature information of each node in each interaction operation among the multiple nodes.
[0234] A node feature information acquisition module 830, configured to execute acquiring second node feature information of each node under a target interaction operation and third node feature information of each node under the target interaction operation. The second node feature information is obtained based on a first perturbed graph data corresponding to target sub-graph data in the initial graph data, and the third node feature information is obtained based on a second perturbed graph data corresponding to the target sub-graph data. The target sub-graph data is sub-graph data corresponding to the target interaction operation among the multiple interaction operations.
[0235] The first contrast loss generation module 840 is configured to generate a first contrast loss corresponding to each node based on the first node feature information; the first contrast loss represents the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation; each other interaction operation is each interaction operation other than the target interaction operation among multiple interaction operations.
[0236] The second contrast loss generation module 850 is configured to generate a second contrast loss corresponding to each node based on the second node feature information and the third node feature information; the second contrast loss represents the difference between the node feature information of each node under the target interaction operation under different perturbations.
[0237] The model training module 860 is configured to train the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account, and obtain the trained object recommendation model.
[0238] In an optional embodiment, the first contrast loss generation module 840 includes:
[0239] The first positive sample information construction unit is configured to construct first positive sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation; the target account node is any sample account node among multiple nodes.
[0240] The first negative sample information construction unit is configured to construct first negative sample information according to the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation; any other account node is any sample account node other than the target account node among multiple nodes.
[0241] The second positive sample information construction unit is configured to construct second positive sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation; the target object node is any sample object node among multiple nodes.
[0242] The second negative sample information construction unit is configured to construct second negative sample information according to the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation; any other object node is any sample object node other than the target object node among multiple nodes.
[0243] A first contrast loss determination unit, configured to determine a first contrast loss based on first positive sample information, first negative sample information, second positive sample information, and second negative sample information.
[0244] In an optional embodiment, the second contrast loss generation module 850 includes:
[0245] A third positive sample information construction unit, configured to construct third positive sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation; the target account node is any sample account node among multiple nodes;
[0246] A third negative sample information construction unit, configured to construct third negative sample information according to the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation; any other account node is any sample account node other than the target account node among multiple nodes;
[0247] A fourth positive sample information construction unit, configured to construct fourth positive sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation; the target object node is any sample object node among multiple nodes;
[0248] A fourth negative sample information construction unit, configured to construct fourth negative sample information according to the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation; any other object node is any sample object node other than the target object node among multiple nodes;
[0249] A second contrast loss determination unit, configured to determine a second contrast loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information.
[0250] In an optional embodiment, the object recommendation model to be trained includes a to-be-trained graph feature extraction module, a to-be-trained self-attention learning module, a feature fusion module, and a classification module; the first object recommendation prediction module 820 includes:
[0251] A first graph feature extraction unit, configured to input the initial graph data into the to-be-trained graph feature extraction module for graph feature extraction to obtain the fourth node feature information of each node under each interaction operation;
[0252] The first self-attention learning unit is configured to perform self-attention learning by inputting the fourth node feature information into the self-attention learning module to be trained, and obtain the first attention weight of each node under each interaction operation;
[0253] The first feature fusion unit is configured to perform feature fusion by inputting the fourth node feature information and the first attention weight into the feature fusion module, and obtain the first node feature information;
[0254] The first classification processing unit is configured to perform classification processing by inputting the first node feature information into the classification module, and obtain the predicted recommendation metric data.
[0255] In an optional embodiment, the model training module 860 includes:
[0256] The recommendation loss determination unit is configured to determine the recommendation loss according to the predicted recommendation metric data and the preset recommendation metric data;
[0257] The first gradient information determination unit is configured to determine the first gradient information corresponding to the model parameters in the object recommendation model to be trained according to the recommendation loss;
[0258] The second gradient information determination unit is configured to determine the second gradient information corresponding to the model parameters in the object recommendation model to be trained according to the first contrast loss;
[0259] The third gradient information determination unit is configured to determine the third gradient information corresponding to the model parameters in the object recommendation model to be trained according to the second contrast loss;
[0260] The gradient information correction unit is configured to perform correction on the second gradient information and the third gradient information based on the first gradient information, and respectively obtain the first corrected gradient information and the second corrected gradient information;
[0261] The model training unit is configured to train the object recommendation model to be trained according to the first gradient information, the first corrected gradient information and the second corrected gradient information, and obtain the trained object recommendation model.
[0262] In an optional embodiment, the gradient information correction module includes:
[0263] The first gradient direction correction unit is configured to remove the gradient component in the target direction from the second gradient information according to the direction of the first gradient information, and obtain the first initial gradient information corresponding to the second gradient information; the target direction is opposite to the direction of the first gradient information;
[0264] The second gradient direction correction unit is configured to perform removing the gradient component in the target direction from the third gradient information according to the direction of the first gradient information, so as to obtain the second initial gradient information corresponding to the third gradient information;
[0265] The gradient magnitude correction unit is configured to perform gradient magnitude adjustment on the first initial gradient information and the second initial gradient information according to the gradient magnitude of the first gradient information, so as to obtain the first corrected gradient information and the second corrected gradient information.
[0266] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0267] Figure 9 is a block diagram of an object recommendation device shown according to an exemplary embodiment. Refer to Figure 9 The device includes:
[0268] The second graph data acquisition module 910 is configured to perform acquiring target graph data corresponding to a target account; the target graph data is graph data with the target account and at least one preset object as nodes, and at least one interaction relationship between the target account and the historical interaction objects of the target account among the target account and at least one preset object as edges;
[0269] The second object recommendation prediction module 920 is configured to perform inputting the target graph data into an object recommendation model obtained by the object recommendation model training method according to any one of the above first aspects for object recommendation prediction, so as to obtain target recommendation index data corresponding to at least one preset object;
[0270] The target recommended object determination module 930 is configured to perform determining a target recommended object from at least one preset object based on the target recommendation index data;
[0271] The object recommendation module 940 is configured to perform recommending the target recommended object to the target account.
[0272] In an optional embodiment, the object recommendation model includes a graph feature extraction module, a self-attention learning module, a feature fusion module, and a classification module; the second object recommendation prediction module 920 includes:
[0273] The second graph feature extraction unit is configured to perform inputting the target graph data into the graph feature extraction module for graph feature extraction, so as to obtain fifth node feature information of the account node corresponding to the target account under each interaction operation;
[0274] The second self-attention learning unit is configured to perform inputting the fifth node feature information into the self-attention learning module for self-attention learning, so as to obtain a second attention weight of the account node under each interaction operation;
[0275] A second feature fusion unit, configured to perform feature fusion by inputting fifth node feature information and second attention weight into a feature fusion module to obtain sixth node feature information;
[0276] A second classification processing unit, configured to perform classification processing by inputting the sixth node feature information into a classification module to obtain target recommendation metric data.
[0277] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0278] Figure 10 is a block diagram of an electronic device for object recommendation shown according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as Figure 10 shown. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements an object recommendation method. The display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device may be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, touchpad, or mouse, etc.
[0279] Figure 11 is a block diagram of an electronic device for training an object recommendation model shown according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as Figure 11 shown. The electronic device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements a method for training an object recommendation model.
[0280] Those skilled in the art can understand, Figure 10 orFigure 11 The structure shown is only a block diagram of some of the structures related to the present disclosure, and does not constitute a limitation on the electronic device to which the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have a different component arrangement.
[0281] In an exemplary embodiment, an electronic device is further provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the training of the object recommendation model or the object recommendation method in the embodiments of the present disclosure.
[0282] In an exemplary embodiment, a computer-readable storage medium is further provided. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the training of the object recommendation model or the object recommendation method in the embodiments of the present disclosure.
[0283] In an exemplary embodiment, a computer program product including instructions is further provided. When it runs on a computer, the computer is enabled to execute the training of the object recommendation model or the object recommendation method in the embodiments of the present disclosure.
[0284] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above methods. Among them, any reference to the memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memories. Non-volatile memories may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memories may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0285] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0286] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A training method for an object recommendation model, characterized in that, it includes: Obtain initial graph data, which is constructed based on multiple interaction relationships, and the multiple interaction relationships represent multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects; the initial graph data includes multiple nodes; The multiple nodes include sample account nodes corresponding to the multiple sample accounts and sample object nodes corresponding to the multiple sample interaction objects; The multiple sample accounts are multiple user accounts in an object recommendation platform; The multiple sample interaction objects are multimedia content recommended in the object recommendation platform; Input the initial graph data into the object recommendation model to be trained for object recommendation prediction, and obtain prediction recommendation index data corresponding to each sample account and first node feature information of each node in each interaction operation among the multiple nodes; Obtain second node feature information of each node under a target interaction operation and third node feature information of each node under the target interaction operation, where the second node feature information is obtained based on first perturbed graph data corresponding to target sub-graph data in the initial graph data, and the third node feature information is obtained based on second perturbed graph data corresponding to the target sub-graph data; The target sub-graph data is sub-graph data corresponding to the target interaction operation among the multiple interaction operations; Generate a first contrast loss corresponding to each node based on the first node feature information; the first contrast loss represents the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation; each other interaction operation is each interaction operation other than the target interaction operation among the multiple interaction operations; Generate a second contrast loss corresponding to each node based on the second node feature information and the third node feature information; the second contrast loss represents the difference between the node feature information of each node under the target interaction operation under different perturbations; Train the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the prediction recommendation index data, and the preset recommendation index data corresponding to each sample account, and obtain a trained object recommendation model.
2. The training method for an object recommendation model according to claim 1, characterized in that, The generating a first contrast loss corresponding to each node based on the first node feature information includes: Construct first positive sample information according to the first node feature information of a target account node under the target interaction operation and the first node feature information of the target account node under each other interaction operation; the target account node is any sample account node among the multiple nodes; Construct first negative sample information based on the first node feature information of the target account node under the target interaction operation and the first node feature information of any other account node under each other interaction operation; the any other account node is any sample account node other than the target account node among the multiple nodes; Construct second positive sample information based on the first node feature information of the target object node under the target interaction operation and the first node feature information of the target object node under each other interaction operation; the target object node is any sample object node among the multiple nodes; Construct second negative sample information based on the first node feature information of the target object node under the target interaction operation and the first node feature information of any other object node under each other interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes; Determine the first contrastive loss based on the first positive sample information, the first negative sample information, the second positive sample information, and the second negative sample information.
3. The training method of the object recommendation model according to claim 1, wherein, The generating the second contrastive loss corresponding to each node based on the second node feature information and the third node feature information includes: Construct third positive sample information based on the second node feature information of the target account node under the target interaction operation and the third node feature information of the target account node under the target interaction operation; the target account node is any sample account node among the multiple nodes; Construct third negative sample information based on the second node feature information of the target account node under the target interaction operation and the third node feature information of any other account node under the target interaction operation; the any other account node is any sample account node other than the target account node among the multiple nodes; Construct fourth positive sample information based on the second node feature information of the target object node under the target interaction operation and the third node feature information of the target object node under the target interaction operation; the target object node is any sample object node among the multiple nodes; Construct fourth negative sample information based on the second node feature information of the target object node under the target interaction operation and the third node feature information of any other object node under the target interaction operation; the any other object node is any sample object node other than the target object node among the multiple nodes; Determine the second contrastive loss based on the third positive sample information, the third negative sample information, the fourth positive sample information, and the fourth negative sample information.
4. The training method of the object recommendation model according to any one of claims 1 to 3, wherein, The object recommendation model to be trained includes a graph feature extraction module to be trained, a self-attention learning module to be trained, a feature fusion module, and a classification module; the step of inputting the initial graph data into the object recommendation model to be trained for object recommendation prediction, and obtaining the predicted recommendation metric data corresponding to each sample account and the first node feature information of each node in each interaction operation among the multiple nodes includes: Inputting the initial graph data into the graph feature extraction module to be trained for graph feature extraction, and obtaining the fourth node feature information of each node in each interaction operation; Inputting the fourth node feature information into the self-attention learning module to be trained for self-attention learning, and obtaining the first attention weight of each node in each interaction operation; Inputting the fourth node feature information and the first attention weight into the feature fusion module for feature fusion, and obtaining the first node feature information; Inputting the first node feature information into the classification module for classification processing, and obtaining the predicted recommendation metric data.
5. The training method of the object recommendation model according to any one of claims 1 to 3, wherein, the step of training the object recommendation model to be trained based on the first contrast loss, the second contrast loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account to obtain the trained object recommendation model includes: Determining a recommendation loss according to the predicted recommendation metric data and the preset recommendation metric data; Determining the first gradient information corresponding to the model parameters in the object recommendation model to be trained according to the recommendation loss; Determining the second gradient information corresponding to the model parameters in the object recommendation model to be trained according to the first contrast loss; Determining the third gradient information corresponding to the model parameters in the object recommendation model to be trained according to the second contrast loss; Based on the first gradient information, correcting the second gradient information and the third gradient information to obtain the first corrected gradient information and the second corrected gradient information respectively; Training the object recommendation model to be trained according to the first gradient information, the first corrected gradient information, and the second corrected gradient information to obtain the trained object recommendation model.
6. The training method of the object recommendation model according to claim 5, wherein, the step of correcting the second gradient information and the third gradient information based on the first gradient information to obtain the first corrected gradient information and the second corrected gradient information respectively includes: According to the direction of the first gradient information, removing the gradient component in the target direction in the second gradient information to obtain the first initial gradient information corresponding to the second gradient information; the target direction is opposite to the direction of the first gradient information; According to the direction of the first gradient information, removing the gradient component in the target direction in the third gradient information to obtain the second initial gradient information corresponding to the third gradient information; Adjust the gradient magnitudes of the first initial gradient information and the second initial gradient information according to the gradient magnitude of the first gradient information to obtain the first corrected gradient information and the second corrected gradient information.
7. An object recommendation method Characterized in that It includes: Obtain target graph data corresponding to a target account; The target graph data is a graph data with the target account and at least one preset object as nodes and at least one interaction relationship between the target account and the historical interaction objects of the target account among the target account and the at least one preset object as edges; Input the target graph data into a trained object recommendation model obtained by the training method of the object recommendation model according to any one of claims 1 to 6 for object recommendation prediction to obtain target recommendation index data corresponding to the at least one preset object; Based on the target recommendation index data, determine a target recommendation object from the at least one preset object; Recommend the target recommendation object to the target account.
8. A training device for an object recommendation model Characterized in that It includes: A first graph data acquisition module configured to execute acquiring initial graph data, the initial graph data being constructed based on multiple interaction relationships, the multiple interaction relationships representing multiple interaction operations performed by multiple sample accounts on multiple sample interaction objects; the initial graph data includes multiple nodes; The multiple nodes include sample account nodes corresponding to the multiple sample accounts and sample object nodes corresponding to the multiple sample interaction objects; The multiple sample accounts are multiple user accounts within an object recommendation platform; The multiple sample interaction objects are multimedia content recommended within the object recommendation platform; A first object recommendation prediction module configured to execute inputting the initial graph data into an object recommendation model to be trained for object recommendation prediction, and obtain prediction recommendation index data corresponding to each sample account and first node feature information of each node among the multiple nodes under each interaction operation; A node feature information acquisition module configured to execute acquiring second node feature information of each node under a target interaction operation and third node feature information of each node under the target interaction operation, the second node feature information being obtained based on a first perturbed graph data corresponding to target sub-graph data in the initial graph data, and the third node feature information being obtained based on a second perturbed graph data corresponding to the target sub-graph data; The target sub-graph data is sub-graph data corresponding to the target interaction operation among the multiple interaction operations; A first contrast loss generation module configured to execute generating a first contrast loss corresponding to each node based on the first node feature information; the first contrast loss represents the difference between the node feature information of each node under the target interaction operation and the node feature information of each node under each other interaction operation; each other interaction operation is each interaction operation other than the target interaction operation among the multiple interaction operations; The second contrastive loss generation module is configured to generate the second contrastive loss corresponding to each node based on the second node feature information and the third node feature information; the second contrastive loss characterizes the difference in node feature information of each node under the target interaction operation under different perturbations; The model training module is configured to train the object recommendation model to be trained based on the first contrastive loss, the second contrastive loss, the predicted recommendation metric data, and the preset recommendation metric data corresponding to each sample account, to obtain a trained object recommendation model.
9. An object recommendation device, Characterized in that, It includes: The second graph data acquisition module is configured to acquire the target graph data corresponding to the target account; The target graph data is a graph data with the target account and at least one preset object as nodes and at least one interaction relationship between the target account and the historical interaction objects of the target account among the at least one preset object as edges; The second object recommendation prediction module is configured to input the target graph data into the object recommendation model obtained by the training method of the object recommendation model according to any one of claims 1 to 6 for object recommendation prediction, to obtain the target recommendation metric data corresponding to the at least one preset object; The target recommended object determination module is configured to determine the target recommended object from the at least one preset object based on the target recommendation metric data; The object recommendation module is configured to recommend the target recommended object to the target account.
10. An electronic device, Characterized in that, It includes: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the training method of the object recommendation model according to any one of claims 1 to 6 or the object recommendation method according to claim 7.
11. A computer-readable storage medium, Characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the training method of the object recommendation model according to any one of claims 1 to 6 or the object recommendation method according to claim 7.
Citation Information
Patent Citations
Training method of neural network model
CN114003960A
Dynamic recommendation method of graph neural network based on acceptance enhancement
CN114387007A