Model Processing Method, Device, Equipment, and Storage Medium for Resource Push
By obtaining heterogeneous graphs, enhancing graph data and coding, and calculating comparison loss and matching loss, the model training method of new users and new items is solved, and the accuracy of resource push is improved.
Patent Information
- Application Number
- CN202211180997.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-09-27
AI Technical Summary
传统的协同过滤方法无法为新用户和新物品提供精准的资源推送,导致冷启动推送问题。
By obtaining heterogeneous graphs, graph data enhancement and graph encoding are performed, and comparison loss and matching loss are calculated using graph encoder for model training to improve the push accuracy of new objects and new resources.
It improves the robustness of the graph encoder, can accurately represent new objects and new resources, solves the problem of cold start push, and improves the accuracy of resource push.
Smart Images

Figure CN117033754B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and particularly to a model processing method, device, computer device, storage medium, and computer program product for resource push. Background Art
[0002] With the rapid development of machine learning technology, in order to perform personalized push for users, a collaborative filtering method is often used to generate a specific push list for users, that is, based on the attribute information and historical behavior data of users, a push model is constructed using a certain algorithm to achieve the purpose of personalized push.
[0003] However, new users and new items are constantly emerging. Due to the lack of interaction information between new users, new items and existing users, existing items, traditional collaborative filtering methods cannot provide accurate push for new users and new items, that is, the problem of cold start push cannot be solved. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a model processing method, device, computer device, computer-readable storage medium, and computer program product for resource push that can improve the accuracy of resource push for newly added objects.
[0005] The present application provides a model processing method for resource push. The method includes:
[0006] Obtain a heterogeneous graph formed based on the interaction between objects and resources, where the heterogeneous graph includes object nodes and resource nodes;
[0007] Obtain sample nodes from the heterogeneous graph. For each sample node, according to at least one path from the neighbor nodes of the sample node to the sample node, obtain the original subgraph corresponding to the sample node, and perform graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node;
[0008] Use a graph encoder to perform graph encoding on the original subgraph and the augmented subgraph respectively to obtain the original graph encoding representation and augmented graph encoding representation of the sample node;
[0009] Calculate a contrast loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the augmented graph encoding representations of different sample nodes, and calculate a matching loss according to the similarity between the original graph encoding representations of the object sample nodes and resource sample nodes with existing edges;
[0010] The model is trained by combining the contrastive loss and the matching loss to obtain a trained graph encoder, which is used for resource push between objects and resources.
[0011] This application also provides a model processing device for resource push. The device includes:
[0012] A first acquisition module, configured to acquire a heterogeneous graph formed based on the interaction between objects and resources, where the heterogeneous graph includes object nodes and resource nodes;
[0013] A second acquisition module, configured to acquire sample nodes from the heterogeneous graph. For each sample node, according to at least one path from the neighbor nodes of the sample node to the sample node, obtain the original sub-graph corresponding to the sample node, and perform graph data augmentation on the original sub-graph to obtain the augmented sub-graph corresponding to the sample node;
[0014] A graph encoding module, configured to use a graph encoder to perform graph encoding on the original sub-graph and the augmented sub-graph respectively to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node;
[0015] A calculation module, configured to calculate the contrastive loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculate the matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection;
[0016] A training module, configured to train the model by combining the contrastive loss and the matching loss to obtain a trained graph encoder, which is used for resource push between objects and resources.
[0017] In one embodiment, the first acquisition module is configured to obtain an interaction bipartite graph between the object nodes representing the objects and the resource nodes representing the resources based on the historical interaction data between the objects and the resources; obtain a social relationship network graph between the object nodes representing the objects based on the social relationship data between the objects; obtain a resource relationship spectrum graph between the resource nodes representing the resources based on the resource relationship data between the resources; and construct a heterogeneous graph according to the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph.
[0018] In one embodiment, the second acquisition module is configured to determine at least one preset path type; for each sample node and each path type, filter the neighbor nodes of the sample node according to the node type of the first-order neighbor nodes indicated by the path type to obtain at least one first-order neighbor node; for each of the first-order neighbor nodes, filter the neighbor nodes of the first-order neighbor nodes according to the node type of the second-order neighbor nodes indicated by the path type to obtain at least one second-order neighbor node; and determine the original subgraph corresponding to the sample node for the path type according to the sample node, the filtered first-order neighbor nodes and the second-order neighbor nodes, and at least one path pointing from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0019] In one embodiment, the second acquisition module is further configured to sample the at least one first-order neighbor node to obtain a first-order sampled neighbor set; sample the at least one second-order neighbor node to obtain a second-order sampled neighbor set; and obtain the original subgraph corresponding to the sample node for the path type according to the sample node, the first-order neighbor nodes in the first-order sampled neighbor set, the second-order neighbor nodes in the second-order sampled neighbor set, and at least one path pointing from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0020] In one embodiment, the second acquisition module is configured to perform graph data augmentation processing on the original subgraph corresponding to the sample node respectively according to a preset graph data augmentation method to obtain an augmented subgraph corresponding to the sample node; the preset graph data augmentation method is an edge discard augmentation method or a feature discard augmentation method.
[0021] In one embodiment, the original subgraph corresponding to the sample node includes the first-order neighbor nodes and the second-order neighbor nodes of the sample node; the graph encoding module is configured to obtain the node features of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, fuse the node features of the second-order neighbor nodes pointing to the first-order neighbor node through the graph encoder to obtain a fused feature corresponding to the first-order neighbor node; for the sample node, fuse the fused features corresponding to the first-order neighbor nodes pointing to the sample node through the graph encoder to obtain a fused feature corresponding to the sample node; and use the fused feature corresponding to the sample node as the original graph encoding representation of the sample node.
[0022] In one embodiment, the graph encoding module is further configured to, when the sample node corresponds to multiple original subgraphs of different path types, after obtaining multiple fusion features corresponding to different path types of the sample node based on the multiple original subgraphs of different path types, aggregate the multiple fusion features corresponding to different path types of the sample node through the graph encoder to obtain an aggregated feature, and use the aggregated feature as the original graph encoding representation of the sample node.
[0023] In one embodiment, the graph encoding module is configured to, through the graph encoder, determine the attention weight of each second-order neighbor node with respect to the first-order neighbor node according to the node feature of the first-order neighbor node and the node feature of the second-order neighbor node pointing to the first-order neighbor node; weight and sum the node features of the second-order neighbor nodes pointing to the first-order neighbor node according to the attention weight to obtain the fusion feature corresponding to the first-order neighbor node.
[0024] In one embodiment, the graph encoding module is configured to, through the graph encoder, determine the attention weight of each first-order neighbor node with respect to the sample node according to the node feature of the sample node and the fusion feature corresponding to the first-order neighbor node pointing to the sample node; weight and sum the fusion features corresponding to the first-order neighbor nodes pointing to the sample node according to the attention weight to obtain the fusion feature corresponding to the sample node.
[0025] In one embodiment, the calculation module is configured to, for each sample node obtained from the heterogeneous graph, calculate the similarity between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representation to obtain the intra-sample similarity; calculate the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes to obtain the inter-sample similarity; and construct the contrast loss of each sample node according to the intra-sample similarity and the inter-sample similarity.
[0026] In one embodiment, the calculation module is configured to determine multiple interaction pairs according to the sample nodes obtained from the heterogeneous graph, where each interaction pair includes an object sample node and a resource sample node with an edge connection; for each interaction pair, calculate the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
[0027] In one embodiment, the training module is configured to combine the contrastive loss and the matching loss to obtain a target loss. The contrastive loss is determined based on the intra-sample similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the inter-sample similarity between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes. The matching loss is determined based on the interaction similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection. The target loss is negatively correlated with the intra-sample similarity, positively correlated with the inter-sample similarity, and negatively correlated with the interaction similarity. After updating the network parameters of the graph encoder with the goal of minimizing the target loss, the step of obtaining sample nodes from the heterogeneous graph is returned to continue training until the training stop condition is met, and a trained graph encoder is obtained.
[0028] In one embodiment, the model processing device for resource pushing further includes a recall module. The recall module is configured to determine a target object of the resource to be pushed; determine a target object node in the heterogeneous graph that represents the target object; obtain an original subgraph corresponding to the target object node according to at least one path from the neighbor nodes of the target object node to the target object node in the heterogeneous graph; perform graph encoding on the original subgraph based on the node features of each node in the original subgraph through the trained graph encoder to obtain an original graph encoding representation of the target object node; perform graph encoding on the original subgraph corresponding to the resource node representing the candidate resource in the heterogeneous graph through the trained graph encoder to obtain graph encoding representations of each resource node; recall a target resource from the candidate resources represented by the resource nodes according to the similarity between the graph encoding representation of the target object node and the graph encoding representations of each resource node.
[0029] This application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0030] Obtain a heterogeneous graph formed based on the interaction between objects and resources, where the heterogeneous graph includes object nodes and resource nodes;
[0031] Obtain sample nodes from the heterogeneous graph. For each sample node, obtain an original subgraph corresponding to the sample node according to at least one path from the neighbor nodes of the sample node to the sample node, and perform graph data augmentation on the original subgraph to obtain an enhanced subgraph corresponding to the sample node;
[0032] Use a graph encoder to perform graph encoding on the original subgraph and the enhanced subgraph respectively to obtain an original graph encoding representation and an enhanced graph encoding representation of the sample node;
[0033] Calculate a contrast loss based on the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes respectively, and calculate a matching loss based on the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection;
[0034] Jointly train the model with the contrast loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources.
[0035] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0036] Obtain a heterogeneous graph formed based on the interaction between objects and resources, where the heterogeneous graph includes object nodes and resource nodes;
[0037] Obtain sample nodes from the heterogeneous graph. For each sample node, obtain the corresponding original subgraph according to at least one path from the neighbor nodes of the sample node to the sample node, and perform graph data augmentation on the original subgraph to obtain the corresponding enhanced subgraph of the sample node;
[0038] Use a graph encoder to perform graph encoding on the original subgraph and the enhanced subgraph respectively to obtain the original graph encoding representation and the enhanced graph encoding representation of the sample node;
[0039] Calculate a contrast loss based on the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes respectively, and calculate a matching loss based on the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection;
[0040] Jointly train the model with the contrast loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources.
[0041] This application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0042] Obtain a heterogeneous graph formed based on the interaction between objects and resources, where the heterogeneous graph includes object nodes and resource nodes;
[0043] Obtain sample nodes from the heterogeneous graph. For each sample node, obtain the original subgraph corresponding to the sample node according to at least one path pointing from the neighbor nodes of the sample node to the sample node, and perform graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node;
[0044] Use a graph encoder to perform graph encoding on the original subgraph and the augmented subgraph respectively to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node;
[0045] Calculate the contrastive loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculate the matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with existing edges;
[0046] Jointly train the model with the contrastive loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources.
[0047] The above model processing method, device, computer device, storage medium, and computer program product for resource push obtain a heterogeneous graph formed based on the interaction between objects and resources. The heterogeneous graph includes object nodes and resource nodes. Sample nodes are obtained from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, the original subgraph corresponding to the sample node is obtained. The original subgraph is subjected to graph data augmentation to obtain the augmented subgraph corresponding to the sample node, which improves the difficulty of subsequent contrast learning tasks, effectively avoiding the overfitting node representations encoded by the graph encoder and making the node representations more generalizable. Using the graph encoder, the original subgraph and the augmented subgraph are respectively encoded to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node. Based on the idea of contrast learning, according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the augmented graph encoding representations of different sample nodes, the contrast loss is calculated to enable new objects and new resources with less interaction information to also obtain additional self-supervised learning. And according to the similarity between the original graph encoding representations of the object sample nodes and resource sample nodes with connecting edges, the matching loss is calculated. The contrast loss and the matching loss are jointly used for model training, taking into account the learning of the matching degree between objects and resources while learning the node representations of new objects and new resources, ensuring the matching degree between objects and resources and greatly improving the robustness of the graph encoder. In this way, the trained graph encoder can not only accurately represent objects and resources with interaction behaviors but also accurately represent new objects and new resources, thus solving the problem of cold start push and being applicable to improving the accuracy of resource push. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 FIG. is an application environment diagram of the model processing method for resource push in an embodiment;
[0049] Figure 2 FIG. is a schematic flowchart of the model processing method for resource push in an embodiment;
[0050] Figure 3 FIG. is a schematic diagram of constructing a heterogeneous graph in an embodiment;
[0051] Figure 4 FIG. is a schematic diagram of the heterogeneous graph in an embodiment;
[0052] Figure 5a FIG. is a schematic diagram of the original subgraph in an embodiment;
[0053] Figure 5b FIG. is a schematic diagram of the original subgraph in another embodiment;
[0054] Figure 6Schematic diagram for obtaining aggregated features in an embodiment;
[0055] Figure 7 Schematic diagram for calculating contrastive loss in an embodiment;
[0056] Figure 8 Flow schematic diagram of the steps for resource recall in an embodiment;
[0057] Figure 9 Flow schematic diagram of the steps for resource recall in another embodiment;
[0058] Figure 10 Structural block diagram of a model processing device for resource push in an embodiment;
[0059] Figure 11 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0060] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] The model processing method for resource push provided in the embodiments of the present application relates to artificial intelligence (AI) technology. Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It 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.
[0062] Artificial intelligence technology is a comprehensive discipline, 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. The model processing method for resource push provided in the embodiments of the present application specifically relates to the machine learning technology of artificial intelligence technology.
[0063] In the related art, in a personalized push system, based on the historical behavior data of an object, associated users with similar hobbies or interests are found for the object, and the resources interacted by the associated users are pushed to the object. This push method is the collaborative filtering method, and this collaborative filtering method strongly depends on the historical behavior data of the object. Therefore, for new objects and new resources with very scarce interaction information, the traditional collaborative filtering method cannot provide accurate pushes in the case of new users and new items.
[0064] The model processing method for resource push provided by the embodiments of the present application obtains a heterogeneous graph formed based on the interaction between an object and a resource. The heterogeneous graph includes object nodes and resource nodes; sample nodes are obtained from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, the original sub-graph corresponding to the sample node is obtained, and the original sub-graph is enhanced in terms of graph data to obtain the enhanced sub-graph corresponding to the sample node, so as to increase the difficulty of subsequent contrast learning tasks, thereby effectively preventing the graph encoder from encoding overfitted node representations and making the node representations more generalizable. Using the graph encoder, the original sub-graph and the enhanced sub-graph are respectively encoded graphically to obtain the original graph encoding representation and the enhanced graph encoding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes, the contrast loss is calculated so that new objects and new resources with little interaction information can also obtain additional self-supervised learning; and according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, the matching loss is calculated, and the contrast loss and the matching loss are jointly used for model training, taking into account the learning of the matching degree between the object and the resource while learning the node representations of the new object and the new resource, ensuring the matching degree between the object and the resource, and greatly improving the robustness of the graph encoder. In this way, the trained graph encoder can not only accurately represent the objects and resources with interaction behaviors, but also accurately represent new objects and new resources, thus solving the problem of cold start push and being applicable to improving the accuracy of resource push.
[0065] The model processing method for resource push provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or on other servers.
[0066] In one embodiment, the model processing method for resource push provided by the embodiments of the present application can be executed by the server 104. The server 104 obtains the interaction data between objects and resources from the terminal 102, obtains new objects and new resources, and thus forms a heterogeneous graph based on the interaction between objects and resources. The heterogeneous graph includes object nodes and resource nodes. The server 104 obtains sample nodes from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, the original subgraph corresponding to the sample node is obtained, and the original subgraph is subjected to graph data augmentation to obtain the augmented subgraph corresponding to the sample node; the server 104 uses a graph encoder to perform graph encoding on the original subgraph and the augmented subgraph respectively to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node. The server 104 calculates a contrast loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculates a matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with existing edges. The server 104 jointly trains the model with the contrast loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources. Optionally, the server 104 can call the trained graph encoder to construct a push model, and use this push model to perform resource push on objects. For example, a client is running on the terminal 102, and the server 104 can provide a resource push service for this client. The server 104 performs resource push on this client based on the object information logged in to this client. The client can be a social application client, a video client, an e-commerce client, and so on.
[0067] Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0068] In one embodiment, as Figure 2 shown, a model processing method for resource push is provided. Taking the example that this method is applied to a computer device (for example, Figure 1 the server 104 in it) for illustration, the method includes the following steps:
[0069] Step 202, obtain a heterogeneous graph formed based on the interaction between objects and resources. The heterogeneous graph includes object nodes and resource nodes.
[0070] Among them, a heterogeneous graph (which can also be understood as a heterogeneous network) refers to a graph in which there is more than one type of node or relationship type. This graph refers to network structure data composed of nodes and edges.
[0071] The nodes in the heterogeneous graph include object nodes representing objects and resource nodes representing resources. The heterogeneous graph can represent the interaction relationship or interaction information between objects and resources. An object is the target for resource pushing, and a resource can be any content that can be pushed to the object, such as goods, videos, articles, etc. For example, in a multimedia pushing scenario, the resource can be a promotional video, an interesting video, etc. In an item pushing scenario, the resource can be an item, etc., and no specific limitation is made.
[0072] The edges in the heterogeneous graph refer to the connections between two nodes, representing the interaction relationship between the nodes. Optionally, the edges in the heterogeneous graph can have edge weights, and the weights of each edge can be the same or different. In one embodiment, there is an edge between two resource nodes, representing that the two resources have a relationship of similar or identical attributes. There is an edge between two object nodes, representing that the objects have a social relationship, such as a following relationship, or can also represent that the objects have a relationship of similar hobbies. In a multimedia content pushing scenario, there is an edge between a resource node and an object node, representing that there is a historical interaction between the object to which the object node belongs and the resource represented by the resource node. For example, the object has browsed, liked, forwarded, commented on, or collected the resource.
[0073] Specifically, the computer device obtains the interaction bipartite graph between the object node and the resource node, and obtains a heterogeneous graph according to the interaction bipartite graph. Among them, the interaction bipartite graph reflects the interaction behavior between the object to which the object node belongs and the resource to which the resource node belongs. For example, in a multimedia pushing scenario, the interaction bipartite graph reflects that the object to which the object node belongs has browsed, or shared, or collected, or purchased the resource to which the resource node belongs.
[0074] Optionally, the computer device directly constructs a heterogeneous graph according to the interaction bipartite graph. Optionally, the computer device constructs a heterogeneous graph based on at least one of the social relationship data between objects and the resource relationship data between resources, in combination with the interaction bipartite graph between the object node and the resource node.
[0075] In one embodiment, obtaining a heterogeneous graph formed based on the interaction between an object and a resource includes: obtaining an interaction bipartite graph between an object node representing an object and a resource node representing a resource based on the historical interaction data between the object and the resource; obtaining a social relationship network graph between the object nodes representing the objects based on the social relationship data between the objects; obtaining a resource relationship spectrum graph between the resource nodes representing the resources based on the resource relationship data between the resources; and constructing a heterogeneous graph according to the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph.
[0076] Among them, for the target object and the target resource, the historical interaction data between the target object and the target resource may include the number of interactions and interaction behaviors between the target object and the target resource. The interaction behavior may be forwarding, liking, etc. The social relationship data may include the objects followed by each object and the frequency of contact between the object and each followed object. The resource relationship data includes each resource and the attributes of each resource. Optionally, the resource relationship data is obtained from a knowledge graph.
[0077] As Figure 3 shown, each edge of the interaction bipartite graph represents a movie liked (i.e., favored) by an object. Figure 3 There are object nodes u1 to u4 and resource nodes i1 to i5. The resource to which each resource node belongs is a movie. According to Figure 3 the social relationship network graph in Figure 3 to determine the social relationships of each object node. For example, object node u1 not only has a social relationship with object node u2 but also has a social relationship with object node u3. According to Figure 3 the resource relationship spectrum graph in
[0078] to determine the attribute relationships between each resource node. The attribute relationships of each resource node are represented by auxiliary nodes, and there are auxiliary nodes a1 to a4. For example, for resource nodes i1 and i2 belonging to the same attribute, it is auxiliary node a1. As Figure 4 shown, by fusing the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph, a heterogeneous graph is constructed. Figure 4 As Figure 4 shown, it is a schematic diagram of the heterogeneous graph in an embodiment. Referring to
[0079] In this embodiment, the interaction bipartite graph representing the interaction between the object node and the resource node obtained from the historical interaction data between the object and the resource can reflect the interaction relationship between the object node and the resource node. Further, the social relationship network graph determined by the social relationship data between objects reflects the social relationships between each object node. The resource relationship spectrum graph determined by the resource relationship data between resources reflects the attribute relationships between each resource node. Therefore, on the basis of determining the interaction bipartite graph between the object node and the resource node, further determining the social relationships between the object nodes and the attribute relationships between the resource nodes can obtain different semantic information, thereby enriching the information volume of each node in the heterogeneous graph.
[0080] Step 204: Obtain sample nodes from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, obtain the original subgraph corresponding to the sample node, and perform graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node.
[0081] Among them, the sample nodes can be object nodes or resource nodes in the heterogeneous graph. In each batch of training processes, the computer device can sample several nodes from the heterogeneous graph to obtain several sample nodes for this batch of training. For a sample node, determine the corresponding neighbor nodes from the heterogeneous graph. The neighbor nodes can include first-order neighbor nodes and second-order neighbor nodes. The first-order neighbor nodes of the sample node are the nodes directly adjacent to the sample node in the heterogeneous graph, and the second-order neighbor nodes of the sample node are the nodes directly adjacent to the first-order neighbor nodes of the sample node.
[0082] The path is the meta-path. In the heterogeneous graph, the path is a specific path used to connect two nodes, which can represent the composite relationship between the nodes. The path has a path type. Since the edge represents the interaction relationship between the two connected nodes, different path types, that is, the paths obtained by alternating nodes and edges, have semantic information. For example, the path type of object node → resource node → resource node can indicate that an object has a high probability of being interested in another resource similar to the resource it has interacted with. For example, in the video recommendation and push scenario, the semantic information of the path "video node → object node → object node" is that an object has a high probability of being interested in the videos watched by another object that has interacted with the object. The path type with certain semantic information can be designed according to actual needs, and the embodiments of the present application do not limit this.
[0083] After determining the neighbor nodes of the sample node, the computer device can obtain the original subgraph corresponding to the sample node according to at least one path pointing from the neighbor nodes of the sample node to the sample node. The sample node can also be called the central node in the original subgraph. As Figure 5a shown, it is a schematic diagram of the original subgraph in an embodiment. Combining Figure 4 , taking the object node u3 in Figure 4 as an example, based on the neighbor nodes of the object node u3, the original subgraph of the object node u3 can be obtained, as Figure 5a shown. Figure 5a In
[0084] To introduce subsequent contrastive learning and to prevent the node representations learned subsequently from being too overfitted to the sample data and unable to represent new objects and new resources, after obtaining the original subgraph corresponding to the sample node, the computer device performs graph data augmentation processing on the original subgraph to obtain the augmented subgraph corresponding to the sample node. In the embodiments of the present application, the graph data augmentation processing is a processing method for simulating the lack of interaction data between newly added object nodes, newly added resource nodes and existing object nodes, existing resource nodes. The computer device may adopt a preset graph data augmentation method, including but not limited to randomly removing a certain proportion of nodes and their incident edges from the original subgraph, randomly adding or deleting a certain proportion of edges, randomly removing the attribute information of some nodes, and so on.
[0085] Specifically, the computer device obtains each sample node by uniformly randomly sampling each node in the heterogeneous graph. For each sample node, the computer device obtains the original subgraph corresponding to the sample node according to at least one path pointing from the neighbor nodes of the sample node to the sample node. The computer device determines at least one preset graph data augmentation method corresponding to the original subgraph, and performs graph data augmentation on the original subgraph by using the corresponding preset graph data augmentation method to obtain the augmented subgraph corresponding to the sample node. The sample node serves as the central node of the original subgraph.
[0086] It should be noted that by obtaining the sample nodes representing objects through uniform random sampling, it can be ensured that the sampling probabilities of new objects and non-new objects are the same. Similarly, by obtaining the sample nodes representing resources through uniform random sampling, it can be ensured that the sampling probabilities of new resources and non-new resources are the same, thereby effectively avoiding the situation that new objects and new resources are not collected due to the lack of interaction data between them, and ensuring the effectiveness of the subsequent graph encoder training process. In one embodiment, new objects can be regarded as low-activity users, and new resources can be regarded as resources with little demand. Optionally, the new resources can be existing resources with little demand (such as long-tail items), and optionally, the new resources can also be newly added resources, that is, resources just generated.
[0087] In one embodiment, for each sample node, according to at least one path pointing from a neighbor node of the sample node to the sample node, an original subgraph corresponding to the sample node is obtained, including: determining at least one preset path type; for each sample node and each path type, filtering the neighbor nodes of the sample node according to the node type of the first-order neighbor nodes indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, filtering the neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor nodes indicated by the path type to obtain at least one second-order neighbor node; determining the original subgraph of the sample node corresponding to the path type according to the sample node, the filtered first-order neighbor nodes and second-order neighbor nodes, and at least one path pointing from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0088] Specifically, the computer device can determine at least one preset path type that matches the push scenario. For each sample node and each path type, the computer device filters at least one first-order neighbor node from the neighbor nodes of the sample node according to the node type of the first-order neighbor indicated by the path type. Then, for each first-order neighbor node, the computer device filters at least one second-order neighbor node from the neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type. Thus, an original subgraph corresponding to the sample node can be obtained according to the second-order neighbor node, the first-order neighbor node, and the sample node.
[0089] For each sample node, the computer device processes it in this way, and an original subgraph corresponding to each sample node can be obtained.
[0090] Figure 5b It is a schematic diagram of the original subgraph in one embodiment. Refer to Figure 5b , combined with Figure 4 to illustrate that there are two existing path types, namely UUI and UIU, where U represents an object node and I represents a resource node. Taking the object node u3 in Figure 4 as an example, for the path type UUI, the node type of the first-order neighbor nodes indicated by this path type is the object type. Then, nodes with the object type are filtered from the neighbor nodes of the object node u3 to obtain the first-order neighbor nodes, which are the object nodes u2 and u1. Next, the node type of the second-order neighbor nodes indicated by this path type is the resource type. Then, nodes with the resource type are filtered from the neighbor nodes of the first-order neighbor nodes, the object nodes u2 and u1, to obtain the second-order neighbor nodes, which are the resource nodes i1, i2, and i3. Thus, multiple paths are obtained, that is, these paths constitute the original subgraph corresponding to the object node u3, as shown in Figure 5b .
[0091] In this embodiment, based on the path type and the sample node, the node types of each level of nodes constituting the path can be accurately known. In this way, the first-order neighbor nodes and the second-order neighbor nodes can be quickly and accurately screened out from the neighbor nodes of the sample node. Thus, the original subgraphs corresponding to the respective path types of the sample node can be efficiently obtained.
[0092] In one embodiment, the method further includes: determining the original subgraph corresponding to the path type of the sample node according to the sample node, the screened first-order neighbor nodes and second-order neighbor nodes, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node, including: sampling the screened first-order neighbor nodes to obtain a first-order sampled neighbor set; sampling the screened second-order neighbor nodes to obtain a second-order sampled neighbor set; obtaining the original subgraph corresponding to the path type of the sample node according to the sample node, the first-order neighbor nodes in the first-order sampled neighbor set, the second-order neighbor nodes in the second-order sampled neighbor set, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0093] Specifically, for each sample node and each path type, after obtaining the first-order neighbor nodes and the second-order neighbor nodes of the sample node corresponding to the path type, the computer device performs random uniform sampling on the screened first-order neighbor nodes, or performs weighted sampling according to the weights of the edges between each first-order neighbor node and the sample node to obtain a first-order sampled neighbor set. For each first-order neighbor node in each first-order sampled neighbor set, the computer device performs random uniform sampling on at least one second-order neighbor node corresponding to the first-order neighbor node, or performs sampling according to the weights of the edges between each second-order neighbor node and the first-order neighbor node to obtain a second-order sampled neighbor set corresponding to the first-order neighbor node. For each sample node and each path type, the computer device uses the sample node as the central node, and screens each second-order sampled neighbor set according to the first-order neighbor nodes in the first-order sampled neighbor set to obtain at least one screened second-order sampled neighbor set. The computer device obtains the original subgraph corresponding to the path type of the sample node according to the first-order neighbor nodes in the first-order sampled neighbor set, the second-order neighbor nodes in the screened second-order sampled neighbor set, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0094] It should be noted that in this embodiment, by sampling the first-order neighbor nodes before sampling, the first-order neighbor nodes before sampling are divided into two parts, that is, one part is the first-order neighbor nodes in the first-order sampling neighbor set, and the other part is the first-order neighbor nodes that are not sampled. At this time, the first-order neighbor nodes corresponding to the second-order sampling neighbor set are the first-order neighbor nodes that are not sampled. Therefore, in order to ensure the correctness of each path in the subsequent original subgraph, it is necessary to delete the second-order sampling neighbor set corresponding to the first-order neighbor nodes that are not sampled to obtain the filtered second-order sampling neighbor set.
[0095] For example, when there are edge weights for the edges in the heterogeneous graph, the sampling method according to the edge weights can be used, that is, nodes are sampled according to the weights of the edges. When there are no edge weights for the edges in the heterogeneous graph, a uniform random sampling method can be used to sample the nodes.
[0096] In this embodiment, by sampling the first-order neighbor nodes and the second-order neighbor nodes, the number of nodes in the generated original subgraph can be further reduced, thereby improving the efficiency of subsequent graph encoding for the sample nodes.
[0097] In one embodiment, graph data augmentation is performed on the original subgraph to obtain an augmented subgraph corresponding to the sample nodes, including: respectively performing graph data augmentation processing on the original subgraph corresponding to the sample nodes according to a preset graph data augmentation method to obtain an augmented subgraph corresponding to the sample nodes; the preset graph data augmentation method is an edge dropping augmentation method or an attribute masking augmentation method.
[0098] Among them, the edge dropping augmentation method (Node dropping) is a method of augmentation by randomly removing a certain proportion of nodes and their incident edges from the graph. This graph data augmentation method makes the learned representation consistent under node perturbations. The prior information represented is that the absence of some nodes does not affect the semantics of the graph. The attribute masking augmentation method (Attribute masking) is to randomly remove the attribute information (which can be understood as feature information) of some nodes, prompting the model to use other information to reconstruct the masked node attributes.
[0099] Specifically, for each original subgraph, the computer device selects one method from the edge dropping augmentation method and the attribute masking augmentation method as the preset graph data augmentation method for the original subgraph. The computer device respectively performs graph data augmentation processing on the original subgraph corresponding to the sample nodes according to the preset graph data augmentation method of the original subgraph to obtain an augmented subgraph corresponding to the sample nodes.
[0100] Optionally, the computer device determines the number of sample nodes sampled in this training, and performs graph data augmentation on the original subgraphs corresponding to a part of the sample nodes by using the edge-drop augmentation method to obtain respective augmented subgraphs, and performs graph data augmentation on the original subgraphs corresponding to another part of the sample nodes by using the feature-drop augmentation method to obtain respective augmented subgraphs. For example, the number of samples participating in a batch of model training is N, and the computer device performs edge-drop augmentation on the original subgraphs corresponding to N / 2 sample nodes respectively to obtain respective augmented subgraphs, and performs feature-drop augmentation on the original subgraphs corresponding to the other N / 2 sample nodes respectively to obtain respective augmented subgraphs. Of course, the division method of the sample nodes is not limited.
[0101] In this embodiment, since the interaction data between the object node representing the new object and the resource node representing the new resource is lacking, the edge between the object node representing the new object and the resource node representing the new resource is sparse, that is, the interaction relationship is lacking. Therefore, by discarding edges to generate an augmented subgraph, it can be ensured that the augmented subgraph can reflect the lack of interaction data between the new object and the new resource. Since the features of the new object and the new resource themselves are lacking, by discarding features to generate an augmented subgraph, it can be ensured that the augmented subgraph can reflect the situation that the feature data carried by the object node representing the new object and the feature data carried by the resource node representing the new resource are few. In this way, by using the edge-drop augmentation method for half of the original subgraphs and the feature-drop augmentation method for the other half of the original subgraphs, it can be ensured that the subsequent generated graph encoder has good robustness, and thus, the problem of low cold-start push accuracy can be solved.
[0102] In one embodiment, for each original subgraph, the computer device selects one method from the edge-drop augmentation method and the feature-drop augmentation method as the first graph data augmentation method for the original subgraph. After determining the first graph data augmentation method, the method further includes: the computer device combines the first graph data augmentation method with the edge perturbation augmentation method, or combines the first graph data augmentation method with the subgraph extraction augmentation method, or combines the first graph data augmentation method with the edge perturbation augmentation method and the subgraph extraction augmentation method, and performs graph data augmentation processing on the original subgraph corresponding to the sample node to obtain the augmented subgraph corresponding to the sample node.
[0103] Among them, both the edge perturbation enhancement method and the subgraph extraction enhancement method belong to the graph data enhancement methods. The edge perturbation enhancement method (Edge perturbation) is a method of enhancement by randomly adding or deleting a certain proportion of edges. This enhancement method makes the learned representation consistent under edge perturbation. The representative prior information is that adding or deleting some connecting edges does not affect the semantics of the graph. The subgraph extraction enhancement method (Subgraph) is a method of enhancement by extracting subgraphs from the original graph using the random walk method.
[0104] In this embodiment, the strategy of combining different graph data enhancement methods increases the difficulty of the contrast learning task, and can avoid the features learned by the subsequent graph encoder being overly fitted to low-level shortcuts, making the subsequently trained graph encoder more generalizable.
[0105] Step 206, using the graph encoder, perform graph encoding on the original subgraph and the enhanced subgraph respectively to obtain the original graph encoding representation and the enhanced graph encoding representation of the sample nodes.
[0106] Among them, the graph encoder is a graph neural network (Graph Attention Network, GAT) based on the attention mechanism, which is used to learn a low-dimensional representation for each node. Optionally, the unencoded high-dimensional features are processed by the graph encoder to obtain a low-dimensional representation. This low-dimensional representation can be regarded as a low-dimensional vector (Embedding), which can characterize the features (or attributes) of an object or a resource. There are potential connections between the elements in this low-dimensional representation.
[0107] Specifically, the computer device uses the graph encoder to obtain the original graph encoding representation of the sample nodes for the original subgraph, and uses the graph encoder to perform graph encoding on the enhanced subgraph to obtain the enhanced graph encoding representation of the sample nodes.
[0108] In one embodiment, the original subgraph corresponding to the sample node includes the first-order neighbor nodes and the second-order neighbor nodes of the sample node; the steps for obtaining the original graph encoding representation of the sample node include: obtaining the node features of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, through the graph encoder, fusing the node features of the second-order neighbor nodes pointing to the first-order neighbor node to obtain the fused feature corresponding to the first-order neighbor node; for the sample node, through the graph encoder, fusing the fused features corresponding to the first-order neighbor nodes pointing to the sample node to obtain the fused feature corresponding to the sample node; using the fused feature corresponding to the sample node as the original graph encoding representation of the sample node.
[0109] Specifically, the computer device obtains the node features of each node in the original subgraph corresponding to the sample node. For each first-order neighbor node in the original subgraph, the computer device fuses the node features of at least one second-order neighbor node pointing to the first-order neighbor node through the attention mechanism of the graph encoder to obtain the fused feature corresponding to the first-order neighbor node. For the sample node, the computer device fuses the fused features corresponding to at least one first-order neighbor node pointing to the sample node through the attention mechanism of the graph encoder to obtain the fused feature corresponding to the sample node. The computer device directly uses the fused feature corresponding to the sample node as the original graph encoding representation of the sample node.
[0110] Among them, for each first-order neighbor node, the attention mechanism of the graph encoder can reflect which second-order neighbor node has a greater influence on the first-order neighbor node among the at least one second-order neighbor node connected to the first-order neighbor node, so as to obtain more attention for the first-order neighbor node. Similarly, for the sample node in the original subgraph, through the attention mechanism of the graph encoder, it can be determined which first-order neighbor node has a greater influence on the sample node among the at least one first-order neighbor node connected to the sample node, so as to obtain more attention for the sample node.
[0111] In the above embodiment, by means of hierarchical fusion from second-order neighbor nodes to first-order neighbor nodes and from first-order neighbor nodes to the central node, neighbor representations with different importance (such as the fused feature of the first-order neighbor node or the fused feature of the sample node) are fused, and the original graph encoding representation of the central node of the original subgraph is accurately generated.
[0112] In one embodiment, the method further includes: when the sample node corresponds to multiple original subgraphs of different path types, after obtaining multiple fused features corresponding to different path types of the sample node based on the multiple original subgraphs of different path types, the computer device aggregates the multiple fused features corresponding to different path types of the sample node through the graph encoder to obtain an aggregated feature, and uses the aggregated feature as the original graph encoding representation of the sample node.
[0113] Specifically, when obtaining at least two original subgraphs corresponding to at least two different path types of the sample node, after the computer device obtains the fused features corresponding to each original subgraph respectively, it aggregates the multiple fused features corresponding to different path types of the sample node through a multi-layer perceptron (MLP) in the graph encoder to obtain an aggregated feature, and uses the aggregated feature as the original graph encoding representation of the sample node.
[0114] Optionally, when the sample node corresponds to at least two different path types and there is at least one original subgraph corresponding to each path type, after the computer device obtains the fusion features corresponding to each original subgraph, the multi-layer perceptron of the connection layer in the graph encoder is used to process each fusion feature corresponding to the sample node respectively, and the processed features corresponding to each fusion feature are obtained. The computer device obtains the aggregated feature according to the mean value of each processed feature, and uses the aggregated feature as the original graph encoding representation of the sample node.
[0115] For each node sample, each path type corresponds to an original subgraph. Suppose there are M path types. After the computer device determines the fusion features corresponding to the original subgraphs respectively, the multi-layer perceptron of the connection layer in the graph encoder is used to determine the aggregated feature h using the following formula u :
[0116]
[0117] where represents the fusion feature corresponding to the original subgraph of the sample node corresponding to the m-th path type. M represents the number of original subgraphs corresponding to the sample node, which is also the number of path types. MLP is the multi-layer perceptron (MultilayerPerceptron). The symbol Σ represents the summation operation.
[0118] As Figure 6 shown, taking the path types including IUU and UIU as an example, the original subgraph of the sample node corresponding to the path type UUI is shown on the left side of Figure 6 , and the original subgraph of the sample node corresponding to the path type UIU is shown on the right side of Figure 6 . The aggregated feature of the sample node is obtained by aggregating the fusions of the two original subgraphs. In this embodiment, for multiple original subgraphs of the sample node for different path types, after obtaining multiple fusion features corresponding to different path types of the sample node based on multiple original subgraphs of different path types, by aggregating each fusion feature, a fusion feature after aggregating different semantic information can be obtained, and an original graph encoding representation of the sample node with richer information can be obtained.
[0119] In one embodiment, the enhancer graph corresponding to the sample node includes the first-order neighbor nodes and the second-order neighbor nodes of the sample node; the steps for obtaining the enhanced graph encoding representation of the sample node include: obtaining the node features of each node in the enhancer graph corresponding to the sample node; for each first-order neighbor node in the enhancer graph, through a graph encoder, fusing the node features of the second-order neighbor nodes pointing to the first-order neighbor node to obtain the fused feature corresponding to the first-order neighbor node; for the sample node, through a graph encoder, fusing the fused features corresponding to the first-order neighbor nodes pointing to the sample node to obtain the fused feature corresponding to the sample node; and taking the fused feature corresponding to the sample node as the enhanced graph encoding representation of the sample node.
[0120] The specific processing method can be the same as that for the original subgraph, and will not be repeated here.
[0121] In the above embodiment, by means of hierarchical fusion from second-order neighbor nodes to first-order neighbor nodes and from first-order neighbor nodes to the central node, neighbor representations with different importance (such as the fused feature corresponding to the first-order neighbor node or the fused feature of the sample node) are fused, and the enhanced graph encoding representation of the sample node in the enhancer graph is accurately generated.
[0122] In one embodiment, fusing the node features of the second-order neighbor nodes pointing to the first-order neighbor node through a graph encoder to obtain the fused feature corresponding to the first-order neighbor node includes: through a graph encoder, determining the attention weights of each second-order neighbor node for the first-order neighbor node according to the node features of the first-order neighbor node and the node features of the second-order neighbor nodes pointing to the first-order neighbor node; and weighted-summing the node features of the second-order neighbor nodes pointing to the first-order neighbor node according to the attention weights to obtain the fused feature corresponding to the first-order neighbor node.
[0123] Specifically, the computer device determines the attention weights of each second-order neighbor node for the first-order neighbor node according to the node features of the first-order neighbor node and the node features of the second-order neighbor nodes pointing to the first-order neighbor node through the attention mechanism in the graph encoder. The computer device weighted-sums the node features of the second-order neighbor nodes pointing to the first-order neighbor node according to the attention weights to obtain a weighted sum, which reflects the combined characteristics of these second-order neighbor nodes. The computer device then determines the fused feature corresponding to the first-order neighbor node based on the sum of the weighted sum and the node features of the first-order neighbor node.
[0124] For example, for the first-order neighbor node i, there are multiple second-order neighbor nodes j pointing to the first-order neighbor node, forming a set N i , then the attention weight α ij of each second-order neighbor node j for the first-order neighbor node i is obtained according to the following formula (1):
[0125]
[0126] Among them, exp(.) represents the exponential function, and the LeakyReLU (Leaky-Rectified linear unit) function is an activation function. a T is the transpose of a, and a is the attention scoring function. W is the mapping function, also known as the weight matrix, which is the model parameter to be trained by the graph encoder. h k is the node feature of any node in the representation set N i . The attention weight α ij represents the correlation between the node feature h i and the node feature h j .
[0127] After obtaining the attention weights of each second-order neighbor node corresponding to the first-order neighbor node, the fused feature h' corresponding to the first-order neighbor node is determined by the following formula two i :[[]]
[0128]
[0129] Among them, σ(.) represents the activation function.[[]]
[0130] In this embodiment, based on the node features of the first-order neighbor nodes and the node features of the second-order neighbor nodes pointing to the first-order neighbor nodes, the attention weights of each second-order neighbor node corresponding to the first-order neighbor node are determined, and the fused features corresponding to the first-order neighbor nodes with different importance are fused, thereby facilitating the subsequent generation of accurate fused features of the sample nodes.[[]]
[0131] For the fused features of the sample nodes, they can also be determined in a similar manner as above.[[]]
[0132] In one embodiment, through the graph encoder, the fused features corresponding to the first-order neighbor nodes pointing to the sample nodes are fused to obtain the fused features corresponding to the sample nodes, including: through the graph encoder, based on the node features of the sample nodes and the fused features corresponding to the first-order neighbor nodes pointing to the sample nodes, determine the attention weights of each first-order neighbor node corresponding to the sample node; perform weighted summation on the fused features corresponding to the first-order neighbor nodes pointing to the sample nodes according to the attention weights to obtain the fused features corresponding to the sample nodes.[[]]
[0133] Specifically, the computer device determines the attention weights of each first-order neighbor node with respect to the sample node according to the node features of the sample node and the fused features of the first-order neighbor nodes pointing to the sample node through the attention mechanism in the graph encoder. The computer device weights and sums the fused features of the first-order neighbor nodes pointing to the sample node according to the attention weights to obtain a weighted sum, which reflects the combined characteristics of these first-order neighbor nodes. The computer device then determines the fused feature corresponding to the sample node based on the sum of the weighted sum and the node features of the sample node.
[0134] For example, the attention weights of each first-order neighbor node with respect to the sample node can be obtained through Equation 1 in the foregoing embodiment. For instance, for the node feature h x of the sample node x, there is the fused feature h y of the first-order neighbor node y pointing to the sample node, and the attention weight α xy of the first-order neighbor node y with respect to the sample node x is obtained. Then, the fused feature h' x corresponding to the sample node x is obtained through Equation 2 in the foregoing embodiment.
[0135] In this embodiment, the attention weights of each first-order neighbor node with respect to the sample node are determined according to the node features of the sample node and the fused features of the first-order neighbor nodes pointing to the sample node. Through fusion, the fused features corresponding to sample nodes with different importance levels can be obtained.
[0136] Step 208: Calculate the contrast loss according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes of the same node type as the sample node, and calculate the matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection.
[0137] Among them, the contrast loss is the loss of the contrast learning task, and the matching loss is used to learn the interest preference of the object, that is, to represent the matching degree between the object and the resource.
[0138] Specifically, the computer device calculates the contrast loss according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes of the same node type as the sample node. The computer device calculates the matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection.
[0139] In one embodiment, a contrastive loss is calculated based on the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes, including: for each sample node obtained from the heterogeneous graph, calculating the similarity between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representation to obtain the intra-sample similarity; calculating the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes to obtain the inter-sample similarity; and constructing the contrastive loss for each sample node according to the intra-sample similarity and the inter-sample similarity.
[0140] Specifically, for each sample node obtained from the heterogeneous graph, the computing device calculates the similarity between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representation to obtain the intra-sample similarity. The computing device calculates the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes of the same node type to obtain the inter-sample similarity. The computing device may construct the contrastive loss corresponding to each sample node by taking the ratio of the intra-sample similarity to the inter-sample similarity.
[0141] Optionally, after determining the contrastive loss corresponding to each sample node, the expectation of the contrastive losses corresponding to each sample node is taken to obtain the contrastive loss corresponding to multiple sample nodes.
[0142] Optionally, the similarity can be calculated by the cosine function or by performing an exponential operation on the value of the cosine function, and no specific limitation is made.
[0143] For example, when the computing device determines the intra-sample similarity exp(h(z g,n ,z d,n )) and the inter-sample similarity between them, the contrastive loss L NCE is obtained through the following formula:
[0144]
[0145] z g,n and z d,n respectively represent the original graph encoding representation and the enhanced graph encoding representation corresponding to the nth sample (i.e., the nth sample node), h() represents the similarity function, the cosine similarity is used here, exp() represents the exponential function, and log() is the exponential function. n' represents the sample nodes with different node types from the nth sample node, and there are N such sample nodes in total. E[] is the expectation, which can be understood as the average value of the contrastive losses of a batch of sample nodes during batch training.
[0146] In this embodiment, a contrastive loss is constructed with the relatively large similarity within samples and the relatively small similarity between samples as the optimization objective, so that the original graph encoding representation of the same sample node is close to the enhanced graph encoding representation, and the original graph encoding representations of different sample nodes and the enhanced graph encoding representations are different in principle, to ensure the robustness of the graph encoder.
[0147] In one embodiment, according to the similarity between the original graph encoding representations of the object sample nodes and the resource sample nodes with connected edges, a matching loss is calculated, including: determining a plurality of interaction pairs according to the sample nodes obtained from the heterogeneous graph, each interaction pair including an object sample node and a resource sample node with a connected edge; for each interaction pair, calculating the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
[0148] Specifically, the computer device determines the sample nodes with historical interaction data according to the sample nodes obtained from the heterogeneous graph, and determines a plurality of interaction pairs according to the at least one sample node with historical interaction data. For each interaction pair, calculating the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
[0149] Optionally, after determining the matching loss of each interaction pair, the computer device takes the mean of the matching losses of each interaction pair to obtain the matching loss corresponding to the plurality of interaction pairs. For example, the computer device obtains 80 different interaction pairs. For each interaction pair, the computer device calculates the cosine value between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair, and takes the cosine value as the matching loss of the interaction pair. The cosine value represents the interaction similarity. The computer device calculates the mean of the 80 matching losses and takes the mean as the matching loss corresponding to the 80 interaction pairs.
[0150] In this embodiment, a plurality of interaction pairs are determined according to the sample nodes obtained from the heterogeneous graph. For each interaction pair, the matching loss of the interaction pair is obtained by calculating the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair. In this way, through the matching loss of the interaction pair, the interest preference of the object to which the object sample node in the interaction pair belongs can be intuitively and accurately reflected, which is beneficial to the subsequent training of the graph encoder.
[0151] Step 210, jointly train the model with the contrastive loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources.
[0152] Specifically, the computer device combines the contrast loss and the matching loss to determine the target loss, and iteratively trains the model according to the target loss to obtain a trained graph encoder.
[0153] For example, the computer device obtains the contrast loss of the same node type, and superimposes the contrast loss and the matching loss of each node type to determine the target loss. As described in the following formula, the target loss L is as follows:
[0154] L = L main ({u g , i h}) + L ssl ({u k}) + L ssl ({i k})
[0155] In the above formula, L main ({u g , i h}) is the matching loss, where u g and i h are the object sample node and the resource sample node with an edge connection, that is, the interaction pair. L ssl ({u k}) is the contrast loss of the object node, and u k represents the object node. L ssl ({i k}) is the contrast loss of the resource node, and i k represents the resource node. For the matching loss, if there are multiple interaction pairs, the computer device first determines the matching loss of each interaction pair, and then takes the mean of the matching losses of multiple interaction pairs as L main ({u g , i h}). For the sample nodes of each node type, if there are multiple sample nodes of the same node type, the computer device first determines the contrast loss corresponding to each sample node respectively, and then takes the mean of the contrast losses corresponding to multiple sample nodes of the same node type to obtain the contrast loss L ssl of this node type. The computer device superimposes the matching loss of L main ({u g , i h}) and the contrast losses of different node types to obtain the target loss. Among them, the contrast loss corresponding to each sample node can be calculated using the formula of the aforementioned contrast loss L NCE .
[0156] In one embodiment, the joint contrast loss and the matching loss are used for model training to obtain a trained graph encoder, including: taking as the optimization objective that the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node is large, the similarity between the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations is small, and the similarity between the original graph encoding representations of the object sample nodes and the resource sample nodes with connected edges is large, combining the contrast loss and the matching loss to obtain a target loss; the contrast loss is determined according to the intra-sample similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the inter-sample similarity between the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations, and the matching loss is determined according to the interaction similarity between the original graph encoding representations of the object sample nodes and the resource sample nodes with connected edges, and the target loss is negatively correlated with the intra-sample similarity, positively correlated with the inter-sample similarity, and negatively correlated with the interaction similarity; after updating the network parameters of the graph encoder with the aim of minimizing the target loss, return to the step of obtaining sample nodes from the heterogeneous graph to continue training until the training stop condition is met, and a trained graph encoder is obtained.
[0157] The network parameters of the graph encoder are initially updated through the target loss to obtain an initially updated graph encoder, and iterative training is entered. The updated graph encoder of the previous iteration is used as the current graph encoder of the current iteration, sample nodes of the current iteration are obtained from the heterogeneous graph, and the current initial features of the sample nodes of the current iteration are determined. Through the current graph encoder and the current initial features, the target loss of the current iteration is determined. If the target loss of the current iteration does not meet the training stop condition, the current graph encoder is updated to obtain an updated graph encoder, enter the next iteration, and use the updated graph encoder as the current graph encoder corresponding to the next iteration, and return to the step of obtaining the sample nodes of the current iteration to continue execution until the target loss of the current iteration meets the training stop condition, and a trained graph encoder is obtained; the current graph encoder of the first iteration is the initially updated graph encoder.
[0158] In this embodiment, by making the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node large, and the similarity between the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations small, it can be ensured that the original graph encoding representation and the enhanced graph encoding representation of the same sample node are close, and the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations are far away. In this way, with the large similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, the small similarity between the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations, and the large similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection as the optimization objective, the graph encoder is jointly trained, and a more robust trained graph encoder can be obtained.
[0159] The above model processing method for resource push obtains a heterogeneous graph formed by the interaction between objects and resources. The heterogeneous graph includes object nodes and resource nodes; sample nodes are obtained from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, the corresponding original subgraph of the sample node is obtained, and the original subgraph is subjected to graph data augmentation to obtain the corresponding enhanced subgraph of the sample node, so as to improve the difficulty of the subsequent contrast learning task, effectively avoid the overfitted node representation encoded by the graph encoder, and make the node representation more generalizable. Using the graph encoder, the original subgraph and the enhanced subgraph are respectively subjected to graph encoding to obtain the original graph encoding representation and the enhanced graph encoding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarity between the original graph encoding representations of different sample nodes and their respective enhanced graph encoding representations, the contrast loss is calculated to enable new objects and new resources with less interaction information to also obtain additional self-supervised learning; and according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, the matching loss is calculated, and the contrast loss and the matching loss are jointly used for model training, taking into account the learning of the matching degree between objects and resources while learning the node representations of new objects and new resources, ensuring the matching degree between objects and resources, and greatly improving the robustness of the graph encoder. In this way, the trained graph encoder can not only accurately represent objects and resources with interaction behaviors, but also accurately represent new objects and new resources, thus solving the problem of cold start push and can be used to improve the accuracy of resource push.
[0160] In one embodiment, after obtaining the original subgraphs corresponding to each sample node, the computer device performs graph data augmentation on the original subgraphs of some sample nodes respectively through an edge-drop augmentation method to obtain first augmented subgraphs, and performs graph encoding on each first augmented subgraph through a graph encoder to obtain the first augmented graph encoding representations corresponding to these sample nodes respectively. For another part of the sample nodes, the computer device directly performs graph encoding on the corresponding original subgraphs to obtain original graph encoding representations, and then performs feature-drop processing through a feature-drop augmentation method to obtain second augmented graph encoding representations. Both the first augmented graph encoding representation and the second augmented graph encoding representation are used as augmented graph encoding representations, and then step 208 is executed.
[0161] For example, as Figure 7 shown, it is a schematic diagram of calculating the contrast loss in one embodiment. Referring to Figure 7 , for different sample nodes in a batch of training (such as Figure 7 the original subgraphs respectively corresponding to two different sample nodes), different graph data augmentation methods are used to perform graph data augmentation. For example, for the original subgraphs of half of the sample nodes (such as Figure 7 the original sub- Figure 2 ), the edge-drop augmentation method is used to perform graph data augmentation processing to obtain augmented subgraphs, and then the first augmented subgraphs are respectively encoded through a graph encoder to obtain first augmented encoding representations. For the original subgraphs of the other half of the sample nodes (such as Figure 7 the original sub- Figure 1 ), the feature-drop augmentation method is used. The original subgraphs of this half of the sample nodes are respectively encoded through a graph encoder to obtain original encoding representations, and then feature dropping is performed on the original encoding representations to obtain second augmented graph encoding representations. The computer device calculates the contrast loss of a batch of training based on the first augmented encoding representations of half of the sample nodes and the second augmented encoding representations of the other half of the sample nodes in a batch of training.
[0162] In this embodiment, for each original subgraph of the feature-drop augmentation method, the original graph encoding representation of the original subgraph is first determined, and then feature dropping is directly performed on each original graph encoding representation to obtain the augmented graph encoding representation corresponding to the feature-drop augmentation method. In this way, there is no need to repeat the calculation through the graph encoder after feature dropping, and one graph calculation can be reduced.
[0163] As Figure 8 shown, it is a schematic diagram of the resource recall process in one embodiment. In one embodiment, the above method further includes a resource push step, and this step specifically includes:
[0164] Step 802, determining the target object of the resource to be pushed.
[0165] Step 804, determine the target object node in the heterogeneous graph that represents the target object.
[0166] Step 806, according to at least one path in the heterogeneous graph that points from the neighbor nodes of the target object node to the target object node, obtain the original subgraph corresponding to the target object node.
[0167] Step 808, through the trained graph encoder, perform graph encoding on the original subgraph based on the node features of each node in the original subgraph to obtain the original graph encoding representation of the target object node.
[0168] Step 810, through the trained graph encoder, perform graph encoding on the original subgraph corresponding to the resource node that represents the candidate resource in the heterogeneous graph to obtain the graph encoding representation of each resource node.
[0169] Step 812, according to the similarity between the graph encoding representation of the target object node and the graph encoding representations of each resource node, recall the target resource from the candidate resources represented by the resource nodes.
[0170] Among them, the target object can be a recorded object or a new object. The new object can be an object that already exists and has very little historical interaction data (such as a low-activity user), or it can be a newly added object. The candidate resource can be an existing resource or a new resource. Among them, the new resource can be a newly added resource or an existing resource with little demand (such as a long-tail item). The purpose of recalling the target resource is to quickly screen out some highly matching data from the massive data for use in the subsequent ranking stage.
[0171] Specifically, after the computer device completes steps 802 to 810, for any target object, the computer device determines the target object node that represents the target object. The computer device determines the similarity between the graph encoding representation of the target object node and the graph encoding representations of each resource node by calculating the cosine value between them. The computer device sorts the similarities from high to low to obtain a similarity sequence. The computer device sequentially selects a preset number of candidate resources starting from the highest similarity to obtain the candidate resources to be selected. The computer device screens out the target resource from the candidate resources to be selected.
[0172] For example, such as Figure 9As shown in the figure, it is a schematic diagram of the resource recall process in an embodiment. The trained graph encoder can be applied to the resource recall scenario. The computer device determines the features of the target object, determines the target object node from the constructed heterogeneous graph, and obtains the original subgraph corresponding to the target object node according to at least one path in the heterogeneous graph that points from the neighbor nodes of the target object node to the target object node. The computer device uses the trained graph encoder (which can be regarded as a recall model) to perform graph encoding on the original subgraph based on the node features of each node in the original subgraph, and obtains the original graph encoding representation of the target object node (that is, it can be understood as the target object feature representation). Through the trained graph encoder, graph encoding is performed on the original subgraph corresponding to the resource node representing the candidate resource in the heterogeneous graph, and the graph encoding representations of each resource node are obtained (that is, it can be understood as the candidate resource feature representation). The computer device determines the similarity between the graph encoding representation of the target object node and the graph encoding representations of each resource node, and sorts the similarities in terms of high and low. Starting from the highest similarity, the computer device sequentially selects K candidate resources as the candidate resources to be matched with the target object, that is, obtains the K recall results with the highest similarity and enters the candidate pool for fine ranking.
[0173] Among them, the process of performing recall through the trained graph encoder obtained by the present application can improve the accuracy of cold start push. Taking the video push scenario as an example, in the recall module of the live broadcast service of a social application, it covers millions of online users. To facilitate the display of the improvement effect of the trained graph encoder of the present application, it is reflected by the improvement amplitude in dimensions such as user click-through rate and the growth rate of daily active users. The specific data is shown in Table 1:
[0174] Table 1 Analysis Table of Improvement Amplitude
[0175]
[0176] In Table 1 above, uctr (user-click-through-rate) is the user click-through rate, dau (daily-active-users) is the daily active user, and pctr (page-click-trough-rate) is the click-through rate. Note that uctr, dau, and pctr are important indicators in the industry to measure whether the model pushes accurately. Obviously, through the trained graph encoder of the present application, uctr, pctr, watch-time, and dau can all achieve a certain ratio of improvement.
[0177] In this embodiment, the trained graph encoder can obtain high-quality original graph encoding representations of any target object and high-quality graph encoding representations of resource nodes of candidate resources. In this way, based on the original graph encoding representations and the graph encoding representations of resource nodes, the similarities between the graph encoding representation of the target object node that can accurately reflect the target object and the graph encoding representations of each resource node can be quickly obtained. Thereby, it is ensured that the target resources recalled for the target object are precisely matched with the target object, improving the effect of the push.
[0178] This application also provides an application scenario that applies the above model processing method for resource push. Specifically, the application of the model processing method for resource push in this application scenario is as follows: In the video push scenario of a social application client, in order to perform precise video push for users, such as live videos, promotional videos, etc. Specifically, the push platform server obtains a heterogeneous graph formed based on the interaction between objects and resources. The heterogeneous graph includes object nodes and resource nodes; samples nodes are obtained from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, the original subgraph corresponding to the sample node is obtained, and the original subgraph is subjected to graph data augmentation to obtain the enhanced subgraph corresponding to the sample node; the graph encoder is used to perform graph encoding on the original subgraph and the enhanced subgraph respectively to obtain the original graph encoding representation and the enhanced graph encoding representation of the sample node; according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes, the contrast loss is calculated, and according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, the matching loss is calculated; the contrast loss and the matching loss are jointly used for model training to obtain a trained graph encoder, and the trained graph encoder is used for resource push between objects and resources (in this application scenario, it is videos).
[0179] Of course, it is not limited to this. The model processing method for resource push provided by this application can also be applied in other application scenarios. For example, in the item push scenario, in order to perform precise item push for an object, the server of an e-commerce platform can implement precise resource (in this application scenario, it is items) push for the object through the model processing method for resource push of this application.
[0180] The above application scenarios are only illustrative. It can be understood that the application of the model processing method for resource push provided by each embodiment of this application is not limited to the above scenarios.
[0181] In a specific embodiment, a model processing method for resource push is provided, and this method is executed by a computer device.
[0182] Specifically, based on the historical interaction data between objects and resources, an interaction bipartite graph between object nodes representing objects and resource nodes representing resources is obtained; based on the social relationship data between objects, a social relationship network graph between object nodes representing objects is obtained; based on the resource relationship data between resources, a resource relationship spectrum graph between resource nodes representing resources is obtained; an heterogeneous graph is constructed according to the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph. Sample nodes are obtained from the heterogeneous graph, and at least one preset path type is determined; for each sample node and each path type, the neighbor nodes of the sample node are filtered according to the node type of the first-order neighbor nodes indicated by the path type, obtaining at least one first-order neighbor node; for each first-order neighbor node, the neighbor nodes of the first-order neighbor node are filtered according to the node type of the second-order neighbor nodes indicated by the path type, obtaining at least one second-order neighbor node; sampling is performed on at least one first-order neighbor node to obtain a first-order sampled neighbor set; sampling is performed on at least one second-order neighbor node to obtain a second-order sampled neighbor set; according to the sample node, the first-order neighbor nodes in the first-order sampled neighbor set, the second-order neighbor nodes in the second-order sampled neighbor set, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node, a raw subgraph corresponding to the path type of the sample node is obtained. For the raw subgraph corresponding to the sample node respectively, graph data augmentation processing is performed according to a preset graph data augmentation method, obtaining an augmented subgraph corresponding to the sample node; the preset graph data augmentation method is an edge dropout augmentation method or a feature dropout augmentation method. The node features of each node in the raw subgraph corresponding to the sample node are obtained; for each first-order neighbor node in the raw subgraph, through a graph encoder, according to the node features of the first-order neighbor node and the node features of the second-order neighbor nodes pointing to the first-order neighbor node, the attention weights of each second-order neighbor node for the first-order neighbor node are determined respectively; the node features of the second-order neighbor nodes pointing to the first-order neighbor node are weighted and summed according to the attention weights, obtaining a fused feature corresponding to the first-order neighbor node. For the sample node, through a graph encoder, according to the node features of the first-order neighbor node and the node features of the second-order neighbor nodes pointing to the first-order neighbor node, the attention weights of each second-order neighbor node for the first-order neighbor node are determined respectively; the node features of the second-order neighbor nodes pointing to the first-order neighbor node are weighted and summed according to the attention weights, obtaining a fused feature corresponding to the first-order neighbor node. When there are multiple raw subgraphs corresponding to different path types for the sample node, after obtaining multiple fused features corresponding to different path types of the sample node based on the multiple raw subgraphs corresponding to different path types, through a graph encoder, the multiple fused features corresponding to different path types of the sample node are aggregated, obtaining an aggregated feature, and the aggregated feature is used as the raw graph encoding representation of the sample node. At the same time, for the augmented subgraph, using a graph encoder, in a manner similar to the above method for obtaining the raw graph encoding representation of the sample node, the graph augmentation encoding representation of the sample node is obtained.
[0183] For each sample node obtained from the heterogeneous graph, calculate the similarity between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representation to obtain the intra-sample similarity; calculate the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes to obtain the inter-sample similarity; determine a plurality of interaction pairs according to the sample nodes obtained from the heterogeneous graph, where each interaction pair includes an object sample node and a resource sample node with an edge connection; for each interaction pair, calculate the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair; combine the intra-sample similarity, the inter-sample similarity, and the interaction similarity to obtain a target loss, where the target loss is negatively correlated with the intra-sample similarity, positively correlated with the inter-sample similarity, and negatively correlated with the interaction similarity; after updating the network parameters of the graph encoder with the goal of minimizing the target loss, return to the step of obtaining sample nodes from the heterogeneous graph to continue training until the training stop condition is met, and obtain the trained graph encoder.
[0184] After obtaining the trained graph encoder, determine the target object of the resource to be pushed, and determine the target object node representing the target object in the heterogeneous graph; according to at least one path from the neighbor nodes of the target object node to the target object node in the heterogeneous graph, obtain the original subgraph corresponding to the target object node; through the trained graph encoder, perform graph encoding on the original subgraph based on the node features of each node in the original subgraph to obtain the original graph encoding representation of the target object node; through the trained graph encoder, perform graph encoding on the original subgraph corresponding to the resource node representing the candidate resource in the heterogeneous graph to obtain the graph encoding representations of each resource node; according to the similarities between the graph encoding representation of the target object node and the graph encoding representations of each resource node, recall the target resource from the candidate resources represented by the resource nodes.
[0185] In this embodiment, by obtaining a heterogeneous graph formed based on the interaction between objects and resources, the heterogeneous graph includes object nodes and resource nodes; obtaining sample nodes from the heterogeneous graph, for each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, obtaining the original subgraph corresponding to the sample node, performing graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node, so as to increase the difficulty of subsequent contrast learning tasks, thereby effectively avoiding the overfitting node representations encoded by the graph encoder and making the node representations more generalizable. Using the graph encoder, graph encoding is respectively performed on the original subgraph and the augmented subgraph to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarity between the original graph encoding representations and the augmented graph encoding representations of different sample nodes, calculating the contrast loss, so that new objects and new resources with less interaction information can also obtain additional self-supervised learning; and according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, calculating the matching loss, jointly training the model with the contrast loss and the matching loss, while learning the node representations of new objects and new resources, taking into account the learning of the matching degree between objects and resources, ensuring the matching degree between objects and resources, and greatly improving the robustness of the graph encoder. In this way, the trained graph encoder can not only accurately represent objects and resources with interaction behaviors, but also accurately represent new objects and new resources, thus solving the problem of cold-start push and can be used to improve the accuracy of resource push.
[0186] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0187] Based on the same inventive concept, an embodiment of the present application further provides a model processing apparatus for resource pushing for implementing the model processing method for resource pushing involved above. The solution provided by this apparatus for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the model processing apparatus for resource pushing provided below can refer to the limitations on the model processing method for resource pushing in the foregoing, and will not be repeated here.
[0188] In one embodiment, as Figure 10 shown, a model processing apparatus for resource pushing is provided, including: a first acquisition module 1002, a second acquisition module 1004, a graph encoding module 1006, a calculation module 1008, and a training module 1010, where:
[0189] The first acquisition module 1002 is configured to acquire a heterogeneous graph formed based on the interaction between an object and a resource, where the heterogeneous graph includes object nodes and resource nodes;
[0190] The second acquisition module 1004 is configured to acquire sample nodes from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, an original sub-graph corresponding to the sample node is obtained, and the original sub-graph is subjected to graph data augmentation to obtain an augmented sub-graph corresponding to the sample node;
[0191] The graph encoding module 1006 is configured to use a graph encoder to perform graph encoding on the original sub-graph and the augmented sub-graph respectively to obtain an original graph encoding representation and an augmented graph encoding representation of the sample node;
[0192] The calculation module 1008 is configured to calculate a contrast loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculate a matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection;
[0193] The training module 1010 is configured to jointly train the model with the contrast loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource pushing between an object and a resource.
[0194] In one embodiment, a first acquisition module is configured to obtain an interaction bipartite graph between an object node representing an object and a resource node representing a resource based on historical interaction data between the object and the resource; obtain a social relationship network graph between the object nodes representing the objects based on social relationship data between the objects; obtain a resource relationship spectrum graph between the resource nodes representing the resources based on resource relationship data between the resources; and construct a heterogeneous graph according to the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph.
[0195] In one embodiment, a second acquisition module is configured to determine at least one preset path type; for each sample node and each path type, filter the neighbor nodes of the sample node according to the node type of the first-order neighbor nodes indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, filter the neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor nodes indicated by the path type to obtain at least one second-order neighbor node; and determine an original subgraph of the sample node corresponding to the path type according to the sample node, the filtered first-order neighbor nodes and second-order neighbor nodes, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0196] In one embodiment, the second acquisition module is further configured to sample at least one first-order neighbor node to obtain a first-order sampled neighbor set; sample at least one second-order neighbor node to obtain a second-order sampled neighbor set; and obtain an original subgraph of the sample node corresponding to the path type according to the sample node, the first-order neighbor nodes in the first-order sampled neighbor set, the second-order neighbor nodes in the second-order sampled neighbor set, and at least one path from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the sample node.
[0197] In one embodiment, the second acquisition module is configured to perform graph data augmentation processing on the original subgraph corresponding to the sample node according to a preset graph data augmentation method to obtain an augmented subgraph corresponding to the sample node; the preset graph data augmentation method is an edge dropout augmentation method or a feature dropout augmentation method.
[0198] In one embodiment, the original subgraph corresponding to the sample node includes the first-order neighbor nodes and the second-order neighbor nodes of the sample node; a graph encoding module is configured to obtain the node features of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, fuse the node features of the second-order neighbor nodes pointing to the first-order neighbor node through a graph encoder to obtain a fused feature corresponding to the first-order neighbor node; for the sample node, fuse the fused features corresponding to the first-order neighbor nodes pointing to the sample node through a graph encoder to obtain a fused feature corresponding to the sample node; and use the fused feature corresponding to the sample node as the original graph encoding representation of the sample node.
[0199] In one embodiment, the graph encoding module is further configured to, when a sample node corresponds to multiple original subgraphs of different path types, after obtaining multiple fusion features corresponding to different path types of the sample node based on the multiple original subgraphs of different path types, aggregate the multiple fusion features corresponding to different path types of the sample node through a graph encoder to obtain an aggregated feature, and use the aggregated feature as the original graph encoding representation of the sample node.
[0200] In one embodiment, the graph encoding module is configured to, through a graph encoder, determine the attention weight of each second-order neighbor node with respect to a first-order neighbor node according to the node feature of the first-order neighbor node and the node feature of the second-order neighbor node pointing to the first-order neighbor node; weighted-sum the node features of the second-order neighbor nodes pointing to the first-order neighbor node according to the attention weight to obtain the fusion feature corresponding to the first-order neighbor node.
[0201] In one embodiment, the graph encoding module is configured to, through a graph encoder, determine the attention weight of each first-order neighbor node with respect to the sample node according to the node feature of the sample node and the fusion feature corresponding to the first-order neighbor node pointing to the sample node; weighted-sum the fusion features corresponding to the first-order neighbor nodes pointing to the sample node according to the attention weight to obtain the fusion feature corresponding to the sample node.
[0202] In one embodiment, the calculation module is configured to, for each sample node obtained from the heterogeneous graph, calculate the similarity between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representation to obtain the intra-sample similarity; calculate the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes to obtain the inter-sample similarity; and construct the contrastive loss of each sample node according to the intra-sample similarity and the inter-sample similarity.
[0203] In one embodiment, the calculation module is configured to, according to the sample nodes obtained from the heterogeneous graph, determine multiple interaction pairs, each interaction pair including an object sample node and a resource sample node with an edge connection; for each interaction pair, calculate the cross similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
[0204] In one embodiment, a training module is configured to combine the contrastive loss and the matching loss to obtain a target loss. The contrastive loss is determined based on the intra-sample similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the inter-sample similarity between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes. The matching loss is determined based on the interaction similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection. The target loss is negatively correlated with the intra-sample similarity, positively correlated with the inter-sample similarity, and negatively correlated with the interaction similarity. After updating the network parameters of the graph encoder with the goal of minimizing the target loss, the step of obtaining sample nodes from the heterogeneous graph is returned to continue training until the training stop condition is met, and a trained graph encoder is obtained.
[0205] In one embodiment, the model processing device for resource push further includes a recall module. The recall module is configured to determine a target object of the resource to be pushed; determine a target object node in the heterogeneous graph that represents the target object; obtain an original subgraph corresponding to the target object node according to at least one path from the neighbor nodes of the target object node to the target object node in the heterogeneous graph; through the trained graph encoder, perform graph encoding on the original subgraph based on the node features of each node in the original subgraph to obtain the original graph encoding representation of the target object node; through the trained graph encoder, perform graph encoding on the original subgraph corresponding to the resource node representing the candidate resource in the heterogeneous graph to obtain the graph encoding representations of each resource node; and recall the target resource from the candidate resources represented by the resource nodes according to the similarity between the graph encoding representation of the target object node and the graph encoding representations of each resource node.
[0206] Each module in the above model processing device for resource push can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0207] In one embodiment, a computer device is provided. The computer device can be Figure 1 the server or terminal shown, and its internal structure diagram can be as Figure 11As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer device is a terminal, the computer device may further include a display unit and an input device. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc. The computer program, when executed by the processor, implements a model processing method for resource pushing.
[0208] Those skilled in the art can understand that Figure 11 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0209] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0210] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0211] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0212] 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 analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0213] Those of ordinary skill in the art can understand that all or part of the processes in the methods of 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 can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0214] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0215] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A model processing method for resource push, characterized in that The method includes: Obtaining a heterogeneous graph formed based on the interaction between an object and a resource, where the heterogeneous graph includes object nodes and resource nodes; Obtaining sample nodes from the heterogeneous graph. For each sample node, according to at least one path pointing from the neighbor nodes of the sample node to the sample node, obtaining the original subgraph corresponding to the sample node, and performing graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node; Using a graph encoder to perform graph encoding on the original subgraph and the augmented subgraph respectively to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node; Calculating a contrastive loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculating a matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection; Jointly training the model with the contrastive loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for resource push between an object and a resource.
2. The method according to claim 1, characterized in that, The obtaining of the heterogeneous graph formed based on the interaction between an object and a resource includes: Based on the historical interaction data between an object and a resource, obtaining an interaction bipartite graph between the object nodes representing the object and the resource nodes representing the resource; Based on the social relationship data between the objects, obtaining a social relationship network graph between the object nodes representing the objects; Based on the resource relationship data between the resources, obtaining a resource relationship spectrum graph between the resource nodes representing the resources; Constructing a heterogeneous graph according to the interaction bipartite graph, the social relationship network graph, and the resource relationship spectrum graph.
3. The method according to claim 1, wherein The obtaining, for each sample node, of the original subgraph corresponding to the sample node according to at least one path pointing from the neighbor nodes of the sample node to the sample node includes: Determining at least one preset path type; For each sample node and each path type, screening the neighbor nodes of the sample node according to the node type of the first-order neighbor nodes indicated by the path type to obtain at least one first-order neighbor node; For each of the first-order neighbor nodes, screening the neighbor nodes of the first-order neighbor nodes according to the node type of the second-order neighbor nodes indicated by the path type to obtain at least one second-order neighbor node; According to the sample node, the screened first-order neighbor nodes and second-order neighbor nodes, and at least one path pointing from the second-order neighbor nodes to the first-order neighbor nodes and from the first-order neighbor nodes to the sample node, determining the original subgraph corresponding to the sample node for the path type.
4. The method according to claim 3, characterized in that, The method further includes: Sampling the at least one first-order neighbor node to obtain a first-order sampled neighbor set; Sampling the at least one second-order neighbor node to obtain a second-order sampled neighbor set; Determining the original subgraph corresponding to the sample node for the path type according to the sample node, the first-order neighbor nodes and the second-order neighbor nodes selected therefrom, and at least one path from the second-order neighbor nodes to the first-order neighbor nodes and from the first-order neighbor nodes to the sample node, includes: Obtaining the original subgraph corresponding to the sample node for the path type according to the sample node, the first-order neighbor nodes in the first-order sampling neighbor set, the second-order neighbor nodes in the second-order sampling neighbor set, and at least one path from the second-order neighbor nodes to the first-order neighbor nodes and from the first-order neighbor nodes to the sample node.
5. The method according to claim 1, characterized in that, Performing graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node, includes: Performing graph data augmentation processing on the original subgraph corresponding to the sample node respectively according to a preset graph data augmentation method to obtain the augmented subgraph corresponding to the sample node; the preset graph data augmentation method is an edge dropout augmentation method or a feature dropout augmentation method.
6. The method according to claim 1, wherein The original subgraph corresponding to the sample node includes the first-order neighbor nodes and the second-order neighbor nodes of the sample node; the steps for obtaining the original graph encoding representation of the sample node include: Obtaining the node features of each node in the original subgraph corresponding to the sample node; For each first-order neighbor node in the original subgraph, fusing the node features of the second-order neighbor nodes pointing to the first-order neighbor node through the graph encoder to obtain the fused feature corresponding to the first-order neighbor node; For the sample node, fusing the fused features corresponding to the first-order neighbor nodes pointing to the sample node through the graph encoder to obtain the fused feature corresponding to the sample node; Taking the fused feature corresponding to the sample node as the original graph encoding representation of the sample node.
7. The method according to claim 6, characterized in that, The method further includes: When there are multiple original subgraphs corresponding to different path types for the sample node, after obtaining multiple fused features corresponding to different path types for the sample node based on the multiple original subgraphs corresponding to different path types, aggregating the multiple fused features corresponding to different path types for the sample node through the graph encoder to obtain an aggregated feature, and taking the aggregated feature as the original graph encoding representation of the sample node.
8. The method according to claim 6, characterized in that, The step of fusing the node features of the second-order neighbor nodes pointing to the first-order neighbor node through the graph encoder to obtain the fused feature corresponding to the first-order neighbor node includes: Determining the attention weights of each of the second-order neighbor nodes for the first-order neighbor node respectively through the graph encoder according to the node features of the first-order neighbor node and the node features of the second-order neighbor nodes pointing to the first-order neighbor node; Performing weighted summation on the node features of the second-order neighbor nodes pointing to the first-order neighbor node according to the attention weights to obtain the fused feature corresponding to the first-order neighbor node.
9. The method according to claim 6, characterized in that The step of fusing the fused features corresponding to the first-order neighbor nodes pointing to the sample node through the graph encoder to obtain the fused feature corresponding to the sample node includes: Through the graph encoder, according to the node features of the sample node and the fusion features corresponding to the first-order neighbor nodes pointing to the sample node, determine the attention weights of each of the first-order neighbor nodes for the sample node; According to the attention weights, perform weighted summation on the fusion features corresponding to the first-order neighbor nodes pointing to the sample node to obtain the fusion feature corresponding to the sample node.
10. The method according to claim 1, characterized in that, The calculating of the contrast loss according to the similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes respectively, includes: For each sample node obtained from the heterogeneous graph, calculate the similarity between the original graph encoding representation and the enhanced graph encoding representation corresponding to the sample node to obtain the intra-sample similarity; Calculate the sum of the similarities between the original graph encoding representation corresponding to the sample node and the enhanced graph encoding representations of other sample nodes to obtain the inter-sample similarity; According to the intra-sample similarity and the inter-sample similarity, construct the contrast loss of each sample node.
11. The method according to claim 1, wherein The calculating of the matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, includes: According to the sample nodes obtained from the heterogeneous graph, determine a plurality of interaction pairs, each of the interaction pairs including an object sample node and a resource sample node with an edge connection; For each interaction pair, calculate the interaction similarity between the original graph encoding representation of the object sample node and the original graph encoding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
12. The method according to claim 1, wherein The jointly training the model with the contrast loss and the matching loss to obtain a trained graph encoder, includes: Joint the contrast loss and the matching loss to obtain a target loss; the contrast loss is determined according to the intra-sample similarity between the original graph encoding representation and the enhanced graph encoding representation of the same sample node, and the inter-sample similarities between the original graph encoding representations and the enhanced graph encoding representations of different sample nodes respectively, the matching loss is determined according to the interaction similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection, and the target loss is negatively correlated with the intra-sample similarity, positively correlated with the inter-sample similarity, and negatively correlated with the interaction similarity; After updating the network parameters of the graph encoder with the goal of minimizing the target loss, return to the step of obtaining sample nodes from the heterogeneous graph to continue training until the training stop condition is met, and obtain a trained graph encoder.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: Determine the target object of the resource to be pushed; Determine the target object node representing the target object in the heterogeneous graph; According to at least one path from the neighbor nodes of the target object node to the target object node in the heterogeneous graph, obtain the original subgraph corresponding to the target object node; Through the trained graph encoder, perform graph encoding on the original subgraph based on the node features of each node in the original subgraph to obtain the original graph encoding representation of the target object node; Through the trained graph encoder, perform graph encoding on the original subgraph corresponding to the resource node representing the candidate resource in the heterogeneous graph to obtain the graph encoding representations of each of the resource nodes; Recall the target resource from the candidate resources represented by the resource nodes according to the similarities between the graph encoding representation of the target object node and the graph encoding representations of each of the resource nodes; 14. A model processing device for resource push, characterized in that The device includes: A first acquisition module, configured to acquire a heterogeneous graph formed based on the interaction between an object and a resource, where the heterogeneous graph includes an object node and a resource node; A second acquisition module, configured to acquire a sample node from the heterogeneous graph. For each sample node, obtain the original subgraph corresponding to the sample node according to at least one path from the neighbor nodes of the sample node to the sample node, and perform graph data augmentation on the original subgraph to obtain the augmented subgraph corresponding to the sample node; A graph encoding module, configured to use a graph encoder to perform graph encoding on the original subgraph and the augmented subgraph respectively to obtain the original graph encoding representation and the augmented graph encoding representation of the sample node; A calculation module, configured to calculate a contrast loss according to the similarity between the original graph encoding representation and the augmented graph encoding representation of the same sample node and the similarities between the original graph encoding representations and the augmented graph encoding representations of different sample nodes respectively, and calculate a matching loss according to the similarity between the original graph encoding representations of the object sample node and the resource sample node with an edge connection; A training module, configured to jointly perform model training with the contrast loss and the matching loss to obtain a trained graph encoder, where the trained graph encoder is used for resource push between an object and a resource; 15. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Structured search queries based on social-graph information
CN104903886A
Recommendation model determination method and related device
CN114647789A